PDA

View Full Version : How To Put Subforums Into Columns


Jake Bunce
Sat 24th Dec '05, 3:11pm
I tested the old instructions (http://www.vbulletin.com/forum/showthread.php?t=127619) on version 3.5 and they work exactly the same. Note that the limitation described in the second post in the old thread (http://www.vbulletin.com/forum/showthread.php?t=127619) still applies to 3.5.

Here are some improved instructions that allow you to specify any number of columns instead of just 2. Note that these improved instructions still suffer from the same limitation described in the second post in the old thread (http://www.vbulletin.com/forum/showthread.php?t=127619).

Edit these 4 templates:

Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_*

Replace this code:


<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>


With this code:


<if condition="$show['subforums']">

<if condition="$GLOBALS[subrow] = 0"></if>

<table width="100%" cellpadding="1" cellspacing="0" border="0">

<tr>

<td width="50%" align="left" colspan="2"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>:</div></td>

</tr>

<tr>

$forum[subforums]

</tr>

</table>

</if>


Delete the contents of both of these templates:

Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_subforumseparator_*

Next edit these 2 templates:

Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_subforumbit_*

Add the red code to both templates:


<if condition="$GLOBALS[subrow] == X">

<if condition="$GLOBALS[subrow] = 1"></if>

</tr><tr>

<else />

<if condition="$GLOBALS[subrow]++"></if>

</if>

<td width="50%" align="left" nowrap="nowrap">
<div class="smallfont">
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum_$forum[statusicon].gif" alt="" /> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
</div>
</td>


Where X is the number of columns you want.

The end result will look like this (if X = 2):

12915
12916