OSDN Git Service

Small bug fix.
[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-2007 Cool Dude 2k - http://intdb.sourceforge.net/
12     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
13     iDB Installer made by Game Maker 2k - http://upload.idb.s1.jcink.com/
14
15     $FileInfo: install.php - Last Update: 11/14/2007 SVN 127 - 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"&&
39         $Settings['charset']!="ISO-8859-1"&&
40         $Settings['charset']!="UTF-8") {
41         $Settings['charset'] = "ISO-8859-15"; } }
42 require($SetupDir['setup'].'preinstall.php');
43 require_once($SettDir['inc'].'filename.php');
44 require_once($SettDir['inc'].'function.php');
45 require($SetupDir['convert'].'info.php');
46 require($SettDir['inc'].'xhtml10.php');
47 unset($Error); $_GET['time'] = false;
48 ?>
49
50 <title> <?php echo "Installing ".$VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </title>
51 </head>
52 <body>
53 <?php require($SettDir['inc'].'navbar.php'); ?>
54
55 <table class="Table1">
56 <tr class="TableRow1">
57 <td class="TableRow1"><span style="float: left;">
58 &nbsp;<a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </a></span>
59 <span style="float: right;">&nbsp;</span></td>
60 </tr>
61 <tr class="TableRow2">
62 <th class="TableRow2" style="width: 100%; text-align: left;">
63 <span style="float: left;">&nbsp;Inert your install info: </span>
64 <span style="float: right;">&nbsp;</span>
65 </th>
66 </tr>
67 <?php
68 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
69 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
70 $this_dir = null;
71 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
72         dirname($_SERVER['SCRIPT_NAME'])!=null) {
73 $this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
74 if($this_dir==null||$this_dir==".") {
75 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
76         dirname($_SERVER['SCRIPT_NAME'])==null) {
77 $this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
78 if($this_dir=="\/") { $this_dir="/"; }
79 $this_dir = str_replace("//", "/", $this_dir);
80 $idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
81 function sql_list_dbs() {
82    $result = mysql_query("SHOW DATABASES;");
83    while( $data = mysql_fetch_row($result) ) {
84        $array[] = $data[0];
85    } return $array; }
86 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
87 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
88 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
89    require($SetupDir['setup'].'license.php'); } } }
90 if ($_GET['act']=="Part2"&&$_POST['act']=="Part2") {
91 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
92 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
93    require($SetupDir['setup'].'presetup.php'); } } }
94 if($_POST['SetupType']=="convert") {
95         require($ConvertInfo['ConvertFile']); }
96 if($_POST['SetupType']=="install") {
97 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
98 if ($_GET['act']=="Part3"&&$_POST['act']=="Part3") {
99 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
100    require($SetupDir['setup'].'setup.php'); } } } }
101 if($_POST['SetupType']=="install") {
102 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
103 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
104 if ($_GET['act']=="Part4"&&$_POST['act']=="Part4") {
105    require($SetupDir['setup'].'/mkconfig.php'); } } } }
106 if ($Error=="Yes") { ?>
107 <br />Install Failed with errors. <a href="install.php?act=view">Click here</a> to restart install. &lt;_&lt;
108 <br /><br />
109 </td>
110 </tr>
111 <?php } ?>
112 <tr class="TableRow4">
113 <td class="TableRow4">&nbsp;<a href="index.php?act=ReadMe">Readme.txt</a>&nbsp;</td>
114 </tr>
115 </table>
116 <div>&nbsp;</div>
117 <?php require($SettDir['inc'].'endpage.php'); ?>
118 </body>
119 </html>
120 <?php fix_amp(null); ?>