##############################################################
## MOD Title:		Add-On Colorize Forumtitle with Categories Hierarchy
## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Description:	Gives admins the possibility to enter a color seperatly for each forumtitle
##			on boards with installed Categories Hierarchy Mod.
## MOD Version:		1.0.0
##
## Installation Level:	Easy
## Installation Time:	3-5 Minutes
## Files To Edit:	7
##			admin/admin_forums.php
##			includes/functions_categories_hierarchy.php
##			language/lang_english/lang_admin.php
##			language/lang_german/lang_admin.php
##			templates/subSilver/index_box.tpl
##			templates/subSilver/admin/forum_admin_body.tpl
##			templates/subSilver/admin/forum_edit_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:
##
## Instead entering the given SQL-Statement, you can upload the file db_update.php
## to your phpbb root directory and run this with your browser.
## This file will do all nessassary changes in the database for you.
## After using this file, please delete it to avoid errors.
##
## If you have NOT installed the Categories Hierarchy Mod, you MUSTN'T install this add-on!
##
## After installing this mod do a resync via ACP for ALL forums!
##
##############################################################
## MOD History:
##
##   2004-05-12 - Version 1.0.0
##      - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_forums ADD COLUMN forum_color varchar(6) DEFAULT '' NOT NULL;

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forums.php

#
#-----[ FIND ]------------------------------------------
#
				$forumname = $row['forum_name'];
				$forumdesc = $row['forum_desc'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
				$forum_color = $row['forum_color'];

#
#-----[ FIND ]------------------------------------------
#
				$forumdesc = '';

#
#-----[ AFTER, ADD ]------------------------------------------
#
				$forum_color = '';

#
#-----[ FIND ]------------------------------------------
#
			$forumstatus == ( FORUM_LOCKED ) ? $forumlocked = "selected=\"selected\"" : $forumunlocked = "selected=\"selected\"";

#
#-----[ AFTER, ADD ]------------------------------------------
#
			$forum_color = ( empty($forum_color) ) ? '' : $forum_color;

#
#-----[ FIND ]------------------------------------------
#
				'L_FORUM_TITLE' => $l_title, 

#
#-----[ AFTER, ADD ]------------------------------------------
#
				'L_FORUM_COLOR' => $lang['Forum_color'],
				'L_FORUM_COLOR_EXPLAIN' => $lang['Forum_color_explain'],

#
#-----[ FIND ]------------------------------------------
#
				'FORUM_NAME' => $forumname,

#
#-----[ AFTER, ADD ]------------------------------------------
#
				'FORUM_COLOR' => $forum_color,

#
#-----[ FIND ]------------------------------------------
#
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
				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 ]------------------------------------------
#
, forum_name

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, forum_color

#
#-----[ IN-LINE FIND ]------------------------------------------
#
'" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "'

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_color']) . "'

#
#-----[ 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_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "'

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, forum_color = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_color']) . "'

#
#-----[ FIND ]------------------------------------------
#
				'FORUM_NAME'		=> $forum_name,

#
#-----[ AFTER, ADD ]------------------------------------------
#
				'FORUM_COLOR' => ($tree['data'][$this]['forum_color'] != '' ) ? 'style="color: #'.$tree['data'][$this]['forum_color'].'"' : '',

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_categories_hierarchy.php

#
#-----[ FIND ]-----
#
		if ($wname != '') $link = '<a href="' . $wpgm . '" title="' . $wdesc . '" class="gensmall">' . $wname . '</a>';

#
#-----[ REPLACE WITH ]-----
#
		$wforum_color = ($tree['data'][$wthis]['forum_color'] != '' ) ? 'style="color: #'.$tree['data'][$wthis]['forum_color'].'"' : '';
		if ($wname != '') $link = '<a href="' . $wpgm . '" title="' . $wdesc . '" '.$wforum_color.' class="gensmall">' . $wname . '</a>';

#
#-----[ FIND ]------------------------------------------
#
				'FORUM_NAME'			=> $title,

#
#-----[ AFTER, ADD ]------------------------------------------
#
				'FORUM_COLOR' => ( $tree['data'][$this]['forum_color'] != '' ) ? 'style="color: #'.$tree['data'][$this]['forum_color'].'"' : '',

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
$lang['Forum_edit_delete_explain'] = 'The form below will allow you to customize all the general board options. For User and Forum configurations use the related links on the left hand side';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_color'] = 'Set a color for the forum title';
$lang['Forum_color_explain'] = 'Leave this field blank to use the default color. Just enter the color number without leading \'#\'!';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_german/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
$lang['Forum_edit_delete_explain'] = 'Hier kannst du alle allgemeinen Boardeinstellungen anpassen. Zur Benutzer- und Forenkonfiguration benutze bitte die entsprechenden Links auf der linken Seite';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_color'] = 'Trage eine Farbe fr den Forentitel ein.';
$lang['Forum_color_explain'] = 'Lass das Feld frei, um die Standardfarbe zu verwenden. Gib nur die Farbzahl ohne fhrende \'#\' ein!';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_box.tpl

#
#-----[ FIND ]------------------------------------------
#
		<span class="forumlink"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /></span>

#
#-----[ REPLACE WITH ]------------------------------------------
#
		<span {catrow.forumrow.FORUM_COLOR} class="forumlink"><a href="{catrow.forumrow.U_VIEWFORUM}" {catrow.forumrow.FORUM_COLOR} class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /></span>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/forum_admin_body.tpl

#
#-----[ FIND ]------------------------------------------
#
	<td class="row2" colspan="{catrow.forumrow.INC_SPAN}" {catrow.forumrow.WIDTH}><table cellpadding="0" cellspacing="0" width="100%"><tr><td>{catrow.forumrow.LINK_IMG}</td><td>{catrow.forumrow.ICON_IMG}</td><td width="100%"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td></tr></table></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
	<td class="row2" colspan="{catrow.forumrow.INC_SPAN}" {catrow.forumrow.WIDTH}><table cellpadding="0" cellspacing="0" width="100%"><tr><td>{catrow.forumrow.LINK_IMG}</td><td>{catrow.forumrow.ICON_IMG}</td><td width="100%"><a href="{catrow.forumrow.U_VIEWFORUM}" {catrow.forumrow.FORUM_COLOR} class="gen"><span {catrow.forumrow.FORUM_COLOR}>{catrow.forumrow.FORUM_NAME}</span></a><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td></tr></table></td>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/forum_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#
	<tr>
	  <td class="row1">{L_FORUM_STATUS}</td>
	  <td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
	<tr>
	  <td class="row1" width="30%">{L_FORUM_COLOR}<br /><span class="gensmall">{L_FORUM_COLOR_EXPLAIN}</span></td>
	  <td class="row2"><input type="text" size="10" maxlength="6" name="forum_color" value="{FORUM_COLOR}" class="post" /></td>
	</tr>


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM