################################################################
##                       COLOR GROUPS                         ##
##                           1.2.1                            ##
################################################################
##
##   Description:  This mod will replace the current
##                 name colorization with a group
##                 system.  You may define your group
##                 name, group color, and group members.
##
##   Compatibility:   phpBB - 2.0.4 - 2.0.6, 2.0.13 - 2.0.17
##                    (probably works with any version above 2.0.5)
##                    php   - 4.0.1 or above
################################################################
##   This hack brought to you by donation support from Kozy.  ##
##   Visit him at Kozy Net (http://www.kozysplace.net) to     ##
##   offer your thanks.                                       ##
################################################################
****************************************************************
**   Author:       Nivisec (support@nivisec.com)              **
**                 http://www.nivisec.com                     **
**                                                            **
**   Language                                                 **
**   Files At:     http://www.nivisec.com/phpbb.php?l=la      **
****************************************************************
################################################################
##   Installation Level: Fairly Easy
##   Installation Time:  10-15 minutes
##
##   Author Notes:
##     Once installed, you will have a new admin panel
##     option called "Color Groups" under the "Group Admin"
##     area.
##
##   Support:    http://www.phpbbhacks.com/forums 
##   Copyright:  2002-2003 Nivisec.com
## 
################################################################
##                  ********* UPDATING *********
##   Please see the goodies/updating/ directory
##   for information on upgrading from a previous
##   version.
################################################################
#
#-----[ UPLOAD ]------------------------------------------ 
#   If you are having trouble understanding this section, read
#   the goodies/understanding_upload.txt file.
#
nivisec_install.php to /
nivisec_schema/*.* to nivisec_schema/
admin/admin_color_groups.php to admin/
language/lang_english/lang_color_groups.php to language/lang_english/
includes/functions_color_groups.php to includes/
templates/subSilver/admin/*.* to templates/subSilver/admin/

# 
#-----[ RUN ]------------------------------------------ 
# 
nivisec_install.php

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

# 
#-----[ FIND ]------------------------------------------ 
#
define('CATEGORIES_TABLE', $table_prefix.'categories');

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
define('COLOR_GROUPS_TABLE', $table_prefix.'color_groups');

# 
#-----[ OPEN ]------------------------------------------ 
# 
index.php

# 
#-----[ FIND ]------------------------------------------ 
#
//
// End session management
//

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
color_groups_setup_list();

# 
#-----[ FIND ]------------------------------------------ 
#
								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';

# 
#-----[REPLACE WITH ]------------------------------------------ 
#
								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']);
# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/index_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
[ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
{COLOR_GROUPS_LIST}

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

# 
#-----[ FIND ]------------------------------------------ 
#
if (defined('SHOW_ONLINE'))
{


# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

# 
#-----[ FIND ]------------------------------------------ 
#
				$style_color = '';
				if ( $row['user_level'] == ADMIN )
				{
					$row['username'] = '<b>' . $row['username'] . '</b>';
					$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
				}
				else if ( $row['user_level'] == MOD )
				{
					$row['username'] = '<b>' . $row['username'] . '</b>';
					$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
				}
				if ( $row['user_allow_viewonline'] )
				{
					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
					$logged_visible_online++;
				}
				else
				{
					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
					$logged_hidden_online++;
				}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
				$user_online_link = color_group_colorize_name($row['user_id']);
				if ( $row['user_allow_viewonline'] )
				{
					$logged_visible_online++;
				}
				else
				{
					$logged_hidden_online++;
				}
				
# 
#-----[ OPEN ]------------------------------------------ 
# 
viewonline.php

# 
#-----[ FIND ]------------------------------------------ 
#
			$username = $row['username'];

			$style_color = '';
			if ( $row['user_level'] == ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
			}
			else if ( $row['user_level'] == MOD )
			{
				$username = '<b style="color:#' . $theme['fontcolor2'] . '">' . $username . '</b>';
			}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
			include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
			$username = color_group_colorize_name($user_id, true);

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

# 
#-----[ FIND ]------------------------------------------ 
#
		'POSTER_NAME' => $poster,

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
		'POSTER_NAME' => ($poster_name = color_group_colorize_name($poster_id, true)) ? $poster_name : $poster,
		
# 
#-----[ OPEN ]------------------------------------------ 
# 
memberlist.php

# 
#-----[ FIND ]------------------------------------------ 
#
include($phpbb_root_path . 'common.'.$phpEx);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

# 
#-----[ FIND ]------------------------------------------ 
#
			'USERNAME' => $username,

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
			'USERNAME' => color_group_colorize_name($user_id, true),
			
# 
#-----[ OPEN ]------------------------------------------ 
# 
privmsg.php

# 
#-----[ FIND ]------------------------------------------ 
#
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

# 
#-----[ FIND ]------------------------------------------ 
#
	$username_from = $privmsg['username_1'];

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
	$username_from = color_group_colorize_name($privmsg['user_id_1'], true);
	
# 
#-----[ FIND ]------------------------------------------ 
#
	$username_to = $privmsg['username_2'];

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
	$username_to = color_group_colorize_name($privmsg['user_id_2'], true);

# 
#-----[ FIND ]------------------------------------------ 
#
			'FROM' =>  $msg_username,

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
			'FROM' =>  color_group_colorize_name($msg_userid, true),

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewforum.php

# 
#-----[ FIND ]------------------------------------------ 
#
include($phpbb_root_path . 'common.'.$phpEx);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

# 
#-----[ FIND ]------------------------------------------ 
#
	$moderators[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
	$moderators[] = color_group_colorize_name($row['user_id']);
	
# 
#-----[ FIND ]------------------------------------------ 
#
		$topic_author = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $topic_rowset[$i]['user_id']) . '">' : '';
		$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : ( ( $topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['Guest'] );

		$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '</a>' : '';

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
		$topic_author = ($topic_rowset[$i]['user_id'] == ANONYMOUS ) ? (($topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['Guest'] ) : color_group_colorize_name($topic_rowset[$i]['user_id']);

# 
#-----[ SAVE & CLOSE ALL FILES ]-------------------------- 
#
#End