예제 #1
0
*								'function2'		=> 'replace_good_with_bad',				// returned variable is '2 is bad'
*							),
*
*/

	$convertor = array(
		'test_file'				=> 'editpost.php',

		// The avatar sources in the db are from the board root.
		'avatar_path'			=> mybb_get_config_path_value('avataruploadpath'),
		'avatar_gallery_path'	=> mybb_get_config_path_value('avatardir'),
		'smilies_path'			=> mybb_get_absolute_path('images/smilies'),
		'upload_path'			=> mybb_get_config_path_value('uploadspath'),
		'icons_path'			=> '',
		'thumbnails'			=> '',
		'ranks_path'			=> mybb_get_absolute_path('images/groupimages'),
		'source_path_absolute'	=> true,

		// We empty some tables to have clean data available
		'query_first'			=> array(
			array('target', $convert->truncate_statement . SEARCH_RESULTS_TABLE),
			array('target', $convert->truncate_statement . SEARCH_WORDLIST_TABLE),
			array('target', $convert->truncate_statement . SEARCH_WORDMATCH_TABLE),
			array('target', $convert->truncate_statement . LOG_TABLE),
		),

//	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.
//	Instead every file gets copied while processing the corresponding attachment entry.
//		if (defined("MOD_ATTACHMENT")) { import_attachment_files(); phpbb_copy_thumbnails(); }

		// phpBB2 allowed some similar usernames to coexist which would have the same
예제 #2
0
/**
* Transfer avatars, copying the image if it was uploaded
*/
function mybb_import_avatar($user_avatar)
{
	global $convert_row, $convert;

	if ($user_avatar)
	{
		$user_avatar = substr($user_avatar, 0, strpos($user_avatar, '?dateline='));
	}

	if (!$convert_row['avatartype'])
	{
		return '';
	}
	else if ($convert_row['avatartype'] == 'upload')
	{
		// Uploaded avatar
		$user_avatar = mybb_get_absolute_path($user_avatar);
		return import_avatar($user_avatar, false, phpbb_user_id($convert_row['uid']));
	}
	else if ($convert_row['avatartype'] == 'remote')
	{
		// Remote avatar
		return $user_avatar;
	}
	else if ($convert_row['avatartype'] == 'gallery')
	{
		// Gallery avatar
		$source = mybb_get_absolute_path($user_avatar);
		return str_replace($convert->convertor['avatar_gallery_path'], '', $source);
	}

	return '';
}