Heavy problem with usercp_register.php

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
Sethernis
Registered User
Posts: 51
Joined: Mon May 12, 2008 5:12 am

Heavy problem with usercp_register.php

Post by Sethernis » Mon Oct 06, 2008 4:45 pm

I really don't know the problem and i've tried everything, including deleting PhpBB Security mod.

When i try to update my profile or register i get the error box under header links showing:

Image

Only T no more error reports.

First i thought it was phpbb security mod but now its somethings else. It is strange that it worked before and suddenly stopped. You should also know that i have a lot of phpbb mods installed which modify usercp_register.

Some of them are:

Skype mod,
Xfire mod,
Gender mod,
Paypal button addon,
Country flags,
Birthday mod,
Topic moved notification,
Arcade,
topic descriptions,
Custom title

And the most recent:

Map mod,
Absent user mod

and much more

One of these mods has an error in it i tried to find it but im not a php coder so i really don't have any clue where to look and i don't want to undo changes for each mod untill i find the error.Thats why im asking someone to please look at my usercp register file bellow and report if any errors found.The file code i posted is clear with my mods installed and phpbb security deleted.

Code: Select all

<?php
/***************************************************************************
 *                            usercp_register.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: usercp_register.php 6775 2006-12-17 10:51:27Z acydburn $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   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.
 *
 *
 ***************************************************************************/

/*

	This code has been modified from its original form by psoTFX @ phpbb.com
	Changes introduce the back-ported phpBB 2.2 visual confirmation code. 

	NOTE: Anyone using the modified code contained within this script MUST include
	a relevant message such as this in usercp_register.php ... failure to do so 
	will affect a breach of Section 2a of the GPL and our copyright

	png visual confirmation system : (c) phpBB Group, 2003 : All Rights Reserved

*/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}

$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');

// ---------------------------------------
// Load agreement template since user has not yet
// agreed to registration conditions/coppa
//
function show_coppa()
{
	global $userdata, $template, $lang, $phpbb_root_path, $phpEx;

	$template->set_filenames(array(
		'body' => 'agreement.tpl')
	);

	$template->assign_vars(array(
		'REGISTRATION' => $lang['Registration'],
		'AGREEMENT' => $lang['Reg_agreement'],
		'AGREEMENT_RULES' => $lang['Reg_agreement_Rules'],
		"AGREE_OVER_13" => $lang['Agree_over_13'],
		"AGREE_UNDER_13" => $lang['Agree_under_13'],
		'DO_NOT_AGREE' => $lang['Agree_not'],

		"U_AGREE_OVER13" => append_sid("profile.$phpEx?mode=register&agreed=true"),
		"U_AGREE_UNDER13" => append_sid("profile.$phpEx?mode=register&agreed=true&coppa=true"))
	);

	$template->pparse('body');

}
//
// ---------------------------------------

$error = FALSE;
$error_msg = '';
$page_title = ( $mode == 'editprofile' ) ? $lang['Edit_profile'] : $lang['Register'];

if ( $mode == 'register' && $board_config['reg_disable'] == '1' )
{
	message_die(GENERAL_MESSAGE, $lang['Reg_disable_message']);
}

if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
{
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	show_coppa();

	include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}

$coppa = ( empty($HTTP_POST_VARS['coppa']) && empty($HTTP_GET_VARS['coppa']) ) ? 0 : TRUE;

// 
// Verify Custom Title Status 
// 
$membertime = ( time() - $userdata['user_regdate'] );
$custom_title_activated = FALSE;
if (( $userdata['user_custom_title_status'] == CUSTOM_TITLE_ENABLED ) || 
	(( $userdata['user_custom_title_status'] == CUSTOM_TITLE_REGDATE ) && 
	( $membertime >= $board_config['custom_title_days'] * 86400) && 
	( $userdata['user_posts'] >= $board_config['custom_title_posts']))) 
{ 
	$custom_title_activated = TRUE; 
}

//
// Check and initialize some variables if needed
//
if (
	isset($HTTP_POST_VARS['submit']) ||
	isset($HTTP_POST_VARS['avatargallery']) ||
	isset($HTTP_POST_VARS['submitavatar']) ||
	isset($HTTP_POST_VARS['cancelavatar']) ||
	$mode == 'register' )
{
	include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
	include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
	include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

	if ( $mode == 'editprofile' )
	{
		$user_id = intval($HTTP_POST_VARS['user_id']);
		$current_email = trim(htmlspecialchars($HTTP_POST_VARS['current_email']));
	}

  // Begin Account Self-Delete MOD
  if( $HTTP_POST_VARS['deleteuser'] )
  {
    $message = "<form action=\"". append_sid("profile.$phpEx?mode=editprofile") ."\" method=\"post\">". $lang['Delete_account_question'] ."<br /><br /><input  type=\"submit\" name=\"delete_confirm\" value=\"". $lang['Yes'] ."\" class=\"mainoption\" />&nbsp;&nbsp;<input type=\"submit\" name=\"delete_cancel\"  value=\"". $lang['No'] ."\" class=\"liteoption\" /><input type=\"hidden\" name=\"user_id\" value=\"$user_id\" /></form>";

    message_die(GENERAL_MESSAGE, $message);  
  }
  // End Account Self-Delete MOD

	$strip_var_list = array('email' => 'email', 'icq' => 'icq', 'bday_day' => 'bday_day', 'bday_month' => 'bday_month', 'bday_year' => 'bday_year', 'aim' => 'aim', 'msn' => 'msn', 'skype' => 'skype', 'xfire' => 'xfire', 'yim' => 'yim', 'website' => 'website', 'paypal' => 'paypal', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests', 'custom_title' => 'custom_title', 'confirm_code' => 'confirm_code', 'country' => 'country');
      $strip_vars_mapmod = array('longitude' => 'longitude', 'latitude' => 'latitude');
      $strip_var_list = array_merge ($strip_var_list, $strip_vars_mapmod);

	// Strip all tags from data ... may p**s some people off, bah, strip_tags is
	// doing the job but can still break HTML output ... have no choice, have
	// to use htmlspecialchars ... be prepared to be moaned at.
	while( list($var, $param) = @each($strip_var_list) )
	{
		if ( !empty($HTTP_POST_VARS[$param]) )
		{
			$$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));
		}
	}

	$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';

	$trim_var_list = array('cur_password' => 'cur_password', 'new_password' => 'new_password', 'password_confirm' => 'password_confirm', 'signature' => 'signature');

	while( list($var, $param) = @each($trim_var_list) )
	{
		if ( !empty($HTTP_POST_VARS[$param]) )
		{
			$$var = trim($HTTP_POST_VARS[$param]);
		}
	}

// Read Modules Configuration from DB
define('MODULES_MOD_TABLE', $table_prefix.'modules');

$MDL = array();
$sql = "SELECT * FROM " . MODULES_MOD_TABLE;

if( !($result = $db->sql_query($sql)) )
{
	message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
	$MDL[$row['modules_name']] = $row['modules_value'];
}


// Switches
if ( $MDL['ac_disable'] == '0' )
{
	$template->assign_block_vars('ac_switch', array());
}

if ( $MDL['ma_disable'] == '0' )
{
	$template->assign_block_vars('ma_switch', array());
}

