The Arcive of vBulletin Modifications Site. |
|
![]() |
|||||||||||||||||||||||||
This is beta, and I won't support it.
What does this do? This will add a dropdown to your navbar that lists the forums below a parent forum. On my bro's site we have a list of 12 worksheets, and each worksheet is a forum. We needed a list of all 12 worksheets for quick navigation. Instead of me getting emails every time they make a forum change, the dropdown is now auto updated, populated and I don't have to worry those emails anymore. It uses forumcache (tnx danny) so it won't add a query to each page, unless it needs to. ===== TEMPLATE CHANGES ===== Open the template: navbar, and find this code: Code:
<if condition="$show['registerbutton']"> Code:
<td id="navforums" class="vbmenu_control"><a href="$show[nojs_link]#navforums">Pick a Forum!</a> <script type="text/javascript"> vbmenu_register("navforums"); </script></td> Code:
<!-- / NAVBAR POPUP MENUS --> Code:
<!-- popup navforums --> <div class="vbmenu_popup" id="navforums_menu" style="display:none"> <table cellpadding="4" cellspacing="1" border="0"> <tr><td class="thead">Quickly jump to one of the forums</td></tr> $navbarforum </table> </div> <!-- / popup navforums --> ===== PLUGIN ===== Create a new plugin in the global_start hook location, call it navbarforums and give it this code: Code:
if (is_array($vbulletin->forumcache)) { foreach ($vbulletin->forumcache AS $forum) { if ($forum[parentid] == 7) { $navforumid = $forum[forumid]; $navforumtitle = $forum[title]; $navbarforum .= "<tr><td class=\"vbmenu_option\"><a href=\"forumdisplay.php?f=".$navforumid."\" rel=\"nofollow\">".$navforumtitle."</a></td></tr>"; } } } else { $navbarforums = $db->query_read(" SELECT forumid, title FROM " . TABLE_PREFIX . "forum WHERE parentid = '7' "); while ($navbarresult = $db->fetch_array($navbarforums)) { $navforumid = $navbarresult[forumid]; $navforumtitle = $navbarresult[title]; $navbarforum .= "<tr><td class=\"vbmenu_option\"><a href=\"forumdisplay.php?f=".$navforumid."\" rel=\"nofollow\">".$navforumtitle."</a></td></tr>"; } } (that means, change the 7 to your PARENT forumid, as it will get all the childforums below this parent) And you're done. Q : Does it list the subforums below the forums too? A : No, only the first level forums below the parentid. Q : My list is too long! A : Your parentid has a lot of forums. Show Your Support
|
Comments |
#2
|
||||
|
||||
![]()
wtf no plugin or products? >_>
Why are there no phrases? |
#3
|
||||
|
||||
![]()
Screenshot? Live Demo? Anything? I don't understand
|
#4
|
|||
|
|||
![]()
A demo site or a screen shot would be great to see it in action. Thanks.
|
#5
|
|||
|
|||
![]()
===== PLUGIN =====
Create a new plugin, call it navbarforums and give it this code: |
#6
|
|||
|
|||
![]()
This is no product, hence why it isn't added as a product. It has no phrases, it is a beta. So there's no need to make this a product. It is a plugin, the instructions say to create a new plugin. So no need to add a plugin.xml as you have to edit the code anyway. Takes away one step during install.
![]() There's no need for a demo, it is a dropdown .. and it has the same forum titles listed as the forums below the parent you've picked, just conv. listed in a dropdown for quick access. ![]() Quote:
![]() Quote:
![]() |
#7
|
|||
|
|||
![]()
What hook location for the plugin?
|
#8
|
|||
|
|||
![]()
I got the code placed correctly but I don't get a list of forums. I changed the parent ID to accomodate one of my forum id's but no dice.
also, would I repeat a portion of the code if I wanted to display multiple "parents"? I understand you don't support this, but I'd appreciate a little help from anyone that's got it working properly. |
#9
|
|||
|
|||
![]()
global_start, as the navbar is for every page
|
#10
|
||||
|
||||
![]()
Nice and thanks, but sad doesn't work on a vba cmps index page. For people who asked for a screenshot, have a look to the attached one. Oh, and I saw it now, attention it's listening hidden forums for all users (guests) too.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|