Blame Extras/phpBB/3.0.4/install/convertors/convert_phpbb20.php

4c79b5
4c79b5
/**
4c79b5
*
4c79b5
* @package install
4c79b5
* @version $Id: convert_phpbb20.php 9155 2008-12-02 17:13:34Z acydburn $
4c79b5
* @copyright (c) 2006 phpBB Group
4c79b5
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
4c79b5
*
4c79b5
*/
4c79b5
4c79b5
/**
4c79b5
* NOTE to potential convertor authors. Please use this file to get
4c79b5
* familiar with the structure since we added some bare explanations here.
4c79b5
*
4c79b5
* Since this file gets included more than once on one page you are not able to add functions to it.
4c79b5
* Instead use a functions_ file.
4c79b5
*
4c79b5
* @ignore
4c79b5
*/
4c79b5
if (!defined('IN_PHPBB'))
4c79b5
{
4c79b5
	exit;
4c79b5
}
4c79b5
4c79b5
include($phpbb_root_path . 'config.' . $phpEx);
4c79b5
unset($dbpasswd);
4c79b5
4c79b5
/**
4c79b5
* $convertor_data provides some basic information about this convertor which is
4c79b5
* used on the initial list of convertors and to populate the default settings
4c79b5
*/
4c79b5
$convertor_data = array(
4c79b5
	'forum_name'	=> 'phpBB 2.0.x',
4c79b5
	'version'		=> '1.0.2',
4c79b5
	'phpbb_version'	=> '3.0.4',
4c79b5
	'author'		=> 'phpBB Group',
4c79b5
	'dbms'			=> $dbms,
4c79b5
	'dbhost'		=> $dbhost,
4c79b5
	'dbport'		=> $dbport,
4c79b5
	'dbuser'		=> $dbuser,
4c79b5
	'dbpasswd'		=> '',
4c79b5
	'dbname'		=> $dbname,
4c79b5
	'table_prefix'	=> 'phpbb_',
4c79b5
	'forum_path'	=> '../forums',
4c79b5
	'author_notes'	=> '',
4c79b5
);
4c79b5
4c79b5
/**
4c79b5
* $tables is a list of the tables (minus prefix) which we expect to find in the
4c79b5
* source forum. It is used to guess the prefix if the specified prefix is incorrect
4c79b5
*/
4c79b5
$tables = array(
4c79b5
	'auth_access',
4c79b5
	'banlist',
4c79b5
	'categories',
4c79b5
	'disallow',
4c79b5
	'forum_prune',
4c79b5
	'forums',
4c79b5
	'groups',
4c79b5
	'posts',
4c79b5
	'posts_text',
4c79b5
	'privmsgs',
4c79b5
	'privmsgs_text',
4c79b5
	'ranks',
4c79b5
	'smilies',
4c79b5
	'topics',
4c79b5
	'topics_watch',
4c79b5
	'user_group',
4c79b5
	'users',
4c79b5
	'vote_desc',
4c79b5
	'vote_results',
4c79b5
	'vote_voters',
4c79b5
	'words'
4c79b5
);
4c79b5
4c79b5
/**
4c79b5
* $config_schema details how the board configuration information is stored in the source forum.
4c79b5
*
4c79b5
* 'table_format' can take the value 'file' to indicate a config file. In this case array_name
4c79b5
* is set to indicate the name of the array the config values are stored in
4c79b5
* 'table_format' can be an array if the values are stored in a table which is an assosciative array
4c79b5
* (as per phpBB 2.0.x)
4c79b5
* If left empty, values are assumed to be stored in a table where each config setting is
4c79b5
* a column (as per phpBB 1.x)
4c79b5
*
4c79b5
* In either of the latter cases 'table_name' indicates the name of the table in the database
4c79b5
*
4c79b5
* 'settings' is an array which maps the name of the config directive in the source forum
4c79b5
* to the config directive in phpBB3. It can either be a direct mapping or use a function.
4c79b5
* Please note that the contents of the old config value are passed to the function, therefore
4c79b5
* an in-built function requiring the variable passed by reference is not able to be used. Since
4c79b5
* empty() is such a function we created the function is_empty() to be used instead.
4c79b5
*/
4c79b5
$config_schema = array(
4c79b5
	'table_name'	=>	'config',
4c79b5
	'table_format'	=>	array('config_name' => 'config_value'),
4c79b5
	'settings'		=>	array(
4c79b5
		'allow_bbcode'			=> 'allow_bbcode',
4c79b5
		'allow_smilies'			=> 'allow_smilies',
4c79b5
		'allow_sig'				=> 'allow_sig',
4c79b5
		'allow_namechange'		=> 'allow_namechange',
4c79b5
		'allow_avatar_local'	=> 'allow_avatar_local',
4c79b5
		'allow_avatar_remote'	=> 'allow_avatar_remote',
4c79b5
		'allow_avatar_upload'	=> 'allow_avatar_upload',
4c79b5
		'board_disable'			=> 'board_disable',
4c79b5
		'sitename'				=> 'phpbb_set_encoding(sitename)',
4c79b5
		'site_desc'				=> 'phpbb_set_encoding(site_desc)',
4c79b5
		'session_length'		=> 'session_length',
4c79b5
		'board_email_sig'		=> 'phpbb_set_encoding(board_email_sig)',
4c79b5
		'posts_per_page'		=> 'posts_per_page',
4c79b5
		'topics_per_page'		=> 'topics_per_page',
4c79b5
		'enable_confirm'		=> 'enable_confirm',
4c79b5
		'board_email_form'		=> 'board_email_form',
4c79b5
		'override_user_style'	=> 'override_user_style',
4c79b5
		'hot_threshold'			=> 'hot_threshold',
4c79b5
		'max_poll_options'		=> 'max_poll_options',
4c79b5
		'max_sig_chars'			=> 'max_sig_chars',
4c79b5
		'pm_max_msgs'			=> 'max_inbox_privmsgs',
4c79b5
		'smtp_delivery'			=> 'smtp_delivery',
4c79b5
		'smtp_host'				=> 'smtp_host',
4c79b5
		'smtp_username'			=> 'smtp_username',
4c79b5
		'smtp_password'			=> 'smtp_password',
4c79b5
		'require_activation'	=> 'require_activation',
4c79b5
		'flood_interval'		=> 'flood_interval',
4c79b5
		'avatar_filesize'		=> 'avatar_filesize',
4c79b5
		'avatar_max_width'		=> 'avatar_max_width',
4c79b5
		'avatar_max_height'		=> 'avatar_max_height',
4c79b5
		'default_dateformat'	=> 'default_dateformat',
4c79b5
		'board_timezone'		=> 'board_timezone',
4c79b5
		'allow_privmsg'			=> 'not(privmsg_disable)',
4c79b5
		'gzip_compress'			=> 'gzip_compress',
4c79b5
		'coppa_enable'			=> 'is_empty(coppa_mail)',
4c79b5
		'coppa_fax'				=> 'coppa_fax',
4c79b5
		'coppa_mail'			=> 'coppa_mail',
4c79b5
		'record_online_users'	=> 'record_online_users',
4c79b5
		'record_online_date'	=> 'record_online_date',
4c79b5
		'board_startdate'		=> 'board_startdate',
4c79b5
	)
4c79b5
);
4c79b5
4c79b5
/**
4c79b5
* $test_file is the name of a file which is present on the source
4c79b5
* forum which can be used to check that the path specified by the
4c79b5
* user was correct
4c79b5
*/
4c79b5
$test_file = 'modcp.php';
4c79b5
4c79b5
/**
4c79b5
* If this is set then we are not generating the first page of information but getting the conversion information.
4c79b5
*/
4c79b5
if (!$get_info)
4c79b5
{
4c79b5
	// Test to see if the birthday MOD is installed on the source forum
4c79b5
	// Niels' birthday mod
4c79b5
	if (get_config_value('birthday_required') !== false || get_config_value('bday_require') !== false)
4c79b5
	{
4c79b5
		define('MOD_BIRTHDAY', true);
4c79b5
	}
4c79b5
4c79b5
	// TerraFrost's validated birthday mod
4c79b5
	if (get_config_value('bday_require') !== false)
4c79b5
	{
4c79b5
		define('MOD_BIRTHDAY_TERRA', true);
4c79b5
	}
4c79b5
4c79b5
	// Test to see if the attachment MOD is installed on the source forum
4c79b5
	// If it is, we will convert this data as well
4c79b5
	$src_db->sql_return_on_error(true);
4c79b5
4c79b5
	$sql = "SELECT config_value
4c79b5
		FROM {$convert->src_table_prefix}attachments_config
4c79b5
		WHERE config_name = 'upload_dir'";
4c79b5
	$result = $src_db->sql_query($sql);
4c79b5
4c79b5
	if ($result && $row = $src_db->sql_fetchrow($result))
4c79b5
	{
4c79b5
		// Here the constant is defined
4c79b5
		define('MOD_ATTACHMENT', true);
4c79b5
4c79b5
		// Here i add more tables to be checked in the old forum
4c79b5
		$tables += array(
4c79b5
			'attachments',
4c79b5
			'attachments_desc',
4c79b5
			'extensions',
4c79b5
			'extension_groups'
4c79b5
		);
4c79b5
4c79b5
		$src_db->sql_freeresult($result);
4c79b5
	}
4c79b5
	else if ($result)
4c79b5
	{
4c79b5
		$src_db->sql_freeresult($result);
4c79b5
	}
4c79b5
4c79b5
4c79b5
	/**
4c79b5
	* Tests for further MODs can be included here.
4c79b5
	* Please use constants for this, prefixing them with MOD_
4c79b5
	*/
4c79b5
4c79b5
	$src_db->sql_return_on_error(false);
4c79b5
4c79b5
	// Now let us set a temporary config variable for user id incrementing
4c79b5
	$sql = "SELECT user_id
4c79b5
		FROM {$convert->src_table_prefix}users
4c79b5
		WHERE user_id = 1";
4c79b5
	$result = $src_db->sql_query($sql);
4c79b5
	$user_id = (int) $src_db->sql_fetchfield('user_id');
4c79b5
	$src_db->sql_freeresult($result);
4c79b5
4c79b5
	// If there is a user id 1, we need to increment user ids. :/
4c79b5
	if ($user_id === 1)
4c79b5
	{
4c79b5
		// Try to get the maximum user id possible...
4c79b5
		$sql = "SELECT MAX(user_id) AS max_user_id
4c79b5
			FROM {$convert->src_table_prefix}users";
4c79b5
		$result = $src_db->sql_query($sql);
4c79b5
		$user_id = (int) $src_db->sql_fetchfield('max_user_id');
4c79b5
		$src_db->sql_freeresult($result);
4c79b5
4c79b5
		set_config('increment_user_id', ($user_id + 1), true);
4c79b5
	}
4c79b5
	else
4c79b5
	{
4c79b5
		set_config('increment_user_id', 0, true);
4c79b5
	}
4c79b5
4c79b5
	// Overwrite maximum avatar width/height
4c79b5
	@define('DEFAULT_AVATAR_X_CUSTOM', get_config_value('avatar_max_width'));
4c79b5
	@define('DEFAULT_AVATAR_Y_CUSTOM', get_config_value('avatar_max_height'));
4c79b5
4c79b5
	// additional table used only during conversion
4c79b5
	@define('USERCONV_TABLE', $table_prefix . 'userconv');
4c79b5
4c79b5
/**
4c79b5
*	Description on how to use the convertor framework.
4c79b5
*
4c79b5
*	'schema' Syntax Description
4c79b5
*		-> 'target'			=> Target Table. If not specified the next table will be handled
4c79b5
*		-> 'primary'		=> Primary Key. If this is specified then this table is processed in batches
4c79b5
*		-> 'query_first'	=> array('target' or 'src', Query to execute before beginning the process
4c79b5
*								(if more than one then specified as array))
4c79b5
*		-> 'function_first'	=> Function to execute before beginning the process (if more than one then specified as array)
4c79b5
*								(This is mostly useful if variables need to be given to the converting process)
4c79b5
*		-> 'test_file'		=> This is not used at the moment but should be filled with a file from the old installation
4c79b5
*
4c79b5
*		// DB Functions
4c79b5
*		'distinct'	=> Add DISTINCT to the select query
4c79b5
*		'where'		=> Add WHERE to the select query
4c79b5
*		'group_by'	=> Add GROUP BY to the select query
4c79b5
*		'left_join'	=> Add LEFT JOIN to the select query (if more than one joins specified as array)
4c79b5
*		'having'	=> Add HAVING to the select query
4c79b5
*
4c79b5
*		// DB INSERT array
4c79b5
*		This one consist of three parameters
4c79b5
*		First Parameter:
4c79b5
*							The key need to be filled within the target table
4c79b5
*							If this is empty, the target table gets not assigned the source value
4c79b5
*		Second Parameter:
4c79b5
*							Source value. If the first parameter is specified, it will be assigned this value.
4c79b5
*							If the first parameter is empty, this only gets added to the select query
4c79b5
*		Third Parameter:
4c79b5
*							Custom Function. Function to execute while storing source value into target table.
4c79b5
*							The functions return value get stored.
4c79b5
*							The function parameter consist of the value of the second parameter.
4c79b5
*
4c79b5
*							types:
4c79b5
*								- empty string == execute nothing
4c79b5
*								- string == function to execute
4c79b5
*								- array == complex execution instructions
4c79b5
*
4c79b5
*		Complex execution instructions:
4c79b5
*		@todo test complex execution instructions - in theory they will work fine
4c79b5
*
4c79b5
*							By defining an array as the third parameter you are able to define some statements to be executed. The key
4c79b5
*							is defining what to execute, numbers can be appended...
4c79b5
*
4c79b5
*							'function' => execute function
4c79b5
*							'execute' => run code, whereby all occurrences of {VALUE} get replaced by the last returned value.
4c79b5
*										The result *must* be assigned/stored to {RESULT}.
4c79b5
*							'typecast'	=> typecast value
4c79b5
*
4c79b5
*							The returned variables will be made always available to the next function to continue to work with.
4c79b5
*
4c79b5
*							example (variable inputted is an integer of 1):
4c79b5
*
4c79b5
*							array(
4c79b5
*								'function1'		=> 'increment_by_one',		// returned variable is 2
4c79b5
*								'typecast'		=> 'string',				// typecast variable to be a string
4c79b5
*								'execute'		=> '{RESULT} = {VALUE} . ' is good';', // returned variable is '2 is good'
4c79b5
*								'function2'		=> 'replace_good_with_bad',				// returned variable is '2 is bad'
4c79b5
*							),
4c79b5
*
4c79b5
*/
4c79b5
4c79b5
	$convertor = array(
4c79b5
		'test_file'				=> 'viewtopic.php',
4c79b5
4c79b5
		'avatar_path'			=> get_config_value('avatar_path') . '/',
4c79b5
		'avatar_gallery_path'	=> get_config_value('avatar_gallery_path') . '/',
4c79b5
		'smilies_path'			=> get_config_value('smilies_path') . '/',
4c79b5
		'upload_path'			=> (defined('MOD_ATTACHMENT')) ? phpbb_get_files_dir() . '/' : '',
4c79b5
		'thumbnails'			=> (defined('MOD_ATTACHMENT')) ? array('thumbs/', 't_') : '',
4c79b5
		'ranks_path'			=> false, // phpBB 2.0.x had no config value for a ranks path
4c79b5
4c79b5
		// We empty some tables to have clean data available
4c79b5
		'query_first'			=> array(
4c79b5
			array('target', $convert->truncate_statement . SEARCH_RESULTS_TABLE),
4c79b5
			array('target', $convert->truncate_statement . SEARCH_WORDLIST_TABLE),
4c79b5
			array('target', $convert->truncate_statement . SEARCH_WORDMATCH_TABLE),
4c79b5
			array('target', $convert->truncate_statement . LOG_TABLE),
4c79b5
		),
4c79b5
4c79b5
//	with this you are able to import all attachment files on the fly. For large boards this is not an option, therefore commented out by default.
4c79b5
//	Instead every file gets copied while processing the corresponding attachment entry.
4c79b5
//		if (defined("MOD_ATTACHMENT")) { import_attachment_files(); phpbb_copy_thumbnails(); }
4c79b5
4c79b5
		// phpBB2 allowed some similar usernames to coexist which would have the same
4c79b5
		// username_clean in phpBB3 which is not possible, so we'll give the admin a list
4c79b5
		// of user ids and usernames and let him deicde what he wants to do with them
4c79b5
		'execute_first'	=> '
4c79b5
			phpbb_create_userconv_table();
4c79b5
			import_avatar_gallery();
4c79b5
			if (defined("MOD_ATTACHMENT")) phpbb_import_attach_config();
4c79b5
			phpbb_insert_forums();
4c79b5
		',
4c79b5
4c79b5
		'execute_last'	=> array('
4c79b5
			add_bots();
4c79b5
		', '
4c79b5
			update_folder_pm_count();
4c79b5
		', '
4c79b5
			update_unread_count();
4c79b5
		', '
4c79b5
			phpbb_convert_authentication(\'start\');
4c79b5
		', '
4c79b5
			phpbb_convert_authentication(\'first\');
4c79b5
		', '
4c79b5
			phpbb_convert_authentication(\'second\');
4c79b5
		', '
4c79b5
			phpbb_convert_authentication(\'third\');
4c79b5
		'),
4c79b5
4c79b5
		'schema' => array(
4c79b5
			array(
4c79b5
				'target'	=> USERCONV_TABLE,
4c79b5
				'query_first'   => array('target', $convert->truncate_statement . USERCONV_TABLE),
4c79b5
4c79b5
4c79b5
				array('user_id',			'users.user_id', 	''),
4c79b5
				array('username_clean',		'users.username',	array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_clean_string')),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> (defined('MOD_ATTACHMENT')) ? ATTACHMENTS_TABLE : '',
4c79b5
				'primary'		=> 'attachments.attach_id',
4c79b5
				'query_first'	=> (defined('MOD_ATTACHMENT')) ? array('target', $convert->truncate_statement . ATTACHMENTS_TABLE) : '',
4c79b5
				'autoincrement'	=> 'attach_id',
4c79b5
4c79b5
				array('attach_id',				'attachments.attach_id',				''),
4c79b5
				array('post_msg_id',			'attachments.post_id',					''),
4c79b5
				array('topic_id',				'posts.topic_id',						''),
4c79b5
				array('in_message',				0,										''),
4c79b5
				array('is_orphan',				0,										''),
4c79b5
				array('poster_id',				'attachments.user_id_1 AS poster_id',	'phpbb_user_id'),
4c79b5
				array('physical_filename',		'attachments_desc.physical_filename',	'import_attachment'),
4c79b5
				array('real_filename',			'attachments_desc.real_filename',		'phpbb_set_encoding'),
4c79b5
				array('download_count',			'attachments_desc.download_count',		''),
4c79b5
				array('attach_comment',			'attachments_desc.comment',				array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
4c79b5
				array('extension',				'attachments_desc.extension',			''),
4c79b5
				array('mimetype',				'attachments_desc.mimetype',			''),
4c79b5
				array('filesize',				'attachments_desc.filesize',			''),
4c79b5
				array('filetime',				'attachments_desc.filetime',			''),
4c79b5
				array('thumbnail',				'attachments_desc.thumbnail',			''),
4c79b5
4c79b5
				'where'			=> 'attachments_desc.attach_id = attachments.attach_id AND attachments.privmsgs_id = 0 AND posts.post_id = attachments.post_id',
4c79b5
				'group_by'		=> 'attachments.attach_id'
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> (defined('MOD_ATTACHMENT')) ? ATTACHMENTS_TABLE : '',
4c79b5
				'primary'		=> 'attachments.attach_id',
4c79b5
				'autoincrement'	=> 'attach_id',
4c79b5
4c79b5
				array('attach_id',				'attachments.attach_id',				''),
4c79b5
				array('post_msg_id',			'attachments.privmsgs_id',				''),
4c79b5
				array('topic_id',				0,										''),
4c79b5
				array('in_message',				1,										''),
4c79b5
				array('is_orphan',				0,										''),
4c79b5
				array('poster_id',				'attachments.user_id_1 AS poster_id',	'phpbb_user_id'),
4c79b5
				array('physical_filename',		'attachments_desc.physical_filename',	'import_attachment'),
4c79b5
				array('real_filename',			'attachments_desc.real_filename',		''),
4c79b5
				array('download_count',			'attachments_desc.download_count',		''),
4c79b5
				array('attach_comment',			'attachments_desc.comment',				array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
4c79b5
				array('extension',				'attachments_desc.extension',			''),
4c79b5
				array('mimetype',				'attachments_desc.mimetype',			''),
4c79b5
				array('filesize',				'attachments_desc.filesize',			''),
4c79b5
				array('filetime',				'attachments_desc.filetime',			''),
4c79b5
				array('thumbnail',				'attachments_desc.thumbnail',			''),
4c79b5
4c79b5
				'where'			=> 'attachments_desc.attach_id = attachments.attach_id AND attachments.post_id = 0',
4c79b5
				'group_by'		=> 'attachments.attach_id'
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> (defined('MOD_ATTACHMENT')) ? EXTENSIONS_TABLE : '',
4c79b5
				'query_first'	=> (defined('MOD_ATTACHMENT')) ? array('target', $convert->truncate_statement . EXTENSIONS_TABLE) : '',
4c79b5
				'autoincrement'	=> 'extension_id',
4c79b5
4c79b5
				array('extension_id',			'extensions.ext_id',				''),
4c79b5
				array('group_id',				'extensions.group_id',				''),
4c79b5
				array('extension',				'extensions.extension',				''),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> (defined('MOD_ATTACHMENT')) ? EXTENSION_GROUPS_TABLE : '',
4c79b5
				'query_first'	=> (defined('MOD_ATTACHMENT')) ? array('target', $convert->truncate_statement . EXTENSION_GROUPS_TABLE) : '',
4c79b5
				'autoincrement'	=> 'group_id',
4c79b5
4c79b5
				array('group_id',				'extension_groups.group_id',			''),
4c79b5
				array('group_name',				'extension_groups.group_name',			array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
4c79b5
				array('cat_id',					'extension_groups.cat_id',				'phpbb_attachment_category'),
4c79b5
				array('allow_group',			'extension_groups.allow_group',			''),
4c79b5
				array('download_mode',			1,										''),
4c79b5
				array('upload_icon',			'',										''),
4c79b5
				array('max_filesize',			'extension_groups.max_filesize',		''),
4c79b5
				array('allowed_forums',			'extension_groups.forum_permissions',	'phpbb_attachment_forum_perms'),
4c79b5
				array('allow_in_pm',			1,										''),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> BANLIST_TABLE,
4c79b5
				'execute_first'	=> 'phpbb_check_username_collisions();',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . BANLIST_TABLE),
4c79b5
4c79b5
				array('ban_ip',					'banlist.ban_ip',					'decode_ban_ip'),
4c79b5
				array('ban_userid',				'banlist.ban_userid',				'phpbb_user_id'),
4c79b5
				array('ban_email',				'banlist.ban_email',				''),
4c79b5
				array('ban_reason',				'',									''),
4c79b5
				array('ban_give_reason',		'',									''),
4c79b5
4c79b5
				'where'			=> "banlist.ban_ip NOT LIKE '%.%'",
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> BANLIST_TABLE,
4c79b5
4c79b5
				array('ban_ip',					'banlist.ban_ip',	''),
4c79b5
				array('ban_userid',				0,					''),
4c79b5
				array('ban_email',				'',					''),
4c79b5
				array('ban_reason',				'',					''),
4c79b5
				array('ban_give_reason',		'',					''),
4c79b5
4c79b5
				'where'			=> "banlist.ban_ip LIKE '%.%'",
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> DISALLOW_TABLE,
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . DISALLOW_TABLE),
4c79b5
4c79b5
				array('disallow_username',		'disallow.disallow_username',				'phpbb_disallowed_username'),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> RANKS_TABLE,
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . RANKS_TABLE),
4c79b5
				'autoincrement'	=> 'rank_id',
4c79b5
4c79b5
				array('rank_id',					'ranks.rank_id',				''),
4c79b5
				array('rank_title',					'ranks.rank_title',				array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_htmlspecialchars')),
4c79b5
				array('rank_min',					'ranks.rank_min',				array('typecast' => 'int', 'execute' => '{RESULT} = ({VALUE}[0] < 0) ? 0 : {VALUE}[0];')),
4c79b5
				array('rank_special',				'ranks.rank_special',			''),
4c79b5
				array('rank_image',					'ranks.rank_image',				'import_rank'),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> TOPICS_TABLE,
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . TOPICS_TABLE),
4c79b5
				'primary'		=> 'topics.topic_id',
4c79b5
				'autoincrement'	=> 'topic_id',
4c79b5
4c79b5
				array('topic_id',				'topics.topic_id',					''),
4c79b5
				array('forum_id',				'topics.forum_id',					''),
4c79b5
				array('icon_id',				0,									''),
4c79b5
				array('topic_poster',			'topics.topic_poster AS poster_id',	'phpbb_user_id'),
4c79b5
				array('topic_attachment',		((defined('MOD_ATTACHMENT')) ? 'topics.topic_attachment' : 0), ''),
4c79b5
				array('topic_title',			'topics.topic_title',				'phpbb_set_encoding'),
4c79b5
				array('topic_time',				'topics.topic_time',				''),
4c79b5
				array('topic_views',			'topics.topic_views',				''),
4c79b5
				array('topic_replies',			'topics.topic_replies',				''),
4c79b5
				array('topic_replies_real',		'topics.topic_replies',				''),
4c79b5
				array('topic_last_post_id',		'topics.topic_last_post_id',		''),
4c79b5
				array('topic_status',			'topics.topic_status',				'is_topic_locked'),
4c79b5
				array('topic_moved_id',			0,									''),
4c79b5
				array('topic_type',				'topics.topic_type',				'phpbb_convert_topic_type'),
4c79b5
				array('topic_first_post_id',	'topics.topic_first_post_id',		''),
4c79b5
				array('topic_last_view_time',	'posts.post_time',					''),
4c79b5
				array('poll_title',				'vote_desc.vote_text',				array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
4c79b5
				array('poll_start',				'vote_desc.vote_start',				'null_to_zero'),
4c79b5
				array('poll_length',			'vote_desc.vote_length',			'null_to_zero'),
4c79b5
				array('poll_max_options',		1,									''),
4c79b5
				array('poll_vote_change',		0,									''),
4c79b5
4c79b5
				'left_join'		=>	array (	'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1',
4c79b5
											'topics LEFT JOIN posts ON topics.topic_last_post_id = posts.post_id',
4c79b5
									),
4c79b5
				'where'			=> 'topics.topic_moved_id = 0',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> TOPICS_TABLE,
4c79b5
				'primary'		=> 'topics.topic_id',
4c79b5
				'autoincrement'	=> 'topic_id',
4c79b5
4c79b5
				array('topic_id',				'topics.topic_id',					''),
4c79b5
				array('forum_id',				'topics.forum_id',					''),
4c79b5
				array('icon_id',				0,									''),
4c79b5
				array('topic_poster',			'topics.topic_poster AS poster_id',	'phpbb_user_id'),
4c79b5
				array('topic_attachment',		((defined('MOD_ATTACHMENT')) ? 'topics.topic_attachment' : 0), ''),
4c79b5
				array('topic_title',			'topics.topic_title',				'phpbb_set_encoding'),
4c79b5
				array('topic_time',				'topics.topic_time',				''),
4c79b5
				array('topic_views',			'topics.topic_views',				''),
4c79b5
				array('topic_replies',			'topics.topic_replies',				''),
4c79b5
				array('topic_replies_real',		'topics.topic_replies',				''),
4c79b5
				array('topic_last_post_id',		'topics.topic_last_post_id',		''),
4c79b5
				array('topic_status',			ITEM_MOVED,							''),
4c79b5
				array('topic_moved_id',			'topics.topic_moved_id',			''),
4c79b5
				array('topic_type',				'topics.topic_type',				'phpbb_convert_topic_type'),
4c79b5
				array('topic_first_post_id',	'topics.topic_first_post_id',		''),
4c79b5
4c79b5
				array('poll_title',				'vote_desc.vote_text',				array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
4c79b5
				array('poll_start',				'vote_desc.vote_start',				'null_to_zero'),
4c79b5
				array('poll_length',			'vote_desc.vote_length',			'null_to_zero'),
4c79b5
				array('poll_max_options',		1,									''),
4c79b5
				array('poll_vote_change',		0,									''),
4c79b5
4c79b5
				'left_join'		=> 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1',
4c79b5
				'where'			=> 'topics.topic_moved_id <> 0',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> TOPICS_WATCH_TABLE,
4c79b5
				'primary'		=> 'topics_watch.topic_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . TOPICS_WATCH_TABLE),
4c79b5
4c79b5
				array('topic_id',				'topics_watch.topic_id',			''),
4c79b5
				array('user_id',				'topics_watch.user_id',				'phpbb_user_id'),
4c79b5
				array('notify_status',			'topics_watch.notify_status',		''),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> SMILIES_TABLE,
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . SMILIES_TABLE),
4c79b5
				'autoincrement'	=> 'smiley_id',
4c79b5
4c79b5
				array('smiley_id',				'smilies.smilies_id',				''),
4c79b5
				array('code',					'smilies.code',						array('function1' => 'phpbb_smilie_html_decode', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
4c79b5
				array('emotion',				'smilies.emoticon',					'phpbb_set_encoding'),
4c79b5
				array('smiley_url',				'smilies.smile_url',				'import_smiley'),
4c79b5
				array('smiley_width',			'smilies.smile_url',				'get_smiley_width'),
4c79b5
				array('smiley_height',			'smilies.smile_url',				'get_smiley_height'),
4c79b5
				array('smiley_order',			'smilies.smilies_id',				''),
4c79b5
				array('display_on_posting',		'smilies.smilies_id',				'get_smiley_display'),
4c79b5
4c79b5
				'order_by'		=> 'smilies.smilies_id ASC',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> POLL_OPTIONS_TABLE,
4c79b5
				'primary'		=> 'vote_results.vote_option_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . POLL_OPTIONS_TABLE),
4c79b5
4c79b5
				array('poll_option_id',			'vote_results.vote_option_id',		''),
4c79b5
				array('topic_id',				'vote_desc.topic_id',				''),
4c79b5
				array('',						'topics.topic_poster AS poster_id',	'phpbb_user_id'),
4c79b5
				array('poll_option_text',		'vote_results.vote_option_text',	array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
4c79b5
				array('poll_option_total',		'vote_results.vote_result',			''),
4c79b5
4c79b5
				'where'			=> 'vote_results.vote_id = vote_desc.vote_id',
4c79b5
				'left_join'		=> 'vote_desc LEFT JOIN topics ON topics.topic_id = vote_desc.topic_id',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> POLL_VOTES_TABLE,
4c79b5
				'primary'		=> 'vote_desc.topic_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . POLL_VOTES_TABLE),
4c79b5
4c79b5
				array('poll_option_id',			VOTE_CONVERTED,						''),
4c79b5
				array('topic_id',				'vote_desc.topic_id',				''),
4c79b5
				array('vote_user_id',			'vote_voters.vote_user_id',			'phpbb_user_id'),
4c79b5
				array('vote_user_ip',			'vote_voters.vote_user_ip',			'decode_ip'),
4c79b5
4c79b5
				'where'			=> 'vote_voters.vote_id = vote_desc.vote_id',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> WORDS_TABLE,
4c79b5
				'primary'		=> 'words.word_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . WORDS_TABLE),
4c79b5
				'autoincrement'	=> 'word_id',
4c79b5
4c79b5
				array('word_id',				'words.word_id',					''),
4c79b5
				array('word',					'words.word',						'phpbb_set_encoding'),
4c79b5
				array('replacement',			'words.replacement',				'phpbb_set_encoding'),
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> POSTS_TABLE,
4c79b5
				'primary'		=> 'posts.post_id',
4c79b5
				'autoincrement'	=> 'post_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . POSTS_TABLE),
4c79b5
				'execute_first'	=> '
4c79b5
					$config["max_post_chars"] = 0;
4c79b5
					$config["max_quote_depth"] = 0;
4c79b5
				',
4c79b5
4c79b5
				array('post_id',				'posts.post_id',					''),
4c79b5
				array('topic_id',				'posts.topic_id',					''),
4c79b5
				array('forum_id',				'posts.forum_id',					''),
4c79b5
				array('poster_id',				'posts.poster_id',					'phpbb_user_id'),
4c79b5
				array('icon_id',				0,									''),
4c79b5
				array('poster_ip',				'posts.poster_ip',					'decode_ip'),
4c79b5
				array('post_time',				'posts.post_time',					''),
4c79b5
				array('enable_bbcode',			'posts.enable_bbcode',				''),
4c79b5
				array('',						'posts.enable_html',				''),
4c79b5
				array('enable_smilies',			'posts.enable_smilies',				''),
4c79b5
				array('enable_sig',				'posts.enable_sig',					''),
4c79b5
				array('enable_magic_url',		1,									''),
4c79b5
				array('post_username',			'posts.post_username',				'phpbb_set_encoding'),
4c79b5
				array('post_subject',			'posts_text.post_subject',			'phpbb_set_encoding'),
4c79b5
				array('post_attachment',		((defined('MOD_ATTACHMENT')) ? 'posts.post_attachment' : 0), ''),
4c79b5
				array('post_edit_time',			'posts.post_edit_time',				array('typecast' => 'int')),
4c79b5
				array('post_edit_count',		'posts.post_edit_count',			''),
4c79b5
				array('post_edit_reason',		'',									''),
4c79b5
				array('post_edit_user',			'',									'phpbb_post_edit_user'),
4c79b5
4c79b5
				array('bbcode_uid',				'posts.post_time',					'make_uid'),
4c79b5
				array('post_text',				'posts_text.post_text',				'phpbb_prepare_message'),
4c79b5
				array('',						'posts_text.bbcode_uid AS old_bbcode_uid',			''),
4c79b5
				array('bbcode_bitfield',		'',									'get_bbcode_bitfield'),
4c79b5
				array('post_checksum',			'',									''),
4c79b5
4c79b5
				// Commented out inline search indexing, this takes up a LOT of time. :D
4c79b5
				// @todo We either need to enable this or call the rebuild search functionality post convert
4c79b5
/*				array('',						'',									'search_indexing'),
4c79b5
				array('',						'posts_text.post_text AS message',	''),
4c79b5
				array('',						'posts_text.post_subject AS title',	''),*/
4c79b5
4c79b5
				'where'			=>	'posts.post_id = posts_text.post_id'
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_TABLE,
4c79b5
				'primary'		=> 'privmsgs.privmsgs_id',
4c79b5
				'autoincrement'	=> 'msg_id',
4c79b5
				'query_first'	=> array(
4c79b5
					array('target', $convert->truncate_statement . PRIVMSGS_TABLE),
4c79b5
					array('target', $convert->truncate_statement . PRIVMSGS_RULES_TABLE),
4c79b5
				),
4c79b5
4c79b5
				'execute_first'	=> '
4c79b5
					$config["max_post_chars"] = 0;
4c79b5
					$config["max_quote_depth"] = 0;
4c79b5
				',
4c79b5
4c79b5
				array('msg_id',					'privmsgs.privmsgs_id',				''),
4c79b5
				array('root_level',				0,									''),
4c79b5
				array('author_id',				'privmsgs.privmsgs_from_userid AS poster_id',	'phpbb_user_id'),
4c79b5
				array('icon_id',				0,									''),
4c79b5
				array('author_ip',				'privmsgs.privmsgs_ip',				'decode_ip'),
4c79b5
				array('message_time',			'privmsgs.privmsgs_date',			''),
4c79b5
				array('enable_bbcode',			'privmsgs.privmsgs_enable_bbcode AS enable_bbcode',	''),
4c79b5
				array('',						'privmsgs.privmsgs_enable_html AS enable_html',	''),
4c79b5
				array('enable_smilies',			'privmsgs.privmsgs_enable_smilies AS enable_smilies',	''),
4c79b5
				array('enable_magic_url',		1,									''),
4c79b5
				array('enable_sig',				'privmsgs.privmsgs_attach_sig',		''),
4c79b5
				array('message_subject',		'privmsgs.privmsgs_subject',		'phpbb_set_encoding'), // Already specialchared in 2.0.x
4c79b5
				array('message_attachment',		((defined('MOD_ATTACHMENT')) ? 'privmsgs.privmsgs_attachment' : 0), ''),
4c79b5
				array('message_edit_reason',	'',									''),
4c79b5
				array('message_edit_user',		0,									''),
4c79b5
				array('message_edit_time',		0,									''),
4c79b5
				array('message_edit_count',		0,									''),
4c79b5
4c79b5
				array('bbcode_uid',				'privmsgs.privmsgs_date AS post_time',	'make_uid'),
4c79b5
				array('message_text',			'privmsgs_text.privmsgs_text',			'phpbb_prepare_message'),
4c79b5
				array('',						'privmsgs_text.privmsgs_bbcode_uid AS old_bbcode_uid',			''),
4c79b5
				array('bbcode_bitfield',		'',										'get_bbcode_bitfield'),
4c79b5
				array('to_address',				'privmsgs.privmsgs_to_userid',			'phpbb_privmsgs_to_userid'),
4c79b5
				array('bcc_address',			'',										''),
4c79b5
4c79b5
				'where'			=>	'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id'
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_FOLDER_TABLE,
4c79b5
				'primary'		=> 'users.user_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . PRIVMSGS_FOLDER_TABLE),
4c79b5
4c79b5
				array('user_id',				'users.user_id',						'phpbb_user_id'),
4c79b5
				array('folder_name',			$user->lang['CONV_SAVED_MESSAGES'],		''),
4c79b5
				array('pm_count',				0,										''),
4c79b5
4c79b5
				'where'			=> 'users.user_id <> -1',
4c79b5
			),
4c79b5
4c79b5
			// Inbox
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_TO_TABLE,
4c79b5
				'primary'		=> 'privmsgs.privmsgs_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . PRIVMSGS_TO_TABLE),
4c79b5
4c79b5
				array('msg_id',					'privmsgs.privmsgs_id',					''),
4c79b5
				array('user_id',				'privmsgs.privmsgs_to_userid',			'phpbb_user_id'),
4c79b5
				array('author_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('pm_deleted',				0,										''),
4c79b5
				array('pm_new',					'privmsgs.privmsgs_type',				'phpbb_new_pm'),
4c79b5
				array('pm_unread',				'privmsgs.privmsgs_type',				'phpbb_unread_pm'),
4c79b5
				array('pm_replied',				0,										''),
4c79b5
				array('pm_marked',				0,										''),
4c79b5
				array('pm_forwarded',			0,										''),
4c79b5
				array('folder_id',				PRIVMSGS_INBOX,							''),
4c79b5
4c79b5
				'where'			=> 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
4c79b5
										AND (privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)',
4c79b5
			),
4c79b5
4c79b5
			// Outbox
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_TO_TABLE,
4c79b5
				'primary'		=> 'privmsgs.privmsgs_id',
4c79b5
4c79b5
				array('msg_id',					'privmsgs.privmsgs_id',					''),
4c79b5
				array('user_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('author_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('pm_deleted',				0,										''),
4c79b5
				array('pm_new',					0,										''),
4c79b5
				array('pm_unread',				0,										''),
4c79b5
				array('pm_replied',				0,										''),
4c79b5
				array('pm_marked',				0,										''),
4c79b5
				array('pm_forwarded',			0,										''),
4c79b5
				array('folder_id',				PRIVMSGS_OUTBOX,						''),
4c79b5
4c79b5
				'where'			=> 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
4c79b5
										AND (privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)',
4c79b5
			),
4c79b5
4c79b5
			// Sentbox
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_TO_TABLE,
4c79b5
				'primary'		=> 'privmsgs.privmsgs_id',
4c79b5
4c79b5
				array('msg_id',					'privmsgs.privmsgs_id',					''),
4c79b5
				array('user_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('author_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('pm_deleted',				0,										''),
4c79b5
				array('pm_new',					'privmsgs.privmsgs_type',				'phpbb_new_pm'),
4c79b5
				array('pm_unread',				'privmsgs.privmsgs_type',				'phpbb_unread_pm'),
4c79b5
				array('pm_replied',				0,										''),
4c79b5
				array('pm_marked',				0,										''),
4c79b5
				array('pm_forwarded',			0,										''),
4c79b5
				array('folder_id',				PRIVMSGS_SENTBOX,						''),
4c79b5
4c79b5
				'where'			=> 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
4c79b5
										AND privmsgs.privmsgs_type = 2',
4c79b5
			),
4c79b5
4c79b5
			// Savebox (SAVED IN)
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_TO_TABLE,
4c79b5
				'primary'		=> 'privmsgs.privmsgs_id',
4c79b5
4c79b5
				array('msg_id',					'privmsgs.privmsgs_id',					''),
4c79b5
				array('user_id',				'privmsgs.privmsgs_to_userid',			'phpbb_user_id'),
4c79b5
				array('author_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('pm_deleted',				0,										''),
4c79b5
				array('pm_new',					'privmsgs.privmsgs_type',				'phpbb_new_pm'),
4c79b5
				array('pm_unread',				'privmsgs.privmsgs_type',				'phpbb_unread_pm'),
4c79b5
				array('pm_replied',				0,										''),
4c79b5
				array('pm_marked',				0,										''),
4c79b5
				array('pm_forwarded',			0,										''),
4c79b5
				array('folder_id',				'privmsgs.privmsgs_to_userid',			'phpbb_get_savebox_id'),
4c79b5
4c79b5
				'where'			=> 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
4c79b5
										AND privmsgs.privmsgs_type = 3',
4c79b5
			),
4c79b5
4c79b5
			// Savebox (SAVED OUT)
4c79b5
			array(
4c79b5
				'target'		=> PRIVMSGS_TO_TABLE,
4c79b5
				'primary'		=> 'privmsgs.privmsgs_id',
4c79b5
4c79b5
				array('msg_id',					'privmsgs.privmsgs_id',					''),
4c79b5
				array('user_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('author_id',				'privmsgs.privmsgs_from_userid',		'phpbb_user_id'),
4c79b5
				array('pm_deleted',				0,										''),
4c79b5
				array('pm_new',					'privmsgs.privmsgs_type',				'phpbb_new_pm'),
4c79b5
				array('pm_unread',				'privmsgs.privmsgs_type',				'phpbb_unread_pm'),
4c79b5
				array('pm_replied',				0,										''),
4c79b5
				array('pm_marked',				0,										''),
4c79b5
				array('pm_forwarded',			0,										''),
4c79b5
				array('folder_id',				'privmsgs.privmsgs_from_userid',		'phpbb_get_savebox_id'),
4c79b5
4c79b5
				'where'			=> 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
4c79b5
										AND privmsgs.privmsgs_type = 4',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> GROUPS_TABLE,
4c79b5
				'autoincrement'	=> 'group_id',
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . GROUPS_TABLE),
4c79b5
4c79b5
				array('group_id',				'groups.group_id',					''),
4c79b5
				array('group_type',				'groups.group_type',				'phpbb_convert_group_type'),
4c79b5
				array('group_display',			0,									''),
4c79b5
				array('group_legend',			0,									''),
4c79b5
				array('group_name',				'groups.group_name',				'phpbb_convert_group_name'), // phpbb_set_encoding called in phpbb_convert_group_name
4c79b5
				array('group_desc',				'groups.group_description',			'phpbb_set_encoding'),
4c79b5
4c79b5
				'where'			=> 'groups.group_single_user = 0',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> USER_GROUP_TABLE,
4c79b5
				'query_first'	=> array('target', $convert->truncate_statement . USER_GROUP_TABLE),
4c79b5
				'execute_first'	=> '
4c79b5
					add_default_groups();
4c79b5
				',
4c79b5
4c79b5
				array('group_id',		'groups.group_id',					''),
4c79b5
				array('user_id',		'groups.group_moderator',			'phpbb_user_id'),
4c79b5
				array('group_leader',	1,									''),
4c79b5
				array('user_pending',	0,									''),
4c79b5
4c79b5
				'where'			=> 'groups.group_single_user = 0 AND groups.group_moderator <> 0',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> USER_GROUP_TABLE,
4c79b5
4c79b5
				array('group_id',		'user_group.group_id',				''),
4c79b5
				array('user_id',		'user_group.user_id',				'phpbb_user_id'),
4c79b5
				array('group_leader',	0,									''),
4c79b5
				array('user_pending',	'user_group.user_pending',			''),
4c79b5
4c79b5
				'where'			=> 'user_group.group_id = groups.group_id AND groups.group_single_user = 0 AND groups.group_moderator <> user_group.user_id',
4c79b5
			),
4c79b5
4c79b5
			array(
4c79b5
				'target'		=> USERS_TABLE,
4c79b5
				'primary'		=> 'users.user_id',
4c79b5
				'autoincrement'	=> 'user_id',
4c79b5
				'query_first'	=> array(
4c79b5
					array('target', 'DELETE FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS),
4c79b5
					array('target', $convert->truncate_statement . BOTS_TABLE)
4c79b5
				),
4c79b5
4c79b5
				'execute_last'	=> '
4c79b5
					remove_invalid_users();
4c79b5
				',
4c79b5
4c79b5
				array('user_id',				'users.user_id',					'phpbb_user_id'),
4c79b5
				array('',						'users.user_id AS poster_id',		'phpbb_user_id'),
4c79b5
				array('user_type',				'users.user_active',				'set_user_type'),
4c79b5
				array('group_id',				'users.user_level',					'phpbb_set_primary_group'),
4c79b5
				array('user_regdate',			'users.user_regdate',				''),
4c79b5
				array('username',				'users.username',					'phpbb_set_default_encoding'), // recode to utf8 with default lang
4c79b5
				array('username_clean',			'users.username',					array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_clean_string')),
4c79b5
				array('user_password',			'users.user_password',				''),
4c79b5
				array('user_pass_convert',		1,									''),
4c79b5
				array('user_posts',				'users.user_posts',					'intval'),
4c79b5
				array('user_email',				'users.user_email',					'strtolower'),
4c79b5
				array('user_email_hash',		'users.user_email',					'gen_email_hash'),
4c79b5
				array('user_birthday',			((defined('MOD_BIRTHDAY')) ? 'users.user_birthday' : ''),	'phpbb_get_birthday'),
4c79b5
				array('user_lastvisit',			'users.user_lastvisit',				'intval'),
4c79b5
				array('user_lastmark',			'users.user_lastvisit',				'intval'),
4c79b5
				array('user_lang',				$config['default_lang'],			''),
4c79b5
				array('',						'users.user_lang',					''),
4c79b5
				array('user_timezone',			'users.user_timezone',				'floatval'),
4c79b5
				array('user_dateformat',		'users.user_dateformat',			array('function1' => 'phpbb_set_encoding', 'function2' => 'fill_dateformat')),
4c79b5
				array('user_inactive_reason',	'',									'phpbb_inactive_reason'),
4c79b5
				array('user_inactive_time',		'',									'phpbb_inactive_time'),
4c79b5
4c79b5
				array('user_interests',			'users.user_interests',				array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_occ',				'users.user_occ',					array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_website',			'users.user_website',				'validate_website'),
4c79b5
				array('user_jabber',			'',									''),
4c79b5
				array('user_msnm',				'users.user_msnm',					array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_yim',				'users.user_yim',					array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_aim',				'users.user_aim',					array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_icq',				'users.user_icq',					array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_from',				'users.user_from',					array('function1' => 'phpbb_set_encoding')),
4c79b5
				array('user_rank',				'users.user_rank',					'intval'),
4c79b5
				array('user_permissions',		'',									''),
4c79b5
4c79b5
				array('user_avatar',			'users.user_avatar',				'phpbb_import_avatar'),
4c79b5
				array('user_avatar_type',		'users.user_avatar_type',			'phpbb_avatar_type'),
4c79b5
				array('user_avatar_width',		'users.user_avatar',				'phpbb_get_avatar_width'),
4c79b5
				array('user_avatar_height',		'users.user_avatar',				'phpbb_get_avatar_height'),
4c79b5
4c79b5
				array('user_new_privmsg',		'users.user_new_privmsg',			''),
4c79b5
				array('user_unread_privmsg',	0,									''), //'users.user_unread_privmsg'
4c79b5
				array('user_last_privmsg',		'users.user_last_privmsg',			'intval'),
4c79b5
				array('user_emailtime',			'users.user_emailtime',				'null_to_zero'),
4c79b5
				array('user_notify',			'users.user_notify',				'intval'),
4c79b5
				array('user_notify_pm',			'users.user_notify_pm',				'intval'),
4c79b5
				array('user_notify_type',		NOTIFY_EMAIL,						''),
4c79b5
				array('user_allow_pm',			'users.user_allow_pm',				'intval'),
4c79b5
				array('user_allow_viewonline',	'users.user_allow_viewonline',		'intval'),
4c79b5
				array('user_allow_viewemail',	'users.user_viewemail',				'intval'),
4c79b5
				array('user_actkey',			'users.user_actkey',				''),
4c79b5
				array('user_newpasswd',			'',									''), // Users need to re-request their password...
4c79b5
				array('user_style',				$config['default_style'],			''),
4c79b5
4c79b5
				array('user_options',			'',									'set_user_options'),
4c79b5
				array('',						'users.user_popup_pm AS popuppm',	''),
4c79b5
				array('',						'users.user_allowhtml AS html',		''),
4c79b5
				array('',						'users.user_allowbbcode AS bbcode',	''),
4c79b5
				array('',						'users.user_allowsmile AS smile',	''),
4c79b5
				array('',						'users.user_attachsig AS attachsig',''),
4c79b5
4c79b5
				array('user_sig_bbcode_uid',		'users.user_regdate',							'make_uid'),
4c79b5
				array('user_sig',					'users.user_sig',								'phpbb_prepare_message'),
4c79b5
				array('',							'users.user_sig_bbcode_uid AS old_bbcode_uid',	''),
4c79b5
				array('user_sig_bbcode_bitfield',	'',												'get_bbcode_bitfield'),
4c79b5
				array('',							'users.user_regdate AS post_time',				''),
4c79b5
4c79b5
				'where'			=> 'users.user_id <> -1',
4c79b5
			),
4c79b5
		),
4c79b5
	);
4c79b5
}
4c79b5
4c79b5
?>