$steps ? $steps : $step;
/*
+-------------------------------------------
+ template
+-------------------------------------------
*/
$tpl_header = ''.\n;
$tpl_header .= ''.\n;
$tpl_header .= '
'.\n;
$tpl_header .= ''.\n;
$tpl_header .= ''.$tplang['title'].''.\n;
$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'])?>
=$tplang['step_last']?>
=$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')?>
=$tplang['step_last']?>
=$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()?>
foreach ($conf as $key=>$val){?>
=$tplang['step4_'.$key]?>
}?>
foreach ($urlconf as $key=>$val){?>
=$tplang['step4_'.$key]?>
}?>
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']?>
=$tplang['step_last']?>
=$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']?>
=$tplang['step_last']?>
=$tplang['step_next']?>
}
}
echo $tpl_footer;
}
}
elseif ($step >= '8' && $step {
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']?>
=$tplang['step_last']?>
=$tplang['step_next']?>
}
}
echo $tpl_footer;
}
}
elseif ($step == '15')
{
echo $tpl_header;
?>
=$tplang['step15_u']?>
=$tplang['step15_p']?>
=$tplang['step15_s']?>
=$tplang['step15_s1']?>
=$tplang['step15_s2']?>
=$tplang['step15_e']?>
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']?>
=$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;
}
}
?>
