IGN Style Colored Names

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

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
.FD
Registered User
Posts: 4
Joined: Wed Nov 26, 2008 11:08 am

Re: IGN Style Colored Names

Post by .FD »

ive installed your mod. it works and names appear with the default setting. but when you try and change it through ucp. The options are there and it changes on the preview. but when i click on submit. i get this error.

Code: Select all

General Error
SQL ERROR [ mysqli ]

Unknown column 'Array' in 'field list' [1054]

SQL

UPDATE phpbb_users SET user_icq = '', user_aim = '', user_msnm = 'red_rebellion@msn.com', user_yim = '', user_jabber = '', user_website = 'http://footy-designs.co.uk', user_from = 'Liverpool', user_occ = '', user_interests = '', style_color = Array, style_fontweight = Array, style_fontstyle = Array, style_background = Array, style_decoration = Array, style_border = Array, username = '.FD', user_id = '2', user_notify_type = 2, user_birthday = ' 3-10-1986' WHERE user_id = 2

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/ucp/ucp_profile.php
LINE: 404
CALL: dbal_mysqli->sql_query()

FILE: includes/functions_module.php
LINE: 471
CALL: ucp_profile->main()

FILE: ucp.php
LINE: 320
CALL: p_master->load_active()

Trel
Registered User
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid
Contact:

Re: IGN Style Colored Names

Post by Trel »

moka moka wrote:with firefox its all right
but with IE the border color is on -NONE- but it still appear
youn can see that in http://www.muslim-tn.com/forum

thanks for help
I'm aware of this, and I will be modifing the next version to add something to compensate for this.
In the mean time, this ONLY happens in IE6. If you have any users using IE6, you should recommend either go to IE7 or switch to another browser because IE6 is not safe.

.FD wrote:ive installed your mod. it works and names appear with the default setting. but when you try and change it through ucp. The options are there and it changes on the preview. but when i click on submit. i get this error.

Code: Select all

General Error
SQL ERROR [ mysqli ]

Unknown column 'Array' in 'field list' [1054]

SQL

UPDATE phpbb_users SET user_icq = '', user_aim = '', user_msnm = 'red_rebellion@msn.com', user_yim = '', user_jabber = '', user_website = 'http://footy-designs.co.uk', user_from = 'Liverpool', user_occ = '', user_interests = '', style_color = Array, style_fontweight = Array, style_fontstyle = Array, style_background = Array, style_decoration = Array, style_border = Array, username = '.FD', user_id = '2', user_notify_type = 2, user_birthday = ' 3-10-1986' WHERE user_id = 2

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/ucp/ucp_profile.php
LINE: 404
CALL: dbal_mysqli->sql_query()

FILE: includes/functions_module.php
LINE: 471
CALL: ucp_profile->main()

FILE: ucp.php
LINE: 320
CALL: p_master->load_active()
Would realy like this mod on my boards, so any help would be much appreciated. I can provide test details if you would like to replicate the problem?

Could you post a copy of your ucp_profile.php file in code tags please?

User avatar
M0PIES
Registered User
Posts: 103
Joined: Sun Sep 14, 2008 6:37 pm

Re: IGN Style Colored Names

Post by M0PIES »

Where is it supposed to show up? Because I can't find it.

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26050
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

IGN Style Colored Names

Post by Paul »

MOD Updated to version 1.2.5
See first post for Download Link
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
M0PIES
Registered User
Posts: 103
Joined: Sun Sep 14, 2008 6:37 pm

Re: IGN Style Colored Names

Post by M0PIES »

What lmfao I just got it to work too.
;__;

Trel
Registered User
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid
Contact:

Re: IGN Style Colored Names

Post by Trel »

M0PIES wrote:What lmfao I just got it to work too.
;__;

No need to worry, the only difference between 1.2.4 and 1.2.5 is a correction in the instructions for upgrading from 1.0.6

I made a mistake in those which would give an error. If you installed 1.2.4 fresh, there's no difference.

If you upgraded from 1.0.6, and you get a board error, then I posted the fix on page 3 or 4, this was the only thing I changed in 1.2.5.

User avatar
M0PIES
Registered User
Posts: 103
Joined: Sun Sep 14, 2008 6:37 pm

