View Full Version : VB4 default sidebar
MrHorror
06-29-2012, 08:54 PM
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:
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:
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. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.