Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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);
     }
 }