📄 install.php
字号:
<?php/***************************************** install.php - installation of VITCIE Version: 1.3(simplied chinese) Author: tracemouse Copyright: wwww.vitci.com Last Modified: 2004/04/20*****************************************/error_reporting(7);set_magic_quotes_runtime(0);$action = ($HTTP_POST_VARS['action']) ? $HTTP_POST_VARS['action'] : $HTTP_GET_VARS['action'];$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'] ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];if (function_exists('set_time_limit') == 1 && @ini_get('safe_mode') == 0) { @set_time_limit(1000);}@include './config.php';header('Content-Type: text/html; charset=gb2312');$version = '1.3 <b style=\'color: #FF9900\'>beta 1</b>';function runquery($sql) { global $tablepre, $db; $sql = str_replace("\r", "\n", str_replace(' vte_', ' '.$tablepre, $sql)); $ret = array(); $num = 0; foreach(explode(";\n", trim($sql)) as $query) { $queries = explode("\n", trim($query)); foreach($queries as $query) { $ret[$num] .= $query[0] == '#' ? NULL : $query; } $num++; } unset($sql); foreach($ret as $query) { $query = trim($query); if($query) { if(substr($query, 0, 12) == 'CREATE TABLE') { $name = preg_replace("/CREATE TABLE ([a-z0-9_]+) .*/is", "\\1", $query); echo '<li>建立数据表 '.$name.' ... <font color="#0000EE">成功</font></li>'; } $db->query($query); } }}function dir_writeable($dir) { if(!is_dir($dir)) { @mkdir($dir, 0777); } if(is_dir($dir)) { if($fp = @fopen("$dir/test.test", 'w')) { @fclose($fp); @unlink("$dir/test.test"); $writeable = 1; } else { $writeable = 0; } } return $writeable;}function dir_clear($dir) { $directory = dir($dir); while($entry = $directory->read()) { $filename = $dir.'/'.$entry; if(is_file($filename)) { @unlink($filename); } } $directory->close();}function showmessage($message){ echo "<br><table id=warning cellspacing=0 cellpadding=8 border=0 width=80% align=center>"; echo "<tr bgcolor=#FFE0E0><td>"; echo "<font color=red size=2><b>警告!</b></font><br><br>"; echo "<b>您的安装出现以下错误:</b><br>请检查原因/修改后,重新再试...<br><br>"; echo "<font color=red><b>".$message."</b></font>"; echo "</td></tr></table>"; exit;}?><html><head><title>VITCIE Installation Wizard</title><style type="text/css">a:link,a:visited { text-decoration: none; color: #003366 }a:hover { text-decoration: underline; }a.sort:link { color: #003366; TEXT-DECORATION: underline }a.sort:visited { color: #003366; TEXT-DECORATION: underline }a.sort:hover { text-decoration: underline; }a.nav:link,a.nav:visited { text-decoration: none; color: #003366 }a.nav:hover { text-decoration: underline; }#warning { BORDER:1px solid #FF0000; BACKGROUND-COLOR: #E4EAF2 }#singleframe { BORDER:1px solid #000000; border-collapse: collapse }body { scrollbar-base-color: #E4EAF2; scrollbar-arrow-color: #ffffff; font-size: 12px; background-color:#ffffff }table { font-family: Verdana,Arial,Helvetica,sans-serif;; color: #000000; font-size: 12px }textarea,input,object { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 12px;; color: #000000; font-weight: normal; background-color: #E4EAF2 }select { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 12px;; color: #000000; font-weight: normal; background-color: #E4EAF2 }.navtd { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 12px;; color: #ffffff; text-decoration: none }.header { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 11px; color: #ffffff; font-weight: BOLD; background-image:url("./install/images/header_bg.gif") }.category { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 11px; color: #3A4F6C; font-weight: BOLD; background-image:url("./install/images/tile_sub.gif") }.multi { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 11px; color: #003366; }.smalltxt { font-family: Verdana,Arial,Helvetica,sans-serif;;font-size: 11px; }.mediumtxt { font-family: Verdana,Arial,Helvetica,sans-serif;; font-size: 12px; color: sdf }.bold { font-weight: bold}.lineheight { line-height=18px}</style></head><body leftmargin="0" rightmargin="0" topmargin="0"><table width="100%" border="0" cellspacing="0" cellpadding="0" background="./install/images/install_hd_bg.gif"><tr><td width="40%" valign="top"><img border="0" src="./install/images/install_logo.gif"></td><td width="60%"><img border="0" src="./install/images/install_hd_bg.gif"></td></tr></table><?if(!$action) { $curr_php_version = PHP_VERSION; if(@ini_get(file_uploads)) { $max_size = @ini_get(upload_max_filesize); $msg = "您可以上传尺寸在 $max_size 以下的附件文件.\t"; } else { $msg = "<li><font color=\"#FF0000\">由于服务器屏蔽, 您无法使用附件功能.</font></li>"; } if(dir_writeable('./templates')) { $curr_tpl_writeable = '可写'; } else { $curr_tpl_writeable = '不可写'; $msg .= "<li><font color=\"#FF0000\">模板 ./templates 目录属性非 777 或无法写入, 无法使用在线编辑模板和风格导入.</font></li>"; } if(!dir_writeable('./tempdata/')) { $msg .="<li><font color=\"#FF0000\">数据 ./tempdata 目录属性非 777 或无法写入, 无法安装 VITCIE !</font></li>"; } if(!dir_writeable('./tempdata/backup/')) { $msg .="<li><font color=\"#FF0000\">数据 ./tempdata/backup 目录属性非 777 或无法写入, 无法使用数据备份功能.</font></li>"; } if(!dir_writeable('./tempdata/templates/')) { $msg .="<li><font color=\"#FF0000\">模板 ./tempdata/templates 目录属性非 777 或无法写入, 无法安装 VITCIE !</font></li>"; }?><br><table width="95%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center"> <tr> <td> <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <b>欢迎使用 VITCIE 安装向导,安装前请仔细阅读 licence.txt, 在您确定可以完全满足授权协议之后才能开始安装。</td> </tr> <tr> <td><br><b>如果您的服务器是LINUX/UNIX,请在安装之前必须确认完成以下操作:</b> <br> <br> <li>将 ./config.php 文件的权限设置为 777</li> <li>将 ./tempdata 目录的权限设置为 777</li> <li>将 ./tempdata/templates 目录的权限设置为 777</li> <li>将 ./tempdata/backup 目录的权限设置为 777</li> <br> <br> <b>您也需要知道以下信息(可以从您的主机提供商处获得):</b> <br> <br> <li>你的MySQL数据库名称</li> <li>你的MySQL用户名</li> <li>你的MySQL密码</li> <li>你的MySQL主机(通常是localhost)</li> <br> <br> <b>您的服务器检查:</b> <br> <br> <li>服务器环境为 <?=PHP_OS?></li> <li>PHP 版本 <?=$curr_php_version?></li> <?=$msg?> <br> <br> <b>请注意:使用这个安装程序时,如果你使用已有的数据库,则将删除该数据库中的已安装的 VITCIE! <br><br> </td> </tr> <tr> <td align="center"> <br> <form method="post" action="<?=$PHP_SELF?>"> <input type="hidden" name="action" value="config"> <input type="submit" name="submit" value="现在开始安装" style="height: 25"> </form> </td> </tr> </table> </td> </tr> </table><? } if($action == 'config') { if(!dir_writeable('./tempdata/')) { showmessage("数据 ./tempdata 目录属性非 777 或无法写入, 无法安装 VITCIE!"); } if(!dir_writeable('./tempdata/templates/')) { showmessage("模板 ./tempdata/templates 目录属性非 777 或无法写入, 无法安装 VITCIE."); } $exist_error = FALSE; $write_error = FALSE; if(file_exists('./config.php')) { $exist_error=FALSE; } else { $exist_error = TRUE; showmessage('您的 <b>config.php</b> 文件不存在, 无法继续安装, 请用 FTP 将该文件上传后再试.'); } if(is_writeable('./config.php')) { $saveconfig=1; $write_error=FALSE; } else { $saveconfig=0; $write_error = TRUE; } ?><form method="post" action="<?=$PHP_SELF?>"><table id="singleframe" cellspacing="0" cellpadding="0" border="0" width="80%" align=center><tr bgcolor="#ffffff"><td> <table border="0" cellspacing="1" cellpadding="7" width="100%"> <tr class="header"> <td colspan="2">MySQL 环境变量</td> </tr><? if(!$exist_error) { if(!$write_error) { $dbhost = 'localhost'; $dbuser = 'dbuser'; $dbpw = 'dbpw'; $dbname = 'dbname'; $adminemail = 'admin@domain.com'; $tablepre = 'vte_'; @include './config.php';?> <tr class="category">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -