Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-06-2008, 03:20 AM
dfc005 dfc005 is offline
 
Join Date: Mar 2008
Posts: 198
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Changing $vbulletin->options on the fly

Hi,

I want to be able to change $vbulletin->options['bbtitle'] and $vbulletin->options['bburl'] on the fly based on the current domain.

Where are they initially set? Would I be able to set them in a global_start hook?

--------------- Added [DATE]1207460812[/DATE] at [TIME]1207460812[/TIME] ---------------

Actually, no worries. Did it fine with global start.

--------------- Added [DATE]1207461726[/DATE] at [TIME]1207461726[/TIME] ---------------

If anyone else needs or wants to do something like this, here's how I did it.

PHP Code:
if(strpos($_SERVER["HTTP_HOST"],'site2') > 0) {
    $vbulletin->options['bbtitle'] = "Site2";
    $vbulletin->options['bburl'] = "http://".$_SERVER["HTTP_HOST"];
} else if(strpos($_SERVER["HTTP_HOST"],'site3') > 0) {
    $vbulletin->options['bbtitle'] = "Site3";
    $vbulletin->options['bburl'] = "http://".$_SERVER["HTTP_HOST"];
} else if(strpos($_SERVER["HTTP_HOST"],'site4') > 0) {
    $vbulletin->options['bbtitle'] = "Site4";
    $vbulletin->options['bburl'] = "http://".$_SERVER["HTTP_HOST"];
} else {
    // Will just show the default you listed in vBulletin options
} 
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 04:09 PM.


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