Re: IGN Style Colored Names

Post by M0PIES »

Trel wrote:
M0PIES wrote:What lmfao I just got it to work too.
;__;

No need to worry, the only difference between 1.2.4 and 1.2.5 is a correction in the instructions for upgrading from 1.0.6

I made a mistake in those which would give an error. If you installed 1.2.4 fresh, there's no difference.

If you upgraded from 1.0.6, and you get a board error, then I posted the fix on page 3 or 4, this was the only thing I changed in 1.2.5.
Oh, alright. Sweet. :)

.FD
Registered User
Posts: 4
Joined: Wed Nov 26, 2008 11:08 am

Re: IGN Style Colored Names

Post by .FD »

It happens in Google Chrome browser. This is my ucp_profile.php as requested.

Code: Select all

<?php
/**
*
* @package ucp
* @version $Id: ucp_profile.php 8990 2008-10-09 15:41:19Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* ucp_profile
* Changing profile settings
*
* @todo what about pertaining user_sig_options?
* @package ucp
*/
class ucp_profile
{
	var $u_action;

	function main($id, $mode)
	{
		global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $cache;

		$user->add_lang('posting');
		$user->add_lang('mods/colored_names');

		$preview	= (!empty($_POST['preview'])) ? true : false;
		$submit		= (!empty($_POST['submit'])) ? true : false;
		$delete		= (!empty($_POST['delete'])) ? true : false;
		$error = $data = array();
		$s_hidden_fields = '';

		switch ($mode)
		{
			case 'reg_details':

				$data = array(
					'username'			=> utf8_normalize_nfc(request_var('username', $user->data['username'], true)),
					'email'				=> strtolower(request_var('email', $user->data['user_email'])),
					'email_confirm'		=> strtolower(request_var('email_confirm', '')),
					'new_password'		=> request_var('new_password', '', true),
					'cur_password'		=> request_var('cur_password', '', true),
					'password_confirm'	=> request_var('password_confirm', '', true),
				);

				add_form_key('ucp_reg_details');

				if ($submit)
				{
					// Do not check cur_password, it is the old one.
					$check_ary = array(
						'new_password'		=> array(
							array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
							array('password')),
						'password_confirm'	=> array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
						'email'				=> array(
							array('string', false, 6, 60),
							array('email')),
						'email_confirm'		=> array('string', true, 6, 60),
					);

					if ($auth->acl_get('u_chgname') && $config['allow_namechange'])
					{
						$check_ary['username'] = array(
							array('string', false, $config['min_name_chars'], $config['max_name_chars']),
							array('username'),
						);
					}

					$error = validate_data($data, $check_ary);

					if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
					{
						$error[] = 'NEW_PASSWORD_ERROR';
					}

					if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password']))
					{
						$error[] = 'CUR_PASSWORD_ERROR';
					}

					// Only check the new password against the previous password if there have been no errors
					if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && phpbb_check_hash($data['new_password'], $user->data['user_password']))
					{
						$error[] = 'SAME_PASSWORD_ERROR';
					}

					if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
					{
						$error[] = 'NEW_EMAIL_ERROR';
					}

					if (!check_form_key('ucp_reg_details'))
					{
						$error[] = 'FORM_INVALID';
					}

					if (!sizeof($error))
					{
						$sql_ary = array(
							'username'			=> ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],
							'username_clean'	=> ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
							'user_email'		=> ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
							'user_email_hash'	=> ($auth->acl_get('u_chgemail')) ? crc32($data['email']) . strlen($data['email']) : $user->data['user_email_hash'],
							'user_password'		=> ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'],
							'user_passchg'		=> ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,
						);

						if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username'])
						{
							add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
						}

						if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !phpbb_check_hash($data['new_password'], $user->data['user_password']))
						{
							$user->reset_login_keys();
							add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']);
						}

						if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'])
						{
							add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
						}

						$message = 'PROFILE_UPDATED';

						if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
						{
							$message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';

							include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

							$server_url = generate_board_url();

							$user_actkey = gen_rand_string(10);
							$key_len = 54 - (strlen($server_url));
							$key_len = ($key_len > 6) ? $key_len : 6;
							$user_actkey = substr($user_actkey, 0, $key_len);

							$messenger = new messenger(false);

							$template_file = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? 'user_activate_inactive' : 'user_activate';
							$messenger->template($template_file, $user->data['user_lang']);

							$messenger->to($data['email'], $data['username']);

							$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
							$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
							$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
							$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);

							$messenger->assign_vars(array(
								'USERNAME'		=> htmlspecialchars_decode($data['username']),
								'U_ACTIVATE'	=> "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
							);

							$messenger->send(NOTIFY_EMAIL);

							if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
							{
								// Grab an array of user_id's with a_user permissions ... these users can activate a user
								$admin_ary = $auth->acl_get_list(false, 'a_user', false);
								$admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();

								// Also include founders
								$where_sql = ' WHERE user_type = ' . USER_FOUNDER;

								if (sizeof($admin_ary))
								{
									$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
								}

								$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
									FROM ' . USERS_TABLE . ' ' .
									$where_sql;
								$result = $db->sql_query($sql);

								while ($row = $db->sql_fetchrow($result))
								{
									$messenger->template('admin_activate', $row['user_lang']);
									$messenger->to($row['user_email'], $row['username']);
									$messenger->im($row['user_jabber'], $row['username']);

									$messenger->assign_vars(array(
										'USERNAME'			=> htmlspecialchars_decode($data['username']),
										'U_USER_DETAILS'	=> "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
										'U_ACTIVATE'		=> "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
									);

									$messenger->send($row['user_notify_type']);
								}
								$db->sql_freeresult($result);
							}

							user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);

							// Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail)
							$sql_ary['user_actkey'] = $user_actkey;
							$sql_ary['user_newpasswd'] = '';
						}

						if (sizeof($sql_ary))
						{
							$sql = 'UPDATE ' . USERS_TABLE . '
								SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
								WHERE user_id = ' . $user->data['user_id'];
							$db->sql_query($sql);
						}

						// Need to update config, forum, topic, posting, messages, etc.
						if ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])
						{
							user_update_name($user->data['username'], $data['username']);
						}

						// Now, we can remove the user completely (kill the session) - NOT BEFORE!!!
						if (!empty($sql_ary['user_actkey']))
						{
							meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
							$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid($phpbb_root_path . 'index.' . $phpEx) . '">', '</a>');

							// Because the user gets deactivated we log him out too, killing his session
							$user->session_kill();
						}
						else
						{
							meta_refresh(3, $this->u_action);
							$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
						}

						trigger_error($message);
					}

					// Replace "error" strings with their real, localised form
					$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
				}

				$template->assign_vars(array(
					'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '',

					'USERNAME'			=> $data['username'],
					'EMAIL'				=> $data['email'],
					'PASSWORD_CONFIRM'	=> $data['password_confirm'],
					'NEW_PASSWORD'		=> $data['new_password'],
					'CUR_PASSWORD'		=> '',

					'L_USERNAME_EXPLAIN'		=> sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
					'L_CHANGE_PASSWORD_EXPLAIN'	=> sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),

					'S_FORCE_PASSWORD'	=> ($auth->acl_get('u_chgpasswd') && $config['chg_passforce'] && $user->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) ? true : false,
					'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false,
					'S_CHANGE_EMAIL'	=> ($auth->acl_get('u_chgemail')) ? true : false,
					'S_CHANGE_PASSWORD'	=> ($auth->acl_get('u_chgpasswd')) ? true : false)
				);
			break;

			case 'profile_info':

				include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);

				$cp = new custom_profile();

				$cp_data = $cp_error = array();

				$data = array(
					'icq'			=> request_var('icq', $user->data['user_icq']),
					'aim'			=> request_var('aim', $user->data['user_aim']),
					'msn'			=> request_var('msn', $user->data['user_msnm']),
					'yim'			=> request_var('yim', $user->data['user_yim']),
					'jabber'		=> utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
					'website'		=> request_var('website', $user->data['user_website']),
					'location'		=> utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)),
					'occupation'	=> utf8_normalize_nfc(request_var('occupation', $user->data['user_occ'], true)),
					'style_color' => request_var('style_color', $user->data['style_color']),
					'style_fontweight' => request_var('style_fontweight', $user->data['style_fontweight']),
					'style_fontstyle' => request_var('style_fontstyle', $user->data['style_fontstyle']),
					'style_background' => request_var('style_background', $user->data['style_background']),
					'style_decoration' => request_var('style_decoration', $user->data['style_decoration']),
					'style_border' => request_var('style_border', $user->data['style_border']),
					'username' => request_var('username', $user->data['username']),
					'user_id' => request_var('user_id', $user->data['user_id']),
					'interests'		=> utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)),
					'style_color'		=> array('match', true, "@(^#[0-9A-F]{6}|transparent)$@i"),
						'style_fontweight'		=> array('match', true, "@(normal|bold)$@"),
						'style_fontstyle'		=> array('match', true, "@(normal|italic)$@"),
						'style_background'		=> array('match', true, "@^(#[0-9A-F]{6}|transparent)$@i"),
						'style_decoration'		=> array('match', true, "@(none|overline|underline|line-through)$@"),
						'style_border'		=> array('match', true, "@(1px solid )(transparent|#[0-9A-F]{6})$@i"),

				);

				if ($config['allow_birthdays'])
				{
					$data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0;

					if ($user->data['user_birthday'])
					{
						list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user->data['user_birthday']);
					}

					$data['bday_day'] = request_var('bday_day', $data['bday_day']);
					$data['bday_month'] = request_var('bday_month', $data['bday_month']);
					$data['bday_year'] = request_var('bday_year', $data['bday_year']);
					$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
				}

				add_form_key('ucp_profile_info');

				if ($submit)
				{
					$validate_array = array(
						'icq'			=> array(
							array('string', true, 3, 15),
							array('match', true, '#^[0-9]+$#i')),
						'aim'			=> array('string', true, 3, 255),
						'msn'			=> array('string', true, 5, 255),
						'jabber'		=> array(
							array('string', true, 5, 255),
							array('jabber')),
						'yim'			=> array('string', true, 5, 255),
						'website'		=> array(
							array('string', true, 12, 255),
							array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
						'location'		=> array('string', true, 2, 100),
						'occupation'	=> array('string', true, 2, 500),
						'interests'		=> array('string', true, 2, 500),
					);

					if ($config['allow_birthdays'])
					{
						$validate_array = array_merge($validate_array, array(
							'bday_day'		=> array('num', true, 1, 31),
							'bday_month'	=> array('num', true, 1, 12),
							'bday_year'		=> array('num', true, 1901, gmdate('Y', time()) + 50),
							'user_birthday' => array('date', true),
						));
					}

					$error = validate_data($data, $validate_array);

					// validate custom profile fields
					$cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error);

					if (sizeof($cp_error))
					{
						$error = array_merge($error, $cp_error);
					}

					if (!check_form_key('ucp_profile_info'))
					{
						$error[] = 'FORM_INVALID';
					}

					if (!sizeof($error))
					{
						$data['notify'] = $user->data['user_notify_type'];

						if (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))
						{
							// User has not filled in a jabber address (Or one of the modules is disabled or jabber is disabled)
							// Disable notify by Jabber now for this user.
							$data['notify'] = NOTIFY_BOTH;
						}

						$sql_ary = array(
							'user_icq'		=> $data['icq'],
							'user_aim'		=> $data['aim'],
							'user_msnm'		=> $data['msn'],
							'user_yim'		=> $data['yim'],
							'user_jabber'	=> $data['jabber'],
							'user_website'	=> $data['website'],
							'user_from'		=> $data['location'],
							'user_occ'		=> $data['occupation'],
							'user_interests'=> $data['interests'],
							'style_color'=> $data['style_color'],
							'style_fontweight'=> $data['style_fontweight'],
							'style_fontstyle'=> $data['style_fontstyle'],
							'style_background'=> $data['style_background'],
							'style_decoration'=> $data['style_decoration'],
							'style_border'=> $data['style_border'],
							'username' => $data['username'],
							'user_id' => $data['user_id'],
							'user_notify_type'	=> $data['notify'],
						);

						if ($config['allow_birthdays'])
						{
							$sql_ary['user_birthday'] = $data['user_birthday'];
						}

						$sql = 'UPDATE ' . USERS_TABLE . '
							SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
							WHERE user_id = ' . $user->data['user_id'];
						$db->sql_query($sql);

						// Update Custom Fields
						if (sizeof($cp_data))
						{
							$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
								SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
								WHERE user_id = ' . $user->data['user_id'];
							$db->sql_query($sql);

							if (!$db->sql_affectedrows())
							{
								$cp_data['user_id'] = (int) $user->data['user_id'];

								$db->sql_return_on_error(true);

								$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
								$db->sql_query($sql);

								$db->sql_return_on_error(false);
							}
						}

						meta_refresh(3, $this->u_action);
						$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
						trigger_error($message);
					}

					// Replace "error" strings with their real, localised form
					$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
				}

				if ($config['allow_birthdays'])
				{
					$s_birthday_day_options = '<option value="0"' . ((!$data['bday_day']) ? ' selected="selected"' : '') . '>--</option>';
					for ($i = 1; $i < 32; $i++)
					{
						$selected = ($i == $data['bday_day']) ? ' selected="selected"' : '';
						$s_birthday_day_options .= "<option value=\"$i\"$selected>$i</option>";
					}

					$s_birthday_month_options = '<option value="0"' . ((!$data['bday_month']) ? ' selected="selected"' : '') . '>--</option>';
					for ($i = 1; $i < 13; $i++)
					{
						$selected = ($i == $data['bday_month']) ? ' selected="selected"' : '';
						$s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
					}
					$s_birthday_year_options = '';

					$now = getdate();
					$s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';
					for ($i = $now['year'] - 100; $i <= $now['year']; $i++)
					{
						$selected = ($i == $data['bday_year']) ? ' selected="selected"' : '';
						$s_birthday_year_options .= "<option value=\"$i\"$selected>$i</option>";
					}
					unset($now);

					$template->assign_vars(array(
						'S_BIRTHDAY_DAY_OPTIONS'	=> $s_birthday_day_options,
						'S_BIRTHDAY_MONTH_OPTIONS'	=> $s_birthday_month_options,
						'S_BIRTHDAY_YEAR_OPTIONS'	=> $s_birthday_year_options,
						'S_BIRTHDAYS_ENABLED'		=> true,
					));
				}

				$template->assign_vars(array(
					'ERROR'		=> (sizeof($error)) ? implode('<br />', $error) : '',

					'ICQ'		=> $data['icq'],
					'YIM'		=> $data['yim'],
					'AIM'		=> $data['aim'],
					'MSN'		=> $data['msn'],
					'JABBER'	=> $data['jabber'],
					'WEBSITE'	=> $data['website'],
					'LOCATION'	=> $data['location'],
					'OCCUPATION'=> $data['occupation'],
					'INTERESTS'	=> $data['interests'],
					'STYLE_COLOR' => generate_color_list($data['style_color']),
					'STYLE_FONTWEIGHT' => generate_option_list($data['style_fontweight'], array("normal","bold")),
					'STYLE_FONTSTYLE' => generate_option_list($data['style_fontstyle'], array("normal","italic")),
					'STYLE_DECORATION' => generate_option_list($data['style_decoration'], array("none","overline", "underline", "line-through")),
					'STYLE_BACKGROUND' => generate_color_list($data['style_background']),
					'STYLE_BORDER' => generate_color_list($data['style_border'], "1px solid "),
					'ALLOWED_STYLE' => $auth->acl_get('u_use_colored_name'),
					'NAME_PREVIEW' => "<span id=\"name_preview\" style=\" font-size: larger; color: ".get_username_string('colour', $data['user_id'], $data['username'])."\">".$data['username']."</span>",
				));

				// Get additional profile fields and assign them to the template block var 'profile_fields'
				$user->get_profile_fields($user->data['user_id']);

				$cp->generate_profile_fields('profile', $user->get_iso_lang_id());
				$cache->destroy('sql', USERS_TABLE);

			break;

			case 'signature':

				if (!$auth->acl_get('u_sig'))
				{
					trigger_error('NO_AUTH_SIGNATURE');
				}

				include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
				include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

				$enable_bbcode	= ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
				$enable_smilies	= ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
				$enable_urls	= ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;

				$signature		= utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true));

				add_form_key('ucp_sig');

				if ($submit || $preview)
				{
					include($phpbb_root_path . 'includes/message_parser.' . $phpEx);

					if (!sizeof($error))
					{
						$message_parser = new parse_message($signature);

						// Allowing Quote BBCode
						$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');

						if (sizeof($message_parser->warn_msg))
						{
							$error[] = implode('<br />', $message_parser->warn_msg);
						}

						if (!check_form_key('ucp_sig'))
						{
							$error[] = 'FORM_INVALID';
						}

						if (!sizeof($error) && $submit)
						{
							$sql_ary = array(
								'user_sig'					=> (string) $message_parser->message,
								'user_sig_bbcode_uid'		=> (string) $message_parser->bbcode_uid,
								'user_sig_bbcode_bitfield'	=> $message_parser->bbcode_bitfield
							);

							$sql = 'UPDATE ' . USERS_TABLE . '
								SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
								WHERE user_id = ' . $user->data['user_id'];
							$db->sql_query($sql);

							$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
							trigger_error($message);
						}
					}

					// Replace "error" strings with their real, localised form
					$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
				}

				$signature_preview = '';
				if ($preview)
				{
					// Now parse it for displaying
					$signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
					unset($message_parser);
				}

				decode_message($signature, $user->data['user_sig_bbcode_uid']);

				$template->assign_vars(array(
					'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '',
					'SIGNATURE'			=> $signature,
					'SIGNATURE_PREVIEW'	=> $signature_preview,

					'S_BBCODE_CHECKED' 		=> (!$enable_bbcode) ? ' checked="checked"' : '',
					'S_SMILIES_CHECKED' 	=> (!$enable_smilies) ? ' checked="checked"' : '',
					'S_MAGIC_URL_CHECKED' 	=> (!$enable_urls) ? ' checked="checked"' : '',

					'BBCODE_STATUS'			=> ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
					'SMILIES_STATUS'		=> ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
					'IMG_STATUS'			=> ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
					'FLASH_STATUS'			=> ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
					'URL_STATUS'			=> ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],

					'L_SIGNATURE_EXPLAIN'	=> sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),

					'S_BBCODE_ALLOWED'		=> $config['allow_sig_bbcode'],
					'S_SMILIES_ALLOWED'		=> $config['allow_sig_smilies'],
					'S_BBCODE_IMG'			=> ($config['allow_sig_img']) ? true : false,
					'S_BBCODE_FLASH'		=> ($config['allow_sig_flash']) ? true : false,
					'S_LINKS_ALLOWED'		=> ($config['allow_sig_links']) ? true : false)
				);

				// Build custom bbcodes array
				display_custom_bbcodes();

			break;

			case 'avatar':

				include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

				$display_gallery = request_var('display_gallery', '0');
				$avatar_select = basename(request_var('avatar_select', ''));
				$category = basename(request_var('category', ''));

				$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;

				add_form_key('ucp_avatar');

				if ($submit)
				{
					if (check_form_key('ucp_avatar'))
					{
						if (avatar_process_user($error))
						{
							meta_refresh(3, $this->u_action);
							$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
							trigger_error($message);
						}
					}
					else
					{
						$error[] = 'FORM_INVALID';
					}
					// Replace "error" strings with their real, localised form
					$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
				}

				$template->assign_vars(array(
					'ERROR'			=> (sizeof($error)) ? implode('<br />', $error) : '',
					'AVATAR'		=> get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
					'AVATAR_SIZE'	=> $config['avatar_filesize'],

					'U_GALLERY'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=avatar&display_gallery=1'),

					'S_FORM_ENCTYPE'	=> ($can_upload) ? ' enctype="multipart/form-data"' : '',

					'L_AVATAR_EXPLAIN'	=> sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
				));

				if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
				{
					avatar_gallery($category, $avatar_select, 4);
				}
				else
				{
					$avatars_enabled = ($can_upload || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;

					$template->assign_vars(array(
						'AVATAR_WIDTH'	=> request_var('width', $user->data['user_avatar_width']),
						'AVATAR_HEIGHT'	=> request_var('height', $user->data['user_avatar_height']),

						'S_AVATARS_ENABLED'		=> $avatars_enabled,
						'S_UPLOAD_AVATAR_FILE'	=> $can_upload,
						'S_UPLOAD_AVATAR_URL'	=> $can_upload,
						'S_LINK_AVATAR'			=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
						'S_DISPLAY_GALLERY'		=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
					);
				}

			break;
		}

		$template->assign_vars(array(
			'L_TITLE'	=> $user->lang['UCP_PROFILE_' . strtoupper($mode)],

			'S_HIDDEN_FIELDS'	=> $s_hidden_fields,
			'S_UCP_ACTION'		=> $this->u_action)
		);

		// Set desired template
		$this->tpl_name = 'ucp_profile_' . $mode;
		$this->page_title = 'UCP_PROFILE_' . strtoupper($mode);
	}
}

