Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2005, 02:34 AM
greenhybrid greenhybrid is offline
 
Join Date: Jan 2005
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to Define Which Style in PHP

I have three sections and directories in my site. One is the vBulletin forum. Another is the vB Articles hack. The last is vBadvanced Gallery. Because I've colorcoded the sections of the site, I'd like to use a different style for each of these sections. Is there certain code I can stick in my PHP files to define the style for the respective page?

For instance, something like this:
PHP Code:
 define('STYLE', 3); 
(I just made that up)

Found it! I was able to write this based on the correct information from another hack. In global.php I find out which subdomain I'm at and define a style accordingly:
PHP Code:
// #############################################################################
// ######################## START TEMPLATES & STYLES ###########################
// #############################################################################

$userselect = false;

// jason
$url = explode("/",$_SERVER['REQUEST_URI']);
if ($url[1] == "learn") {
    $styleid = 4; 
    $userselect = true; 
} elseif ($url[1] == "share") {
    $styleid = 5; 
    $userselect = true; 
} else 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:24 PM.


Powered by vBulletin® Version 3.9.0 Beta 2
Copyright ©2000 - 2017, vBulletin Solutions Inc.