[2.0.19] Advanced Group Color Management

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
38
64%
Very Good
10
17%
Good
3
5%
Fair
3
5%
Poor
5
8%
 
Total votes: 59

poetic puppy
Registered User
Posts: 1
Joined: Mon Dec 10, 2007 2:38 pm

Re: [2.0.19] Advanced Group Color Management

Post by poetic puppy » Mon Dec 10, 2007 2:42 pm

Please help. I have version 2.0.20 and am getting the following error message:
SQL Error : 1054 Unknown column 'u.user_group_id' in 'field list'

SELECT u.user_group_id, u.user_group_id, u.user_id, u.username, u.user_session_time, u.user_session_page, s.session_logged_in, s.session_ip, s.session_start FROM phpbb_users u, phpbb_sessions s WHERE s.session_logged_in = 1 AND u.user_id = s.session_user_id AND u.user_id <> -1 AND s.session_time >= 1197297007 ORDER BY u.user_session_time DESC

Line : 345
File : index.php
Can anyone tell me what I have done wrong or how I can fix it? Please? I have looked through the rest of this thread but cannot find the answer I am looking for.

I think it may have something to do with this section of code in index.php:
//
// Get users online information.
//
$sql = "SELECT u.user_group_id, u.user_id, u.username, u.user_session_time, u.user_session_page, s.session_logged_in, s.session_ip, s.session_start
FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s
WHERE s.session_logged_in = " . TRUE . "
AND u.user_id = s.session_user_id
AND u.user_id <> " . ANONYMOUS . "
AND s.session_time >= " . ( time() - 300 ) . "
ORDER BY u.user_session_time DESC";

//-- mod : Advanced Group Color Management -------------------------------------
//-- add
$sql = str_replace('SELECT ', 'SELECT u.user_group_id, ', $sql);
//-- fin mod : Advanced Group Color Management ---------------------------------

J.Buesking
Registered User
Posts: 9
Joined: Sat Aug 18, 2007 3:35 am

Re: [2.0.19] Advanced Group Color Management

Post by J.Buesking » Sun Dec 16, 2007 2:16 am

Don't install this. I just tried and it doesn't work properly. It also appears the author has abandoned it.

There's two main bugs that make this a show stopper and they can be found 2 pages back.

Luizianna
Registered User
Posts: 46
Joined: Thu Jan 24, 2008 3:43 pm

Re: [2.0.19] Advanced Group Color Management

Post by Luizianna » Mon Feb 11, 2008 4:52 pm

Ok, I have searched these forums til I'm blue in the face. Gonna give this one more try. We don't have groups on our forum. All we want to do is add new ranks and put colors to those new ranks. Will this Advanced Group Color Management mod allow that? Somebody please help me and please don't tell me to do a search again...I am so frustrated at trying to get an answer thru searches and asking questions that are not getting answered. Thanks
Linda

Dennix
Registered User
Posts: 21
Joined: Sat Oct 13, 2007 11:39 pm

Re: [2.0.19] Advanced Group Color Management

Post by Dennix » Sun Mar 09, 2008 11:50 pm

Im trying to install it with easymod but I keep getting:

Critical Error

FIND FAILED: In file [includes/functions.php] could not find:

