Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
Style Switcher like on vB.org Details »»
Style Switcher like on vB.org
Version: 1.00, by MoMan MoMan is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.6 Rating:
Released: 09-03-2010 Last Update: Never Installs: 9
Template Edits
Re-useable Code Code Changes  
No support by the author.

I've written a simple JS function that can be used if you want to implement a style selector like on vB.org (using colored icons instead of a dropdown).

Simply add this to vbulletin_global.js, or include it in your footer template:

Code:
function switch_style(F)
{
    E = "style";
    if(F == "")
    {
        return; 
    }
    var B=new String(window.location);
    var A=new String("");
    B=B.split("#");
    if(B[1])
    {
        A="#"+B[1]
    }
    B=B[0];
    if(B.indexOf(E+"id=")!=-1&&is_regexp)
    {
        var D=new RegExp(E+"id=\\d+&?");
        B=B.replace(D,"")
    }
    if(B.indexOf("?")==-1)
    {
        B+="?"
    }
    else
    {
        lastchar=B.substr(B.length-1);
        if(lastchar!="&"&&lastchar!="?")
        {
            B+="&"
        }
    }
    window.location=B+E+"id="+F+A
}
Then, you'd use something like this in your footer template:

HTML Code:
<a onclick="switch_style('9');return false;" href="$vboptions[bburl]/index.php?styleid=9" rel="nofollow"><img src="$vboptions[bburl]/images/redstyle.gif" alt="" title="Red Layout" border="0" width="13" height="13" class="inlineimg" /></a>
This will then switch your style to an ID of your choice (9 in the example above). You will have to have separate styles for each color you want to switch between.

Hope someone will find this useful! Enjoy!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
DePReM11

Comments
  #2  
Old 09-10-2010, 07:51 AM
Silencer Groans's Avatar
Silencer Groans Silencer Groans is offline
 
Join Date: Dec 2007
Location: k.s.a
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank
Reply With Quote
  #3  
Old 10-05-2010, 07:31 PM
Konstantinos Konstantinos is offline
 
Join Date: Apr 2006
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and what happens with styles that are only viewable by admins ?
Reply With Quote
  #4  
Old 10-05-2010, 10:56 PM
Eduardo Leon's Avatar
Eduardo Leon Eduardo Leon is offline
 
Join Date: Oct 2009
Location: Peru
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can give some screenshots ?
Reply With Quote
  #5  
Old 10-19-2010, 05:35 AM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Konstantinos View Post
and what happens with styles that are only viewable by admins ?
Nothing would happen- the style wouldn't be selected. You obviously don't want to be creating icons for styles that aren't public.

You can view a demo here on vB.org - just try the style switcher. My implementation is the same, except that it's JS-powered.
Reply With Quote
  #6  
Old 07-22-2011, 10:00 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gonna try this in vb4.1.4
Reply With Quote
  #7  
Old 07-22-2011, 10:04 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm. Doesn't work.
Reply With Quote
  #8  
Old 07-22-2011, 10:09 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Octavius. View Post
Hmm. Doesn't work.
I could've told you that
Reply With Quote
  #9  
Old 07-22-2011, 10:19 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HMBeaty View Post
I could've told you that
LOL Is there one like this for vb4?
Reply With Quote
  #10  
Old 07-22-2011, 10:22 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Octavius. View Post
LOL Is there one like this for vb4?
I don't believe so.....not at the moment anyway.....
Reply With Quote
Reply

Thread Tools

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 08:20 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.05343 seconds
  • Memory Usage 2,314KB
  • Queries Executed 24 (?)
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_code
  • (1)bbcode_html
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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