function import() { global $import_session; $int_to_yes_no = array("karmaMode" => 1, "enableCompressedOutput" => 1, "attachmentThumbnails" => 1, "cal_enabled" => 1); $int_to_on_off = array("enableErrorLogging" => 1); $query = $this->old_db->simple_select("settings", "variable, value", "variable IN('" . implode("','", array_keys($this->convert_settings)) . "')", array('limit_start' => $this->trackers['start_settings'], 'limit' => $import_session['settings_per_screen'])); while ($setting = $this->old_db->fetch_array($query)) { // SMF values $name = $this->convert_settings[$setting['variable']]; $value = $setting['value']; if ($setting['variable'] == "karmaMode") { if ($value == "2") { $value = 1; } } if ($setting['variable'] == "mail_type") { if ($value == 1) { $value = "smtp"; } else { $value = "mail"; } } if ($setting['variable'] == "avatar_max_height_upload") { $avatar_setting = "x" . $value; continue; } else { if ($setting['variable'] == "avatar_max_width_upload") { $value = $value . $avatar_setting; unset($avatar_setting); } } if ($setting['variable'] == "registration_method") { if ($value == 0) { $value = "instant"; } else { if ($value == 2) { $value = "admin"; } else { $value = "verify"; } } } if ($setting['variable'] == "reserveNames") { $value = str_replace("\n", ",", $value); } if (($value == 0 || $value == 1) && isset($int_to_yes_no[$setting['conf_name']])) { $value = int_to_yes_no($value, $int_to_yes_no[$setting['conf_name']]); } if (($value == 0 || $value == 1) && isset($int_to_on_off[$setting['variable']])) { $value = int_to_on_off($value, $int_to_on_off[$setting['variable']]); } $this->update_setting($name, $value); } }
function import() { global $import_session; $int_to_yes_no = array("o_show_version" => 1, "o_smilies_sig" => 1, "o_quickpost" => 1, "o_users_online" => 1, "o_show_dot" => 1, "o_gzip" => 1, "o_regs_allow" => 0, "o_maintenance" => 1, "p_sig_bbcode" => 1, "p_sig_img_tag" => 1); $query = $this->old_db->simple_select("config", "conf_name, conf_value", "conf_name IN('" . implode("','", array_keys($this->convert_settings)) . "')", array('limit_start' => $this->trackers['start_settings'], 'limit' => $import_session['settings_per_screen'])); while ($setting = $this->old_db->fetch_array($query)) { // punBB 1 values $name = $this->convert_settings[$setting['conf_name']]; $value = $setting['conf_value']; if ($setting['conf_name'] == "o_timeout_online") { $value = ceil($value / 60); } if ($setting['conf_name'] == "o_server_timezone") { $value = str_replace(".5", "", $value); } if ($setting['conf_name'] == "o_avatars_width") { $avatar_setting = $value . "x"; echo "done.<br />\n"; continue; } if ($setting['conf_name'] == "o_avatars_height") { $value = $avatar_setting . $value; unset($avatar_setting); } if ($setting['conf_name'] == "o_avatars_size") { $value = ceil($value / 1024); } if ($setting['conf_name'] == "o_regs_verify") { if ($value == 0) { $value = "randompass"; } else { $value = "verify"; } } if ($setting['conf_name'] == "o_quickpost") { if ($value == 0) { $value = 0; } else { $value = 1; } } if (($value == 0 || $value == 1) && isset($int_to_yes_no[$setting['conf_name']])) { $value = int_to_yes_no($value, $int_to_yes_no[$setting['conf_name']]); } $this->update_setting($name, $value); } }
function import() { global $import_session; $int_to_yes_no = array("allow_privmsg" => 1, "gzip_compress" => 1); $int_to_on_off = array("enable_confirm" => 1); $query = $this->old_db->simple_select("config", "config_name, config_value", "config_name IN('" . implode("','", array_keys($this->convert_settings)) . "')", array('limit_start' => $this->trackers['start_settings'], 'limit' => $import_session['settings_per_screen'])); while ($setting = $this->old_db->fetch_array($query)) { // phpBB 3 values $name = $this->convert_settings[$setting['config_name']]; $value = $setting['config_value']; if ($setting['config_name'] == "avatar_max_height") { $avatar_setting = "x" . $value; continue; } else { if ($setting['config_name'] == "avatar_max_width") { $value = $value . $avatar_setting; unset($avatar_setting); } } if ($setting['config_name'] == "avatar_filesize") { $value = ceil($value / 1024); } if (($value == 0 || $value == 1) && isset($int_to_yes_no[$setting['config_name']])) { $value = int_to_yes_no($value, $int_to_yes_no[$setting['config_name']]); } if (($value == 0 || $value == 1) && isset($int_to_on_off[$setting['config_name']])) { $value = int_to_on_off($value, $int_to_on_off[$setting['config_name']]); } if ($setting['config_name'] == 'search_type') { $value = "fulltext"; } if ($setting['config_name'] == 'board_timezone') { if (strpos($value, '-') === false && $value != 0) { $value = "+" . $value; } } if ($setting['config_name'] == "smtp_delivery" && $value == 1) { $value = "smtp"; } $this->update_setting($name, $value); } }
function import() { global $import_session; $int_to_yes_no = array("privmsg_disable" => 0); $query = $this->old_db->simple_select("config", "config_name, config_value", "config_name IN('" . implode("','", array_keys($this->convert_settings)) . "')", array('limit_start' => $this->trackers['start_settings'], 'limit' => $import_session['settings_per_screen'])); while ($setting = $this->old_db->fetch_array($query)) { // phpBB 2 values $name = $this->convert_settings[$setting['config_name']]; $value = $setting['config_value']; if ($setting['config_name'] == "avatar_max_height") { if (isset($avatar_width)) { $value = $avatar_width . "x" . $value; unset($avatar_width); } else { $avatar_height = $value; continue; } } if ($setting['config_name'] == "avatar_max_width") { if (isset($avatar_height)) { $value = $value . "x" . $avatar_height; unset($avatar_height); } else { $avatar_width = $value; continue; } } if ($setting['config_name'] == "avatar_filesize") { $value = ceil($value / 1024); } if (($value == 0 || $value == 1) && isset($int_to_yes_no[$setting['config_name']])) { $value = int_to_yes_no($value, $int_to_yes_no[$setting['config_name']]); } $this->update_setting($name, $value); } }
function import() { global $import_session; $settings = ""; $int_to_yes_no = array("addtemplatename" => 1, "allowregistration" => 0, "allowkeepbannedemail" => 1, "attachthumbs" => 1, "bbactive" => 0, "displayloggedin" => 1, "dstonoff" => 1, "enablememberlist" => 1, "enablepms" => 1, "gzipoutput" => 1, "nocacheheaders" => 1, "privallowbbcode" => 1, "privallowbbimagecode" => 1, "privallowhtml" => 1, "privallowsmilies" => 1, "reputationenable" => 1, "showbirthdays" => 1, "showdots" => 1, "showforumdescription" => 1, "showsimilarthreads" => 1, "usereferrer" => 1); $query = $this->old_db->simple_select("setting", "varname, value", "varname IN('" . implode("','", array_keys($this->convert_settings)) . "')", array('limit_start' => $this->trackers['start_settings'], 'limit' => $import_session['settings_per_screen'])); while ($setting = $this->old_db->fetch_array($query)) { // vBulletin 3.6 values $name = $this->convert_settings[$setting['varname']]; $value = $setting['value']; if ($setting['varname'] == "logip") { if ($value == 1) { $value = "hide"; } else { if ($value == 2) { $value = "show"; } else { $value = 0; } } } if ($setting['varname'] == "moderatenewmembers") { if ($setting['config_value'] == 1) { $value = "admin"; } else { $value = "verify"; } } if ($setting['varname'] == "WOLrefresh") { $value = ceil($value / 60); } if ($setting['varname'] == "showforumusers") { if ($value == 0) { $value = 0; } else { $value = 1; } } if ($setting['varname'] == "useheaderredirect") { if ($value == 0) { $value = 0; } else { $value = 1; } } if ($setting['varname'] == "showprivateforums") { if ($value == 0) { $value = 0; } else { $value = 1; } } if (($value == 0 || $value == 1) && isset($int_to_yes_no[$setting['varname']])) { $value = int_to_yes_no($value, $int_to_yes_no[$setting['varname']]); } $this->update_setting($name, $value); if ($setting['varname'] == "attachthumbssize") { $name = "attachthumbw"; $this->update_setting($name, $value); } } }
/** * Reverses an 1/0 integer * @param int Integer to be converted * @return string Correspondig no or yes */ function int_to_01($var) { return int_to_yes_no($var, 0); }