// Verify the user is allowed to alter their custom title.  If not, replace it with their old one. 
	if ($custom_title_activated == FALSE) 
	{ 
		$custom_title = addslashes($userdata['user_custom_title']); 
	}

	// Check the length of the custom title.  Prevents people from editing the HTML to get a longer one.
	if (strlen($custom_title) > $board_config['custom_title_maxlength'])
	{
		if ($custom_title != addslashes($userdata['user_custom_title'])) {
			$custom_title = addslashes($userdata['user_custom_title']);
			$error = TRUE;
			if (isset($error_msg)) $error_msg .= '<br />';
			$error_msg .= $lang['Custom_title_toolong'];
		}
	}

	$signature = (isset($signature)) ? str_replace('<br />', "\n", $signature) : '';
	$signature_bbcode_uid = '';

	// Run some validation on the optional fields. These are pass-by-ref, so they'll be changed to
	// empty strings if they fail.
	validate_optional_fields($icq, $aim, $msn, $yim, $website, $paypal, $location, $country, $occupation, $interests, $signature, $user_absence_text, $skype, $xfire);

	$viewemail = ( isset($HTTP_POST_VARS['viewemail']) ) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;
	$user_absence_mode = abs( intval($HTTP_POST_VARS['user_absence_mode']) );
	$user_absence = ( isset($HTTP_POST_VARS['user_absence']) ) ? ( ($HTTP_POST_VARS['user_absence']) ? TRUE : 0 ) : 0;
	$user_absence_text = htmlspecialchars($HTTP_POST_VARS['user_absence_text']);
	$allowviewonline = ( isset($HTTP_POST_VARS['hideonline']) ) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : TRUE ) : TRUE;
      $showprofile = ( isset($HTTP_POST_VARS['showprofile']) ) ? ( ($HTTP_POST_VARS['showprofile'] == 1) ? 1 : 0 ) : 0;
	$notifyreply = ( isset($HTTP_POST_VARS['notifyreply']) ) ? ( ($HTTP_POST_VARS['notifyreply']) ? TRUE : 0 ) : 0;
	$notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
      $games_block_pm = ( isset($HTTP_POST_VARS['games_block_pm']) ) ? ( ($HTTP_POST_VARS['games_block_pm']) ? TRUE : 0 ) : TRUE;
	$popup_pm = ( isset($HTTP_POST_VARS['popup_pm']) ) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
	$sid = (isset($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : 0;

	// begin topic moved mailer by Wicher
	$mail_on_topic_moved = ( isset($HTTP_POST_VARS['topic_moved_mail']) ) ? ( ($HTTP_POST_VARS['topic_moved_mail']) ? TRUE : 0 ) : 0;
	$pm_on_topic_moved = ( isset($HTTP_POST_VARS['topic_moved_pm']) ) ? ( ($HTTP_POST_VARS['topic_moved_pm']) ? TRUE : 0 ) : TRUE;
	$pm_on_topic_moved_notify = ( isset($HTTP_POST_VARS['topic_moved_pm_notify']) ) ? ( ($HTTP_POST_VARS['topic_moved_pm_notify']) ? TRUE : 0 ) : TRUE;
	// end topic moved mailer by Wicher

	if ( $mode == 'register' )
	{
		$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $board_config['allow_sig'];

		$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $board_config['allow_html'];
		$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $board_config['allow_bbcode'];
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $board_config['allow_smilies'];
		$user_gender = ( isset($HTTP_POST_VARS['user_gender']) ) ? intval( $HTTP_POST_VARS['user_gender'] ) : 0;
            $showdescriptions = ( isset($HTTP_POST_VARS['showdescriptions']) ) ? ( ($HTTP_POST_VARS['showdescriptions']) ? TRUE : 0 ) : $board_config['allow_descriptions'];
            $showtooltips = ( isset($HTTP_POST_VARS['showtooltips']) ) ? ( ($HTTP_POST_VARS['showtooltips']) ? TRUE : 0 ) : $board_config['show_tooltips'];
            $tooltips_static = ( isset($HTTP_POST_VARS['tooltips_static']) ) ? ( ($HTTP_POST_VARS['tooltips_static']) ? TRUE : 0 ) : $board_config['tooltips_static'];
            $tooltips_parse = ( isset($HTTP_POST_VARS['tooltips_parse']) ) ? ( ($HTTP_POST_VARS['tooltips_parse']) ? TRUE : 0 ) : $board_config['tooltips_parse'];
            $toolimg_width = ( isset( $HTTP_POST_VARS['toolimg_width'] ) ) ? intval( $HTTP_POST_VARS['toolimg_width'] ) : $board_config['toolimg_width'];
            $toolimg_height = ( isset( $HTTP_POST_VARS['toolimg_height'] ) ) ? intval( $HTTP_POST_VARS['toolimg_height'] ) : $board_config['toolimg_height'];
	}
	else
	{
		$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $userdata['user_attachsig'];

		$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
		$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $userdata['user_allowbbcode'];
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];
		$user_gender = ( isset($HTTP_POST_VARS['user_gender']) ) ? intval( $HTTP_POST_VARS['user_gender'] ) : $userdata['user_gender'];
            $showdescriptions = ( isset($HTTP_POST_VARS['showdescriptions']) ) ? ( ($HTTP_POST_VARS['showdescriptions']) ? TRUE : 0 ) : $userdata['user_show_descriptions'];
            $showtooltips = ( isset($HTTP_POST_VARS['showtooltips']) ) ? ( ($HTTP_POST_VARS['showtooltips']) ? TRUE : 0 ) : $userdata['user_show_tooltips'];
            $tooltips_static = ( isset($HTTP_POST_VARS['tooltips_static']) ) ? ( ($HTTP_POST_VARS['tooltips_static']) ? TRUE : 0 ) : $userdata['user_tooltips_static'];
            $tooltips_parse = ( isset($HTTP_POST_VARS['tooltips_parse']) ) ? ( ($HTTP_POST_VARS['tooltips_parse']) ? TRUE : 0 ) : $userdata['user_tooltips_parse'];
            $toolimg_width = intval ( ( isset( $HTTP_POST_VARS['toolimg_width'] ) ) ? $HTTP_POST_VARS['toolimg_width'] : $userdata['user_toolimg_width'] );
            $toolimg_height = intval ( ( isset( $HTTP_POST_VARS['toolimg_height'] ) ) ? $HTTP_POST_VARS['toolimg_height'] : $userdata['user_toolimg_height'] );
	}

	$birthday_display = ( isset($HTTP_POST_VARS['birthday_display']) ) ? intval($HTTP_POST_VARS['birthday_display']) : 0;
	$birthday_greeting = ( isset($HTTP_POST_VARS['birthday_greeting']) ) ? intval($HTTP_POST_VARS['birthday_greeting']) : 0;
	$user_style = ( isset($HTTP_POST_VARS['style']) ) ? intval($HTTP_POST_VARS['style']) : $board_config['default_style'];

	if ( !empty($HTTP_POST_VARS['language']) )
	{
		if ( preg_match('/^[a-z_]+$/i', $HTTP_POST_VARS['language']) )
		{
			$user_lang = htmlspecialchars($HTTP_POST_VARS['language']);
		}
		else
		{
			$error = true;
			$error_msg = $lang['Fields_empty'];
		}
	}
	else
	{
		$user_lang = $board_config['default_lang'];
	}

	if ( !empty($HTTP_POST_VARS['country']) )
	{
		if ( preg_match('/^[a-z_]+$/i', $HTTP_POST_VARS['country']) )
		{
			$user_country = htmlspecialchars($HTTP_POST_VARS['country']);
		}
		else
		{
			$error = true;
			$error_msg = $country['Fields_empty'];
		}
	}
	else
	{
		$user_country = 'nospec';
	}

	$user_timezone = ( isset($HTTP_POST_VARS['timezone']) ) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];

	$sql = "SELECT config_value
		FROM " . CONFIG_TABLE . "
		WHERE config_name = 'default_dateformat'";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not select default dateformat', '', __LINE__, __FILE__, $sql);
	}
	$row = $db->sql_fetchrow($result);
	$board_config['default_dateformat'] = $row['config_value'];
	$user_dateformat = ( !empty($HTTP_POST_VARS['dateformat']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['dateformat'])) : $board_config['default_dateformat'];

	$user_avatar_local = ( isset($HTTP_POST_VARS['avatarselect']) && !empty($HTTP_POST_VARS['submitavatar']) && $board_config['allow_avatar_local'] ) ? htmlspecialchars($HTTP_POST_VARS['avatarselect']) : ( ( isset($HTTP_POST_VARS['avatarlocal'])  ) ? htmlspecialchars($HTTP_POST_VARS['avatarlocal']) : '' );
	$user_avatar_category = ( isset($HTTP_POST_VARS['avatarcatname']) && $board_config['allow_avatar_local'] ) ? htmlspecialchars($HTTP_POST_VARS['avatarcatname']) : '' ;

	$user_avatar_remoteurl = ( !empty($HTTP_POST_VARS['avatarremoteurl']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['avatarremoteurl'])) : '';
	$user_avatar_upload = ( !empty($HTTP_POST_VARS['avatarurl']) ) ? trim($HTTP_POST_VARS['avatarurl']) : ( ( $HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : '' );
	$user_avatar_name = ( !empty($HTTP_POST_FILES['avatar']['name']) ) ? $HTTP_POST_FILES['avatar']['name'] : '';
	$user_avatar_size = ( !empty($HTTP_POST_FILES['avatar']['size']) ) ? $HTTP_POST_FILES['avatar']['size'] : 0;
	$user_avatar_filetype = ( !empty($HTTP_POST_FILES['avatar']['type']) ) ? $HTTP_POST_FILES['avatar']['type'] : '';

	$user_avatar = ( empty($user_avatar_local) && $mode == 'editprofile' ) ? $userdata['user_avatar'] : '';
	$user_avatar_type = ( empty($user_avatar_local) && $mode == 'editprofile' ) ? $userdata['user_avatar_type'] : '';

      $longitude = ( !empty($HTTP_POST_VARS['longitude']) ) ? str_replace(',','.',trim(strip_tags( $HTTP_POST_VARS['longitude'] ) ) ) : '';
      $latitude = ( !empty($HTTP_POST_VARS['latitude']) ) ? str_replace(',','.',trim(strip_tags( $HTTP_POST_VARS['latitude'] ) ) ) : '';

	if ( (isset($HTTP_POST_VARS['avatargallery']) || isset($HTTP_POST_VARS['submitavatar']) || isset($HTTP_POST_VARS['cancelavatar'])) && (!isset($HTTP_POST_VARS['submit'])) )
	{
		$username = stripslashes($username);
		$email = stripslashes($email);
		$cur_password = htmlspecialchars(stripslashes($cur_password));
		$new_password = htmlspecialchars(stripslashes($new_password));
		$password_confirm = htmlspecialchars(stripslashes($password_confirm));

		$icq = stripslashes($icq);
		$aim = stripslashes($aim);
		$msn = stripslashes($msn);
            $skype = stripslashes($skype);
		$xfire = stripslashes($xfire);
		$yim = stripslashes($yim);

		$website = stripslashes($website);
		$paypal = stripslashes( $paypal );
		$location = stripslashes($location);
		$occupation = stripslashes($occupation);
		$interests = stripslashes($interests);
		$user_absence_text = stripslashes($user_absence_text);
		$custom_title = stripslashes($custom_title);
		$signature = htmlspecialchars(stripslashes($signature));

		$user_lang = stripslashes($user_lang);
		$user_country = stripslashes($user_country);
		$user_dateformat = stripslashes($user_dateformat);

		if ( !isset($HTTP_POST_VARS['cancelavatar']))
		{
			$user_avatar = $user_avatar_category . '/' . $user_avatar_local;
			$user_avatar_type = USER_AVATAR_GALLERY;
		}
	}
}

