Back to vBulletin 3.0 Add-Ons

Arrange Sub-Forums in columns
Mod Version: 1.00, by tamarian

This modification is in the archives.
vB Version: 3.0.7 Rating: (2 votes - 5.00 average) Installs: 138
Released: 06 Apr 2004 Last Update: Never Downloads: 11
Not Supported  

There's also a vB 3.5 version here: http://www.vbulletin.org/forum/showthread.php?s=&threadid=82845

What it does
This hack arranges sub-forums on the forum home into 2 (or more) columns, makeing large lists of sub-forums more presentable. You can see it in action on my forums here:

Demo
http://forum.lowcarber.org

Note:
1. You need to enable sub-forum display on the forum home from your vB admin panel
2. This hack is for the forum home page, not forum display.


To enable sub-forums on the forum home page
1. Go to your forum Admin panel
2. Click vBulletin Options
3. Select "Forum Listings Display Options" from the drop down list
4. In "Depth of Sub-Forums" replace 0 with 1

Installation
To install, edit the file functions_forumlist.php (in the includes directory)

1. Find

PHP Code:
      foreach($vbulletin->iforumcache["$parentid"] AS $forumid
Place this code above it:

PHP Code:
$output .= "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" ><tr valign=\"top\"> ";
      
$cols 0
2. Find
PHP Code:
            eval('$subforum = "' fetch_template("forumhome_subforumbit_$canpost") . '";');
            if (!empty(
$output))
            {
                
$subforum $splitter["$canpost"] . $subforum;
            }
            if (
$depth $vbulletin->options['subforumdepth'])
            {
                
$output .= construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1);
            }
        }
    }

    return 
$output;


Replace with
PHP Code:
            eval('$subforum = "' fetch_template("forumhome_subforumbit_$canpost") . '";');
                    if (
$depth $vbulletin->options['subforumdepth'])
                        {
                                
$cols++;
                                if (
$cols==3)
                                        {
                                        
$cols 1;
                                        
$output .=  "</tr><tr>";
                                        }

                        
$output .= '<td width="50%">' construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1) . "</td>";
                        }
        }
    }

        if (
$cols ==1$output.="<td>&nbsp;</td></tr></table>";
    else 
$output.="</tr></table>";

        return 
$output;


To put them in 3 columns, instead of t2, just edit this line "if ($cols==3)" to "if ($cols==4)" and change this line:

PHP Code:
                  $output .= "<td width=\"50%\">" construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1) . ""
To this:
PHP Code:
                  $output .= "<td width=\"33%\">" construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1) . ""
Template modification (optional)
As this hack will list the sub-forums in a table, the font used is not effected by the <div> tag for subforums, which will cause the default font to be used instead of smallfont.

To use smallfont for sub-forum names, edit the "forumhome_subforumbit_post"

Change (this is the whole template)
Code:
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum_$forum[statusicon].gif" alt="" /> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
To:
Code:
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum_$forum[statusicon].gif" alt="" /> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><span class="smallfont">$forum[title]</span></a>

And for those who want to edit or remove the "Sub-forum" word, just remove (or edit, if you just want to change it) "<strong>$vbphrase[subforums]</strong>:" from the "forumhome_forumbit_level2_post" template

Screen shots, before/after

Download

No files for download.

Screenshots

   

Similar Mods

Arrange Sub-Forums in columns vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024