if ( $userdata['user_id'] != ANONYMOUS )
{
if ( !empty($userdata['user_lang']))
{
$board_config['default_lang'] = $userdata['user_lang'];
}

Does anyone know whats the problem?
I checked the functions.php file, and I could indeed not find the $board_config['default_lang'] = $userdata['user_lang']; sentence.

User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: [2.0.19] Advanced Group Color Management

Post by Jim_UK » Sat Mar 29, 2008 8:35 pm

Sometimes code is changed to either cure bugs or improve security.
I would always do a partial search and then compare the found with what I was meant to look for. In this case my search was just for ANONYMOUS

Did you not find this?

Code: Select all

	if ( $userdata['user_id'] != ANONYMOUS )
	{
		if ( !empty($userdata['user_lang']))
		{
			$default_lang = phpbb_ltrim(basename(phpbb_rtrim($userdata['user_lang'])), "'");
		}

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!

User avatar
Shaythong
Registered User
Posts: 48
Joined: Sun May 22, 2005 1:57 am

Re: [2.0.19] Advanced Group Color Management

Post by Shaythong » Mon Apr 07, 2008 5:58 pm

Thanks, it works great! But is there anyway to get this working with the default IM Portal blocks? There Should be legend and fix the User Block, Who is Online, Recent Topics, News block and Statistics to show the colors.

User avatar
Ornette
Registered User
Posts: 56
Joined: Thu Mar 06, 2008 3:53 pm

Re: [2.0.19] Advanced Group Color Management

Post by Ornette » Tue Apr 08, 2008 5:04 am

Luizianna wrote:Ok, I have searched these forums til I'm blue in the face. Gonna give this one more try. We don't have groups on our forum. All we want to do is add new ranks and put colors to those new ranks.
Linda
I think this one is prolly the one you are wanting:

Extend Rank Color
http://www.phpbb.com/community/viewtopic.php?t=231931

If I am not mistaken 'Extend Rank Color' is the MOD they use on forum5.com i believe, and does exactly the thing you have described - allowing you to apply colours to the ranks you have created.
Quote: "This mod allows you the possibility to add color ranks into 'Who is online' page and into 'Who is online' box in bottom of the index. You can create color ranks via the ACP."

Give it a go... :)
DJ Ornsman - Back To 93
Tuesday 9-11pm GMT on Stress Factor

http://www.stressfactor.co.uk

Desiler
Registered User
Posts: 8
Joined: Sat Apr 26, 2008 5:26 pm

Re: [2.0.19] Advanced Group Color Management

Post by Desiler » Sun Apr 27, 2008 3:15 pm

Thanks but if I try to put on the colors he gives a error!

Couldn't obtain group data

DEBUG MODE

SQL Error : 1054 Unknown column 'group_weight' in 'field list'

SELECT group_id, group_name, group_weight, group_legend, group_color FROM phpbb_desilergroups WHERE group_single_user <> 1 ORDER BY group_weight ASC

Line : 110
File : admin_color.php

User avatar
Ornette
Registered User
Posts: 56
Joined: Thu Mar 06, 2008 3:53 pm

Re: [2.0.19] Advanced Group Color Management

Post by Ornette » Sun Apr 27, 2008 4:17 pm

Doh.

You better off using Simple Colored Usergroups it does all this and a bit more. (You dont have to add user color to each user manually, for one).

This one is pretty broken. And the promised version update very early on in its lifespan was never delivered. The high post count on this one is not a measure of popularity, but of the amount of problems people have had using this...

Should be moved to the [2.0.x] MOD Database Cleanup section, imo!
DJ Ornsman - Back To 93
Tuesday 9-11pm GMT on Stress Factor

http://www.stressfactor.co.uk

knight.rider69
Registered User
Posts: 177
Joined: Fri Aug 08, 2008 5:44 am

Re: [2.0.19] Advanced Group Color Management

Post by knight.rider69 » Fri Nov 28, 2008 7:20 am

after i installed it i haveing this kind of problem
Fatal error: Call to undefined method stdClass::lang() in /home/addabaz/public_html/forum/includes/functions.php on line 406
i can't do anything
please help me as soon as possible

knight.rider69
Registered User
Posts: 177
Joined: Fri Aug 08, 2008 5:44 am

Re: [2.0.19] Advanced Group Color Management

Post by knight.rider69 » Sat Nov 29, 2008 5:49 am

the first problem is solved somehow
but now i got another one, it saying:

Fatal error: Call to undefined method stdClass::get_user_color() in /home/addabaz/public_html/forum/includes/page_header.php on line 268

AGCM is installing 'AGCM_CURRENT_VERSION' onto your board.
Running :: INSERT phpbb_config (config_name , config_value) VALUES ('mod_advanced_group_color_management' , 'AGCM_CURRENT_VERSION') -> COMPLETED

Running :: INSERT INTO phpbb_config (config_name , config_value) VALUES ('agcm_check', '1') -> FAILED ---> Duplicate entry 'agcm_check' for key 1

Running :: INSERT INTO phpbb_config (config_name , config_value) VALUES ('agcm_time', '900') -> FAILED ---> Duplicate entry 'agcm_time' for key 1

Running :: ALTER TABLE phpbb_groups ADD group_weight MEDIUMINT(3) NOT NULL DEFAULT '' -> FAILED ---> Invalid default value for 'group_weight'

Running :: ALTER TABLE phpbb_groups ADD group_legend SMALLINT(1) NOT NULL DEFAULT '' -> FAILED ---> Invalid default value for 'group_legend'

Running :: ALTER TABLE phpbb_groups ADD group_color SMALLINT(1) NOT NULL DEFAULT '' -> FAILED ---> Invalid default value for 'group_color'

Running :: ALTER TABLE phpbb_themes ADD session_time VARCHAR(6) NOT NULL DEFAULT '' -> FAILED ---> Duplicate column name 'session_time'

Running :: ALTER TABLE phpbb_themes ADD g0 VARCHAR(6) NOT NULL DEFAULT '' -> FAILED ---> Duplicate column name 'g0'

Running :: ALTER TABLE phpbb_themes ADD g VARCHAR(6) NOT NULL DEFAULT '' -> FAILED ---> Duplicate column name 'g'

Running :: ALTER TABLE phpbb_users ADD user_group_id MEDIUMINT(8) NULL -> FAILED ---> Duplicate column name 'user_group_id'

Running :: UPDATE phpbb_users SET user_group_id = NULL -> COMPLETED

Running :: UPDATE phpbb_users SET user_group_id = '0' WHERE user_id = '-1' -> COMPLETED


Fatal error: Call to undefined method stdClass::read() in /home/addabaz/public_html/forum/install_color/install.php on line 515

Code: Select all

<?php

/***************************************************************************

 *                              page_header.php

 *                            -------------------

 *   begin                : Saturday, Feb 13, 2001

 *   copyright            : (C) 2001 The phpBB Group

 *   email                : support@phpbb.com

 *

 *   $Id: page_header.php,v 1.106.2.25 2005/10/30 15:17:14 acydburn Exp $

 *

 *

 ***************************************************************************/



/***************************************************************************

 *

 *   This program is free software; you can redistribute it and/or modify

 *   it under the terms of the GNU General Public License as published by

 *   the Free Software Foundation; either version 2 of the License, or

 *   (at your option) any later version.

 *

 ***************************************************************************/



if ( !defined('IN_PHPBB') )

{

	die("Hacking attempt");

}



define('HEADER_INC', TRUE);



//

// gzip_compression

//

$do_gzip_compress = FALSE;

if ( $board_config['gzip_compress'] )

{

	$phpver = phpversion();



	$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');



	if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )

	{

		if ( extension_loaded('zlib') )

		{

			ob_start('ob_gzhandler');

		}

	}

	else if ( $phpver > '4.0' )

	{

		if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )

		{

			if ( extension_loaded('zlib') )

			{

				$do_gzip_compress = TRUE;

				ob_start();

				ob_implicit_flush(0);



				header('Content-Encoding: gzip');

			}

		}

	}

}