// Begin Account Self-Delete MOD ** Code from admin/admin_users.php
if( isset($HTTP_POST_VARS['delete_confirm']) )
{  
  $user_id = intval( $HTTP_POST_VARS['user_id'] );

  $sql = "SELECT g.group_id 
    FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g  
    WHERE ug.user_id = $user_id 
    AND g.group_id = ug.group_id 
    AND g.group_single_user = 1";
  if( !($result = $db->sql_query($sql)) )
  {
    message_die(GENERAL_ERROR, 'Could not obtain group information for this user', '', __LINE__, __FILE__, $sql);
  }

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

  $sql = "UPDATE " . POSTS_TABLE . "
    SET poster_id = " . DELETED . ", post_username = '$username' 
    WHERE poster_id = $user_id";
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not update posts for this user', '', __LINE__, __FILE__, $sql);
  }

  $sql = "UPDATE " . TOPICS_TABLE . "
    SET topic_poster = " . DELETED . " 
    WHERE topic_poster = $user_id";
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not update topics for this user', '', __LINE__, __FILE__, $sql);
  }
			
  $sql = "UPDATE " . VOTE_USERS_TABLE . "
    SET vote_user_id = " . DELETED . "
    WHERE vote_user_id = $user_id";
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not update votes for this user', '', __LINE__, __FILE__, $sql);
  }
			
  $sql = "SELECT group_id
    FROM " . GROUPS_TABLE . "
    WHERE group_moderator = $user_id";
  if( !($result = $db->sql_query($sql)) )
  {
    message_die(GENERAL_ERROR, 'Could not select groups where user was moderator', '', __LINE__, __FILE__, $sql);
  }
			
  while ( $row_group = $db->sql_fetchrow($result) )
  {
    $group_moderator[] = $row_group['group_id'];
  }
			
  if ( count($group_moderator) )
  {
    $update_moderator_id = implode(', ', $group_moderator);
			
    $sql = "UPDATE " . GROUPS_TABLE . "
      SET group_moderator = " . $userdata['user_id'] . "
      WHERE group_moderator IN ($update_moderator_id)";
    if( !$db->sql_query($sql) )
    {
      message_die(GENERAL_ERROR, 'Could not update group moderators', '', __LINE__, __FILE__, $sql);
    }
  }

  $sql = "DELETE FROM " . USERS_TABLE . "
    WHERE user_id = $user_id";
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $sql);
  }

  $sql = "DELETE FROM " . USER_GROUP_TABLE . "
    WHERE user_id = $user_id";
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not delete user from user_group table', '', __LINE__, __FILE__, $sql);
  }

  $sql = "DELETE FROM " . GROUPS_TABLE . "
    WHERE group_id = " . $row['group_id'];
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not delete group for this user', '', __LINE__, __FILE__, $sql);
  }

  $sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
    WHERE group_id = " . $row['group_id'];
  if( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not delete group for this user', '', __LINE__, __FILE__, $sql);
  }

  $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
    WHERE user_id = $user_id";
  if ( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not delete user from topic watch table', '', __LINE__, __FILE__, $sql);
  }
			
  $sql = "DELETE FROM " . BANLIST_TABLE . "
    WHERE ban_userid = $user_id";
  if ( !$db->sql_query($sql) )
  {
    message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
  }

  $sql = "SELECT privmsgs_id
    FROM " . PRIVMSGS_TABLE . "
    WHERE privmsgs_from_userid = $user_id 
    OR privmsgs_to_userid = $user_id";
  if ( !($result = $db->sql_query($sql)) )
  {
    message_die(GENERAL_ERROR, 'Could not select all users private messages', '', __LINE__, __FILE__, $sql);
  }

  // This little bit of code directly from the private messaging section.
  while ( $row_privmsgs = $db->sql_fetchrow($result) )
  {
    $mark_list[] = $row_privmsgs['privmsgs_id'];
  }
			
  if ( count($mark_list) )
  {
    $delete_sql_id = implode(', ', $mark_list);
		
    $delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . "
      WHERE privmsgs_text_id IN ($delete_sql_id)";
    $delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . "
      WHERE privmsgs_id IN ($delete_sql_id)";
				
    if ( !$db->sql_query($delete_sql) )
    {
      message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql);
    }
				
    if ( !$db->sql_query($delete_text_sql) )
    {
      message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql);
    }
  }

  $message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_userprofile'], '<a href="' . append_sid("profile.$phpEx?mode=editprofile")  . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

  message_die(GENERAL_MESSAGE, $message);
}
// End Account Self-Delete MOD

//
// Let's make sure the user isn't logged in while registering,
// and ensure that they were trying to register a second time
// (Prevents double registrations)
//
if ($mode == 'register' && ($userdata['session_logged_in'] || $username == $userdata['username']))
{
	message_die(GENERAL_MESSAGE, $lang['Username_taken'], '', __LINE__, __FILE__);
}

//
// Did the user submit? In this case build a query to update the users profile in the DB
//
if ( isset($HTTP_POST_VARS['submit']) )
{
	include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);

