![]() |
Menu like on vB.org
You see at the top right, that menu (Home, Forums, Articles, Mods, Styles) that change the class into 'current' depending on wich category we are browsing. I have setted something like that on my vBulletin forum. But I don't know how can I do the same: example -> if we are on category id.2 (and all the subforums wich they are in), active this part of the menu, etc. Can you please help me?
|
Use the THIS_SCRIPT condition?
|
Yes, but how do I set that in order to change my menu's class when we're browsing just some categories?
|
$foruminfo['forumid']
|
Yes, but if I set that.. I define one forum id.. and not a forum category id.
Should I create an array with all the forum ids in wich it should be 'active', or can I define just the categories ids? |
I believe there is also $foruminfo['parentid'].
|
Ok, it works but only when I enter one subforum of that category id. When I directly view the category id it doesn't appear as 'current'.
Also, for the forums wich are on my forumhome.. it should be 'current' for the 'Home' part of the menu. I have used THIS_SCRIPT == 'index'.. but it work only when I'm browsing the homepage.. This is my actual code: Code:
<div id="menucase"> |
Combine it with $foruminfo['forumid'] ;). As for your home part, you will need to compile all your other ones together, and make one big "not" conditional.
|
Can you please post me an example of both these methods?
How do I combine them? Also, what do you mean with a 'big "not" conditional'? |
Code:
<if condition="$foruminfo['parentid'] == 72 OR $foruminfo['forumid'] == 72"> |
Thank you, but I don't understand how do I do the 'Home' condition. Using the code below, can you please post me another example?
Now my code is: Code:
<div id="menucase"> |
Code:
<if condition="!in_array($foruminfo['parentid'], 72, 36, 60) AND in_array($foruminfo['forumid'], 72, 36, 60)"> |
Excuse me Dismounted, but I'm not too familiar with PHP.
If I put it like this: Code:
<div id="menucase"> Quote:
|
Code:
<if condition="!in_array($foruminfo['parentid'], array(72, 36, 60)) AND in_array($foruminfo['forumid'], array(72, 36, 60))"> |
No, it doesn't work correctly..
EDIT: Fixed. Now it works. In this conditional wasn't an '!'.. :) <if condition="!in_array($foruminfo['parentid'], array(72, 36, 60)) AND !in_array($foruminfo['forumid'], array(72, 36, 60))"> Thank you guys. |
thaks :)
|
All times are GMT. The time now is 06:21 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|