The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Highlighting tabs when specific forums are displayed
I have 2 menu buttons for the forums on my site, one which takes you to the Award forums and one which takes you the the Main forums.
I have used ?tabid=xx to highlight the correct "Award forums" menu button when the award forums are displayed but when someone clicks into a sub forum, the "Main forums" menu button is highlighted. Is there a way that I can append ?tabid=xx to specific forums so that the correct menu button is highlighted when the forum is displayed? I know it will display as I want it because I can manually add ?tabid=xx to the forum link and get the correct result. I guess I need some code that says "if this forum is a subforum of froumid 8 then append ?tabid=xx to the url"? Thanks. |
#2
|
|||
|
|||
Are you still looking for this? I think this works: create a plugin using hook set_navigaton_tab_main and this code:
Code:
global $forumid, $vbulletin; $awards_forumid = X; if (!empty($forumid) && $forumid != -1 && is_array($vbulletin->forumcache[$awards_forumid])) { if (in_array($forumid, explode(',',$vbulletin->forumcache[$awards_forumid]['childlist']))) { $root = 'tab_id'; } } |
Благодарность от: | ||
mattltm |
#3
|
||||
|
||||
Perfect. You are "The Man"!
I was scratching my head for ages with that! |
#4
|
|||
|
|||
Oh, also you can set "Append 'tabid' to URL" to No since you don't need it with that plugin.
|
#5
|
||||
|
||||
Next stupid question...
Can I do the same sort of thing for the calendar tab? In the default view, the correct tab is highlighted because I've added "?tabid=61" to the end of the navigation link but if you click week or day view (for example) it highlights the "forum" tab. I'm not smart enough to work out how to morph your code to work for it! |
#6
|
|||
|
|||
I noticed a problem with the plugin. For the forum home page the forumid is -1 and it was selecting the Awards tab. I changed the code above to add a check for forumid != 1, so you probably want to copy the code again (sorry about that).
For the calendar, try setting Tab Script(s) to "calendar" (without the quotes) for that tab. |
Благодарность от: | ||
MarkFL |
#7
|
||||
|
||||
Sweet!
Thanks a bunch |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|