// Skype-Erweiterung
	if ( !empty($skype) )
	{
		$skypemuster = '/^[a-zA-Z0-9_.\-@,]{6,32}$/';
		if ( !preg_match( $skypemuster, $skype ) )
		{
			$error = true; 
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['skype_falsch'];
		}
	}

	// session id check
	if ($sid == '' || $sid != $userdata['session_id'])
	{
		$error = true;
		$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Session_invalid'];
	}

	$passwd_sql = '';
	if ( $mode == 'editprofile' )
	{
		if ( $user_id != $userdata['user_id'] )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Wrong_Profile'];
		}
	}
	else if ( $mode == 'register' )
	{
		if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
		}
	}

	if ($board_config['enable_confirm'] && $mode == 'register')
	{
		if (empty($HTTP_POST_VARS['confirm_id']))
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
		}
		else
		{
			$confirm_id = htmlspecialchars($HTTP_POST_VARS['confirm_id']);
			if (!preg_match('/^[A-Za-z0-9]+$/', $confirm_id))
			{
				$confirm_id = '';
			}
			
			$sql = 'SELECT code 
				FROM ' . CONFIRM_TABLE . " 
				WHERE confirm_id = '$confirm_id' 
					AND session_id = '" . $userdata['session_id'] . "'";
			if (!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, 'Could not obtain confirmation code', '', __LINE__, __FILE__, $sql);
			}

			if ($row = $db->sql_fetchrow($result))
			{
				if ($row['code'] != $confirm_code)
				{
					$error = TRUE;
					$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
				}
				else
				{
					$sql = 'DELETE FROM ' . CONFIRM_TABLE . " 
						WHERE confirm_id = '$confirm_id' 
							AND session_id = '" . $userdata['session_id'] . "'";
					if (!$db->sql_query($sql))
					{
						message_die(GENERAL_ERROR, 'Could not delete confirmation code', '', __LINE__, __FILE__, $sql);
					}
				}
			}
			else
			{		
				$error = TRUE;
				$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Confirm_code_wrong'];
			}
			$db->sql_freeresult($result);
		}
	}

	$passwd_sql = '';
	if ( !empty($new_password) && !empty($password_confirm) )
	{
		if ( $new_password != $password_confirm )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch'];
		}
		else if ( strlen($new_password) > 32 )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_long'];
		}
		else
		{
			if ( $mode == 'editprofile' )
			{
				$sql = "SELECT user_password
					FROM " . USERS_TABLE . "
					WHERE user_id = $user_id";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain user_password information', '', __LINE__, __FILE__, $sql);
				}

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

				if ( $row['user_password'] != md5($cur_password) )
				{
					$error = TRUE;
					$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Current_password_mismatch'];
				}
			}

			if ( !$error )
			{
				$new_password = md5($new_password);
				$passwd_sql = "user_password = '$new_password', ";
			}
		}
	}
	else if ( ( empty($new_password) && !empty($password_confirm) ) || ( !empty($new_password) && empty($password_confirm) ) )
	{
		$error = TRUE;
		$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch'];
	}

	//
	// Do a ban check on this email address
	//
	if ( $email != $userdata['user_email'] || $mode == 'register' )
	{
		$result = validate_email($email);
		if ( $result['error'] )
		{
			$email = $userdata['user_email'];

			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $result['error_msg'];
		}

		if ( $mode == 'editprofile' )
		{
			$sql = "SELECT user_password
				FROM " . USERS_TABLE . "
				WHERE user_id = $user_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain user_password information', '', __LINE__, __FILE__, $sql);
			}

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

			if ( $row['user_password'] != md5($cur_password) )
			{
				$email = $userdata['user_email'];

				$error = TRUE;
				$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Current_password_mismatch'];
			}
		}
	}

	$username_sql = '';
	if ( $board_config['allow_namechange'] || $mode == 'register' )
	{
		if ( empty($username) )
		{
			// Error is already triggered, since one field is empty.
			$error = TRUE;
		}
		else if ( $username != $userdata['username'] || $mode == 'register')
		{
			if (strtolower($username) != strtolower($userdata['username']) || $mode == 'register')
			{
				$result = validate_username($username);
				if ( $result['error'] )
				{
					$error = TRUE;
					$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $result['error_msg'];
				}
			}

			if (!$error)
			{
				$username_sql = "username = '" . str_replace("\'", "''", $username) . "', ";
			}
		}
	}

	$bday_locked = $board_config['bday_lock'] && $userdata['user_birthday'] != 0;

	if ( !$bday_locked )
	{
		$empty_month = empty($bday_month) || $bday_month == $lang['Default_Month'];
		$empty_day = empty($bday_day) || $bday_day == $lang['Default_Day'];
		$empty_year = empty($bday_year) || $bday_year == $lang['Default_Year'];
	}
	else
	{
		$empty_month = false;
		$empty_day = false;
		$empty_year = false;
		// we set the following to 1 since otherwise we'd be assigning undefined variables to $temp_*
		$bday_month = $bday_day = $bday_year = 1;
	}

	$temp_month = $empty_month ? 1 : $bday_month;
	$temp_day = $empty_day ? 1 : $bday_day;
	$temp_year = $empty_year ? 4 : $bday_year;

	switch (true)
	{
		case $board_config['bday_require'] && $board_config['bday_year'] && ($empty_month || $empty_day || $empty_year):
		case $board_config['bday_require'] && !$board_config['bday_year'] && ($empty_month || $empty_day):
		case !$board_config['bday_require'] && $board_config['bday_year'] && (($empty_month != $empty_day) || ($empty_day != $empty_year)):
		case !$board_config['bday_require'] && !$board_config['bday_year'] && (($empty_month != $empty_day) || ($empty_day && !$empty_year)):
		case !@checkdate( $temp_month, $temp_day, $temp_year ):
			$error = TRUE;
			$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Birthday_invalid'];
			break;
		case !$empty_month && !$empty_day && !$empty_year && !$bday_locked:
			$age = gmdate('Y') - $bday_year - ( sprintf('%02d%02d',$bday_month,$bday_day) > gmdate('md',time()) );
			if ( $board_config['bday_min'] > $age || $age > $board_config['bday_max'] )
			{
				$error = TRUE;
				$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . sprintf($lang['Birthday_range'],$board_config['bday_min'],$board_config['bday_max']);
			}
	}

	$user_birthday = sprintf('%02d%02d%04d',$bday_month,$bday_day,$bday_year);
	$user_birthday2 = ( $birthday_display != BIRTHDAY_DATE && $birthday_display != BIRTHDAY_NONE && !$empty_month && !$empty_day && !$empty_year ) ? sprintf('%04d%02d%02d',$bday_year,$bday_month,$bday_day) : 'NULL';

	$birthday_greeting = ( isset($HTTP_POST_VARS['bday_greeting']) ) ? intval($HTTP_POST_VARS['bday_greeting']) : 0;
	if ( $birthday_greeting && !( $board_config['bday_greeting'] & 1<<($birthday_greeting-1) ) )
	{
		$birthday_greeting = 0;
	}

	if ( $signature != '' )
	{
		if ( strlen($signature) > $board_config['max_sig_chars'] )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long'];
		}

		if ( !isset($signature_bbcode_uid) || $signature_bbcode_uid == '' )
		{
			$signature_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : '';
		}
		$signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
	}

	if ( $website != '' )
	{
		rawurlencode($website);
	}

	if ( $paypal != '' )
	{
		rawurlencode( $paypal );
	}

	$avatar_sql = '';

	if ( isset($HTTP_POST_VARS['avatardel']) && $mode == 'editprofile' )
	{
		$avatar_sql = user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']);
	}
	else
	if ( ( !empty($user_avatar_upload) || !empty($user_avatar_name) ) && $board_config['allow_avatar_upload'] )
	{
		if ( !empty($user_avatar_upload) )
		{
			$avatar_mode = (empty($user_avatar_name)) ? 'remote' : 'local';
			$avatar_sql = user_avatar_upload($mode, $avatar_mode, $userdata['user_avatar'], $userdata['user_avatar_type'], $error, $error_msg, $user_avatar_upload, $user_avatar_name, $user_avatar_size, $user_avatar_filetype);
		}
		else if ( !empty($user_avatar_name) )
		{
			$l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));

			$error = true;
			$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $l_avatar_size;
		}
	}
	else if ( $user_avatar_remoteurl != '' && $board_config['allow_avatar_remote'] )
	{
		user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']);
		$avatar_sql = user_avatar_url($mode, $error, $error_msg, $user_avatar_remoteurl);
	}
	else if ( $user_avatar_local != '' && $board_config['allow_avatar_local'] )
	{
		user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']);
		$avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local, $user_avatar_category);
	}

	if ( !$error )
	{
		if ( $avatar_sql == '' )
		{
			$avatar_sql = ( $mode == 'editprofile' ) ? '' : "'', " . USER_AVATAR_NONE;
		}

		if ( $mode == 'editprofile' )
		{
			if ( $email != $userdata['user_email'] && $board_config['require_activation'] != USER_ACTIVATION_NONE && $userdata['user_level'] != ADMIN )
			{
				$user_active = 0;

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

				if ( $userdata['session_logged_in'] )
				{
					session_end($userdata['session_id'], $userdata['user_id']);
				}
			}
			else
			{
				$user_active = 1;
				$user_actkey = '';
			}

// mod topic description add to sql query
			$birthday_sql = '';
			if ( !$board_config['bday_lock'] || $userdata['user_birthday'] == 0 )
			{
				$birthday_sql = "user_birthday = $user_birthday, user_birthday2 = $user_birthday2, ";
			}

			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_topic_moved_mail = $mail_on_topic_moved, user_topic_moved_pm = $pm_on_topic_moved, user_topic_moved_pm_notify = $pm_on_topic_moved_notify, " . $birthday_sql . "birthday_display = $birthday_display, birthday_greeting = $birthday_greeting, user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_paypal = '" . str_replace("\'", "''", $paypal) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_absence_mode = $user_absence_mode, user_absence = $user_absence, user_absence_text = '" . str_replace("\'", "''", $user_absence_text) . "', user_gender = $user_gender, user_custom_title = '" . str_replace("\'", "''", $custom_title) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_skype = '" . str_replace("\'", "''", $skype) . "', user_xfire = '" . str_replace("\'", "''", $xfire) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_showdescriptions = $showdescriptions, user_showtooltips = $showtooltips, user_tooltips_parse = $tooltips_parse, user_tooltips_static = $tooltips_static, user_toolimg_width = $toolimg_width, user_toolimg_height = $toolimg_height, user_allow_viewonline = $allowviewonline, user_allow_showprofile = $showprofile, user_notify = $notifyreply, user_notify_pm = $notifypm, games_block_pm = $games_block_pm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . ", user_country = '" . str_replace("\'", "''", $user_country) . "'
				WHERE user_id = $user_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
			}

			// We remove all stored login keys since the password has been updated
			// and change the current one (if applicable)
			if ( !empty($passwd_sql) )
			{
				session_reset_keys($user_id, $user_ip);
			}

// Begin Map Mod
$sql = "SELECT user_id
	FROM ". MAP_MOD_USER_TABLE . "
	WHERE user_id = $user_id ";
if (! $result = $db->sql_query($sql)) {
	message_die(GENERAL_ERROR, 'Could not get map data.', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if ($row['user_id']==$user_id) {
	$sql = "DELETE 
		FROM " . MAP_MOD_USER_TABLE . "
		WHERE user_id = $user_id ";
	if (! $result = $db->sql_query($sql)) {
		message_die(GENERAL_ERROR, 'Could not delete map data.', '', __LINE__, __FILE__, $sql);
	}
}
if (((float)$longitude != 0.0) || ((float)$latitude != 0.0)) {
	$sql = "INSERT INTO " .MAP_MOD_USER_TABLE. "
	VALUES (" . intval($user_id) . ", " . (float)$longitude . "," . (float)$latitude. ")";
	if(! $result = $db->sql_query($sql)) {
		message_die(GENERAL_ERROR, 'Could not update map table.', '', __LINE__, __FILE__, $sql);
	}
}
// End Map Mod

			if ( !$user_active )
			{
				//
				// The users account has been deactivated, send them an email with a new activation key
				//
				include($phpbb_root_path . 'includes/emailer.'.$phpEx);
				$emailer = new emailer($board_config['smtp_delivery']);

 				if ( $board_config['require_activation'] != USER_ACTIVATION_ADMIN )
 				{
 					$emailer->from($board_config['board_email']);
 					$emailer->replyto($board_config['board_email']);
 
 					$emailer->use_template('user_activate', stripslashes($user_lang));
 					$emailer->email_address($email);
 					$emailer->set_subject($lang['Reactivate']);
  
 					$emailer->assign_vars(array(
 						'SITENAME' => $board_config['sitename'],
 						'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
 						'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '',
  
 						'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
 					);
 					$emailer->send();
 					$emailer->reset();
 				}
 				else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
 				{
 					$sql = 'SELECT user_email, user_lang 
 						FROM ' . USERS_TABLE . '
 						WHERE user_level = ' . ADMIN;
 					
 					if ( !($result = $db->sql_query($sql)) )
 					{
 						message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
 					}
 					
 					while ($row = $db->sql_fetchrow($result))
 					{
 						$emailer->from($board_config['board_email']);
 						$emailer->replyto($board_config['board_email']);
 						
 						$emailer->email_address(trim($row['user_email']));
 						$emailer->use_template("admin_activate", $row['user_lang']);
 						$emailer->set_subject($lang['Reactivate']);
 
 						$emailer->assign_vars(array(
 							'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
 							'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),
 
 							'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
 						);
 						$emailer->send();
 						$emailer->reset();
 					}
 					$db->sql_freeresult($result);
 				}

				$message = $lang['Profile_updated_inactive'] . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
			}
			else
			{
				$message = $lang['Profile_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
			}

			$template->assign_vars(array(
				"META" => '<meta http-equiv="refresh" content="5;url=' . append_sid("index.$phpEx") . '">')
			);

			message_die(GENERAL_MESSAGE, $message);
		}
		else
		{
			$sql = "SELECT MAX(user_id) AS total
				FROM " . USERS_TABLE;
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
			}

			if ( !($row = $db->sql_fetchrow($result)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
			}
			$user_id = $row['total'] + 1;

			//
			// Get current date
			//

// mod topic description add to sql query
			$sql = "INSERT INTO " . USERS_TABLE . "	(user_id, username, user_regdate, user_password, user_email, user_topic_moved_mail, user_topic_moved_pm, user_topic_moved_pm_notify, user_birthday, user_birthday2, birthday_display, birthday_greeting, user_icq, user_website, user_paypal, user_occ, user_from, user_interests, user_absence_mode, user_absence, user_absence_text, user_custom_title, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_skype, user_xfire, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_showdescriptions, user_showtooltips, user_tooltips_parse, user_tooltips_static, user_toolimg_width, user_toolimg_height, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_gender, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_country, user_active, user_actkey)
				VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', $mail_on_topic_moved, $pm_on_topic_moved, $pm_on_topic_moved_notify, $user_birthday, $user_birthday2, $birthday_display, $birthday_greeting, '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $paypal) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', $user_absence_mode, $user_absence, '" . str_replace("\'", "''", $user_absence_text) . "', '" . str_replace("\'", "''", $custom_title) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', '" . str_replace("\'", "''", $skype) . "', '" . str_replace("\'", "''", $xfire) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $showdescriptions, $showtooltips, $tooltips_parse, $tooltips_static, $toolimg_width, $toolimg_height, $allowviewonline, $notifyreply, $notifypm, $games_block_pm, $popup_pm, $user_timezone, $user_gender, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, '$user_country',";
			if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
			{
				$user_actkey = gen_rand_string(true);
				$key_len = 54 - (strlen($server_url));
				$key_len = ( $key_len > 6 ) ? $key_len : 6;
				$user_actkey = substr($user_actkey, 0, $key_len);
				$sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
			}
			else
			{
				$sql .= "1, '')";
			}

			if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
			}

// Begin Map Mod
if (((float)$longitude != 0.0) || ((float)$latitude != 0.0)) {
	$sql = "INSERT INTO " . MAP_MOD_USER_TABLE . " (user_id, longitude, latitude)
		VALUES (" . intval($user_id) . ", " . (float)$longitude . "," . (float)$latitude . ")";
	if(! $result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, 'Could not update map table.', '', __LINE__, __FILE__, $sql);
	}
}
// End Map Mod

			$sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
				VALUES ('', 'Personal User', 1, 0)";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql);
			}

			$group_id = $db->sql_nextid();

			$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
				VALUES ($user_id, $group_id, 0)";
			if( !($result = $db->sql_query($sql, END_TRANSACTION)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
			}

			$auto_group_id = $board_config['auto_group_id'];

			$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
				VALUES ($user_id, $auto_group_id, 0)";
			if( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
			}

			if ( $coppa )
			{
				$message = $lang['COPPA'];
				$email_template = 'coppa_welcome_inactive';
			}
			else if ( $board_config['require_activation'] == USER_ACTIVATION_SELF )
			{
				$message = $lang['Account_inactive'];
				$email_template = 'user_welcome_inactive';
			}
			else if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
			{
				$message = $lang['Account_inactive_admin'];
				$email_template = 'admin_welcome_inactive';
			}
			else
			{
				$message = $lang['Account_added'];
				$email_template = 'user_welcome';
			}

			include($phpbb_root_path . 'includes/emailer.'.$phpEx);
			$emailer = new emailer($board_config['smtp_delivery']);

			$emailer->from($board_config['board_email']);
			$emailer->replyto($board_config['board_email']);

			$emailer->use_template($email_template, stripslashes($user_lang));
			$emailer->email_address($email);
			$emailer->set_subject(sprintf($lang['Welcome_subject'], $board_config['sitename']));

			if( $coppa )
			{
				$emailer->assign_vars(array(
					'SITENAME' => $board_config['sitename'],
					'WELCOME_MSG' => sprintf($lang['Welcome_subject'], $board_config['sitename']),
					'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
					'PASSWORD' => $password_confirm,
					'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),

					'FAX_INFO' => $board_config['coppa_fax'],
					'MAIL_INFO' => $board_config['coppa_mail'],
					'EMAIL_ADDRESS' => $email,
					'ICQ' => $icq,
					'AIM' => $aim,
					'YIM' => $yim,
					'MSN' => $msn,
                              'SKYPE' => $skype,
					'XFIRE' => $xfire, 
					'WEB_SITE' => $website,
					'PAYPAL' => $paypal,
					'FROM' => $location,
					'COUNTRY' => $country,
					'OCC' => $occupation,
					'INTERESTS' => $interests,
					'SITENAME' => $board_config['sitename']));
			}
			else
			{
				$emailer->assign_vars(array(
					'SITENAME' => $board_config['sitename'],
					'WELCOME_MSG' => sprintf($lang['Welcome_subject'], $board_config['sitename']),
					'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
					'PASSWORD' => $password_confirm,
					'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),

					'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
				);
			}

			$emailer->send();
			$emailer->reset();

			if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN )
			{
				$sql = "SELECT user_email, user_lang 
					FROM " . USERS_TABLE . "
					WHERE user_level = " . ADMIN;
				
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
				}
				
				while ($row = $db->sql_fetchrow($result))
				{
					$emailer->from($board_config['board_email']);
					$emailer->replyto($board_config['board_email']);
					
					$emailer->email_address(trim($row['user_email']));
					$emailer->use_template("admin_activate", $row['user_lang']);
					$emailer->set_subject($lang['New_account_subject']);

					$emailer->assign_vars(array(
						'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
						'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),

						'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)
					);
					$emailer->send();
					$emailer->reset();
				}
				$db->sql_freeresult($result);
			}

			$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

//
			// START wpm mod by Duvelske (http://www.vitrax.vze.com)
			{
				$sql = "SELECT *
					FROM " . WPM;
				if(!$result = $db->sql_query($sql))
				{
					message_die(GENERAL_ERROR, "", "", __LINE__, __FILE__, $sql);
				}
				else
				{
					while($row = $db->sql_fetchrow($result))
					{
						$swpm_config[$row['name']] = $row['value'];
					}
				}
				if($swpm_config['active_wpm'])
				{
				// add functions wpm
				include_once($phpbb_root_path . 'includes/functions_wpm.' . $phpEx);

				// Just a couple of replaces for better customisation on a per user basis
				// no point making a special function since there are so few needed

				$wpm_subject = str_replace("[username]", $username, $swpm_config['wpm_subject']);
				$wpm_subject = str_replace("[user_id]", $user_id, $wpm_subject);
				$wpm_subject = str_replace("[sitename]", $board_config['sitename'], $wpm_subject);

				$wpm_message = str_replace("[username]", $username, $swpm_config['wpm_message']);
				$wpm_message = str_replace("[user_id]", $user_id, $wpm_message);
				$wpm_message = str_replace("[sitename]", $board_config['sitename'], $wpm_message);

				// Will not send a pm notification via email (already sent the standard welcome email)
				// Simply change the 0 to a 1 to turn it on
				wpm_send_pm($user_id, $wpm_subject, $wpm_message, 0);
				}
			}
			// END wpm mod
			//

			message_die(GENERAL_MESSAGE, $message);
		} // if mode == register
	}
} // End of submit

