OSDN Git Service

Small bug fixes also added link to goto last reply in topic view. :P
[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: 08/12/2007 SVN 77 - 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 require($SetupDir['setup'].'preinstall.php');
36 require_once($SettDir['inc'].'filename.php');
37 require_once($SettDir['inc'].'function.php');
38 require($SetupDir['convert'].'info.php');
39 require($SettDir['inc'].'xhtml10.php');
40 unset($Error); $_GET['time'] = false;
41 ?>
42
43 <title> <?php echo "Installing ".$VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </title>
44 </head>
45 <body>
46 <?php require($SettDir['inc'].'navbar.php'); ?>
47
48 <table class="Table1">
49 <tr class="TableRow1">
50 <td class="TableRow1"><span style="float: left;">
51 &nbsp;<a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </a></span>
52 <span style="float: right;">&nbsp;</span></td>
53 </tr>
54 <tr class="TableRow2">
55 <th class="TableRow2" style="width: 100%; text-align: left;">
56 <span style="float: left;">&nbsp;Inert your install info: </span>
57 <span style="float: right;">&nbsp;</span>
58 </th>
59 </tr>
60 <?php
61 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
62 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
63 $this_dir = null;
64 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
65         dirname($_SERVER['SCRIPT_NAME'])!=null) {
66 $this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
67 if($this_dir==null||$this_dir==".") {
68 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
69         dirname($_SERVER['SCRIPT_NAME'])==null) {
70 $this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
71 if($this_dir=="\/") { $this_dir="/"; }
72 $this_dir = str_replace("//", "/", $this_dir);
73 $idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
74 function sql_list_dbs() {
75    $result = mysql_query("SHOW DATABASES;");
76    while( $data = mysql_fetch_row($result) ) {
77        $array[] = $data[0];
78    } return $array; }
79 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
80 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
81 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
82    require($SetupDir['setup'].'license.php'); } } }
83 if ($_GET['act']=="Part2"&&$_POST['act']=="Part2") {
84 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
85 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
86    require($SetupDir['setup'].'presetup.php'); } } }
87 if($_POST['SetupType']=="convert") {
88         require($ConvertInfo['ConvertFile']); }
89 if($_POST['SetupType']=="install") {
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'].'setup.php'); } } } }
94 if($_POST['SetupType']=="install") {
95 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
96 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
97 if ($_GET['act']=="Part4"&&$_POST['act']=="Part4") {
98    require($SetupDir['setup'].'/mkconfig.php'); } } } }
99 if ($Error=="Yes") { ?>
100 <br />Install Failed with errors. <a href="install.php?act=view">Click here</a> to restart install. &lt;_&lt;
101 <br /><br />
102 </td>
103 </tr>
104 <?php } ?>
105 <tr class="TableRow4">
106 <td class="TableRow4" colspan="2">&nbsp;<a href="index.php?act=ReadMe">Readme.txt</a>&nbsp;</td>
107 </tr>
108 </table>
109 <div>&nbsp;</div>
110 <?php require($SettDir['inc'].'endpage.php'); ?>
111 </body>
112 </html>
113 <?php fix_amp(null); ?>