// figure out the chosen style settings
$codestyleid = 0;
Under that add:
PHP Code:
// switch style based on domain
$sitestyles = array(
'vbsite1' => 1,
'vbsite2' => 2);
$hostname = $_SERVER['HTTP_HOST'];
if(array_key_exists($hostname, $sitestyles))
{
$codestyleid = $sitestyles[$hostname];
}
// end hack
Then find:
PHP Code:
// automatically query $getpost, $threadinfo & $foruminfo if $threadid exists
if ($_REQUEST['postid'] AND $postinfo = verify_id('post', $_REQUEST['postid'], 0, 1))
{
$getpost = $postinfo; // Not needed other than to maintain newreply.php for now.
$postid = $postinfo['postid'];
$_REQUEST['threadid'] = $postinfo['threadid'];
}
// automatically query $threadinfo & $foruminfo if $threadid exists
if ($_REQUEST['threadid'] AND $threadinfo = verify_id('thread', $_REQUEST['threadid'], 0, 1))
{
$threadid = $threadinfo['threadid'];
$forumid = $threadinfo['forumid'];
if ($forumid)
{
$foruminfo = fetch_foruminfo($threadinfo['forumid']);
if (($foruminfo['styleoverride'] == 1 OR $bbuserinfo['styleid'] == 0) AND !defined('BYPASS_STYLE_OVERRIDE'))
{
$codestyleid = $foruminfo['styleid'];
}
}
}
// automatically query $foruminfo if $forumid exists
else if ($_REQUEST['forumid'])
{
$foruminfo = verify_id('forum', $_REQUEST['forumid'], 0, 1);
$forumid = $foruminfo['forumid'];
if (($foruminfo['styleoverride'] == 1 OR $bbuserinfo['styleid'] == 0) AND !defined('BYPASS_STYLE_OVERRIDE'))
{
$codestyleid = $foruminfo['styleid'];
}
}
// automatically query forum for style info if $pollid exists
else if ($_REQUEST['pollid'])
{
$pollid = intval($_REQUEST['pollid']);
$getforum = $DB_site->query_first("SELECT forum.forumid, styleid, ((options & $_FORUMOPTIONS[styleoverride]) != 0) AS styleoverride FROM " . TABLE_PREFIX . "forum AS forum, " . TABLE_PREFIX . "thread AS thread WHERE forum.forumid = thread.forumid AND pollid = $pollid");
if (($getforum['styleoverride'] == 1 OR $bbuserinfo['styleid'] == 0) AND !defined('BYPASS_STYLE_OVERRIDE'))
{
$codestyleid = $getforum['styleid'];
}
unset($getforum);
}
Replace with (commented out version of code to disable it, this basicly prevents styles set in forums from overriding the one set by the domain)
PHP Code:
/*
// automatically query $getpost, $threadinfo & $foruminfo if $threadid exists
if ($_REQUEST['postid'] AND $postinfo = verify_id('post', $_REQUEST['postid'], 0, 1))
{
$getpost = $postinfo; // Not needed other than to maintain newreply.php for now.
$postid = $postinfo['postid'];
$_REQUEST['threadid'] = $postinfo['threadid'];
}
// automatically query $threadinfo & $foruminfo if $threadid exists
if ($_REQUEST['threadid'] AND $threadinfo = verify_id('thread', $_REQUEST['threadid'], 0, 1))
{
$threadid = $threadinfo['threadid'];
$forumid = $threadinfo['forumid'];
if ($forumid)
{
$foruminfo = fetch_foruminfo($threadinfo['forumid']);
if (($foruminfo['styleoverride'] == 1 OR $bbuserinfo['styleid'] == 0) AND !defined('BYPASS_STYLE_OVERRIDE'))
{
$codestyleid = $foruminfo['styleid'];
}
}
}
// automatically query $foruminfo if $forumid exists
else if ($_REQUEST['forumid'])
{
$foruminfo = verify_id('forum', $_REQUEST['forumid'], 0, 1);
$forumid = $foruminfo['forumid'];
if (($foruminfo['styleoverride'] == 1 OR $bbuserinfo['styleid'] == 0) AND !defined('BYPASS_STYLE_OVERRIDE'))
{
$codestyleid = $foruminfo['styleid'];
}
}
// automatically query forum for style info if $pollid exists
else if ($_REQUEST['pollid'])
{
$pollid = intval($_REQUEST['pollid']);
$getforum = $DB_site->query_first("SELECT forum.forumid, styleid, ((options & $_FORUMOPTIONS[styleoverride]) != 0) AS styleoverride FROM " . TABLE_PREFIX . "forum AS forum, " . TABLE_PREFIX . "thread AS thread WHERE forum.forumid = thread.forumid AND pollid = $pollid");
if (($getforum['styleoverride'] == 1 OR $bbuserinfo['styleid'] == 0) AND !defined('BYPASS_STYLE_OVERRIDE'))
{
$codestyleid = $getforum['styleid'];
}
unset($getforum);
}
*/
Then find
PHP Code:
// style specified in user profile
$styleid = $bbuserinfo['styleid'];
Replace with (this disables users from selecting a style via their profile)
PHP Code:
// style specified in user profile
// $styleid = $bbuserinfo['styleid'];