//

// Parse and show the overall header.

//

$template->set_filenames(array(

	'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')

);



//

// Generate logged in/logged out status

//

if ( $userdata['session_logged_in'] )

{

	$u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];

	$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';

}

else

{

	$u_login_logout = 'login.'.$phpEx;

	$l_login_logout = $lang['Login'];

}



$s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : '';



//

// Get basic (usernames + totals) online

// situation

//

$logged_visible_online = 0;

$logged_hidden_online = 0;

$guests_online = 0;

$online_userlist = '';

$l_online_users = '';



if (defined('SHOW_ONLINE'))


{



	$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';

	$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip

		FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s

		WHERE u.user_id = s.session_user_id

			AND s.session_time >= ".( time() - 300 ) . "

			$user_forum_sql

		ORDER BY u.username ASC, s.session_ip ASC";
//-- mod : Advanced Group Color Management -------------------------------------
//-- add
			$sql = str_replace('SELECT ', 'SELECT u.user_group_id, u.user_session_time, ', $sql);
//-- fin mod : Advanced Group Color Management ---------------------------------

	if( !($result = $db->sql_query($sql)) )

	{

		message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);

	}



	$userlist_ary = array();

	$userlist_visible = array();



	$prev_user_id = 0;

	$prev_user_ip = $prev_session_ip = '';



	while( $row = $db->sql_fetchrow($result) )

	{

		// User is logged in and therefor not a guest

		if ( $row['session_logged_in'] )

		{

			// Skip multiple sessions for one user

			if ( $row['user_id'] != $prev_user_id )

			{

				$style_color = '';
//-- mod : Advanced Group Color Management -------------------------------------
//-- delete
//	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'] . '"';
//	}
//-- add
				$style_color = ' style="color : #' . $colors->get_user_color($row['user_group_id'], $row['user_session_time']) . ';" class="username_color"';
//-- fin mod : Advanced Group Color Management ---------------------------------


				if ( $row['user_allow_viewonline'] )
				{
					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . 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&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
					$logged_hidden_online++;
				}


				if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )

				{

					$online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link;

				}

			}



			$prev_user_id = $row['user_id'];

		}

		else

		{

			// Skip multiple sessions for one user

			if ( $row['session_ip'] != $prev_session_ip )

			{

				$guests_online++;

			}

		}



		$prev_session_ip = $row['session_ip'];

	}

	$db->sql_freeresult($result);



	if ( empty($online_userlist) )

	{

		$online_userlist = $lang['None'];

	}

	$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;



	$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;



	if ( $total_online_users > $board_config['record_online_users'])

	{

		$board_config['record_online_users'] = $total_online_users;

		$board_config['record_online_date'] = time();



		$sql = "UPDATE " . CONFIG_TABLE . "

			SET config_value = '$total_online_users'

			WHERE config_name = 'record_online_users'";

		if ( !$db->sql_query($sql) )

		{

			message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);

		}



		$sql = "UPDATE " . CONFIG_TABLE . "

			SET config_value = '" . $board_config['record_online_date'] . "'

			WHERE config_name = 'record_online_date'";

		if ( !$db->sql_query($sql) )

		{

			message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);

		}

	}



	if ( $total_online_users == 0 )

	{

		$l_t_user_s = $lang['Online_users_zero_total'];

	}

	else if ( $total_online_users == 1 )

	{

		$l_t_user_s = $lang['Online_user_total'];

	}

	else

	{

		$l_t_user_s = $lang['Online_users_total'];

	}



	if ( $logged_visible_online == 0 )

	{

		$l_r_user_s = $lang['Reg_users_zero_total'];

	}

	else if ( $logged_visible_online == 1 )

	{

		$l_r_user_s = $lang['Reg_user_total'];

	}

	else

	{

		$l_r_user_s = $lang['Reg_users_total'];

	}



	if ( $logged_hidden_online == 0 )

	{

		$l_h_user_s = $lang['Hidden_users_zero_total'];

	}

	else if ( $logged_hidden_online == 1 )

	{

		$l_h_user_s = $lang['Hidden_user_total'];

	}

	else

	{

		$l_h_user_s = $lang['Hidden_users_total'];

	}



	if ( $guests_online == 0 )

	{

		$l_g_user_s = $lang['Guest_users_zero_total'];

	}

	else if ( $guests_online == 1 )

	{

		$l_g_user_s = $lang['Guest_user_total'];

	}

	else

	{

		$l_g_user_s = $lang['Guest_users_total'];

	}



	$l_online_users = sprintf($l_t_user_s, $total_online_users);

	$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);

	$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);

	$l_online_users .= sprintf($l_g_user_s, $guests_online);

}