if ($board_config['board_email_moved_topic'] == 1)
{
	$template->assign_block_vars('switch_email_moved_topic', array());
}

if ( $error )
{
	//
	// If an error occured we need to stripslashes on returned data
	//
	$username = stripslashes($username);
	$email = stripslashes($email);
	$cur_password = '';
	$new_password = '';
	$password_confirm = '';

	$icq = stripslashes($icq);
	$aim = str_replace('+', ' ', stripslashes($aim));
	$msn = stripslashes($msn);
      $skype = stripslashes($skype);
	$xfire = stripslashes($xfire);
	$yim = stripslashes($yim);

	$website = stripslashes($website);
	$paypal = stripslashes( $paypal );
	$location = stripslashes($location);
	$user_country = stripslashes($user_country);
	$occupation = stripslashes($occupation);
	$interests = stripslashes($interests);
	$user_absence_text = stripslashes($user_absence_text);
	$custom_title = stripslashes($custom_title);
	$signature = stripslashes($signature);
	$signature = ($signature_bbcode_uid != '') ? preg_replace("/:(([a-z0-9]+:)?)$signature_bbcode_uid(=|\])/si", '\\3', $signature) : $signature;

	$user_lang = stripslashes($user_lang);
	$user_dateformat = stripslashes($user_dateformat);

}
else if ( $mode == 'editprofile' && !isset($HTTP_POST_VARS['avatargallery']) && !isset($HTTP_POST_VARS['submitavatar']) && !isset($HTTP_POST_VARS['cancelavatar']) )
{
	$user_id = $userdata['user_id'];
	$username = $userdata['username'];
	$email = $userdata['user_email'];
	$cur_password = '';
	$new_password = '';
	$password_confirm = '';

	preg_match('/(..)(..)(....)/', sprintf('%08d',$userdata['user_birthday']), $bday_parts);
	$bday_month = $bday_parts[1];
	$bday_day = $bday_parts[2];
	$bday_year = $bday_parts[3];
	$birthday_display = $userdata['birthday_display'];
	$birthday_greeting = $userdata['birthday_greeting'];
	$icq = $userdata['user_icq'];
	$aim = str_replace('+', ' ', $userdata['user_aim']);
	$msn = $userdata['user_msnm'];
      $skype = $userdata['user_skype'];
	$xfire = $userdata['user_xfire'];
	$yim = $userdata['user_yim'];

	$website = $userdata['user_website'];
	$paypal = $userdata['user_paypal'];
	$location = $userdata['user_from'];
	$occupation = $userdata['user_occ'];
	$interests = $userdata['user_interests'];
	$custom_title = $userdata['user_custom_title'];
	$signature_bbcode_uid = $userdata['user_sig_bbcode_uid'];
	$signature = ($signature_bbcode_uid != '') ? preg_replace("/:(([a-z0-9]+:)?)$signature_bbcode_uid(=|\])/si", '\\3', $userdata['user_sig']) : $userdata['user_sig'];

      $showprofile = $userdata['user_allow_showprofile'];
	$viewemail = $userdata['user_viewemail'];
	$user_absence_mode = $userdata['user_absence_mode'];
	$user_absence = $userdata['user_absence'];
	$user_absence_text = $userdata['user_absence_text'];
	$notifypm = $userdata['user_notify_pm'];
      $games_block_pm = $userdata['games_block_pm'];
	$popup_pm = $userdata['user_popup_pm'];
	$mail_on_topic_moved = $userdata['user_topic_moved_mail'];
	$pm_on_topic_moved = $userdata['user_topic_moved_pm'];
	$pm_on_topic_moved_notify = $userdata['user_topic_moved_pm_notify'];
	$notifyreply = $userdata['user_notify'];
	$attachsig = $userdata['user_attachsig'];
	$allowhtml = $userdata['user_allowhtml'];
	$allowbbcode = $userdata['user_allowbbcode'];
	$allowsmilies = $userdata['user_allowsmile'];
	$allowviewonline = $userdata['user_allow_viewonline'];
	$user_gender = $userdata['user_gender'];
      $showdescriptions = $userdata['user_showdescriptions'];
      $showtooltips = $userdata['user_showtooltips'];
      $tooltips_parse = $userdata['user_tooltips_parse'];
      $tooltips_static = $userdata['user_tooltips_static'];
      $toolimg_width = $userdata['user_toolimg_width'];
      $toolimg_height = $userdata['user_toolimg_height'];

	$user_avatar = ( $userdata['user_allowavatar'] ) ? $userdata['user_avatar'] : '';
	$user_avatar_type = ( $userdata['user_allowavatar'] ) ? $userdata['user_avatar_type'] : USER_AVATAR_NONE;

	$user_style = $userdata['user_style'];
	$user_lang = $userdata['user_lang'];
	$user_country = $userdata['user_country'];
	$user_timezone = $userdata['user_timezone'];
	$user_dateformat = $userdata['user_dateformat'];
// Begin Map Mod
$sql = "SELECT * 
	FROM " . MAP_MOD_USER_TABLE . " 
	WHERE user_id=".$userdata['user_id'];
if(!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Couldn't obtain map information.", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$longitude = $row['longitude'];
$latitude = $row['latitude'];
// End Map Mod
}

//
// Default pages
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

make_jumpbox('viewforum.'.$phpEx);

if ( $mode == 'editprofile' )
{
	if ( $user_id != $userdata['user_id'] )
	{
		$error = TRUE;
		$error_msg = $lang['Wrong_Profile'];
	}
}

if( isset($HTTP_POST_VARS['avatargallery']) && !$error )
{
	include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);

	$avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? htmlspecialchars($HTTP_POST_VARS['avatarcategory']) : '';

	$template->set_filenames(array(
		'body' => 'profile_avatar_gallery.tpl')
	);

	$allowviewonline = !$allowviewonline;

	display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $new_password, $cur_password, $password_confirm, $icq, $aim, $msn, $skype, $xfire, $yim, $website, $paypal, $location, $user_country, $occupation, $interests, $custom_title, $signature, $viewemail, $notifypm, $games_block_pm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $showdescriptions, $showtooltips, $tooltips_parse, $tooltips_static, $toolimg_width, $toolimg_height, $allowsmilies, $allowviewonline, $user_style, $user_lang, $bday_month, $bday_day, $bday_year, $birthday_display, $birthday_greeting, $user_timezone, $user_dateformat, $user_absence_mode, $user_absence, $user_absence_text, $userdata['session_id'], $longitude, $latitude, $user_gender);
}
else
{
	include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

	if ( !isset($coppa) )
	{
		$coppa = FALSE;
	}

	if ( !isset($user_style) )
	{
		$user_style = $board_config['default_style'];
	}

//----------------------------------------------------------------------
// Hide the Red X - Begin Code Alteration
//
/* Next line disables the Original phpBB Code following it. */

/*
	$avatar_img = '';
	if ( $user_avatar_type )
	{
		switch( $user_avatar_type )
		{
			case USER_AVATAR_UPLOAD:
				$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $user_avatar . '" alt="" />' : '';
				break;
			case USER_AVATAR_REMOTE:
				$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt="" />' : '';
				break;
			case USER_AVATAR_GALLERY:
				$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $user_avatar . '" alt="" />' : '';
				break;
		}
	}
*/

/* Above line marks the end of disabling of the Original phpBB Code. */
	$avatar_img = get_avatar(array('user_avatar_type' => $user_avatar_type, 'user_avatar' => $user_avatar), false);
//
// Hide the Red X - End Code Alteration
//----------------------------------------------------------------------


	$s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="coppa" value="' . $coppa . '" />';
	$s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
	if( $mode == 'editprofile' )
	{
		$s_hidden_fields .= '<input type="hidden" name="user_id" value="' . $userdata['user_id'] . '" />';
		//
		// Send the users current email address. If they change it, and account activation is turned on
		// the user account will be disabled and the user will have to reactivate their account.
		//
		$s_hidden_fields .= '<input type="hidden" name="current_email" value="' . $userdata['user_email'] . '" />';
	}

	if ( !empty($user_avatar_local) )
	{
		$s_hidden_fields .= '<input type="hidden" name="avatarlocal" value="' . $user_avatar_local . '" /><input type="hidden" name="avatarcatname" value="' . $user_avatar_category . '" />';
	}

	$html_status =  ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
	$bbcode_status = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode']  ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
	$smilies_status = ( $userdata['user_allowsmile'] && $board_config['allow_smilies']  ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];

	if ( $error )
	{
		$template->set_filenames(array(
			'reg_header' => 'error_body.tpl')
		);
		$template->assign_vars(array(
			'ERROR_MESSAGE' => $error_msg)
		);
		$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
	}

	$template->set_filenames(array(
		'body' => 'profile_add_body.tpl')
	);

	if ( ($userdata['user_level'] == USER && $board_config['users_allow_absence'] == TRUE) || ($userdata['user_level'] != USER && $userdata['user_level'] != ANONYMOUS) )
	{
		$template->assign_block_vars('allow_absence', array());
	}

	$s_user_absence_mode = '<select name = "user_absence_mode">';
	$s_user_absence_mode .= '<option value = "1">' . $lang['On_holidays'] . '</option>';
	$s_user_absence_mode .= '<option value = "2">' . $lang['User_ill'] . '</option>';
	$s_user_absence_mode .= '<option value = "3">' . $lang['Longer_absenct'] . '</option>';
	$s_user_absence_mode .= '</select>';

	$s_user_absence_mode = str_replace('value = "' . $userdata['user_absence_mode'] . '">', 'value = "' . $userdata['user_absence_mode'] . '" SELECTED>' ,$s_user_absence_mode);

	if ( $mode == 'editprofile' )
	{
		$template->assign_block_vars('switch_edit_profile', array());
	}

	if ( ($mode == 'register') || ($board_config['allow_namechange']) )
	{
		$template->assign_block_vars('switch_namechange_allowed', array());
	}
	else
	{
		$template->assign_block_vars('switch_namechange_disallowed', array());
	}

	// Gender MOD
	if ( $board_config['gender_display'] )
	{
		$template->assign_block_vars('switch_gender_display', array());
	}
	else
	{
		$s_hidden_fields .= '<input type="hidden" name="user_gender" value="' . $userdata['user_gender'] . '" />';
	}
	// Gender MOD


	// Visual Confirmation
	$confirm_image = '';
	if (!empty($board_config['enable_confirm']) && $mode == 'register')
	{
		$sql = 'SELECT session_id 
			FROM ' . SESSIONS_TABLE; 
		if (!($result = $db->sql_query($sql)))
		{
			message_die(GENERAL_ERROR, 'Could not select session data', '', __LINE__, __FILE__, $sql);
		}

		if ($row = $db->sql_fetchrow($result))
		{
			$confirm_sql = '';
			do
			{
				$confirm_sql .= (($confirm_sql != '') ? ', ' : '') . "'" . $row['session_id'] . "'";
			}
			while ($row = $db->sql_fetchrow($result));
		
			$sql = 'DELETE FROM ' .  CONFIRM_TABLE . " 
				WHERE session_id NOT IN ($confirm_sql)";
			if (!$db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, 'Could not delete stale confirm data', '', __LINE__, __FILE__, $sql);
			}
		}
		$db->sql_freeresult($result);

		$sql = 'SELECT COUNT(session_id) AS attempts 
			FROM ' . CONFIRM_TABLE . " 
			WHERE session_id = '" . $userdata['session_id'] . "'";
		if (!($result = $db->sql_query($sql)))
		{
			message_die(GENERAL_ERROR, 'Could not obtain confirm code count', '', __LINE__, __FILE__, $sql);
		}

		if ($row = $db->sql_fetchrow($result))
		{
			if ($row['attempts'] > 3)
			{
				message_die(GENERAL_MESSAGE, $lang['Too_many_registers']);
			}
		}
		$db->sql_freeresult($result);
		
		// Generate the required confirmation code
		// NB 0 (zero) could get confused with O (the letter) so we make change it
		$code = dss_rand();
		$code = substr(str_replace('0', 'Z', strtoupper(base_convert($code, 16, 35))), 2, 6);

		$confirm_id = md5(uniqid($user_ip));

		$sql = 'INSERT INTO ' . CONFIRM_TABLE . " (confirm_id, session_id, code) 
			VALUES ('$confirm_id', '". $userdata['session_id'] . "', '$code')";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Could not insert new confirm code information', '', __LINE__, __FILE__, $sql);
		}

		unset($code);
		
		$confirm_image = '<img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id") . '" alt="" title="" />';
		$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';

		$template->assign_block_vars('switch_confirm', array());
	}

