$_v) ${$_k} = RunMagicQuotes($_v); } require_once(DEDEINC.'/common.func.php'); if(file_exists(INSLOCKFILE)) { exit(" 绋嬪簭宸茶繍琛屽畨瑁咃紝濡傛灉浣犵‘瀹氳閲嶆柊瀹夎锛岃鍏堜粠FTP涓垹闄?install/install_lock.txt锛?); } if(empty($step)) { $step = 1; } /*------------------------ 浣跨敤鍗忚涔? function _1_Agreement() ------------------------*/ if($step==1) { include('./templates/step-1.html'); exit(); } /*------------------------ 鐜娴嬭瘯 function _2_TestEnv() ------------------------*/ else if($step==2) { $phpv = phpversion(); $sp_os = PHP_OS; $sp_gd = gdversion(); $sp_server = $_SERVER['SERVER_SOFTWARE']; $sp_host = (empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_HOST'] : $_SERVER['REMOTE_ADDR']); $sp_name = $_SERVER['SERVER_NAME']; $sp_max_execution_time = ini_get('max_execution_time'); $sp_allow_reference = (ini_get('allow_call_time_pass_reference') ? '[鈭歖On' : '[脳]Off'); $sp_allow_url_fopen = (ini_get('allow_url_fopen') ? '[鈭歖On' : '[脳]Off'); $sp_safe_mode = (ini_get('safe_mode') ? '[脳]On' : '[鈭歖Off'); $sp_gd = ($sp_gd>0 ? '[鈭歖On' : '[脳]Off'); $sp_mysql = (function_exists('mysql_connect') ? '[鈭歖On' : '[脳]Off'); if($sp_mysql=='[脳]Off') $sp_mysql_err = TRUE; else $sp_mysql_err = FALSE; $sp_testdirs = array( '/', '/plus/*', '/dede/*', '/data/*', '/a/*', '/install', '/special', '/uploads/*' ); include('./templates/step-2.html'); exit(); } /*------------------------ 璁剧疆鍙傛暟 function _3_WriteSeting() ------------------------*/ else if($step==3) { if(!empty($_SERVER['REQUEST_URI'])) $scriptName = $_SERVER['REQUEST_URI']; else $scriptName = $_SERVER['PHP_SELF']; $basepath = preg_replace("#\/install(.*)$#i", '', $scriptName); if(!empty($_SERVER['HTTP_HOST'])) $baseurl = 'http://'.$_SERVER['HTTP_HOST']; else $baseurl = "http://".$_SERVER['SERVER_NAME']; $chars='abcdefghigklmnopqrstuvwxwyABCDEFGHIGKLMNOPQRSTUVWXWY0123456789'; $rnd_cookieEncode=''; $length = rand(28,32); $max = strlen($chars) - 1; for($i = 0; $i < $length; $i++) { $rnd_cookieEncode .= $chars[mt_rand(0, $max)]; } $isdemosign = 0; if(file_exists(INSTALL_DEMO_NAME) && file_get_contents(INSTALL_DEMO_NAME)) $isdemosign = 1; $module_local = DEDEDATA.'/module/'; include('./templates/step-3.html'); exit(); } /*------------------------ 鏅氬畨瑁? function _4_Setup() ------------------------*/ else if($step==4) { if ( $dbtype == 'sqlite' ) { $db = new SQLite3(DEDEDATA.'/'.$dbname.'.db'); } else { $dbtype = 'mysql'; $conn = mysql_connect($dbhost,$dbuser,$dbpwd) or die(""); mysql_query("CREATE DATABASE IF NOT EXISTS `".$dbname."`;",$conn); mysql_select_db($dbname, $conn) or die(""); //鑾峰緱鏁版嵁搴撶増鏈俊鎭? $rs = mysql_query("SELECT VERSION();",$conn); $row = mysql_fetch_array($rs); $mysqlVersions = explode('.',trim($row[0])); $mysqlVersion = $mysqlVersions[0].".".$mysqlVersions[1]; mysql_query("SET NAMES '$dblang',character_set_client=binary,sql_mode='';",$conn); } $fp = fopen(dirname(__FILE__)."/common.inc.php","r"); $configStr1 = fread($fp,filesize(dirname(__FILE__)."/common.inc.php")); fclose($fp); $fp = fopen(dirname(__FILE__)."/config.cache.inc.php","r"); $configStr2 = fread($fp,filesize(dirname(__FILE__)."/config.cache.inc.php")); fclose($fp); //common.inc.php $configStr1 = str_replace("~dbtype~",$dbtype,$configStr1); $configStr1 = str_replace("~dbhost~",$dbhost,$configStr1); $configStr1 = str_replace("~dbname~",$dbname,$configStr1); $configStr1 = str_replace("~dbuser~",$dbuser,$configStr1); $configStr1 = str_replace("~dbpwd~",$dbpwd,$configStr1); $configStr1 = str_replace("~dbprefix~",$dbprefix,$configStr1); $configStr1 = str_replace("~dblang~",$dblang,$configStr1); @chmod(DEDEDATA,0777); $fp = fopen(DEDEDATA."/common.inc.php","w") or die(""); fwrite($fp,$configStr1); fclose($fp); //config.cache.inc.php $cmspath = trim(preg_replace("#\/{1,}#", '/', $cmspath)); if($cmspath!='' && !preg_match("#^\/#", $cmspath)) $cmspath = '/'.$cmspath; if($cmspath=='') $indexUrl = '/'; else $indexUrl = $cmspath; $configStr2 = str_replace("~baseurl~",$baseurl,$configStr2); $configStr2 = str_replace("~basepath~",$cmspath,$configStr2); $configStr2 = str_replace("~indexurl~",$indexUrl,$configStr2); $configStr2 = str_replace("~cookieEncode~",$cookieencode,$configStr2); $configStr2 = str_replace("~webname~",$webname,$configStr2); $configStr2 = str_replace("~adminmail~",$adminmail,$configStr2); $fp = fopen(DEDEDATA.'/config.cache.inc.php','w'); fwrite($fp,$configStr2); fclose($fp); $fp = fopen(DEDEDATA.'/config.cache.bak.php','w'); fwrite($fp,$configStr2); fclose($fp); if($mysqlVersion >= 4.1) { $sql4tmp = "ENGINE=MyISAM DEFAULT CHARSET=".$dblang; } //鍒涘缓鏁版嵁琛? $query = ''; $fp = fopen(dirname(__FILE__).'/sql-dftables.txt','r'); while(!feof($fp)) { $line = rtrim(fgets($fp,1024)); if(preg_match("#;$#", $line)) { $query .= $line."\n"; $query = str_replace('#@__',$dbprefix,$query); if ( $dbtype == 'sqlite' ) { $query = preg_replace('/character set (.*?) /i','',$query); $query = str_replace('unsigned','',$query); $query = str_replace('TYPE=MyISAM','',$query); $query = preg_replace ('/TINYINT\(([\d]+)\)/i','INTEGER',$query); $query = preg_replace ('/mediumint\(([\d]+)\)/i','INTEGER',$query); $query = preg_replace ('/smallint\(([\d]+)\)/i','INTEGER',$query); $query = preg_replace('/int\(([\d]+)\)/i','INTEGER',$query); $query = preg_replace('/auto_increment/i','PRIMARY KEY AUTOINCREMENT',$query); $query = preg_replace('/, KEY(.*?)MyISAM;/','',$query); $query = preg_replace('/, KEY(.*?);/',');',$query); $query = preg_replace('/, UNIQUE KEY(.*?);/',');',$query); $query = preg_replace('/set\(([^\)]*?)\)/','varchar',$query); $query = preg_replace('/enum\(([^\)]*?)\)/','varchar',$query); if ( preg_match("/PRIMARY KEY AUTOINCREMENT/",$query) ) { $query = preg_replace('/,([\t\s ]+)PRIMARY KEY \(`([0-9a-zA-Z]+)`\)/i','',$query); $query = str_replace(', PRIMARY KEY (`id`)','',$query); } $db->exec($query); } else { if($mysqlVersion < 4.1) { $rs = mysql_query($query,$conn); } else { if(preg_match('#CREATE#i', $query)) { $rs = mysql_query(preg_replace("#TYPE=MyISAM#i",$sql4tmp,$query),$conn); } else { $rs = mysql_query($query,$conn); } } } $query=''; } else if(!preg_match("#^(\/\/|--)#", $line)) { $query .= $line; } } fclose($fp); //瀵煎叆榛樿鏁版嵁 $query = ''; $fp = fopen(dirname(__FILE__).'/sql-dfdata.txt','r'); while(!feof($fp)) { $line = rtrim(fgets($fp, 1024)); if(preg_match("#;$#", $line)) { if ( $dbtype == 'sqlite' ) { $query .= $line; $query = str_replace('#@__',$dbprefix,$query); $query = str_replace("\'","\"",$query); $db->exec($query); } else { $query .= $line; $query = str_replace('#@__',$dbprefix,$query); if($mysqlVersion < 4.1) $rs = mysql_query($query,$conn); else $rs = mysql_query(str_replace('#~lang~#',$dblang,$query),$conn); } $query=''; } else if(!preg_match("#^(\/\/|--)#", $line)) { $query .= $line; } } fclose($fp); //鏇存柊閰嶇疆 $cquery = "Update `{$dbprefix}sysconfig` set value='{$baseurl}' where varname='cfg_basehost';"; $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); $cquery = "Update `{$dbprefix}sysconfig` set value='{$cmspath}' where varname='cfg_cmspath';"; $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); $cquery = "Update `{$dbprefix}sysconfig` set value='{$indexUrl}' where varname='cfg_indexurl';"; $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); $cquery = "Update `{$dbprefix}sysconfig` set value='{$cookieencode}' where varname='cfg_cookie_encode';"; $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); $cquery = "Update `{$dbprefix}sysconfig` set value='{$webname}' where varname='cfg_webname';"; $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); $cquery = "Update `{$dbprefix}sysconfig` set value='{$adminmail}' where varname='cfg_adminemail';"; $dbtype == 'sqlite'? $db->exec($cquery) : mysql_query($cquery,$conn); //澧炲姞绠$悊鍛樺笎鍙? $adminquery = "INSERT INTO `{$dbprefix}admin` VALUES (1, 10, '$adminuser', '".substr(md5($adminpwd),5,20)."', 'admin', '', '', 0, '".time()."', '127.0.0.1');"; $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); //鍏宠繛鍓嶅彴浼氬憳甯愬彿 $adminquery = "INSERT INTO `{$dbprefix}member` (`mid`,`mtype`,`userid`,`pwd`,`uname`,`sex`,`rank`,`money`,`email`, `scores` ,`matt` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` ) VALUES ('1','涓汉','$adminuser','".md5($adminpwd)."','$adminuser','鐢?,'100','0','','10000','10','','0','','".time()."','','0',''); "; $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); $adminquery = "INSERT INTO `{$dbprefix}member_person` (`mid`,`onlynet`,`sex`,`uname`,`qq`,`msn`,`tel`,`mobile`,`place`,`oldplace`,`birthday`,`star`, `income` , `education` , `height` , `bodytype` , `blood` , `vocation` , `smoke` , `marital` , `house` ,`drink` , `datingtype` , `language` , `nature` , `lovemsg` , `address`,`uptime`) VALUES ('1', '1', '鐢?, '{$adminuser}', '', '', '', '', '0', '0','1980-01-01', '1', '0', '0', '160', '0', '0', '0', '0', '0', '0','0', '0', '', '', '', '','0'); "; $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); $adminquery = "INSERT INTO `{$dbprefix}member_tj` (`mid`,`article`,`album`,`archives`,`homecount`,`pagecount`,`feedback`,`friend`,`stow`) VALUES ('1','0','0','0','0','0','0','0','0'); "; $dbtype == 'sqlite'? $db->exec($adminquery): mysql_query($adminquery,$conn); $adminquery = "Insert Into `{$dbprefix}member_space`(`mid` ,`pagesize` ,`matt` ,`spacename` ,`spacelogo` ,`spacestyle`, `sign` ,`spacenews`) Values('1','10','0','{$adminuser}鐨勭┖闂?,'','person','',''); "; $dbtype == 'sqlite'? $db->exec($adminquery) : mysql_query($adminquery,$conn); //瀹夎浣撻獙鏁版嵁 if($installdemo == 1) { if($setupsql = file_get_contents(INSTALL_DEMO_NAME)) { $setupsql = preg_replace("#ENGINE=MyISAM#i", 'TYPE=MyISAM', $setupsql); $sql41tmp = 'ENGINE=MyISAM DEFAULT CHARSET='.$cfg_db_language; if($mysql_version >= 4.1) { $setupsql = preg_replace("#TYPE=MyISAM#i", $sql41tmp, $setupsql); } $setupsql = preg_replace("#_ROOTURL_#i", $rooturl, $setupsql); $setupsql = preg_replace("#[\r\n]{1,}#", "\n", $setupsql); $setupsql = preg_replace('/#@__/i',$dbprefix,$setupsql); $sqls = preg_split("#;[ \t]{0,}\n#", $setupsql); foreach($sqls as $sql) { if(trim($sql)!='') mysql_query($sql,$conn); } // 鏇存柊鏍忕洰缂撳瓨 UpDateCatCache(); } else { die("娌℃湁浣撻獙鏁版嵁鍖呮枃浠?璇锋鏌ユ槸鍚︿笅杞?"); } } //涓嶅畨瑁呬换浣曞彲閫夋ā鍧? if(!isset($modules) || !is_array($modules)) { //閿佸畾瀹夎绋嬪簭 $fp = fopen($insLockfile,'w'); fwrite($fp,'ok'); fclose($fp); include('./templates/step-5.html'); exit(); } else { $module = join(',',$modules); $fp = fopen($moduleCacheFile,'w'); fwrite($fp,'<'.'?php'."\r\n"); fwrite($fp,'$selModule = "'.$module.'"; '."\r\n"); fwrite($fp,'?'.'>'); //濡傛灉涓嶈兘鍐欏叆缂撳瓨鏂囦欢锛岄鍑烘ā鍧楀畨瑁? if(!$fp) { //閿佸畾瀹夎绋嬪簭 $fp = fopen($insLockfile,'w'); fwrite($fp,'ok'); fclose($fp); $errmsg = "鐢变簬鏃犳硶鍐欏叆妯″潡缂撳瓨锛屽畨瑁呭彲閫夋ā鍧楀け璐ワ紝璇风櫥褰曞悗鍦ㄦā鍧楃鐞嗗瀹夎銆?/font>"; include('./templates/step-5.html'); exit(); } fclose($fp); include('./templates/step-4.html'); exit(); } exit(); } /*------------------------ 瀹夎鍙夋ā鍧? function _5_SetupModule() ------------------------*/ else if($step==5) { header("location:module-install.php"); exit(); } /*------------------------ 妫娴嬫暟鎹簱鏄惁鏈夋晥 function _10_TestDbPwd() ------------------------*/ else if($step==10) { header("Pragma:no-cache\r\n"); header("Cache-Control:no-cache\r\n"); header("Expires:0\r\n"); $conn = @mysql_connect($dbhost,$dbuser,$dbpwd); if($conn) { if(empty($dbname)){ echo "淇℃伅姝g‘"; }else{ $info = mysql_select_db($dbname,$conn)?"鏁版嵁搴撳凡缁忓瓨鍦紝绯荤粺灏嗚鐩栨暟鎹簱":"鏁版嵁搴撲笉瀛樺湪,绯荤粺灏嗚嚜鍔ㄥ垱寤?/font>"; echo $info; } } else { echo "鏁版嵁搴撹繛鎺ュけ璐ワ紒"; } @mysql_close($conn); exit(); } else if($step==11) { require_once('../data/admin/config_update.php'); $rmurl = UPDATEHOST."dedecms/demodata.{$s_lang}.txt"; $sql_content = file_get_contents($rmurl); $fp = fopen(INSTALL_DEMO_NAME,'w'); if(fwrite($fp,$sql_content)) echo '  [鈭歖 瀛樺湪(鎮ㄥ彲浠ラ夋嫨瀹夎杩涜浣撻獙)'; else echo '  [脳] 杩滅▼鑾峰彇澶辫触'; unset($sql_content); fclose($fp); exit(); } 明升88体育 仁寿县| 灵台县| 丰县| 常州市| 瑞金市| 临清市| 长白| 元谋县| 育儿| 巴林左旗| 长垣县| 百色市| 永平县| 柏乡县| 青田县| 罗甸县| 永仁县| 柞水县| 阿鲁科尔沁旗| 洪雅县| 彭泽县| 枣庄市| 宁安市| 萨嘎县| 白山市| 宜良县| 陕西省| 仲巴县| 茶陵县| 肇庆市| 门源| 庄浪县| 靖西县| 秀山| 通州市| 夹江县| 牡丹江市| 贡山| 加查县| 潼南县| 郴州市| 巴中市| 聂拉木县| 河池市| 山西省| 元阳县| 五常市| 青冈县| 曲阜市| 盐山县| 晋江市| 诸暨市| 大城县| 牙克石市| 广平县| 盐亭县| 罗源县| 双江| 灌云县| 溧水县| 突泉县| 广南县| 民县| 虞城县| 双鸭山市| 衢州市| 会理县| 阳新县| 安泽县| 精河县| 新安县| 搜索| 修武县| 上高县| 祥云县| 大城县| 定结县| 兴国县| 柘城县| 邯郸县| 大荔县| 大姚县| 铁力市| 大新县| 章丘市| 新乡市| 临桂县| 涞水县| 庆城县| 双峰县| 新绛县| 南京市| 饶阳县| 大邑县| 灌云县| 陇川县| 瑞丽市| 德安县| 苍山县| 汉川市| 越西县| 荣昌县| 西乌珠穆沁旗| 普陀区| 民勤县| 临桂县| 房产| 新巴尔虎右旗| 屯留县| 洞头县| 长沙市| 淄博市| 东阿县| 庄浪县| 定陶县| 广州市| 离岛区| 保山市| 兰溪市| 凤山市| 陕西省| 军事| 蒙自县| 米脂县| 扬中市| 射洪县| 常德市| 惠来县| 安达市| 万州区| 海丰县| 韶山市| 江安县| 高要市| 肥西县| 晋江市| 米林县|