##############################################################
## MOD Title:		Colorize Forumtitle
## 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.
## MOD Version:		1.0.0
##
## Traduccion Espaol: ThE KuKa - http://www.phpbb-es.com
##
## Installation Level:	Easy
## Installation Time:	3-5 Minutes
## Files To Edit:	7
##			index.php
##			admin/admin_forums.php
##			language/lang_english/lang_admin.php
##			language/lang_spanish/lang_admin.php
##			templates/subSilver/index_body.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 installed the Categories Hierarchy Mod, ONLY install the add-on!
##
##############################################################
## 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 ]------------------------------------------
#
index.php

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

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

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

#
#-----[ FIND ]------------------------------------------
#
				$forumdesc = $row['forum_desc'];
				$forumstatus = $row['forum_status'];

#
#-----[ 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_rows[$j]['forum_name'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
					'FORUM_COLOR' => ( $forum_rows[$j]['forum_color'] != '' ) ? 'style="color: #'.$forum_rows[$j]['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_spanish/lang_admin.php

#
#-----[ FIND ]------------------------------------------
# Busqueda parcial, esta linea acaba con punto y coma ;
$lang['Forum_edit_delete_explain']

#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_color'] = 'Fijar el color del titulo del foro';
$lang['Forum_color_explain'] = 'Dejar este espacio en blanco para utilizar el color por defecto. Puede introducir el codigo del color sin \'#\'';

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

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

#
#-----[ 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>

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

#
#-----[ FIND ]------------------------------------------
#
		<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
		<td class="row2"><span {catrow.forumrow.FORUM_COLOR} class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new" {catrow.forumrow.FORUM_COLOR}>{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></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