Quote:
Originally Posted by Kybyrian
To outline my problem, I'm using a php file for my user group colors forum-wide. With multiple styles, I need multiple usergroup colors for each style. This is all in a php file, which looks like this:
PHP Code:
<? include('global.php'); //include('/includes/class_core.php'); header("Content-type: text/css");
switch($vbulletin->userinfo[styleid]) { case 27: ?> .ugc_blah{ color:#F57676; } <? break; case 28: ?> .ugc_blah{ color: #EE3B3B; } <? break; case 16: default: //Default Theme ?> .ugc_blah{ color:#c91c1c; } <?
break; } ?>
My problem here seems to be switch($vbulletin->userinfo[styleid]). It works fine when viewing the forum index, but my forum has certain sections that override the user-selected theme. Since I'm using userinfo[styleid], it's grabbing the styleid of the style the user picked, and not the one that the forum is overriding their selection with. This causes the wrong colors to be used on a theme when viewing threads. I'm looking for a way I can grab the styleid of the style the user is currently on, regardless of whether it's an override or not. foruminfo[styleid] was the most clever thing I could think of, and did not work.
|
Ohh my that's too much trouble to do what you want to do...
Try a new plugin:
Product: vBulletin
Hook Location: parse_templates
Title: Custom CSS for our different styles (something you can easily identify etc)
Execution Order: 5
Plugin PHP Code:
PHP Code:
if (STYLEID == 27) {
$switchcss = '<style type="text/css">
.ugc_blah{ color:#F57676 !important; }
</style>';
}
if (STYLEID == 28) {
$switchcss = '<style type="text/css">
.ugc_blah{ color: #EE3B3B !important; }
</style>';
}
if (STYLEID == 16) {
$switchcss = '<style type="text/css">
// Default Style
.ugc_blah{ color:#c91c1c !important; }
</style>';
}
$template_hook[headinclude_bottom_css] .= $switchcss;
I would simply customize the default style w/ the value your using for styleid 16 and take that last part out though if it were me. Your also free to use else in there to make it shorter etc but that should do the same thing your having so much trouble with the way your doing it currently

.