OSDN Git Service

Small update. (Updated copyright info) :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-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://upload.idb.s1.jcink.com/
14
15     $FileInfo: install.php - Last Update: 01/01/2008 SVN 144 - 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 unset($Error); $_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
58 <table class="Table1">
59 <tr class="TableRow1">
60 <td class="TableRow1"><span style="float: left;">
61 &nbsp;<a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']." on ".$OSType2; ?> </a></span>
62 <span style="float: right;">&nbsp;</span></td>
63 </tr>
64 <tr class="TableRow2">
65 <th class="TableRow2" style="width: 100%; text-align: left;">
66 <span style="float: left;">&nbsp;Inert your install info: </span>
67 <span style="float: right;">&nbsp;</span>
68 </th>
69 </tr>
70 <?php
71 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
72 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
73 $this_dir = null;
74 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
75         dirname($_SERVER['SCRIPT_NAME'])!=null) {
76 $this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
77 if($this_dir==null||$this_dir==".") {
78 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
79         dirname($_SERVER['SCRIPT_NAME'])==null) {
80 $this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
81 if($this_dir=="\/") { $this_dir="/"; }
82 $this_dir = str_replace("//", "/", $this_dir);
83 $idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
84 function sql_list_dbs() {
85    $result = mysql_query("SHOW DATABASES;");
86    while( $data = mysql_fetch_row($result) ) {
87        $array[] = $data[0];
88    } return $array; }
89 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
90 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
91 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
92    require($SetupDir['setup'].'license.php'); } } }
93 if ($_GET['act']=="Part2"&&$_POST['act']=="Part2") {
94 if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
95 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
96    require($SetupDir['setup'].'presetup.php'); } } }
97 if($_POST['SetupType']=="convert") {
98         require($ConvertInfo['ConvertFile']); }
99 if($_POST['SetupType']=="install") {
100 if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
101 if ($_GET['act']=="Part3"&&$_POST['act']=="Part3") {
102 if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
103    require($SetupDir['setup'].'setup.php'); } } } }
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'].'/mkconfig.php'); } } } }
109 if ($Error=="Yes") { ?>
110 <br />Install Failed with errors. <a href="install.php?act=view">Click here</a> to restart install. &lt;_&lt;
111 <br /><br />
112 </td>
113 </tr>
114 <?php } ?>
115 <tr class="TableRow4">
116 <td class="TableRow4">&nbsp;<a href="index.php?act=ReadMe">Readme.txt</a>&nbsp;</td>
117 </tr>
118 </table>
119 <div>&nbsp;</div>
120 <?php require($SettDir['inc'].'endpage.php'); ?>
121 </body>
122 </html>
123 <?php fix_amp(null); ?>