KuraFire
02-01-2004, 10:00 PM
Searching around, I couldn't find a way to get any page that wasn't a thread/forum based page to have a style override. So what happens then if you have, for instance, a fixed width layout and a liquid layout but you want the FAQ to always be fixed width, regardless of the user's chosen style, and the Memberlist to always be liquid?
Well, here's how to make that possible.
It's really simple, open up ./global.php and find this code (line 265 unhacked RC3):
// ################################################## ###########################
// if user can control panel, allow selection of any style (for testing purposes)
// otherwise only allow styles that are user-selectable
Add DIRECTLY ABOVE that:
// [START HACK='Allow Style override on Any page' AUTHOR='KuraFire' VERSION='1.00' CHANGEID= 1 ]
if (defined('OVERWRITE_STYLEID'))
{
$styleid = intval(OVERWRITE_STYLEID);
}
// [END HACK='Allow Style override on Any page' AUTHOR='KuraFire' VERSION='1.00' CHANGEID= 1 ]
Now, if you wish for a certain style to override on a certain page, use this in that page's .php file above the require_once('./global.php'); line:
define('OVERWRITE_STYLEID', 1);
where 1 is the styleid of the style you wish to use on that page.
That's all. Now you can enforce any style on any page, regardless of usersetting. Works on non-vB pages too, as long as you're using the vB engine for the templates of your page. :)
Well, here's how to make that possible.
It's really simple, open up ./global.php and find this code (line 265 unhacked RC3):
// ################################################## ###########################
// if user can control panel, allow selection of any style (for testing purposes)
// otherwise only allow styles that are user-selectable
Add DIRECTLY ABOVE that:
// [START HACK='Allow Style override on Any page' AUTHOR='KuraFire' VERSION='1.00' CHANGEID= 1 ]
if (defined('OVERWRITE_STYLEID'))
{
$styleid = intval(OVERWRITE_STYLEID);
}
// [END HACK='Allow Style override on Any page' AUTHOR='KuraFire' VERSION='1.00' CHANGEID= 1 ]
Now, if you wish for a certain style to override on a certain page, use this in that page's .php file above the require_once('./global.php'); line:
define('OVERWRITE_STYLEID', 1);
where 1 is the styleid of the style you wish to use on that page.
That's all. Now you can enforce any style on any page, regardless of usersetting. Works on non-vB pages too, as long as you're using the vB engine for the templates of your page. :)