Forum collums
Geplaatst: 20 mei 2005, 13:11
Een mod op aanvraag deze keer, en denk dat hij zo goed werkt 
Nog een klein ding: Zet de value, in acp NOOIT lager als 1!!!

Nog een klein ding: Zet de value, in acp NOOIT lager als 1!!!
Code: Selecteer alles
##############################################################
## MOD Title: Forum collums
## MOD Author: paulus < webmaster@paulscripts.nl > (paul sohier) http://www.paulscripts.nl
## MOD Description: With this mod, you can set collums at your forum index.
## MOD Version: 0.0.1
##
## Installation Level: (Easy)
## Installation Time: 15 Minutes
## Files To Edit: 5
## index.php
## admin/admin_board.php
## language/lang_english/lang_admin.php
## templates/subSilver/index_body.tpl
## templates/subSilver/admin/board_config_body.tpl
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##
## 2005-05-20 - Version 0.0.1
## - first release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
INSERT INTO phpbb_config (config_name,config_value) VALUES ('col','2');
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < $total_categories; $i++)
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$totcat = 0;
for($i = 0; $i < $total_categories; $i++)
{
for($j = 0; $j < $total_forums; $j++)
{
if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id )
{
$totcat++;
break;
}
}
}
$inline_columns = $board_config['col'];
$totcat = min(19, $totcat);
$s_colspan = 0;
$row = 0;
$col = 0;
$width = ceil(100 / $inline_columns)."%";
$template->assign_var("WIDTH",$width);
#
#-----[ FIND ]------------------------------------------
#
if ( $display_forums )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
if (!$col)
{
$template->assign_block_vars('row_row', array());
}
$template->assign_block_vars('row_row.col',array(
));
$s_colspan = max($s_colspan, $col + 1);
if ($col == ($inline_columns - 1))
{
$col = 0;
$row++;
}
else
{
$col++;
}
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('catrow', array(
#
#-----[ REPLACE, WITH ]------------------------------------------
#
$template->assign_block_vars('row_row.col.catrow', array(
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('catrow.forumrow', array(
#
#-----[ REPLACE, WITH ]------------------------------------------
#
$template->assign_block_vars('row_row.col.catrow.forumrow', array(
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_ENABLE_PRUNE" => $lang['Enable_prune'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_COL" => $lang['col'],
"L_COL_EXPLAIN" => $lang['col_explain'],
#
#-----[ FIND ]------------------------------------------
#
"S_COOKIE_SECURE_DISABLED" => $cookie_secure_no,
#
#-----[ AFTER, ADD ]------------------------------------------
#
"COL" => $new['col'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['col'] = 'Collums at the index:';
$lang['col_explain'] = 'How many collums you want to your index, set it never lower then 1.';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<table width="100%" cellpadding="2" cellspacing="1" border="0">
<!-- BEGIN row_row -->
<tr>
<!-- BEGIN col -->
<td width="{WIDTH}" valign="top">
#
#-----[ FIND ]------------------------------------------
#
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
#
#-----[ REPLACE, WITH ]------------------------------------------
#
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{row_row.col.catrow.U_VIEWCAT}" class="cattitle">{row_row.col.catrow.CAT_DESC}</a></span></td>
#
#-----[ FIND ]------------------------------------------
#
<td class="row1" align="center" valign="middle" height="50"><img src="{row_row.col.catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{row_row.col.catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{row_row.col.catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{row_row.col.catrow.forumrow.U_VIEWFORUM}" class="forumlink">{row_row.col.catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{row_row.col.catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{row_row.col.catrow.forumrow.L_MODERATOR} {row_row.col.catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{row_row.col.catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{row_row.col.catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{row_row.col.catrow.forumrow.LAST_POST}</span></td>
#
#-----[ REPLACE, WITH ]------------------------------------------
#
<td class="row1" align="center" valign="middle" height="50"><img src="{row_row.col.catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{row_row.col.catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{row_row.col.catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{row_row.col.catrow.forumrow.U_VIEWFORUM}" class="forumlink">{row_row.col.catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{row_row.col.catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{row_row.col.catrow.forumrow.L_MODERATOR} {row_row.col.catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{row_row.col.catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{row_row.col.catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{row_row.col.catrow.forumrow.LAST_POST}</span></td>
#
#-----[ FIND ]------------------------------------------
#
<!-- END catrow -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
</table></td>
<!-- END col -->
</tr>
<!-- END row_row -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_COL}<br /><span class="gensmall">{L_COL_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="col" value="{COL}" size="25" maxlength="255" /></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM