Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Change Style dropdown on ALL of your vB pages :) (hardcoded, no queries) Details »»
Change Style dropdown on ALL of your vB pages :) (hardcoded, no queries)
Version: 1.00, by KuraFire KuraFire is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-05-2003 Last Update: Never Installs: 15
 
No support by the author.

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 ), 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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-06-2003, 12:31 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This file is needed for Step 4 of this hack (put it in your /admin directory!!)
Reply With Quote
  #3  
Old 02-06-2003, 01:07 PM
PSI|Dr-X PSI|Dr-X is offline
 
Join Date: Aug 2002
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ill try
Reply With Quote
  #4  
Old 02-06-2003, 01:07 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sigh .. what can I say

Another feature filled by kurafire Thank you!
Reply With Quote
  #5  
Old 02-06-2003, 02:00 PM
gameplanetz gameplanetz is offline
 
Join Date: Aug 2002
Location: Bali
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice, might try...
Reply With Quote
  #6  
Old 02-06-2003, 07:54 PM
saint_seiya saint_seiya is offline
 
Join Date: Oct 2002
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The hack is nice, might use it in the future
Reply With Quote
  #7  
Old 02-10-2003, 01:00 AM
leviw leviw is offline
 
Join Date: Jan 2003
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 02-10-2003, 01:08 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 03-20-2003, 07:26 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!!!
Reply With Quote
  #10  
Old 05-04-2003, 09:27 PM
Conundrum9 Conundrum9 is offline
 
Join Date: Feb 2003
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04819 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete