【www.gdgbn.com--php安装】
/*
+-------------------------------------------
|
| Technology of WeSpace Software
| ========================================
| Powered by WeSpace
| (c) 2006 wane.net
| F_Space Ver3.x
| ========================================
| Site: http://www.wesofts.com
|
+-------------------------------------------
| Autohr : wsfuyibing
| Email : websearch@163.com
| MSN : websearch@163.com
+-------------------------------------------
*/
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
define("IN_www.111cn.net",true);
define("IN_LICENSED",true);
define("WANE_ROOT","../");
$timestamp = time();
$configfile = "../config.inc.php";
/*
+-------------------------------------------
+ Check PHP version
+-------------------------------------------
*/
if (@phpversion() < "4.1.0")
{
$_COOKIE = &$HTTP_COOKIE_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
$_FILES = &$HTTP_POST_FILES;
$_GET = &$HTTP_GET_VARS;
$_POST = &$HTTP_POST_VARS;
}
/*
+-------------------------------------------
+ Language
+-------------------------------------------
*/
$lang = in_array($_GET["lang"],array("gbk","big5","utf-8-gbk","utf-8-big5")) ? $_GET["lang"] : "utf-8-gbk";
$charset = substr($lang ,0,5);
if (!file_exists("./".$lang."/language.php"))
{
exit("Can not load language file . ");
}
else
{
require_once "./".$lang."/language.php";
}
/*
+-------------------------------------------
+ Step
+-------------------------------------------
*/
$step = file_exists("../upload/install.lock") ? "0" : ($_GET["step"] ? $_GET["step"] : "1");
$steps = 16;
$step = $step > $steps ? $steps : $step;
/*
+-------------------------------------------
+ Template
+-------------------------------------------
*/
$tpl_header = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"."\n";
$tpl_header .= "http://www.w3.org/1999/xhtml">"."\n";
$tpl_header .= "
$tpl_header .= ""."\n";
$tpl_header .= "
$tpl_header .= ""."\n";
$tpl_header .= ""."\n";
$tpl_header .= ""."\n";
$tpl_header .= ""."\n\t".""."\n\t\t"."".$tplang["title"].""."\n\t\t"."".($step > 1 ? $tplang["lang_".$lang]."
" : "").$tplang["step_name"].": ".$tplang["step".$step]."(".$tplang["step_cur"].$step.$tplang["step_unit"]."/".$tplang["step_total"].$steps.$tplang["step_unit"].")"."\n\t".""."\n".""."\n";
$tpl_footer = ""."\n\t".""."\n\t\t"."".$tplang["footer"].""."\n\t".""."\n".""."\n".""."\n";
$tpl_footer .= "";
/*
+-------------------------------------------
+ Start Install
+-------------------------------------------
*/
if (file_exists("../upload/install.lock"))
{
echo $tpl_header;
?>
=$tplang["step0_1"]?>
echo $tpl_footer;
}
elseif ($step == "1")
{
echo $tpl_header;
?>
=$tplang["lang_gbk"]?>
=$tplang["lang_big5"]?>
=$tplang["lang_utf-8-gbk"]?>
=$tplang["lang_utf-8-big5"]?>
echo $tpl_footer;
}
elseif ($step == "2")
{
echo $tpl_header;
?>
=nl2br($tplang["license"])?>
&step==$step-1?>">=$tplang["step_last"]?>
&step==$step+1?>">=$tplang["step_next"]?>
echo $tpl_footer;
}
elseif ($step == "3")
{
function filewrite()
{
return (file_exists("../config.inc.php") && is_writable("../config.inc.php")) ? "".$GLOBALS["tplang"]["yes"]."" : "".$GLOBALS["tplang"]["no"]."";
}
function dirwrite($folder)
{
$filename = "../".$folder."/index.htm";
$fp = @fopen($filename,"w+");
if (!$fp)
{
return "".$GLOBALS["tplang"]["no"]."";
}
else
{
@fwrite($fp," ");
fclose($fp);
return "".$GLOBALS["tplang"]["yes"]."";
}
}
echo $tpl_header;
?>
=$tplang["step3_8"]?> =filewrite()?>
- =$tplang["step3_0"]?>
=$tplang["step3_1"]?> =dirwrite("upload")?>
=$tplang["step3_2"]?> =dirwrite("upload/cards")?>
=$tplang["step3_3"]?> =dirwrite("upload/gifts")?>
=$tplang["step3_4"]?> =dirwrite("upload/group")?>
=$tplang["step3_5"]?> =dirwrite("wespacedata")?>
=$tplang["step3_6"]?> =dirwrite("wespacedata/cache")?>
=$tplang["step3_7"]?> =dirwrite("wespacedata/template")?>
&step==$step-1?>">=$tplang["step_last"]?>
&step==$step+1?>">=$tplang["step_next"]?>
echo $tpl_footer;
}
elseif ($step == "4")
{
function filewrite()
{
return (file_exists("../config.inc.php") && is_writable("../config.inc.php")) ? "".$GLOBALS["tplang"]["yes"]."" : "".$GLOBALS["tplang"]["no"]."";
}
if (!file_exists($configfile))
{
echo $tpl_header;
?>
=$tplang["step4_0"]?>
echo $tpl_footer;
}
else
{
require_once $configfile;
echo $tpl_header;
?>
=$tplang["step3_8"]?> =filewrite()?>
echo $tpl_footer;
}
}
elseif ($step == "5")
{
require_once WANE_ROOT."install/query/5.php";
header("location:install.php?lang={$lang}&step=6");
}
elseif ($step == "6")
{
if (!file_exists($configfile))
{
echo $tpl_header;
?>
=$tplang["step4_0"]?>
echo $tpl_footer;
}
else
{
require_once $configfile;
$conn = @mysql_connect($conf["dbserver"],$conf["dbuser"],$conf["dbpass"]);
echo $tpl_header;
if (!$conn)
{
?>
=$tplang["step6_1_0"]?>
}
else
{
?>
=$tplang["step6_1_1"]?>
$sels = @mysql_select_db($conf["dbname"],$conn);
if (!$sels)
{
?>
=$tplang["step6_2_0"]?>
}
else
{
?>
=$tplang["step6_2_1"]?>
&step==$step-2?>">=$tplang["step_last"]?>
&step==$step+1?>">=$tplang["step_next"]?>
}
}
echo $tpl_footer;
}
}
elseif ($step == "7")
{
if (!file_exists($configfile))
{
echo $tpl_header;
?>
=$tplang["step4_0"]?>
echo $tpl_footer;
}
else
{
echo $tpl_header;
$sqlfile = "./sql/struct.php";
if (!file_exists($sqlfile))
{
?>
=$tplang["step7_0_0"]?> (=$sqlfile?>)
}
else
{
$fp = @fopen($sqlfile,"r");
if (!$fp)
{
?>
=$tplang["step7_0_1"]?> (=$sqlfile?>)
}
else
{
require_once WANE_ROOT."install/query/7.php";
?>
=$tplang["step7_1"]?>
&step==$step-1?>">=$tplang["step_last"]?>
&step==$step+1?>">=$tplang["step_next"]?>
}
}
echo $tpl_footer;
}
}
elseif ($step >= "8" && $step <= "14")
{
if (!file_exists($configfile))
{
echo $tpl_header;
?>
=$tplang["step4_0"]?>
echo $tpl_footer;
}
else
{
echo $tpl_header;
$sqlfile = "./".$lang."/data".$step.".php";
if (!file_exists($sqlfile))
{
?>
=$tplang["step7_0_0"]?> (=$sqlfile?>)
}
else
{
$fp = @fopen($sqlfile,"r");
if (!$fp)
{
?>
=$tplang["step7_0_1"]?> (=$sqlfile?>)
}
else
{
require_once WANE_ROOT."install/query/8-14.php";
?>
=$tplang["step14_1"]?>
&step==$step-1?>">=$tplang["step_last"]?>
&step==$step+1?>">=$tplang["step_next"]?>
}
}
echo $tpl_footer;
}
}
elseif ($step == "15")
{
echo $tpl_header;
?>
echo $tpl_footer;
}
else
{
$configsubmit = trim($_POST["configsubmit"]);
if ($step == "16" && $configsubmit)
{
$magic = @get_magic_quotes_gpc();
function cutempty($varchar)
{
global $magic,$_POST;
$varchar = $magic ? stripslashes($_POST[$varchar]) : $_POST[$varchar];
return addslashes(htmlspecialchars(str_replace(array(" ","\n","\t","\r"),array("","","",""),$varchar)));
}
$username = substr(cutempty("username"),0,15);
$password = cutempty("password");
$email = cutempty("email");
$sex = cutempty("sex");
if (!$username || !$password || !$email || !$sex)
{
echo $tpl_header;
?>
=$tplang["step15_1_0"]?>
&step==$step-1?>">=$tplang["step_last"]?>
echo $tpl_footer;
}
else
{
require_once WANE_ROOT."install/query/16.php";
echo $tpl_header;
?>
=$tplang["step16_1"]?>
=$tplang["step16_2"]?>
=$tplang["step15_u"]?>:=$username?>
=$tplang["step15_p"]?>:=$password?>
=$tplang["step15_s"]?>:=$sex=="1" ? $tplang["step15_s1"] : $tplang["step15_s2"]?>
=$tplang["step15_e"]?>:=$email?>
echo $tpl_footer;
}
}
else
{
echo $tpl_header;
?>
=$tplang["step16_1"]?>
=$tplang["step16_2"]?>
echo $tpl_footer;
}
}
?>