switch($board_config['custom_title_mode'])
	{
		case CUSTOM_TITLE_MODE_INDEPENDENT: 
			$custom_title_mode_explain = $lang['Custom_title_independent_explain'];
			break;
		case CUSTOM_TITLE_MODE_REPLACE_RANK:
			$custom_title_mode_explain = $lang['Custom_title_replace_rank_explain'];
			break;
		case CUSTOM_TITLE_MODE_REPLACE_BOTH:
			$custom_title_mode_explain = $lang['Custom_title_replace_both_explain'];
			break;
		default:
			break;
	}

	$showprofile = ($HTTP_GET_VARS['mode'] == 'register') ? ( (isset($showprofile)) ? $showprofile : 0 ) : $showprofile;	

	//
	// Let's do an overall check for settings/versions which would prevent
	// us from doing file uploads....
	//
	$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
	$form_enctype = ( @$ini_val('file_uploads') == '0' || strtolower(@$ini_val('file_uploads') == 'off') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';

	$template->assign_vars(array(
		'USERNAME' => isset($username) ? $username : '',
		'CUR_PASSWORD' => isset($cur_password) ? $cur_password : '',
		'NEW_PASSWORD' => isset($new_password) ? $new_password : '',
		'PASSWORD_CONFIRM' => isset($password_confirm) ? $password_confirm : '',
		'EMAIL' => isset($email) ? $email : '',
		'CONFIRM_IMG' => $confirm_image, 
		'BDAY_MONTH' => ($bday_month != 0) ? $bday_month : $lang['Default_Month'],
		'BDAY_DAY' => ($bday_day != 0) ? $bday_day : $lang['Default_Day'],
		'BDAY_YEAR' => ($bday_year != 0) ? $bday_year : $lang['Default_Year'],
		'BIRTHDAY_ALL' => BIRTHDAY_ALL,
		'BIRTHDAY_ALL_SELECTED' => ( $birthday_display == BIRTHDAY_ALL ) ? ' selected="selected"' : '',
		'BIRTHDAY_DATE' => BIRTHDAY_DATE,
		'BIRTHDAY_DATE_SELECTED' => ( $birthday_display == BIRTHDAY_DATE ) ? ' selected="selected"' : '',
		'BIRTHDAY_AGE' => BIRTHDAY_AGE,
		'BIRTHDAY_AGE_SELECTED' => ( $birthday_display == BIRTHDAY_AGE ) ? ' selected="selected"' : '',
		'BIRTHDAY_NONE' => BIRTHDAY_NONE,
		'BIRTHDAY_NONE_SELECTED' => ( $birthday_display == BIRTHDAY_NONE ) ? ' selected="selected"' : '',
		'BDAY_NONE_ENABLED' => ( !$birthday_greeting ) ? ' checked="checked"' : '',
		'BDAY_EMAIL' => BIRTHDAY_EMAIL,
		'BDAY_EMAIL_ENABLED' => ( $birthday_greeting == BIRTHDAY_EMAIL ) ? ' checked="checked"' : '',
		'BDAY_PM' => BIRTHDAY_PM,
		'BDAY_PM_ENABLED' => ( $birthday_greeting == BIRTHDAY_PM ) ? ' checked="checked"' : '', 
		'BDAY_POPUP' => BIRTHDAY_POPUP,
		'BDAY_POPUP_ENABLED' => ( $birthday_greeting == BIRTHDAY_POPUP ) ? ' checked="checked"' : '',
		'YIM' => $yim,
		'ICQ' => $icq,
		'MSN' => $msn,
            'SKYPE' => $skype,
		'XFIRE' => $xfire,
		'AIM' => $aim,
		'OCCUPATION' => $occupation,
		'INTERESTS' => $interests,
		'L_USER_ABSENCE' => $lang['User_absence'],
		'L_USER_ABSENCE_MODE' => $lang['User_absence_mode'],
		'L_USER_ABSENCE_TEXT' => $lang['User_absence_text'],
		'USER_ABSENCE_YES' => ($user_absence) ? 'checked="checked"' : '',
		'USER_ABSENCE_NO' => (!$user_absence) ? 'checked="checked"' : '',
		'S_USER_ABSENCE_MODE' => $s_user_absence_mode,
		'S_USER_ABSENCE_TEXT' => $user_absence_text,
		'CUSTOM_TITLE' => $custom_title,
		'CUSTOM_TITLE_MAXLENGTH' => $board_config['custom_title_maxlength'],
		'LOCATION' => $location,
		'WEBSITE' => $website,
		'GENDER_M_SELECTED' => ( $user_gender == GENDER_M ) ? 'checked="checked"' : '',
		'GENDER_F_SELECTED' => ( $user_gender == GENDER_F ) ? 'checked="checked"' : '',
		'GENDER_X_SELECTED' => ( !$user_gender ) ? 'checked="checked"' : '',
		'PAYPAL' => $paypal,
		'SIGNATURE' => str_replace('<br />', "\n", $signature),
		'SIGNATURE_MAX' => $board_config['max_sig_chars'],
		'SHOW_PROFILE_YES' => ( $showprofile ) ? 'checked="checked"' : '',
		'SHOW_PROFILE_NO' => ( !$showprofile ) ? 'checked="checked"' : '',
		'VIEW_EMAIL_YES' => ( $viewemail ) ? 'checked="checked"' : '',
		'VIEW_EMAIL_NO' => ( !$viewemail ) ? 'checked="checked"' : '',
		'HIDE_USER_YES' => ( !$allowviewonline ) ? 'checked="checked"' : '',
		'HIDE_USER_NO' => ( $allowviewonline ) ? 'checked="checked"' : '',
		'NOTIFY_PM_YES' => ( $notifypm ) ? 'checked="checked"' : '',
		'NOTIFY_PM_NO' => ( !$notifypm ) ? 'checked="checked"' : '',
            'BLOCK_PM_YES' => ( $games_block_pm ) ? 'checked="checked"' : '',
            'BLOCK_PM_NO' => ( !$games_block_pm ) ? 'checked="checked"' : '',
		'POPUP_PM_YES' => ( $popup_pm ) ? 'checked="checked"' : '',
		'POPUP_PM_NO' => ( !$popup_pm ) ? 'checked="checked"' : '',
		'TOPIC_MOVED_MAIL_YES' => ( $mail_on_topic_moved ) ? 'checked="checked"' : '',
		'TOPIC_MOVED_MAIL_NO' => ( !$mail_on_topic_moved ) ? 'checked="checked"' : '',
		'TOPIC_MOVED_PM_YES' => ( $pm_on_topic_moved ) ? 'checked="checked"' : '',
		'TOPIC_MOVED_PM_NO' => ( !$pm_on_topic_moved ) ? 'checked="checked"' : '',
		'TOPIC_MOVED_PM_NOTIFY_YES' => ( $pm_on_topic_moved_notify ) ? 'checked="checked"' : '',
		'TOPIC_MOVED_PM_NOTIFY_NO' => ( !$pm_on_topic_moved_notify ) ? 'checked="checked"' : '',
		'ALWAYS_ADD_SIGNATURE_YES' => ( $attachsig ) ? 'checked="checked"' : '',
		'ALWAYS_ADD_SIGNATURE_NO' => ( !$attachsig ) ? 'checked="checked"' : '',
		'NOTIFY_REPLY_YES' => ( $notifyreply ) ? 'checked="checked"' : '',
		'NOTIFY_REPLY_NO' => ( !$notifyreply ) ? 'checked="checked"' : '',
		'ALWAYS_ALLOW_BBCODE_YES' => ( $allowbbcode ) ? 'checked="checked"' : '',
		'ALWAYS_ALLOW_BBCODE_NO' => ( !$allowbbcode ) ? 'checked="checked"' : '',
            'SHOW_DESCRIPTIONS_YES' => ( $showdescriptions ) ? 'checked="checked"' : '',
            'SHOW_DESCRIPTIONS_NO' => ( !$showdescriptions ) ? 'checked="checked"' : '',
            'SHOW_TOOLTIPS_YES' => ( $showtooltips ) ? 'checked="checked"' : '',
            'SHOW_TOOLTIPS_NO' => ( !$showtooltips ) ? 'checked="checked"' : '',
            'TOOLTIPS_PARSE_YES' => ( $tooltips_parse ) ? 'checked="checked"' : '',
            'TOOLTIPS_PARSE_NO' => ( !$tooltips_parse ) ? 'checked="checked"' : '',
            'TOOLTIPS_STATIC_YES' => ( $tooltips_static ) ? 'checked="checked"' : '',
            'TOOLTIPS_STATIC_NO' => ( !$tooltips_static ) ? 'checked="checked"' : '',
            'TOOLIMG_WIDTH' => $toolimg_width,
            'TOOLIMG_HEIGHT' => $toolimg_height,
		'ALWAYS_ALLOW_HTML_YES' => ( $allowhtml ) ? 'checked="checked"' : '',
		'ALWAYS_ALLOW_HTML_NO' => ( !$allowhtml ) ? 'checked="checked"' : '',
		'ALWAYS_ALLOW_SMILIES_YES' => ( $allowsmilies ) ? 'checked="checked"' : '',
		'ALWAYS_ALLOW_SMILIES_NO' => ( !$allowsmilies ) ? 'checked="checked"' : '',
		'ALLOW_AVATAR' => $board_config['allow_avatar_upload'],
		'AVATAR' => $avatar_img,
		'AVATAR_SIZE' => $board_config['avatar_filesize'],
		'LANGUAGE_SELECT' => language_select($user_lang, 'language'),
		'COUNTRY_SELECT' => country_select($user_country, 'country'),
		'BIRTHMONTH_SELECT' => bday_month_select($bday_month, 'bday_month'),
		'BIRTHDAY_SELECT' => bday_day_select($bday_day, 'bday_day'),
		'BIRTHYEAR_SELECT' => bday_year_select($bday_year, 'bday_year'),
		'STYLE_SELECT' => style_select($user_style, 'style'),
		'TIMEZONE_SELECT' => tz_select($user_timezone, 'timezone'),
		'DATE_FORMAT' => $user_dateformat,
		'HTML_STATUS' => $html_status,
		'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
		'SMILIES_STATUS' => $smilies_status,

		'L_CURRENT_PASSWORD' => $lang['Current_password'],
		'L_PUBLIC_VIEW_PROFILE' => $lang['Allow_show_profile'],
		'L_NEW_PASSWORD' => ( $mode == 'register' ) ? $lang['Password'] : $lang['New_password'],
		'L_CONFIRM_PASSWORD' => $lang['Confirm_password'],
		'L_CONFIRM_PASSWORD_EXPLAIN' => ( $mode == 'editprofile' ) ? $lang['Confirm_password_explain'] : '',
		'L_PASSWORD_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_if_changed'] : '',
		'L_PASSWORD_CONFIRM_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_confirm_if_changed'] : '',
		'L_SUBMIT' => $lang['Submit'],
		'L_RESET' => $lang['Reset'],
		'L_CLEAR' => $lang['Clear'],
		'L_BIRTHDAY' => $lang['Birthday'],
		'L_MONTH' => $lang['Month'],
		'L_DAY' => $lang['Day'],
		'L_YEAR' => ( $board_config['bday_year'] ) ? $lang['Year'] : $lang['Year_Optional'],
		'L_OPTIONAL' => ( $board_config['bday_year'] ) ? '' : $lang['Optional'],
		'L_BIRTHDAY_DISPLAY' => $lang['Birthday_Display'],
		'L_BIRTHDAY_ALL' => $lang['Display_all'],
		'L_BIRTHDAY_YEAR' => $lang['Display_day_and_month'],
		'L_BIRTHDAY_AGE' => $lang['Display_age'],
		'L_BIRTHDAY_NONE' => $lang['Display_nothing'],
		'L_BDAY_SEND_GREETING' => $lang['bday_send_greeting'],
		'L_BDAY_SEND_GREETING_EXPLAIN' => $lang['bday_send_greeting_user_explain'],
		'L_NONE' => $lang['Do_not_send'],
		'L_EMAIL' => $lang['Email'],
		'L_PM' => $lang['PM'],
		'L_POPUP' => $lang['Popup'],
		'L_ICQ_NUMBER' => $lang['ICQ'],
		'L_MESSENGER' => $lang['MSNM'],
            'L_SKYPE' => $lang['skype'], 
		'L_XFIRE' => $lang['xfire'], 
		'L_YAHOO' => $lang['YIM'],
		'L_WEBSITE' => $lang['Website'],
		'L_DONATE' => $lang['Donate'],
		'L_DONATE_EXPLAIN' => $lang['Donate_explain'],
		'L_AIM' => $lang['AIM'],
		'L_LOCATION' => $lang['Location'],
		'L_COUNTRY' => $lang['Country'],
		'L_OCCUPATION' => $lang['Occupation'],
		'L_BOARD_LANGUAGE' => $lang['Board_lang'],
		'L_BOARD_STYLE' => $lang['Board_style'],
		'L_TIMEZONE' => $lang['Timezone'],
		'L_DATE_FORMAT' => $lang['Date_format'],
		'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'],
		'L_YES' => $lang['Yes'],
		'L_NO' => $lang['No'],
		'L_INTERESTS' => $lang['Interests'],
		'L_CUSTOM_TITLE' => $lang['Custom_title'],
		'L_CUSTOM_TITLE_EXPLAIN' => sprintf($lang['Custom_title_explain'], $custom_title_mode_explain, $board_config['custom_title_maxlength']),
		'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'],
		'L_ALWAYS_ALLOW_BBCODE' => $lang['Always_bbcode'],
            'L_SHOW_DESCRIPTIONS' => $lang['show_descriptions'],
            'L_SHOW_TOOLTIPS' => $lang['show_tooltips'],
            'L_TOOLTIPS_EXP' => $lang['tooltips_explain'],
            'L_TOOLTIPS_PARSE' => $lang['tooltips_parse'],
            'L_TOOLTIPS_PARSE_EXP' => $lang['tooltips_parse_explain'],
            'L_TOOLTIPS_STATIC' => $lang['tooltips_static'],
            'L_TOOLTIPS_STATIC_EXP' => $lang['tooltips_static_explain'],
            'L_TOOLIMG_SIZE' => $lang['toolimg_size'],
		'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'],
		'L_HIDE_USER' => $lang['Hide_user'],
		'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'],
		'L_GENDER' => $lang['gender'],
		'L_GENDER_M' => $lang['gender_m'],
		'L_GENDER_F' => $lang['gender_f'],
		'L_GENDER_X' => $lang['gender_x'],
		'IMG_GENDER_M' => ( $board_config['gender_display'] == GENDER_IMG ) ? '<img src="' . $images['gender_m'] . '" border="0" alt="' . $lang['gender_m'] . '" title="' . $lang['gender_m'] . '" />' : '',
		'IMG_GENDER_F' => ( $board_config['gender_display'] == GENDER_IMG ) ? '<img src="' . $images['gender_f'] . '" border="0" alt="' . $lang['gender_f'] . '" title="' . $lang['gender_f'] . '" />' : '',
		'IMG_GENDER_X' => ( $board_config['gender_display'] == GENDER_IMG ) ? '<img src="' . $images['gender_x'] . '" border="0" alt="' . $lang['gender_x'] . '" title="' . $lang['gender_x'] . '" />' : '',
            'L_ACCOUNT_DELETE' => $lang['Account_delete'],
            'L_DELETE_ACCOUNT_EXPLAIN' => $lang['Account_delete_explain'],

		'L_AVATAR_PANEL' => $lang['Avatar_panel'],
		'L_AVATAR_EXPLAIN' => sprintf($lang['Avatar_explain'], $board_config['avatar_max_width'], $board_config['avatar_max_height'], (round($board_config['avatar_filesize'] / 1024))),
		'L_UPLOAD_AVATAR_FILE' => $lang['Upload_Avatar_file'],
		'L_UPLOAD_AVATAR_URL' => $lang['Upload_Avatar_URL'],
		'L_UPLOAD_AVATAR_URL_EXPLAIN' => $lang['Upload_Avatar_URL_explain'],
		'L_AVATAR_GALLERY' => $lang['Select_from_gallery'],
		'L_SHOW_GALLERY' => $lang['View_avatar_gallery'],
		'L_LINK_REMOTE_AVATAR' => $lang['Link_remote_Avatar'],
		'L_LINK_REMOTE_AVATAR_EXPLAIN' => $lang['Link_remote_Avatar_explain'],
		'L_DELETE_AVATAR' => $lang['Delete_Image'],
		'L_CURRENT_IMAGE' => $lang['Current_Image'],

		'L_SIGNATURE' => $lang['Signature'],
		'L_YOU_HAVE' => $lang['You_have'],
		'L_CHARS_LEFT' => $lang['Chars_left'],
		'L_SIGNATURE_EXPLAIN' => sprintf($lang['Signature_explain'], $board_config['max_sig_chars']),
		'L_NOTIFY_ON_REPLY' => $lang['Always_notify'],
		'L_NOTIFY_ON_REPLY_EXPLAIN' => $lang['Always_notify_explain'],
		'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'],
            'L_BLOCK_ARCADE_PM' => $lang['Block_Arcade_pm'],
		'L_POPUP_ON_PRIVMSG' => $lang['Popup_on_privmsg'],
		'L_POPUP_ON_PRIVMSG_EXPLAIN' => $lang['Popup_on_privmsg_explain'],
		'L_NO_USE' => $lang['no_use'],
		'L_TOPIC_MOVED_MAIL' => $lang['topic_moved_mail'],
		'L_TOPIC_MOVED_PM' => $lang['topic_moved_pm'],
		'L_TOPIC_MOVED_PM_NOTIFY' => $lang['topic_moved_pm_notify'],
		'L_PREFERENCES' => $lang['Preferences'],
		'L_PUBLIC_VIEW_EMAIL' => $lang['Public_view_email'],
		'L_ITEMS_REQUIRED' => $lang['Items_required'],
		'L_REGISTRATION_INFO' => $lang['Registration_info'],
		'L_PROFILE_INFO' => $lang['Profile_info'],
		'L_PROFILE_INFO_NOTICE' => $lang['Profile_info_warn'],
		'L_EMAIL_ADDRESS' => $lang['Email_address'],

		'L_CONFIRM_CODE_IMPAIRED'	=> sprintf($lang['Confirm_code_impaired'], '<a href="mailto:' . $board_config['board_email'] . '">', '</a>'), 
		'L_CONFIRM_CODE'			=> $lang['Confirm_code'], 
		'L_CONFIRM_CODE_EXPLAIN'	=> $lang['Confirm_code_explain'], 

            'LONGITUDE' => $longitude,
            'LATITUDE' => $latitude,
            'L_LONGITUDE' => $lang['map_longitude'],
            'L_LATITUDE' => $lang['map_latitude'],
            'L_LONGITUDE_HELP' => $lang['map_longitudehelp'],
            'L_LATITUDE_HELP' => $lang['map_latitudehelp'],
            'L_MAP_INFO' => $lang['map_section_title'],
            'L_MAP_DESCRIPTION' => $lang['map_section_description'],
            'L_DEGREES' => $lang['map_degrees'],
            'L_MINUTES' => $lang['map_minutes'],
            'L_FIND_PLACE' => $lang['map_find_place'],
            'U_FIND_PLACE' => append_sid("map_search.$phpEx"),

		'S_ALLOW_AVATAR_UPLOAD' => $board_config['allow_avatar_upload'],
		'S_ALLOW_AVATAR_LOCAL' => $board_config['allow_avatar_local'],
		'S_ALLOW_AVATAR_REMOTE' => $board_config['allow_avatar_remote'],
		'S_HIDDEN_FIELDS' => $s_hidden_fields,
		'S_FORM_ENCTYPE' => $form_enctype,
		'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
	);

	if ( !$board_config['bday_lock'] || $userdata['user_birthday'] == 0 )
	{
		$block = ( $board_config['bday_require'] == TRUE ) ? 'birthday_required' : 'birthday_optional';
		$template->assign_block_vars($block, array());
		$template->birthday_interface();
	}

	if ( $board_config['bday_greeting'] != 0 )
	{
		$template->assign_block_vars('birthdays_greeting',array());
		if ($board_config['bday_greeting'] & (1<<(BIRTHDAY_EMAIL-1)))
		{
			$template->assign_block_vars('birthdays_greeting.birthdays_email',array());
		}
		if ($board_config['bday_greeting'] & (1<<(BIRTHDAY_PM-1)))
		{
			$template->assign_block_vars('birthdays_greeting.birthdays_pm',array());
		}
		if ($board_config['bday_greeting'] & (1<<(BIRTHDAY_POPUP-1)))
		{
			$template->assign_block_vars('birthdays_greeting.birthdays_popup',array());
		}
	}

	//
	// This is another cheat using the block_var capability
	// of the templates to 'fake' an IF...ELSE...ENDIF solution
	// it works well :)
	//
	if ( $mode != 'register' )
	{
    // Begin Account Self-Delete MOD
    if( $board_config['account_delete'] )
    {
      $template->assign_block_vars('account_delete_block', array() );
    }
    // End Account Self-Delete MOD
		if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
		{
			$template->assign_block_vars('switch_avatar_block', array() );

			if ( $board_config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_path'])) )
			{
				if ( $form_enctype != '' )
				{
					$template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
				}
				$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
			}

			if ( $board_config['allow_avatar_remote'] )
			{
				$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
			}

			if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
			{
				$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
			}
		}
	}
	if ($custom_title_activated == TRUE) 
	{ 
		$template->assign_block_vars('switch_custom_title', array() ); 
	}
}

