I have two child skins with custom userprofile.css templates. What I'd like to do is find a way to use the custom templates, but still allow the user to customize their own profile pages.
Now, I had a thought to write a plugin that would run to check if the user had a customized profile page in the database... AND then in the userprofile.css template, use vb conditionals to either use my default css or use the css based on the users customizations from the database.
Here's a
rough version of my code:
PHP Code:
$txtCustomProfileQuery = $vbulletin->scriptpath; //I will use this to parse to get the UserID of the profile page we are currently on...
$re1 = '.*?'; # Non-greedy match on filler
$re2 = '(\\d+)'; # Integer Number 1
if ($c=preg_match_all ("/".$re1.$re2."/is", $txtCustomProfileQuery, $customProfileMatches)) {
$int1 = $customProfileMatches[1][0];
//echo $int1;
}
$customProfilePageStatus = 1; // 1 == User's profile is customized, 0 == Not customized...
$customProfileQuery = $db->query_read("SELECT count(*) AS `count` FROM " . TABLE_PREFIX . "customprofile WHERE userid='$int1'");
$row = mysql_fetch_array($customProfileQuery);
$customProfilePage = $row['count'];
if( $customProfilePage == 0 ) {
$customProfilePageStatus = 0;
} else {
$customProfilePageStatus = 1;
}
Now, I cannot figure out how to use $customProfilePageStatus, within the templates... With vB3, it was super easy... But with vB4, I cannot seem to get it to work.
I was hoping someone would have an idea..
Thanks!
--------------- Added [DATE]1307842055[/DATE] at [TIME]1307842055[/TIME] ---------------
bump....