Back to vBulletin 3.0 Add-Ons

Mini-hack: show list of forums from the same category in a popup menu
Mod Version: 1.2, by kmike

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 3
Released: 21 May 2005 Last Update: 30 Jun 2005 Downloads: 1
Not Supported Template Edits Code Changes  

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'];
	}
Add these lines below:
PHP Code:
    // HACK: display sibling forums as related topics menu
    
require_once('./includes/functions_misc.php');
    
$childforums fetch_child_forums($foruminfo['parentid'], 'ARRAY');
    foreach (
$childforums AS $val)
    {
        if (
$val <> $forumid)
        {
            
$relatedperms $bbuserinfo['forumpermissions']["$val"];
            if (!(
$relatedperms CANVIEW) AND $vboptions['hideprivateforums'])
            {
                continue;
            }
            
$relatedinfo fetch_foruminfo($val);
            if (! (
$relatedinfo['options'] & $_FORUMOPTIONS['active']) )
            { 
// forum isn't active
                
continue;
            }
            eval(
'$relatedtopicbits .= "' fetch_template('relatedtopicbit') . '";');
        }
    }
    
// HACK 
In the same file, find this code (near the top):
Code:
	'none' => array(
		'FORUMDISPLAY',
Add this beneath:
Code:
		'relatedtopicbit',
Template changes:
In the FORUMDISPLAY template, find this line:
Code:
	<td class="tcat" width="100%">$vbphrase[threads_in_forum]<span class="normal">: $foruminfo[title]</span></td>
underneath it, add this:
Code:
	<td class="vbmenu_control" id="relatedtools"><a href="#goto_relatedtools">Related Topics</a> <script type="text/javascript"> vbmenu_register("relatedtools"); </script></td>
Find this fragment:
Code:
<if condition="$show['popups']">
<br />
<!-- popup menu contents -->
Add underneath it:
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 -->
Create new template named "relatedtopicbit". Populate it with this:
Code:
	<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]f=$relatedinfo[forumid]">$relatedinfo[title]</a></td></tr>
That's it.

Download

This modification is archived and cannot be downloaded.

Screenshots

 

Similar Mods

[mini-hack] Stylin' Buddy List vBulletin 2.x Full Releases
Mini-Hack: Improved PM Popup JavaScript vBulletin 2.x Beta Releases

vblts.ru supports vBulletin®, 2022-2024