PDA

View Full Version : Forcing specific styles on specific pages


Borisch
03-27-2006, 10:24 AM
Hey,

I'm currently developing my new site and I would like to debug it both as a guest and user/admin. So far I've been using index.php?styleid=2 to set a specific style. However, this doesn't work for guests and so I would like to force a style on the pages I'm debugging.

I've tried doing something like this:
$styleid = 2;
eval('print_output("' . fetch_template('TEMPLATE') . '");');

But it's not actually doing anything, I'm still only getting a white page unless I log in and choose a specific style. Any ideas?

RS_Jelle
03-27-2006, 04:18 PM
Have a look at global.php ;)

Search for:
// ################################################## ###########################
// ######################## START TEMPLATES & STYLES ###########################
// ################################################## ###########################
There you can manipulate $styleid by using the style_fetch hook :)

Borisch
03-29-2006, 10:23 AM
Thanks, but I don't think I quite understand how to use this. I tried the following, but I'm still getting a blank page:

$styleid = 4;
($hook = vBulletinHook::fetch_hook('style_fetch')) ? eval($hook) : false;
style_fetch($styleid);

Daniel
05-21-2006, 01:00 AM
Bumping.... I need this too.

James T Brock
10-06-2006, 08:20 PM
I need it as well.

Zachariah
10-20-2006, 01:06 PM
One way:

On your custom PHP file.
EX: phpfile.php

define('THIS_SCRIPT', 'phpfile');

ACP -> Plugin System -> Add New Plugin

Hook Location: style_fetch
Title: phpfile.php style change
Plugin PHP Code:

if (THIS_SCRIPT == 'phpfile'){
$styleid = 1; // or 2 or 3 etc
}

Plugin is Active: Yes

DannyITR
07-21-2008, 11:27 PM
That worked perfectly!