vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   VB4 default sidebar (https://vborg.vbsupport.ru/showthread.php?t=285059)

MrHorror 06-29-2012 08:54 PM

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?

Lynne 06-29-2012 10:50 PM

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


MrHorror 06-30-2012 03:28 AM

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?

cellarius 06-30-2012 05:41 AM

In order to use a plugin, yes, you need to go through the plugin manager. Use the hook Lynne told you.

Lynne 06-30-2012 01:15 PM

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.

MrHorror 06-30-2012 08:52 PM

Ok, thanks!

MrHorror 08-25-2012 09:48 PM

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?

cellarius 08-25-2012 09:56 PM

No, you need to use http://php.net/manual/de/function.in-array.php

MrHorror 08-25-2012 10:26 PM

That wasn't really any help. Those examples are very mumbled.

Lynne 08-26-2012 01:57 AM

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


All times are GMT. The time now is 10:00 PM.

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.01076 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete