vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Mini-hack: Ability for Style Override on ANY vB-powered page (https://vborg.vbsupport.ru/showthread.php?t=61064)

KuraFire 02-01-2004 10:00 PM

Mini-hack: Ability for Style Override on ANY vB-powered page
 
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):

PHP Code:

// #############################################################################
 // 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:

PHP Code:

 // [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:

PHP Code:

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. :)

Zachery 02-02-2004 09:11 AM

nice work kura :)

KuraFire 02-02-2004 09:23 AM

it's so simple I'm amazed that this wasn't actually possible in vB3 itself already.. :D

gmarik 02-02-2004 03:54 PM

nice and easy

KuraFire 02-03-2004 03:11 PM

psst, you forgot handy ;)

Boofo 02-03-2004 03:57 PM

Nice, easy, handy AND well done! ;)

KuraFire 02-03-2004 04:38 PM

Hehe, thanks, glad you like :)

Boofo 02-03-2004 04:41 PM

Mind if I post it in my how-to area giving you full credit? ;)

KuraFire 02-03-2004 07:23 PM

not at all, but if other people are gonna implement it on their boards, they ought to hit that Install button over there ;)

Boofo 02-03-2004 07:45 PM

LOL I don't have an install button. Never figured out how to set it up like they did here. ;)

KuraFire 02-03-2004 08:03 PM

tsk, they should register here of course! ;)

kyk0 05-05-2004 11:01 AM

Great mod! Installed.

Floris 05-05-2004 11:06 AM

Quote:

Originally Posted by kyk0
Great mod! Installed.

Oh you! ..

But yeah, nice little tweak.

Tony G 05-05-2004 12:28 PM

Thought I might just join the crowd - nice mod Kura. Very handy. :)

Zachery 09-08-2004 10:46 PM

Quote:

Originally Posted by Tony G
Thought I might just join the crowd - nice mod Kura. Very handy. :)

Almost forgot this thing exsisted :)

Zachariah 10-08-2004 04:28 PM

I only get this to work if the member is loged in. As a guest I can only see the default style not the 'OVERWRITE_STYLEID'.

Zachariah 10-12-2004 02:12 AM

To the other 7 that have installed this hack. Can you see the style you want if the user is not loged in?

CyberRanger 02-09-2007 06:26 PM

Quote:

Originally Posted by Zachariah (Post 561380)
To the other 7 that have installed this hack. Can you see the style you want if the user is not loged in?

hehe ... I realize this thread is two+ years old but I have the same problem. The hack works great if the user is logged in but guest see the default forum style instead of the style I specified.

Any ideas? Anyone?

Edit: this will do it: https://vborg.vbsupport.ru/showpost....43&postcount=3. I've combined the two methods for more flexibility. Hmmm ... I could make this a little plugin ver vb3.5 and up. :-)


All times are GMT. The time now is 01:29 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01190 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete