Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 06-29-2012, 08:54 PM
MrHorror MrHorror is offline
 
Join Date: Nov 2010
Posts: 277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default VB4 default sidebar

Yes hello. I'd like to activate my vb4 default sidebar. But want it to show ONLY on my vb4 default style. And not on any of my custom made styles. As you are aware of by now, when activating the sidebar in vb4, it shows up on every friggin style you create or have! So how can I achieve the sidebar showing just on the default when turned on?
Reply With Quote
  #2  
Old 06-29-2012, 10:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could delete the sidebar code from the FORUMHOME template in your custom style. Or, a plugin at forumhome_complete like:
PHP Code:
if ($style['styleid'] != x$show['sidebar'] = false
Reply With Quote
  #3  
Old 06-30-2012, 03:28 AM
MrHorror MrHorror is offline
 
Join Date: Nov 2010
Posts: 277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So if I place that plugin into the forumhome_complete template of the styles I DIDN'T want a sidebar on, it would give me the requested result? Or do I have to do that through the plugin manager?
Reply With Quote
  #4  
Old 06-30-2012, 05:41 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In order to use a plugin, yes, you need to go through the plugin manager. Use the hook Lynne told you.
Reply With Quote
  #5  
Old 06-30-2012, 01:15 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's a plugin - you use the Plugin system for it. Change x to the styleid of the style you *do* want it to show up in.
Reply With Quote
  #6  
Old 06-30-2012, 08:52 PM
MrHorror MrHorror is offline
 
Join Date: Nov 2010
Posts: 277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, thanks!
Reply With Quote
  #7  
Old 08-25-2012, 09:48 PM
MrHorror MrHorror is offline
 
Join Date: Nov 2010
Posts: 277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So now I need to know how to make this code work for multiple styles. this is how I have it set up right now:

Code:
if ($style['styleid'] != 14) $show['sidebar'] = false;
So how would I go about adding an extra style ID? Would I just put a comma after 14 and then add the second style ID number?
Reply With Quote
  #8  
Old 08-25-2012, 09:56 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you need to use http://php.net/manual/de/function.in-array.php
Reply With Quote
  #9  
Old 08-25-2012, 10:26 PM
MrHorror MrHorror is offline
 
Join Date: Nov 2010
Posts: 277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That wasn't really any help. Those examples are very mumbled.
Reply With Quote
  #10  
Old 08-26-2012, 01:57 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Instead of:
if ($style['styleid'] != 14)

Try something like (replace x,y - you may need to put single-quotes around them, but I'm not sure):
if (in_array($style['styleid'],array(x.y)))

That is actually shown in the link Cellarius linked you to, only they show the third option also, which you aren't needing. If you don't have a test site, I would *highly* recommend one so you can try these things out and get a bit more confident in figuring things out yourself which will lead you to do other cool things on your site.
Reply With Quote
Reply

Thread Tools
Display Modes

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:34 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.04354 seconds
  • Memory Usage 2,240KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete