OSDN Git Service

Many runtime errors fixed in the install process. (PHP Notice errors)
[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: 07/01/2007 SVN 35 - Author: cooldude2k $
16 */
17 @error_reporting(E_ALL ^ E_NOTICE);
18 if(!isset($preact['idb'])) { $preact['idb'] = null; }
19 if(!isset($_GET['act'])) { $_GET['act'] = null; }
20 if(!isset($_POST['act'])) { $_POST['act'] = null; }
21 if ($_GET['act']==null||$_GET['act']=="view") { $_GET['act']="Part1"; }
22 if ($_POST['act']==null||$_POST['act']=="view") { $_POST['act']="Part1"; }
23 $_TEG = array(null); $_TEG['part'] = preg_replace("/Part(1|2|3|4)/","\\1",$_GET['act']);
24 $_GET['act'] = strtolower($_GET['act']); if(isset($_TEG['part'])) {
25 if($_TEG['part']<=4&&$_TEG['part']>=1) { $_GET['act'] = "Part".$_TEG['part']; } }
26 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
27         $preact['idb'] = "installing";  }
28 $SetupDir['setup'] = "setup/"; $ConvertDir['setup'] = $SetupDir['setup'];
29 $SetupDir['convert'] = "setup/convert/"; $ConvertDir['convert'] = $SetupDir['convert'];
30 $Settings['output_type'] = "html"; $Settings['html_type'] = "xhtml10";
31 $Settings['board_name'] = "Installing iDB";
32 require($SetupDir['setup'].'preinstall.php');
33 require_once($SettDir['inc'].'filename.php');
34 require_once($SettDir['inc'].'function.php');
35 require($SetupDir['convert'].'info.php');
36 require($SettDir['inc'].'xhtml10.php');
37 unset($Error); $_GET['time'] = false;
38 ?>
39
40 <title> <?php echo "Installing ".$VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </title>
41 </head>
42 <body>
43 <?php require($SettDir['inc'].'navbar.php'); ?>
44
45 <table class="Table1">
46 <tr class="TableRow1">
47 <td class="TableRow1"><span style="float: left;">
48 &nbsp;<a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </a></span>
49 <span style="float: right;">&nbsp;</span></td>
50 </tr>
51 <tr class="TableRow2">
52 <th class="TableRow2" style="width: 100%; text-align: left;">
53 <span style="float: left;">&nbsp;Inert your install info: </span>
54 <span style="float: right;">&nbsp;</span>
55 </th>
56 </tr>
57 <?php
58 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
59 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
60 $this_dir = null;
61 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
62         dirname($_SERVER['SCRIPT_NAME'])!=null) {
63 $this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
64 if($this_dir==null||$this_dir==".") {
65 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
66         dirname($_SERVER['SCRIPT_NAME'])==null) {
67 $this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
68 if($this_dir=="\/") { $this_dir="/"; }
69 $this_dir = str_replace("//", "/", $this_dir);
70 $idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
71 function sql_list_dbs() {
72    $result = mysql_query("SHOW DATABASES;");
73    while( $data = mysql_fetch_row($result) ) {
74        $array[] = $data[0];
75    } return $array; }
76 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
77 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
78 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
79    require($SetupDir['setup'].'license.php'); } } }
80 if ($_GET['act']=="Part2"&&$_POST['act']=="Part2") {
81 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
82 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
83    require($SetupDir['setup'].'presetup.php'); } } }
84 if($_POST['SetupType']=="convert") {
85         require($ConvertInfo['ConvertFile']); }
86 if($_POST['SetupType']=="install") {
87 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
88 if ($_GET['act']=="Part3"&&$_POST['act']=="Part3") {
89 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
90    require($SetupDir['setup'].'setup.php'); } } } }
91 if($_POST['SetupType']=="install") {
92 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
93 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
94 if ($_GET['act']=="Part4"&&$_POST['act']=="Part4") {
95    require($SetupDir['setup'].'/mkconfig.php'); } } } }
96 if ($Error=="Yes") { ?>
97 <br />Install Failed with errors. <a href="install.php?act=view">Click here</a> to restart install. &lt;_&lt;
98 <br /><br />
99 </td>
100 </tr>
101 <?php } ?>
102 <tr class="TableRow4">
103 <td class="TableRow4" colspan="2">&nbsp;<a href="index.php?act=ReadMe">Readme.txt</a>&nbsp;</td>
104 </tr>
105 </table>
106 <div>&nbsp;</div>
107 <?php require($SettDir['inc'].'endpage.php'); ?>
108 </body>
109 </html>
110 <?php fix_amp(null); ?>