//

// Obtain number of new private messages

// if user is logged in

//

if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )

{

	if ( $userdata['user_new_privmsg'] )

	{

		$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];

		$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);



		if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )

		{

			$sql = "UPDATE " . USERS_TABLE . "

				SET user_last_privmsg = " . $userdata['user_lastvisit'] . "

				WHERE user_id = " . $userdata['user_id'];

			if ( !$db->sql_query($sql) )

			{

				message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);

			}



			$s_privmsg_new = 1;

			$icon_pm = $images['pm_new_msg'];

		}

		else

		{

			$s_privmsg_new = 0;

			$icon_pm = $images['pm_new_msg'];

		}

	}

	else

	{

		$l_privmsgs_text = $lang['No_new_pm'];



		$s_privmsg_new = 0;

		$icon_pm = $images['pm_no_new_msg'];

	}



	if ( $userdata['user_unread_privmsg'] )

	{

		$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];

		$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);

	}

	else

	{

		$l_privmsgs_text_unread = $lang['No_unread_pm'];

	}

}

else

{

	$icon_pm = $images['pm_no_new_msg'];

	$l_privmsgs_text = $lang['Login_check_pm'];

	$l_privmsgs_text_unread = '';

	$s_privmsg_new = 0;

}



//

// Generate HTML required for Mozilla Navigation bar

