/** * Obtain the path to uploaded files on the 2.0.x forum * This is only used if the Attachment MOD was installed */ function phpbb_get_files_dir() { if (!defined('MOD_ATTACHMENT')) { return; } global $src_db, $same_db, $convert, $user, $config, $cache; if ($convert->mysql_convert && $same_db) { $src_db->sql_query("SET NAMES 'binary'"); } $sql = 'SELECT config_value AS upload_dir FROM ' . $convert->src_table_prefix . "bbattachments_config\n\t\tWHERE config_name = 'upload_dir'"; $result = $src_db->sql_query($sql); $upload_path = $src_db->sql_fetchfield('upload_dir'); $src_db->sql_freeresult($result); $sql = 'SELECT config_value AS ftp_upload FROM ' . $convert->src_table_prefix . "bbattachments_config\n\t\tWHERE config_name = 'allow_ftp_upload'"; $result = $src_db->sql_query($sql); $ftp_upload = (int) $src_db->sql_fetchfield('ftp_upload'); $src_db->sql_freeresult($result); if ($convert->mysql_convert && $same_db) { $src_db->sql_query("SET NAMES 'utf8'"); } if ($ftp_upload) { $convert->p_master->error($user->lang['CONV_ERROR_ATTACH_FTP_DIR'], __LINE__, __FILE__); } return phpbb_strip_module_path($upload_path); }
$src_db->sql_freeresult($result); // If there is a user id 1, we need to increment user ids. :/ if ($user_id === 1) { // Try to get the maximum user id possible... $sql = "SELECT MAX(user_id) AS max_user_id\n\t\t\tFROM {$convert->src_table_prefix}users"; $result = $src_db->sql_query($sql); $user_id = (int) $src_db->sql_fetchfield('max_user_id'); $src_db->sql_freeresult($result); set_config('increment_user_id', $user_id + 1, true); } else { set_config('increment_user_id', 0, true); } // Overwrite maximum avatar width/height @define('DEFAULT_AVATAR_X_CUSTOM', get_config_value('avatar_max_width')); @define('DEFAULT_AVATAR_Y_CUSTOM', get_config_value('avatar_max_height')); $convertor = array('test_file' => 'viewtopic.php', 'avatar_path' => phpbb_strip_module_path(get_config_value('avatar_path')) . '/', 'avatar_gallery_path' => phpbb_strip_module_path(get_config_value('avatar_gallery_path')) . '/', 'smilies_path' => phpbb_strip_module_path(get_config_value('smilies_path')) . '/', 'upload_path' => defined('MOD_ATTACHMENT') ? phpbb_get_files_dir() . '/' : '', 'thumbnails' => defined('MOD_ATTACHMENT') ? array('thumbs/', 't_') : '', 'ranks_path' => false, '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)), 'execute_first' => ' phpbb_check_username_collisions(); import_avatar_gallery(); if (defined("MOD_ATTACHMENT")) phpbb_import_attach_config(); phpbb_insert_forums(); ', 'execute_last' => array(' add_bots(); ', ' update_folder_pm_count(); ', ' update_unread_count(); ', ' phpbb_convert_authentication(\'start\'); ', ' phpbb_convert_authentication(\'first\'); ', '