########################################################
## MOD Title: Forum Icon with ACP Control
## MOD Version: 1.0.2
## MOD Author: Mac (Y.C. LIN) < ycl_6@sinamail.com > http://endless-tw.net
##
## MOD Description: This mod allow admin to give each forum a icon in the ACP
## Icons will show on index
##
## Installation Level: Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 5
## index.php
## admin/admin_forums.php
## language/lang_english/lang_admin.php
## templates/BBTech/admin/forum_edit_body.tpl
## templates/BBTech/index_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:
## Set your forum icon image paths as those rank images
##
##############################################################
## MOD History:
##
## 2003-11-15 - Version 1.0.2
## - Corrections were made for phpBB MOD Database submission
##
## 2003-11-08 - Version 1.0.1
## - Checked for 2.0.6 competibility, no change in coding
##
## 2003-11-04 - Version 1.0.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
# Remember to change the table prefix used on your database
ALTER TABLE `acplugins_db` ADD `forum_icon` VARCHAR( 255 ) default NULL;
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Forum_status'] = 'Forum status';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_icon'] = 'Forum icon'; // Forum Icon MOD
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]------------------------------------------
#
$forumstatus = $row['forum_status'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forumicon = $row['forum_icon']; // Forum Icon MOD
#
#-----[ FIND ]------------------------------------------
#
$forumstatus = FORUM_UNLOCKED;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forumicon = ''; // Forum Icon MOD
#
#-----[ FIND ]------------------------------------------
#
'L_FORUM_STATUS' => $lang['Forum_status'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_FORUM_ICON' => $lang['Forum_icon'], // Forum Icon MOD
#
#-----[ FIND ]------------------------------------------
#
'DESCRIPTION' => $forumdesc)
#
#-----[ REPLACE WITH ]------------------------------------------
#
'DESCRIPTION' => $forumdesc, // Forum Icon MOD
'ICON' => ( $forumicon ) ? $forumicon : '', // Forum Icon MOD
'ICON_DISPLAY' => ( $forumicon ) ? '<img src="' . $phpbb_root_path . $forumicon . '" />' : '')
// Forum Icon MOD
#
#-----[ FIND ]------------------------------------------
#
// There is no problem having duplicate forum names so we won't check for it.
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
#
#-----[ IN-LINE FIND ]------------------------------------------
#
forum_status
#
#-----[ AFTER, ADD ]------------------------------------------
#
, forum_icon
#
#-----[ FIND ]------------------------------------------
#
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, " . intval($HTTP_POST_VARS['forumstatus']) . "
#
#-----[ AFTER, ADD ]------------------------------------------
#
, '" . str_replace("\'", "''", $HTTP_POST_VARS['forumicon']) . "'
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . "
#
#-----[ AFTER, ADD ]------------------------------------------
#
, forum_icon = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumicon']) . "'
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
$posts = $forum_data[$j]['forum_posts'];
$topics = $forum_data[$j]['forum_topics'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$icon = $forum_data[$j]['forum_icon']; // Forum Icon Mod
#
#-----[ FIND ]------------------------------------------
#
'FORUM_FOLDER_IMG' => $folder_image,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FORUM_ICON_IMG' => ($icon) ? '<img src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '', // Forum Icon Mod
#
#-----[ OPEN ]------------------------------------------
#
templates/BBTech/admin/forum_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_FORUM_NAME}</td>
<td class="row2"><input type="text" size="25" name="forumname" value="{FORUM_NAME}" class="post" /></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_FORUM_ICON}</td>
<td class="row2"><input type="text" size="35" name="forumicon" value="{ICON}" class="post"
/> {ICON_DISPLAY}</td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/BBTech/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th colspan="2" class="1" height="25" nowrap="nowrap"> {L_FORUM} </th>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
colspan="2"
#
#-----[ REPLACE WITH ]------------------------------------------
#
colspan="3"
#
#-----[ FIND ]------------------------------------------
#
<td class="rowpic" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
colspan="2"
#
#-----[ REPLACE WITH ]------------------------------------------
#
colspan="3"
#
#-----[ FIND ]------------------------------------------
#
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="row1" align="center" valign="middle" height="50">{catrow.forumrow.FORUM_ICON_IMG}</td>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Select all
#
#-----[ FIND ]------------------------------------------
#
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
colspan="2"
#
#-----[ REPLACE WITH ]------------------------------------------
#
colspan="3"
#
#-----[ FIND ]------------------------------------------
#
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
colspan="2"
#
#-----[ REPLACE WITH ]------------------------------------------
#
colspan="3"
#
#-----[ FIND ]------------------------------------------
#
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="row1" align="center" valign="middle" height="50">{catrow.forumrow.FORUM_ICON_IMG}</td>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<td align="left" valign="bottom" colspan="2">
#
#-----[ AFTER, ADD ]------------------------------------------
#
{FORUM_ICON_IMG}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
Code: Select all
<!-- mod : categories hierarchy v 2 -->
<!-- BEGIN catrow -->
<!-- BEGIN tablehead -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="{catrow.tablehead.INC_SPAN}" width="100%" class="thCornerL" nowrap="nowrap"> {catrow.tablehead.L_FORUM} </th>
<th width="50" nowrap="nowrap"> {L_TOPICS} <br />{L_POSTS}</th>
<th width="150" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- END tablehead -->
<!-- BEGIN cathead -->
<tr>
<!-- BEGIN inc -->
<td width="46" class="{catrow.cathead.inc.INC_CLASS}"><img src="{SPACER}" width="46" height="0" /></td>
<!-- END inc -->
<td class="{catrow.cathead.CLASS_CAT}" width="100%" colspan="{catrow.cathead.INC_SPAN}"><span class="cattitle"><a href="{catrow.cathead.U_VIEWCAT}" class="cattitle">{catrow.cathead.CAT_TITLE}</a></span></td>
<td class="{catrow.cathead.CLASS_CAT} colspan="2" " "></td>
<td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>
</tr>
<!-- END cathead -->
<!-- BEGIN forumrow -->
<tr>
<!-- BEGIN inc -->
<td width="46" class="{catrow.forumrow.inc.INC_CLASS}"><img src="{SPACER}" width="46" height="0" /></td>
<!-- END inc -->
<td class="row2" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row2" width="100%" height="50" colspan="{catrow.forumrow.INC_SPAN}" valign="top" onMouseOver="this.style.backgroundColor='#f4f6fb'; this.style.cursor='default';" onMouseOut="this.style.backgroundColor='#e1e9f2';">
<span class="forumlink"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /></span>
<span class="genmed">{catrow.forumrow.FORUM_DESC}<br /></span>
<span class="gensmall">
<!-- BEGIN links -->
{catrow.forumrow.links.L_LINKS} {catrow.forumrow.links.LINKS}
<!-- END links -->
</span>
</td>
<!-- BEGIN forum_link_no -->
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}<br /><hr width="60">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
<!-- END forum_link_no -->
<!-- BEGIN forum_link -->
<td class="row2" align="center" valign="middle" height="50" colspan="5"><span class="gensmall">{catrow.forumrow.forum_link.HIT_COUNT}</span></td>
<!-- END forum_link -->
</tr>
<!-- END forumrow -->
<!-- BEGIN catfoot -->
<tr>
<!-- BEGIN inc -->
<td width="46" class="{catrow.catfoot.inc.INC_CLASS}"><img src="{SPACER}" width="46" height="0" /></td>
<!-- END inc -->
<td colspan="6" height="1" class="spaceRow"><img src="{SPACER}" alt="" width="1" height="1" /></td>
</tr>
<!-- END catfoot -->
<!-- BEGIN tablefoot -->
</table>
<br class="gensmall" />
<!-- END tablefoot -->
<!-- END catrow -->
Trollie wrote: So your mod is different.. i don't have to use it ?
Trollie wrote: now let me find a way to get it next to the word forum, and change that word forum
Code: Select all
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th>
<th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- BEGIN catrow -->
<tr>
<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
<td class="rowpic" colspan="3" align="right"> </td>
</tr>
<!-- BEGIN forumrow -->
<tr>
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
</tr>
<!-- END forumrow -->
<!-- END catrow -->
</table>