The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Mini-hack: show list of forums from the same category in a popup menu Details »» | |||||||||||||||||||||||||||
Mini-hack: show list of forums from the same category in a popup menu
Developer Last Online: Apr 2014
Description:
This hack makes navigation within forums from the same category much easier - no need to go to forum home or other aggregate page, just use popup menu similar to "Forum tools". See attached screenshot, it is really self-describing. There're no new db queries, one .php file changed, one template edited and one template added. Limitations: Obviously, this is for forums which are categorized. Also, it will list all sub-forums of a parent forum, including subforums of the current forum and all subforums of forums from the current category. In other words, it's not for boards with advanced tree-like forum structure (more than 1 level deep). Another issue: it will only work when DHTML popups are enabled. Required code is missing from the part of FORUMDISPLAY template responsible for displaying non-DHTML navigation. Updates: 1.2 - Add check for active forum state when listing forums. 1.01 - Check forum permissions to hide forums which can't be accessed by user. Code changes: In forumdisplay.php, find this code fragment (vb 3.0.7): Code:
else { $lastread = $bbuserinfo['lastvisit']; } PHP Code:
Code:
'none' => array( 'FORUMDISPLAY', Code:
'relatedtopicbit', In the FORUMDISPLAY template, find this line: Code:
<td class="tcat" width="100%">$vbphrase[threads_in_forum]<span class="normal">: $foruminfo[title]</span></td> Code:
<td class="vbmenu_control" id="relatedtools"><a href="#goto_relatedtools">Related Topics</a> <script type="text/javascript"> vbmenu_register("relatedtools"); </script></td> Code:
<if condition="$show['popups']"> <br /> <!-- popup menu contents --> Code:
<!-- related tools menu --> <div class="vbmenu_popup" id="relatedtools_menu" style="display:none"> <table cellpadding="4" cellspacing="1" border="0"> <tr><td class="thead">Forums<a name="goto_relatedtools"></a></td></tr> $relatedtopicbits </table> </div> <!-- / related tools menu --> Code:
<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]f=$relatedinfo[forumid]">$relatedinfo[title]</a></td></tr> Show Your Support
|
Comments |
#12
|
||||
|
||||
Ok .. this goes to show how bad I am ..
I need to use the opposite of .. Code:
<if condition="$show['threadslist']"> |
#13
|
||||
|
||||
Ahh ..
I used an Code:
<else /> |
#14
|
||||
|
||||
Hmm .. just installed it .. and it seems to be listing all of the forums at the same level .. as well as the subforums .. (about 40 forums in all) ..
Any way to change it to just show the subforums of the forum you're in? Oh .. and it's listing forums that are closed for posting too (and therefore shouldn't be seen) .. |
#15
|
|||
|
|||
Well, I stated that it will list ALL subforums under "Limitations" part of hack description. I see no obvious way to show only subforums of the current depth.
I'll add check for closed forums today. EDIT: do you want to skip forums closed for posting (Forum is Open = No) or forum categories (Act as Forum = No)? Forums closed for posting can still contain threads, so I guess they should be listed. |
#16
|
||||
|
||||
Well .. tbh I don't need either any more ..
I used your hack as a pointer on how to do it .. If you go to .. http://www.savageforums.com/forumdisplay.php?f=6 You'll see that it shows all the subforums in the "non" forum as normal .. But if you go .. http://www.savageforums.com/forumdisplay.php?f=104 You'll see that it's an open forum, with subforums, but they have been removed from the top, as is normal, and been put into a "Sub Forums" drop down .. I just want to say thanks, as I've been wanting a solution for this problem for ages .. and finally I've got it sussed .. |
#17
|
|||
|
|||
Somehow the check for active forum state didn't make it to the last update...
I updated instructions. If you already have it installed, find this line in forumdisplay.php: Code:
$relatedinfo = fetch_foruminfo($val); Code:
if (! ($relatedinfo['options'] & $_FORUMOPTIONS['active']) ) { // forum isn't active continue; } |
#18
|
||||
|
||||
works great! thanks much.
|
#19
|
|||
|
|||
will this work in a cmps module?
|
#20
|
|||
|
|||
Sorry, I have no idea.
|
#21
|
||||
|
||||
@Kmike,
Is this or will this be ported to 3.5? Regards, Renada |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|