$template->pparse('body');

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

?>
Thanks to anyone who decides to check my file.Thanks!

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Heavy problem with usercp_register.php

Post by RMcGirr83 » Mon Oct 06, 2008 5:31 pm

[SNIP]

A link to your board would be good ;)
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Sethernis
Registered User
Posts: 51
Joined: Mon May 12, 2008 5:12 am

Re: Heavy problem with usercp_register.php

Post by Sethernis » Mon Oct 06, 2008 8:58 pm

http://testing-boards.freetzi.com/

These are just my testing boards before i make a public site.

Try to register or edit your profile then submit ot see what happens.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51867
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Heavy problem with usercp_register.php

Post by Brf » Mon Oct 06, 2008 9:06 pm

Why does the country default to "thumbs.db" ?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Heavy problem with usercp_register.php

Post by RMcGirr83 » Mon Oct 06, 2008 10:58 pm

...and what are those blank boxes at the bottom of the screen (also latitude and longitude show up twice).
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Sethernis
Registered User
Posts: 51
Joined: Mon May 12, 2008 5:12 am

Re: Heavy problem with usercp_register.php

Post by Sethernis » Tue Oct 07, 2008 3:02 pm

Thumbs.db ... don't really know i must delete it from folder which contains country flags.I guess image information is stored in there.

The blank boxed are the 'leftovers' from phpbb security mod.I still didn't remove those blank ones from profile_add_body.tpl - not to worry about that.

EDIT: Thanks a lot!You solved my problem.It was the stupid thumbs.db - i didn't change my country flag so i used thumbs.db which caused the error.

Thanks again.I will now delete these thumbs.db

However thumbs.db exist on my computer in almost every folder with images.Next time i must not upload it.

... Reinstalling phpbb security ...

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Heavy problem with usercp_register.php

Post by espicom » Tue Oct 07, 2008 7:00 pm

thumbs.db will appear in just about any folder the Windows Explorer touches, UNLESS you turn off certain features. It's where it saves the thumbnail images it displays, to save load time.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

Locked

Return to “2.0.x Support Forum”