//

if (!isset($nav_links))

{

	$nav_links = array();

}



$nav_links_html = '';

$nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n";

while( list($nav_item, $nav_array) = @each($nav_links) )

{

	if ( !empty($nav_array['url']) )

	{

		$nav_links_html .= sprintf($nav_link_proto, $nav_item, append_sid($nav_array['url']), $nav_array['title']);

	}

	else

	{

		// We have a nested array, used for items like <link rel='chapter'> that can occur more than once.

		while( list(,$nested_array) = each($nav_array) )

		{

			$nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']);

		}

	}

}



// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility

$l_timezone = explode('.', $board_config['board_timezone']);

$l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])];


//

// The following assigns all _common_ variables that may be used at any point

// in a template.

//

$template->assign_vars(array(

	'SITENAME' => $board_config['sitename'],

	'SITE_DESCRIPTION' => $board_config['site_desc'],

	'PAGE_TITLE' => $page_title,

	'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),

	'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),

	'TOTAL_USERS_ONLINE' => $l_online_users,

	'LOGGED_IN_USER_LIST' => $online_userlist,
	
	
	'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),

	'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,

	'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,

	'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
	
	

	'PRIVMSG_IMG' => $icon_pm,



	'L_USERNAME' => $lang['Username'],

	'L_PASSWORD' => $lang['Password'],

	'L_LOGIN_LOGOUT' => $l_login_logout,

	'L_LOGIN' => $lang['Login'],

	'L_LOG_ME_IN' => $lang['Log_me_in'],

	'L_AUTO_LOGIN' => $lang['Log_me_in'],

	'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),

	'L_REGISTER' => $lang['Register'],

	'L_PROFILE' => $lang['Profile'],

	'L_SEARCH' => $lang['Search'],

	'L_PRIVATEMSGS' => $lang['Private_Messages'],

	'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],

	'L_MEMBERLIST' => $lang['Memberlist'],

	'L_FAQ' => $lang['FAQ'],
//-- mod : Advanced Group Color Management -------------------------------------
//-- add
	'L_GROUP_LEGEND' => $lang['AGCM_legend'],
//-- fin mod : Advanced Group Color Management ---------------------------------

Post Reply

Return to “[2.0.x] MOD Database Releases”