OSDN Git Service

Another small update.
[idb/iDB.git.git] / install.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
12     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
13     iDB Installer made by Game Maker 2k - http://idb.berlios.de/support/category.php?act=view&id=2
14
15     $FileInfo: install.php - Last Update: 12/12/2008 SVN 215 - Author: cooldude2k $
16 */
17 @error_reporting(E_ALL ^ E_NOTICE);
18 if(@ini_get("register_globals")) { 
19         if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; }
20         require_once($SettDir['misc'].'killglobals.php'); }
21 if(!isset($preact['idb'])) { $preact['idb'] = null; }
22 if(!isset($_GET['act'])) { $_GET['act'] = null; }
23 if(!isset($_POST['act'])) { $_POST['act'] = null; }
24 if ($_GET['act']==null||$_GET['act']=="view") { $_GET['act']="Part1"; }
25 if ($_POST['act']==null||$_POST['act']=="view") { $_POST['act']="Part1"; }
26 $_TEG = array(null); $_TEG['part'] = preg_replace("/Part(1|2|3|4)/","\\1",$_GET['act']);
27 $_GET['act'] = strtolower($_GET['act']); if(isset($_TEG['part'])) {
28 if($_TEG['part']<=4&&$_TEG['part']>=1) { $_GET['act'] = "Part".$_TEG['part']; } }
29 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
30         $preact['idb'] = "installing";  }
31 $SetupDir['setup'] = "setup/"; $ConvertDir['setup'] = $SetupDir['setup'];
32 $SetupDir['convert'] = "setup/convert/"; $ConvertDir['convert'] = $SetupDir['convert'];
33 $Settings['output_type'] = "html"; $Settings['html_type'] = "xhtml10";
34 $Settings['board_name'] = "Installing iDB"; 
35 if(!isset($Settings['charset'])) {
36         $Settings['charset'] = "ISO-8859-15"; }
37 if(isset($Settings['charset'])) {
38 if($Settings['charset']!="ISO-8859-15"&&$Settings['charset']!="ISO-8859-1"&&
39         $Settings['charset']!="UTF-8"&&$Settings['charset']!="CP866"&&
40         $Settings['charset']!="Windows-1251"&&$Settings['charset']!="Windows-1252"&&
41         $Settings['charset']!="KOI8-R"&&$Settings['charset']!="BIG5"&&
42         $Settings['charset']!="GB2312"&&$Settings['charset']!="BIG5-HKSCS"&&
43         $Settings['charset']!="Shift_JIS"&&$Settings['charset']!="EUC-JP") {
44         $Settings['charset'] = "ISO-8859-15"; } }
45 require($SetupDir['setup'].'preinstall.php');
46 require_once($SettDir['inc'].'filename.php');
47 require_once($SettDir['inc'].'function.php');
48 require($SetupDir['convert'].'info.php');
49 require($SettDir['inc'].'xhtml10.php');
50 $Error = null; $_GET['time'] = false;
51 ?>
52
53 <title> <?php echo "Installing ".$VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </title>
54 </head>
55 <body>
56 <?php require($SettDir['inc'].'navbar.php'); ?>
57 <div class="Table1Border">
58 <?php if($ThemeSet['TableStyle']=="div") { ?>
59 <div class="TableRow1">
60 <span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </a></span>
61 </div>
62 <?php } ?>
63 <table class="Table1">
64 <?php if($ThemeSet['TableStyle']=="table") { ?>
65 <tr class="TableRow1">
66 <td class="TableColumn1" colspan="2"><span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </a></span>
67 </td>
68 </tr><?php } ?>
69 <tr class="TableRow2">
70 <th class="TableColumn2" style="width: 100%; text-align: left;">
71 <span style="float: left;">&nbsp;Inert your install info: </span>
72 <span style="float: right;">&nbsp;</span>
73 </th>
74 </tr>
75 <?php
76 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
77 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
78 $this_dir = null;
79 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
80         dirname($_SERVER['SCRIPT_NAME'])!=null) {
81 $this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
82 if($this_dir==null||$this_dir==".") {
83 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
84         dirname($_SERVER['SCRIPT_NAME'])==null) {
85 $this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
86 if($this_dir=="\/") { $this_dir="/"; }
87 $this_dir = str_replace("//", "/", $this_dir);
88 $idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
89 function sql_list_dbs() {
90    $result = mysql_query("SHOW DATABASES;");
91    while( $data = mysql_fetch_row($result) ) {
92        $array[] = $data[0];
93    } return $array; }
94 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
95 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
96 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
97    require($SetupDir['setup'].'license.php'); } } }
98 if ($_GET['act']=="Part2"&&$_POST['act']=="Part2") {
99 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
100 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
101    require($SetupDir['setup'].'presetup.php'); } } }
102 if($_POST['SetupType']=="convert") {
103         require($ConvertInfo['ConvertFile']); }
104 if($_POST['SetupType']=="install") {
105 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
106 if ($_GET['act']=="Part3"&&$_POST['act']=="Part3") {
107 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
108    require($SetupDir['setup'].'setup.php'); } } } }
109 if($_POST['SetupType']=="install") {
110 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
111 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
112 if ($_GET['act']=="Part4"&&$_POST['act']=="Part4") {
113    require($SetupDir['setup'].'/mkconfig.php'); } } } }
114 if ($Error=="Yes") { ?>
115 <br />Install Failed with errors. <a href="install.php?act=view">Click here</a> to restart install. &lt;_&lt;
116 <br /><br />
117 </td>
118 </tr>
119 <?php } ?>
120 <tr class="TableRow4">
121 <td class="TableColumn4">&nbsp;<a href="index.php?act=ReadMe">Readme.txt</a>&nbsp;</td>
122 </tr>
123 </table></div>
124 <div>&nbsp;</div>
125 <?php require($SettDir['inc'].'endpage.php'); ?>
126 </body>
127 </html>
128 <?php fix_amp(null); ?>