?>

Trel
Registered User
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid
Contact:

Re: IGN Style Colored Names

Post by Trel »

.FD wrote:It happens in Google Chrome browser. This is my ucp_profile.php as requested.

I see some problems with that yes.

First one is

Code: Select all

			$data = array(
			   'icq'         => request_var('icq', $user->data['user_icq']),
			   'aim'         => request_var('aim', $user->data['user_aim']),
			   'msn'         => request_var('msn', $user->data['user_msnm']),
			   'yim'         => request_var('yim', $user->data['user_yim']),
			   'jabber'      => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
			   'website'      => request_var('website', $user->data['user_website']),
			   'location'      => utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)),
			   'occupation'   => utf8_normalize_nfc(request_var('occupation', $user->data['user_occ'], true)),
			   'style_color' => request_var('style_color', $user->data['style_color']),
			   'style_fontweight' => request_var('style_fontweight', $user->data['style_fontweight']),
			   'style_fontstyle' => request_var('style_fontstyle', $user->data['style_fontstyle']),
			   'style_background' => request_var('style_background', $user->data['style_background']),
			   'style_decoration' => request_var('style_decoration', $user->data['style_decoration']),
			   'style_border' => request_var('style_border', $user->data['style_border']),
			   'username' => request_var('username', $user->data['username']),
			   'user_id' => request_var('user_id', $user->data['user_id']),
			   'interests'      => utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)),
			   'style_color'      => array('match', true, "@(^#[0-9A-F]{6}|transparent)$@i"),
				  'style_fontweight'      => array('match', true, "@(normal|bold)$@"),
				  'style_fontstyle'      => array('match', true, "@(normal|italic)$@"),
				  'style_background'      => array('match', true, "@^(#[0-9A-F]{6}|transparent)$@i"),
				  'style_decoration'      => array('match', true, "@(none|overline|underline|line-through)$@"),
				  'style_border'      => array('match', true, "@(1px solid )(transparent|#[0-9A-F]{6})$@i"),

			);
This section

Code: Select all

			   'style_color'      => array('match', true, "@(^#[0-9A-F]{6}|transparent)$@i"),
				  'style_fontweight'      => array('match', true, "@(normal|bold)$@"),
				  'style_fontstyle'      => array('match', true, "@(normal|italic)$@"),
				  'style_background'      => array('match', true, "@^(#[0-9A-F]{6}|transparent)$@i"),
				  'style_decoration'      => array('match', true, "@(none|overline|underline|line-through)$@"),
				  'style_border'      => array('match', true, "@(1px solid )(transparent|#[0-9A-F]{6})$@i"),
does not belong there.

It belonged here

Code: Select all

			   $validate_array = array(
				  'icq'         => array(
					 array('string', true, 3, 15),
					 array('match', true, '#^[0-9]+$#i')),
				  'aim'         => array('string', true, 3, 255),
				  'msn'         => array('string', true, 5, 255),
				  'jabber'      => array(
					 array('string', true, 5, 255),
					 array('jabber')),
				  'yim'         => array('string', true, 5, 255),
				  'website'      => array(
					 array('string', true, 12, 255),
					 array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
				  'location'      => array('string', true, 2, 100),
				  'occupation'   => array('string', true, 2, 500),
				  'interests'      => array('string', true, 2, 500),
			   );
I'd try re-modding a fresh copy of that file. Make sure you put that block in the right section. I'm almost positive that what was breaking it.

.FD
Registered User
Posts: 4
Joined: Wed Nov 26, 2008 11:08 am

Re: IGN Style Colored Names

Post by .FD »

thanks, will try it and let you know

figo
Registered User
Posts: 129
Joined: Tue Sep 18, 2007 4:57 am

Re: IGN Style Colored Names

Post by figo »

how come when in install it, it changes "Everyones" username color to red, with a red border in regular font?


I want it so that peoples colors dont get affected at all, and everything is standard, so if they are part of a usergroup, that wont get overridden, unless they choose it to be.

I want it to be the board defaults as a standard, this mod should be an option to change the board standards

figo
Registered User
Posts: 129
Joined: Tue Sep 18, 2007 4:57 am

Re: IGN Style Colored Names

Post by figo »

i guess i never made myself clear enough

1. is there away to change the default style to the default style that comes with the board? By this i mean there should be a default color for regular members, and a default color for people that are part of a usergroup.


Basically im saying that the usergroups color should override the defaults from this mod. How can this be done? (unless the user wants to override the default usergroup color)

2. How do I change the defaults settings of this mod to match the default color and sizing of the board with regular members?

Trel
Registered User
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid
Contact:

Re: IGN Style Colored Names

Post by Trel »

figo wrote:i guess i never made myself clear enough

1. is there away to change the default style to the default style that comes with the board? By this i mean there should be a default color for regular members, and a default color for people that are part of a usergroup.

Basically im saying that the usergroups color should override the defaults from this mod. How can this be done? (unless the user wants to override the default usergroup color)

2. How do I change the defaults settings of this mod to match the default color and sizing of the board with regular members?
It shouldn't be changing everyone. It should only change name's of users you've granted permission to.
(Is that what you meant?)

As far as your other question, as of now, no. If the user can use it, they do use it.
I will begin work on the next version over my Christmas break.
I will take suggestions at that time, so when that happens, suggest it there and I'll do my best to include it.

As for 2, the default values are done in the query you ran.
I did a brief explanation on how to change it here: http://www.phpbb.com/community/viewtopi ... 5#p7735175

If you need more detail, ask me. (Also, last I checked, I didn't touch the size of text, only the color and background and such)

figo
Registered User
Posts: 129
Joined: Tue Sep 18, 2007 4:57 am

Re: IGN Style Colored Names

Post by figo »

Trel wrote:
figo wrote:i guess i never made myself clear enough

1. is there away to change the default style to the default style that comes with the board? By this i mean there should be a default color for regular members, and a default color for people that are part of a usergroup.

Basically im saying that the usergroups color should override the defaults from this mod. How can this be done? (unless the user wants to override the default usergroup color)

2. How do I change the defaults settings of this mod to match the default color and sizing of the board with regular members?
It shouldn't be changing everyone. It should only change name's of users you've granted permission to.
(Is that what you meant?)

As far as your other question, as of now, no. If the user can use it, they do use it.
I will begin work on the next version over my Christmas break.
I will take suggestions at that time, so when that happens, suggest it there and I'll do my best to include it.

As for 2, the default values are done in the query you ran.
I did a brief explanation on how to change it here: http://www.phpbb.com/community/viewtopi ... 5#p7735175

If you need more detail, ask me. (Also, last I checked, I didn't touch the size of text, only the color and background and such)

ok thanks, i will wait for the next version then.

it changes for everyone for me cause i set those permissions to be used by all "regular members" usergroup.

My main concern here is that the usergroups color should be the default style, and users should change it if they dont like that default that comes with the group.

Eg. Moderators at my forums have a "green" name, being the default color for that group. This should override ur mod, unless the user wants to go and take the option ur mod offers.


So please include this in the next version if u got time. i will wait till then,


Thanks bud

User avatar
M0PIES
Registered User
Posts: 103
Joined: Sun Sep 14, 2008 6:37 pm

Re: IGN Style Colored Names

Post by M0PIES »

Is it possible to change other users colored name options?

Locked

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