vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Change Style dropdown on ALL of your vB pages :) (hardcoded, no queries) (https://vborg.vbsupport.ru/showthread.php?t=48597)

KuraFire 02-05-2003 10:00 PM

Change Style dropdown on ALL of your vB pages :) (hardcoded, no queries)
 
HACK: Change Style dropdown on ALL of your vB pages :) (hardcoded, no queries)
BY: KuraFire [www.kurafire.com]
DESCRIPTION: Allows users/guests to change the style on ANY given vB page of yours
DIFFICULTY: Medium
INSTALL-TIME: 10 minutes
STEPS: 9

Demo: www.kurafire.com/thecouch/
Just browse around and try changing the style on various pages :)

EXTENDED DESCRIPTION:
This hack will put a small drop-down box in your Header template, containing all the styles of your vBulletin forum. This particular version of the hack will not require a query for every pageload to get the different Styles, but it does require you to hardcode your Styles into the global.php file. There is also a version where you don't have to do that, but that will add one query to every page load.

PROS FOR THIS VERSION:
- no query extra for every page load of your vB
- drop down box isn't as wide as with the other version of the hack
CONS FOR THIS VERSION:
- the amount of users using each style is not displayed;
- if you add more styles, you have to hardcode the new ones into your global.php again.

Personally, I use this version, for I don't add styles very often at all (made 6 initial ones and will only add 1 more style somewhere in the coming year or two :D), and I like to keep my query count as low as possible on every page load :)



Install instructions are in the attachment. Enjoy / good luck :)

KuraFire 02-06-2003 12:31 PM

This file is needed for Step 4 of this hack (put it in your /admin directory!!)

PSI|Dr-X 02-06-2003 01:07 PM

Ill try

Floris 02-06-2003 01:07 PM

Sigh .. what can I say :)

Another feature filled by kurafire :) Thank you! :)

gameplanetz 02-06-2003 02:00 PM

nice, might try...

saint_seiya 02-06-2003 07:54 PM

The hack is nice, might use it in the future ;)

leviw 02-10-2003 01:00 AM

Having some trouble with step 8, you say:

Step 8
----------
Run this query on your database (in phpMyAdmin or wherever you run your queries on):

UPDATE template SET templatesetid='-1' WHERE title LIKE 'header_stylebox%' LIMIT 2;

I'm pretty new to php, how do I run this query? I assume phpMyAdmin is a seperate program sort of like Telnet?

Thanks in advance for any tips.

KuraFire 02-10-2003 01:08 PM

you just have to run that query on your database. phpMyAdmin is a webbased administration system in which you can very easily run queries on your DB, but you can also telnet to your server, login to the mysql server and run that query from there. :)

AlexanderT 03-20-2003 07:26 PM

I tried to run the Query in phpMyAdmin but it didnt seem to work.

I went to menu SQL (right to Structure) and pasted

UPDATE template SET templatesetid='-1' WHERE title LIKE 'header_stylebox%' LIMIT 2;

into the "Run SQL query/queries..." field. Then I hit Go. After that, it says "Affected rows: 0" and I dont see any changes to the database.

Any help would be greatly appreciated!!!

Conundrum9 05-04-2003 09:27 PM

I'm not sure if there is a reason fo rit, but I found a problem with the instructions for Step 5.

PHP Code:

$boxurl $PHP_SELF "?" $_SERVER['QUERY_STRING'];
$boxurl str_replace("s=$session[sessionhash]"""$boxurl);
$boxurl preg_replace("/(&changestyle=(.{0,2}))/"""$boxurl);
$boxurl str_replace("?&""?"$boxurl);
if(
substr($boxurl, -1)!="&"){
    
$boxurl .= "&";
}
$dropdownbits "";

foreach(
$allstyles as $key=>$val) {
    
$stylesel = ($styleid==$key) ? "selected=\"selected\"" "";
    eval(
"\$dropdownbits .= \"".gettemplate('nc_stylechangebit')."\";");
}
eval(
"\$dropdownbox = \"".gettemplate('header_stylebox')."\";"); 

I found that on installing this on my test board the nc_stylechangebit needed to be changed to header_styleboxbit which is a template the instructions tell you to make in Step 6.

Anyway since I'm still just learning the finer points of php it might just be me, but I thought I should bring it up.


All times are GMT. The time now is 11:18 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.01092 seconds
  • Memory Usage 1,742KB
  • 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
  • (1)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