## MOD Title: Sub-Forums in Two Columns
## MOD Author: JackV http://vtn.niitss.com
## MOD Description: Showing sub-forums in two columns
## MOD Version: 1.1
## Installation Level: Very Easy
## Installation Time: ~1 minutes
## Files To Edit: (1)
## - includes/functions_display.php
## Included Files: n/a
##############################################################
## MOD History:
## 2008-06-1 edited & initial release.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#--- [ OPEN ] ----------------------------
includes/functions_display.php
#--- [ FIND ] ----------------------------
- Código: Seleccionar todos
$s_subforums_list = array();
foreach ($subforums_list as $subforum)
{
$s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>';
}
$s_subforums_list = (string) implode(', ', $s_subforums_list);
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
#--- [ REPLACE ] ----------------------------
- Código: Seleccionar todos
//$s_subforums_list = array();
$count = 0;
$s_subforums_list = '<div><table border="0" width="100%"><tr>';
foreach ($subforums_list as $subforum)
{
$count++;
if($count % 2 != 0)
{
$s_subforums_list .= '</tr><tr><td width="2%"> </td>';
}
$s_subforums_list .= '<td width="49%" valign="top"><a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] .'</a> </td>';
}
$s_subforums_list .='</tr></table></div>';
#--- [ SAVE AND CLOSE ALL FILES ] ----------------------------
OU ( MELHOR AINDA ) / OR BETTER
# Allow multiple columns for Sub-Forum display on index
#
#-----[ OPEN ]------------------------------------------
#
include/functions_display.php
#
#-----[ FIND ]------------------------------------------
#
- Código: Seleccionar todos
$s_subforums_list = array();
foreach ($subforums_list as $subforum)
{
$s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>';
}
$s_subforums_list = (string) implode(', ', $s_subforums_list);
#
#-----[ REPLACE WITH ]------------------------------------------
#
- Código: Seleccionar todos
//$s_subforums_list = array();
$columns = 2; // how much columns
$result = 0;
$s_subforums_list = '<table><tr>';
foreach ($subforums_list as $subforum)
{
$s_subforums_list .= '<td><a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] . '</a> </td>';
$result++;
if($result % $columns == 0)
{
$s_subforums_list .= '</tr><tr>';
}
}
$s_subforums_list .='</tr></table>';
#--- [ SAVE AND CLOSE ALL FILES ] ----------------------------
Refresh your Styles, clear your cache.
End of MOD.