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


All times are GMT. The time now is 07:33 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.00990 seconds
  • Memory Usage 1,733KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete