if (!$portalstatus) { $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('portalstatus', '0')"); } if (!$groupstatus) { $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('groupstatus', '0')"); } if (!$homestatus) { $db->query("REPLACE INTO {$tablepre}common_setting (skey, svalue) VALUES ('homestatus', '0')"); } $yearmonth = date('Ym_', time()); loginit($yearmonth . 'ratelog'); loginit($yearmonth . 'illegallog'); loginit($yearmonth . 'modslog'); loginit($yearmonth . 'cplog'); loginit($yearmonth . 'errorlog'); loginit($yearmonth . 'banlog'); dir_clear(ROOT_PATH . './data/template'); dir_clear(ROOT_PATH . './data/cache'); dir_clear(ROOT_PATH . './data/threadcache'); dir_clear(ROOT_PATH . './uc_client/data'); dir_clear(ROOT_PATH . './uc_client/data/cache'); foreach ($serialize_sql_setting as $k => $v) { $v = addslashes(serialize($v)); $db->query("REPLACE INTO {$tablepre}common_setting VALUES ('{$k}', '{$v}')"); } $query = $db->query("SELECT COUNT(*) FROM {$tablepre}common_member"); $totalmembers = $db->result($query, 0); $userstats = array('totalmembers' => $totalmembers, 'newsetuser' => $username); $ctype = 1; $data = addslashes(serialize($userstats)); $db->query("REPLACE INTO {$tablepre}common_syscache (cname, ctype, dateline, data) VALUES ('userstats', '{$ctype}', '" . time() . "', '{$data}')");
ins_footer(); runquery($sql); $backupdir = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . substr($timestamp, 0, 4)), 8, 6); @mkdir('dynamic/backup_' . $backupdir, 0777); $hosturl = 'http://' . $_SERVER['HTTP_HOST']; $php_self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $cmsurl = substr($php_self, 0, strrpos($php_self, '/')) . '/'; $authkey = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $dbhost . $dbuser . $dbpw . $dbname . $username . $password . $pconnect . substr($timestamp, 0, 6)), 8, 6) . random(10); $db->query("REPLACE INTO {$tblprefix}mconfigs (varname, value, cftype) VALUES ('authkey','{$authkey}','visit')"); $db->query("REPLACE INTO {$tblprefix}mconfigs (varname, value, cftype) VALUES ('hosturl','{$hosturl}','site')"); $db->query("REPLACE INTO {$tblprefix}mconfigs (varname, value, cftype) VALUES ('cmsurl','{$cmsurl}','site')"); $db->query("REPLACE INTO {$tblprefix}mconfigs (varname, value, cftype) VALUES ('backupdir','{$backupdir}','')"); $db->query("REPLACE INTO {$tblprefix}mconfigs (varname, value, cftype) VALUES ('dir_userfile','userfiles','upload')"); $db->query("REPLACE INTO {$tblprefix}members (mid,mname,isfounder,password,email,checked,regdate) VALUES ('1','{$username}','1','{$password}','{$email}','1','{$timestamp}');", 'SILENT'); $db->query("REPLACE INTO {$tblprefix}members_1 (mid) VALUES ('1')", 'SILENT'); $db->query("REPLACE INTO {$tblprefix}members_sub (mid) VALUES ('1')", 'SILENT'); dir_clear('./dynamic/records'); $yearmonth = date('Ym_', time()); loginit($yearmonth . 'adminlog'); loginit($yearmonth . 'badlogin'); loginit($yearmonth . 'currencylog'); cacheinit(); @touch(M_ROOT . $lockfile); @unlink(M_ROOT . 'index.htm'); //删除首页跳转文件 @unlink(M_ROOT . 'index.html'); //删除首页跳转文件 echo '<script type="text/javascript">document.getElementById("laststep").disabled = false; </script>' . "\r\n"; echo '<script type="text/javascript">document.getElementById("laststep").value = \'OK\'; </script>' . "\r\n"; echo '<iframe width="0" height="0" src="./install/inscache.php"></iframe>'; }
$db->query("DELETE FROM {$tablepre}admin"); $db->query("INSERT INTO {$tablepre}admin SET uid='{$uid}',adminid=1,sid='all'"); echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>\n"; echo " <hr noshade align=\"center\" width=\"100%\" size=\"1\">\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td><b><font color=\"#FF0000\">></font><font color=\"#000000\"> {$lang['init_file']}</font></b></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>\n"; loginit('adminlog'); loginit('errorlog'); if (@($fp = fopen($lockfile, 'w'))) { fwrite($fp, 'Cyask 3.2'); fclose($fp); } dir_clear(CYASK_ROOT . './askdata/templates'); ?> </td> </tr> <tr> <td> <hr noshade align="center" width="100%" size="1"> </td> </tr> <tr> <td align="center">
echo " <td>\n"; echo " <hr noshade align=\"center\" width=\"100%\" size=\"1\">\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td><b><font color=\"#FF0000\">></font><font color=\"#000000\"> {$lang['create_table']}</font></b></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>\n"; $extrasql = <<<EOT INSERT INTO bra_users (username,`password`,groupid) VALUES ('{$username}','{$brpswd}','9'); EOT; runquery($sql); runquery($extrasql); loginit('adminlog'); loginit('newsinfo'); dir_clear('./gamedata/bak'); //dir_clear('./gamedata/log'); //dir_clear('./gamedata/mapitem'); //dir_clear('./gamedata/shopitem'); dir_clear('./gamedata/templates'); echo $lang['init_game']; $adminmsg = setconfig($_POST['adminmsg']); $startmode = (int) $_POST['startmode']; $iplimit = (int) $_POST['iplimit']; if ($startmode == 1) { $starthour = 10; } elseif ($startmode == 2) { $starthour = 1; } else { $starthour = 0;
} $db->query("UPDATE {$tablepre}cron SET lastrun='0', nextrun='" . ($timestamp + 3600) . "'"); for ($i = 0; $i < 5; $i++) { showjsmessage('正在设置系统...成功!'); } for ($i = 0; $i < 5; $i++) { showjsmessage('正在导入区划数据...'); } install_districtdata(); for ($i = 0; $i < 5; $i++) { showjsmessage('正在导入区划数据...成功!'); } $yearmonth = date('Ym_', time()); loginit($yearmonth . 'illegallog'); loginit($yearmonth . 'cplog'); loginit($yearmonth . 'errorlog'); dir_clear(ROOT_PATH . './data/template'); dir_clear(ROOT_PATH . './data/cache'); foreach ($serialize_sql_setting as $k => $v) { $v = addslashes(serialize($v)); $db->query("REPLACE INTO {$tablepre}setting VALUES ('{$k}', '{$v}')"); } if ($runqueryerror) { showjsmessage('<span class="red">' . $lang['error_quit_msg'] . '</span>'); exit; } showjsmessage('系统数据安装成功!请点击下一步设置管理员</span>'); echo '<script type="text/javascript">function setlaststep() {document.getElementById("laststep").disabled=false;}</script><script type="text/javascript">setTimeout(function(){window.location=\'index.php?step=4\'}, 30000);setlaststep();</script>' . "\r\n"; show_footer(); } show_form($form_db_init_items, $error_msg);