OSDN Git Service

10447e270e93ce1e1d2f5cf1e7fea806546940ef
[idb/iDB.git.git] / setup / setup.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-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12     Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13     iDB Installer made by Game Maker 2k - http://idb.berlios.net/
14
15     $FileInfo: setup.php - Last Update: 6/16/2021 SVN 934 - Author: cooldude2k $
16 */
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="setup.php"||$File3Name=="/setup.php") {
19         require('index.php');
20         exit(); }
21 if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
22 if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
23 ?>
24 <tr class="TableRow3">
25 <td class="TableColumn3">
26 <?php
27 $checkfile="settings.php";
28 $iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
29 $iDBRSVN = $VER2[2]." ".$SubVerN;
30 $LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
31 $pretext = "<?php\n/*\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    Revised BSD License for more details.\n\n    Copyright 2004-".$SVNDay[2]." iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1\n    Copyright 2004-".$SVNDay[2]." Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2\n    iDB Installer made by Game Maker 2k - http://idb.berlios.net/\n\n    \$FileInfo: settings.php & settingsbak.php - ".$LastUpdateS." - Author: cooldude2k \$\n*/\n";
32 $pretext2 = array("/*   Board Setting Section Begins   */\n\$Settings = array();","/*   Board Setting Section Ends  \n     Board Info Section Begins   */\n\$SettInfo = array();","/*   Board Setting Section Ends   \n     Board Dir Section Begins   */\n\$SettDir = array();","/*   Board Dir Section Ends   */");
33 $settcheck = "\$File3Name = basename(\$_SERVER['SCRIPT_NAME']);\nif (\$File3Name==\"settings.php\"||\$File3Name==\"/settings.php\"||\n    \$File3Name==\"settingsbak.php\"||\$File3Name==\"/settingsbak.php\") {\n    header('Location: index.php');\n    exit(); }\n";
34 $BoardSettingsBak = $pretext.$settcheck;
35 $BoardSettings = $pretext.$settcheck;
36 $fp = fopen("settings.php","w+");
37 fwrite($fp, $BoardSettings);
38 fclose($fp);
39 //      cp("settings.php","settingsbak.php");
40 $fp = fopen("settingsbak.php","w+");
41 fwrite($fp, $BoardSettingsBak);
42 fclose($fp);
43 if (!is_writable($checkfile)) {
44    echo "<br />Settings is not writable.";
45    chmod("settings.php",0755); $Error="Yes";
46    chmod("settingsbak.php",0755);
47 } else { /* settings.php is writable install iDB. ^_^ */ }
48 if(!function_exists("mysql_connect")&&!function_exists("mysqli_connect")&&
49 !function_exists("pg_connect")&&!function_exists("sqlite_open")&&!class_exists('SQLite3')&&
50 !function_exists("cubrid_connect")) { $Error="Yes";
51 echo "<span class=\"TableMessage\">You need to enbale a database php extension to install ".$VerInfo['iDB_Ver_Show']." on this server.<br />\n"; 
52 echo "You can use MySQL, MySQLi, PostgreSQL, or SQLite</span>"; }
53 if ($Error!="Yes") {
54 $StatSQL = sql_connect_db($_POST['DatabaseHost'],$_POST['DatabaseUserName'],$_POST['DatabasePassword']);
55 if(!$StatSQL) { $Error="Yes";
56 echo "<span class=\"TableMessage\">";
57 echo "<br />".sql_errorno($StatSQL)."\n</span>\n"; } }
58 if ($Error!="Yes") {
59 $iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
60 $iDBRSVN = $VER2[2]." ".$SubVerN;
61 $LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
62 $pretext = "<?php\n/*\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    Revised BSD License for more details.\n\n    Copyright 2004-".$SVNDay[2]." iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1\n    Copyright 2004-".$SVNDay[2]." Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2\n    iDB Installer made by Game Maker 2k - http://idb.berlios.net/\n\n    \$FileInfo: settings.php & settingsbak.php - ".$LastUpdateS." - Author: cooldude2k \$\n*/\n";
63 $BoardSettings=$pretext."\$Settings = array();\n\$Settings['sqlhost'] = '".$_POST['DatabaseHost']."';\n\$Settings['sqluser'] = '".$_POST['DatabaseUserName']."';\n\$Settings['sqlpass'] = '".$_POST['DatabasePassword']."';\n?>";
64 $fp = fopen("./settings.php","w+");
65 fwrite($fp, $BoardSettings);
66 fclose($fp);
67 //      cp("settings.php","settingsbak.php");
68 $fp = fopen("./settingsbak.php","w+");
69 fwrite($fp, $BoardSettings);
70 fclose($fp);
71 $gettzinfofromjs = date_default_timezone_get();
72 if(isset($_COOKIE['getusertz']) && in_array($_COOKIE['getusertz'], DateTimeZone::listIdentifiers())) {
73    $gettzinfofromjs = $_COOKIE['getusertz']; }
74 // http://www.tutorialspoint.com/php/php_function_timezone_identifiers_list.htm
75 $timezone_identifiers = DateTimeZone::listIdentifiers();
76 //$timezone_identifiers = timezone_identifiers_list();
77 $zonelist['africa'] = array();
78 $zonelist['america'] = array();
79 $zonelist['antarctica'] = array();
80 $zonelist['arctic'] = array();
81 $zonelist['asia'] = array();
82 $zonelist['atlantic'] = array();
83 $zonelist['australia'] = array();
84 $zonelist['europe'] = array();
85 $zonelist['indian'] = array();
86 $zonelist['pacific'] = array();
87 $zonelist['etcetera'] = array();
88 for ($i=0; $i < count($timezone_identifiers); $i++) {
89     $zonelookup = explode("/", $timezone_identifiers[$i]);
90     if(count($zonelookup)==1) { array_push($zonelist['etcetera'], array($timezone_identifiers[$i], $timezone_identifiers[$i])); }
91     if(count($zonelookup)>1) { 
92         if($zonelookup[0]=="Africa") {
93             if(count($zonelookup)==2) {
94                 array_push($zonelist['africa'], array($zonelookup[1], $timezone_identifiers[$i])); }
95             if(count($zonelookup)==3) {
96                 array_push($zonelist['africa'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
97         if($zonelookup[0]=="America") {
98             if(count($zonelookup)==2) {
99                 array_push($zonelist['america'], array($zonelookup[1], $timezone_identifiers[$i])); }
100             if(count($zonelookup)==3) {
101                 array_push($zonelist['america'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
102         if($zonelookup[0]=="Antarctica") {
103             if(count($zonelookup)==2) {
104                 array_push($zonelist['antarctica'], array($zonelookup[1], $timezone_identifiers[$i])); }
105             if(count($zonelookup)==3) {
106                 array_push($zonelist['antarctica'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
107         if($zonelookup[0]=="Arctic") {
108             if(count($zonelookup)==2) {
109                 array_push($zonelist['arctic'], array($zonelookup[1], $timezone_identifiers[$i])); }
110             if(count($zonelookup)==3) {
111                 array_push($zonelist['arctic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
112         if($zonelookup[0]=="Asia") {
113             if(count($zonelookup)==2) {
114                 array_push($zonelist['asia'], array($zonelookup[1], $timezone_identifiers[$i])); }
115             if(count($zonelookup)==3) {
116                 array_push($zonelist['asia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
117         if($zonelookup[0]=="Atlantic") {
118             if(count($zonelookup)==2) {
119                 array_push($zonelist['atlantic'], array($zonelookup[1], $timezone_identifiers[$i])); }
120             if(count($zonelookup)==3) {
121                 array_push($zonelist['atlantic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
122         if($zonelookup[0]=="Australia") {
123             if(count($zonelookup)==2) {
124                 array_push($zonelist['australia'], array($zonelookup[1], $timezone_identifiers[$i])); }
125             if(count($zonelookup)==3) {
126                 array_push($zonelist['australia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
127         if($zonelookup[0]=="Europe") {
128             if(count($zonelookup)==2) {
129                 array_push($zonelist['europe'], array($zonelookup[1], $timezone_identifiers[$i])); }
130             if(count($zonelookup)==3) {
131                 array_push($zonelist['europe'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
132         if($zonelookup[0]=="Indian") {
133             if(count($zonelookup)==2) {
134                 array_push($zonelist['indian'], array($zonelookup[1], $timezone_identifiers[$i])); }
135             if(count($zonelookup)==3) {
136                 array_push($zonelist['indian'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
137         if($zonelookup[0]=="Pacific") {
138             if(count($zonelookup)==2) {
139                 array_push($zonelist['pacific'], array($zonelookup[1], $timezone_identifiers[$i])); }
140             if(count($zonelookup)==3) {
141                 array_push($zonelist['pacific'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
142     }
143 }
144 ?>
145 <form style="display: inline;" method="post" id="install" action="<?php echo url_maker("install",".php","act=Part4","&","=",null,null); ?>">
146 <table style="text-align: left;">
147 <tr style="text-align: left;">
148         <td style="width: 50%;"><label class="TextBoxLabel" for="NewBoardName">Insert Board Name:</label></td>
149         <td style="width: 50%;"><input type="text" name="NewBoardName" class="TextBox" id="NewBoardName" size="20" /></td>
150 </tr><tr>
151         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseName">Insert Database Name:</label></td>
152         <td style="width: 50%;"><input type="text" name="DatabaseName" class="TextBox" id="DatabaseName" size="20" />
153         <?php /*<select id="dblist" name="dblist" class="TextBox" onchange="document.install.DatabaseName.value=this.value">
154         <option value=" ">none on list</option>
155         <?php $dblist = sql_list_dbs();
156         $num = count($dblist); $i = 0;
157         while ($i < $num) {
158                 echo "<option value=\"".$dblist[$i]."\">";
159                 echo $dblist[$i]."</option>\n";
160                 ++$i;
161         } ?></select><?php */ ?></td>
162 </tr><tr>
163         <td style="width: 50%;"><label class="TextBoxLabel" for="tableprefix">Insert Table Prefix:<br /></label></td>
164         <td style="width: 50%;"><input type="text" name="tableprefix" class="TextBox" id="tableprefix" value="idb_" size="20" /></td>
165 </tr><tr>
166         <td style="width: 50%;"><label class="TextBoxLabel" for="AdminUser">Insert Admin User Name:</label></td>
167         <td style="width: 50%;"><input type="text" name="AdminUser" class="TextBox" id="AdminUser" size="20" /></td>
168 </tr><tr>
169         <td style="width: 30%;"><label class="TextBoxLabel" for="AdminEmail">Insert Admin Email:</label></td>
170         <td style="width: 70%;"><input type="email" class="TextBox" name="AdminEmail" size="20" id="AdminEmail" /></td>
171 </tr><tr>
172         <td style="width: 50%;"><label class="TextBoxLabel" for="AdminPassword">Insert Admin Password:</label></td>
173         <td style="width: 50%;"><input type="password" name="AdminPasswords" class="TextBox" id="AdminPassword" size="20" maxlength="30" /></td>
174 </tr><tr>
175         <td style="width: 50%;"><label class="TextBoxLabel" for="ReaPassword">ReInsert Admin Password:</label></td>
176         <td style="width: 50%;"><input type="password" class="TextBox" name="ReaPassword" size="20" id="ReaPassword" maxlength="30" /></td>
177 </tr><tr>
178         <td style="width: 50%;"><label class="TextBoxLabel" for="BoardURL">Insert The Board URL:</label></td>
179         <td style="width: 50%;"><input type="url" class="TextBox" name="BoardURL" size="20" id="BoardURL" value="<?php echo $prehost.$_SERVER['HTTP_HOST'].$this_dir; ?>" /></td>
180 </tr><tr>
181         <td style="width: 50%;"><label class="TextBoxLabel" for="WebURL">Insert The WebSite URL:</label></td>
182         <td style="width: 50%;"><input type="url" class="TextBox" name="WebURL" size="20" id="WebURL" value="<?php echo $prehost.$_SERVER['HTTP_HOST']."/"; ?>" /></td>
183 </tr><?php if($_POST['DatabaseType']=="mysql"||$_POST['DatabaseType']=="mysqli") { ?><tr>
184         <td style="width: 50%;"><label class="TextBoxLabel" for="sqlcollate">MySQL Collate:</label></td>
185         <td style="width: 50%;"><select size="1" class="TextBox" name="sqlcollate" id="sqlcollate">
186         <?php if($_POST['charset']=="ISO-8859-1"||$_POST['charset']=="ISO-8859-15") { ?>
187         <option value="latin1_general_ci">Latin1 Case-Insensitive</option>
188         <option value="latin1_general_cs">Latin1 Case-Sensitive</option>
189         <option value="latin1_bin">Latin1 Binary</option>
190         <option value="ascii_generel_ci">ASCII Case-Insensitive</option>
191         <option value="ascii_bin">ASICC Binary</option>
192         <?php } if($_POST['charset']=="UTF-8") { ?>
193         <option value="utf8_unicode_ci">UTF-8 Unicode Case-Insensitive</option>
194         <option value="utf8_general_ci">UTF-8 General Case-Insensitive</option>
195         <option value="utf8_bin">UTF-8 Binary</option>
196         <option value="utf8mb4_unicode_ci">UTF-8 Multibyte Unicode Case-Insensitive</option>
197         <option value="utf8mb4_general_ci">UTF-8 Multibyte General Case-Insensitive</option>
198         <option value="utf8mb4_bin">UTF-8 Multibyte Binary</option>
199         <?php } ?>
200         </select></td>
201 </tr><?php } ?><tr>
202         <td style="width: 50%;"><label class="TextBoxLabel" title="Can save some bandwidth." for="UseGzip">Enable HTTP Compression:</label></td>
203         <td style="width: 50%;"><select size="1" class="TextBox" name="GZip" id="UseGzip">
204         <option value="off">No</option>
205         <option value="on">Yes</option>
206         <option value="gzip">Only GZip</option>
207         <option value="deflate">Only Deflate</option>
208         <option value="brotli">Only Brotli</option>
209         </select></td>
210 </tr><tr>
211         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLType">HTML Type to use:</label></td>
212         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLType" id="HTMLType">
213         <!--<option value="xhtml10">XHTML 1.0</option>-->
214         <!--<option value="xhtml11">XHTML 1.1</option>-->
215         <option value="html5">HTML 5</option>
216         <option value="xhtml5">XHTML 5</option>
217         </select></td>
218 </tr><tr>
219         <td style="width: 50%;"><label class="TextBoxLabel" for="OutPutType">Output file as:</label></td>
220         <td style="width: 50%;"><select size="1" class="TextBox" name="OutPutType" id="OutPutType">
221         <option value="html">HTML</option>
222         <option value="xhtml">XHTML</option>
223         </select></td>
224 </tr><tr>
225         <td style="width: 50%;"><label class="TextBoxLabel" title="Store userinfo as a cookie so you dont need to login again." for="storecookie">Store as cookie?</label></td>
226         <td style="width: 50%;"><select id="storecookie" name="storecookie" class="TextBox">
227 <option value="true">Yes</option>
228 <option value="false">No</option>
229 </select></td>
230 </tr><tr>
231         <td style="width: 50%;"><label class="TextBoxLabel" for="usehashtype">Hash user passwords with?</label></td>
232         <td style="width: 50%;"><select id="usehashtype" name="usehashtype" class="TextBox">
233 <?php // PHP 5 hash algorithms to functions :o 
234 if(function_exists('hash')&&function_exists('hash_algos')) {
235 if(in_array("md2",hash_algos())) { ?>
236 <option value="md2">MD2</option>
237 <?php } if(in_array("md4",hash_algos())) { ?>
238 <option value="md4">MD4</option>
239 <?php } if(in_array("md5",hash_algos())) { ?>
240 <option value="md5">MD5</option>
241 <?php } if(in_array("gost",hash_algos())) { ?>
242 <option value="gost">GOST</option>
243 <?php } if(in_array("joaat",hash_algos())) { ?>
244 <option value="joaat">JOAAT</option>
245 <?php } if(in_array("sha1",hash_algos())) { ?>
246 <option value="sha1">SHA1</option>
247 <?php } if(in_array("sha224",hash_algos())) { ?>
248 <option value="sha224">SHA224</option>
249 <?php } if(in_array("sha256",hash_algos())) { ?>
250 <option value="sha256" selected="selected">SHA256</option>
251 <?php } if(in_array("sha384",hash_algos())) { ?>
252 <option value="sha384">SHA384</option>
253 <?php } if(in_array("sha512",hash_algos())) { ?>
254 <option value="sha512">SHA512</option>
255 <?php } if(in_array("sha3-224",hash_algos())) { ?>
256 <option value="sha3-224">SHA3-224</option>
257 <?php } if(in_array("sha3-256",hash_algos())) { ?>
258 <option value="sha3-256">SHA3-256</option>
259 <?php } if(in_array("sha3-384",hash_algos())) { ?>
260 <option value="sha3-384">SHA3-384</option>
261 <?php } if(in_array("sha3-512",hash_algos())) { ?>
262 <option value="sha3-512">SHA3-512</option>
263 <?php } if(in_array("ripemd128",hash_algos())) { ?>
264 <option value="ripemd128">RIPEMD128</option>
265 <?php } if(in_array("ripemd160",hash_algos())) { ?>
266 <option value="ripemd160">RIPEMD160</option>
267 <?php } if(in_array("ripemd256",hash_algos())) { ?>
268 <option value="ripemd256">RIPEMD256</option>
269 <?php } if(in_array("ripemd320",hash_algos())) { ?>
270 <option value="ripemd320">RIPEMD320</option>
271 <?php } } if(function_exists('password_hash')) { ?>
272 <option value="bcrypt">BCRYPT</option>
273 <?php } 
274 if(!function_exists('hash')&&!function_exists('hash_algos')) { ?>
275 <option value="md5">MD5</option>
276 <option value="sha1" selected="selected">SHA1</option>
277 <?php } ?>
278 </select></td>
279 </tr><tr>
280         <td style="width: 50%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
281         <td style="width: 50%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
282 <optgroup label="Africa">
283 <?php
284 $optsel="";
285 for ($i=0; $i < count($zonelist['africa']); $i++) {
286     if($gettzinfofromjs==$zonelist['africa'][$i][1]) { $optsel = " selected=\"selected\""; }
287     echo "<option".$optsel." value=\"".$zonelist['africa'][$i][1]."\">".str_replace("_", " ", $zonelist['africa'][$i][0])."</option>\n"; 
288     $optsel=""; }
289 ?>
290 </optgroup>
291 <optgroup label="America">
292 <?php
293 $optsel="";
294 for ($i=0; $i < count($zonelist['america']); $i++) {
295     if($gettzinfofromjs==$zonelist['america'][$i][1]) { $optsel = " selected=\"selected\""; }
296     echo "<option".$optsel." value=\"".$zonelist['america'][$i][1]."\">".str_replace("_", " ", $zonelist['america'][$i][0])."</option>\n"; 
297     $optsel=""; }
298 ?>
299 </optgroup>
300 <optgroup label="Antarctica">
301 <?php
302 $optsel="";
303 for ($i=0; $i < count($zonelist['antarctica']); $i++) {
304     if($gettzinfofromjs==$zonelist['antarctica'][$i][1]) { $optsel = " selected=\"selected\""; }
305     echo "<option".$optsel." value=\"".$zonelist['antarctica'][$i][1]."\">".str_replace("_", " ", $zonelist['antarctica'][$i][0])."</option>\n"; 
306     $optsel=""; }
307 ?>
308 </optgroup>
309 <optgroup label="Arctic">
310 <?php
311 $optsel="";
312 for ($i=0; $i < count($zonelist['arctic']); $i++) {
313     if($gettzinfofromjs==$zonelist['arctic'][$i][1]) { $optsel = " selected=\"selected\""; }
314     echo "<option".$optsel." value=\"".$zonelist['arctic'][$i][1]."\">".str_replace("_", " ", $zonelist['arctic'][$i][0])."</option>\n"; 
315     $optsel=""; }
316 ?>
317 </optgroup>
318 <optgroup label="Asia">
319 <?php
320 for ($i=0; $i < count($zonelist['asia']); $i++) {
321     if($gettzinfofromjs==$zonelist['asia'][$i][1]) { $optsel = " selected=\"selected\""; }
322     echo "<option".$optsel." value=\"".$zonelist['asia'][$i][1]."\">".str_replace("_", " ", $zonelist['asia'][$i][0])."</option>\n"; 
323     $optsel=""; }
324 ?>
325 </optgroup>
326 <optgroup label="Atlantic">
327 <?php
328 $optsel="";
329 for ($i=0; $i < count($zonelist['atlantic']); $i++) {
330     if($gettzinfofromjs==$zonelist['atlantic'][$i][1]) { $optsel = " selected=\"selected\""; }
331     echo "<option".$optsel." value=\"".$zonelist['atlantic'][$i][1]."\">".str_replace("_", " ", $zonelist['atlantic'][$i][0])."</option>\n"; 
332     $optsel=""; }
333 ?>
334 </optgroup>
335 <optgroup label="Australia">
336 <?php
337 $optsel="";
338 for ($i=0; $i < count($zonelist['australia']); $i++) {
339     if($gettzinfofromjs==$zonelist['australia'][$i][1]) { $optsel = " selected=\"selected\""; }
340     echo "<option".$optsel." value=\"".$zonelist['australia'][$i][1]."\">".str_replace("_", " ", $zonelist['australia'][$i][0])."</option>\n"; 
341     $optsel=""; }
342 ?>
343 </optgroup>
344 <optgroup label="Europe">
345 <?php
346 $optsel="";
347 for ($i=0; $i < count($zonelist['europe']); $i++) {
348     if($gettzinfofromjs==$zonelist['europe'][$i][1]) { $optsel = " selected=\"selected\""; }
349     echo "<option".$optsel." value=\"".$zonelist['europe'][$i][1]."\">".str_replace("_", " ", $zonelist['europe'][$i][0])."</option>\n"; 
350     $optsel=""; }
351 ?>
352 </optgroup>
353 <optgroup label="Indian">
354 <?php
355 $optsel="";
356 for ($i=0; $i < count($zonelist['indian']); $i++) {
357     if($gettzinfofromjs==$zonelist['indian'][$i][1]) { $optsel = " selected=\"selected\""; }
358     echo "<option".$optsel." value=\"".$zonelist['indian'][$i][1]."\">".str_replace("_", " ", $zonelist['indian'][$i][0])."</option>\n"; 
359     $optsel=""; }
360 ?>
361 </optgroup>
362 <optgroup label="Pacific">
363 <?php
364 $optsel="";
365 for ($i=0; $i < count($zonelist['pacific']); $i++) {
366     if($gettzinfofromjs==$zonelist['pacific'][$i][1]) { $optsel = " selected=\"selected\""; }
367     echo "<option".$optsel." value=\"".$zonelist['pacific'][$i][1]."\">".str_replace("_", " ", $zonelist['pacific'][$i][0])."</option>\n"; 
368     $optsel=""; }
369 ?>
370 </optgroup>
371 <optgroup label="Etcetera">
372 <?php
373 $optsel="";
374 for ($i=0; $i < count($zonelist['etcetera']); $i++) {
375     if($gettzinfofromjs==$zonelist['etcetera'][$i][1]) { $optsel = " selected=\"selected\""; }
376     echo "<option".$optsel." value=\"".$zonelist['etcetera'][$i][1]."\">".str_replace("_", " ", $zonelist['etcetera'][$i][0])."</option>\n"; 
377     $optsel=""; }
378 ?>
379 </optgroup>
380 </select></td>
381 </tr><tr>
382         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
383         <td style="width: 50%;"><input type="text" class="TextBox" name="iDBTimeFormat" size="20" id="iDBTimeFormat" value="<?php echo "g:i A"; ?>" /></td>
384 </tr><tr>
385         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
386         <td style="width: 50%;"><input type="text" class="TextBox" name="iDBDateFormat" size="20" id="iDBDateFormat" value="<?php echo "F j Y"; ?>" /></td>
387 </tr><tr>
388         <td style="width: 50%;"><label class="TextBoxLabel" for="TestReferer">Test Referering URL:</label></td>
389         <td style="width: 50%;"><select id="TestReferer" name="TestReferer" class="TextBox">
390 <option selected="selected" value="off">Off</option>
391 <option value="on">On</option>
392 </select></td>
393 </tr><tr>
394         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBHTTPLogger">Log Every HTTP Requests:</label></td>
395         <td style="width: 50%;"><select id="iDBHTTPLogger" name="iDBHTTPLogger" class="TextBox">
396 <option value="off">Off</option>
397 <option value="on">On</option>
398 </select></td>
399 </tr><tr>
400         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBLoggerFormat">Insert The Format for HTTP Logger:</label></td>
401         <td style="width: 50%;"><input type="text" class="TextBox" name="iDBLoggerFormat" size="20" id="iDBLoggerFormat" value="<?php echo "%h %l %u %t &quot;%r&quot; %&gt;s %b &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot;"; ?>" /></td>
402 </tr><tr>
403         <td style="width: 50%;"><label class="TextBoxLabel" for="DefaultTheme">Default Theme</label></td>
404         <td style="width: 50%;"><select id="DefaultTheme" name="DefaultTheme" class="TextBox"><?php
405 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
406 if ($handle = opendir($skindir)) { $dirnum = null;
407    while (false !== ($file = readdir($handle))) {
408            $selected = null;
409            if ($dirnum==null) { $dirnum = 0; }
410            if (file_exists($skindir.$file."/info.php")) {
411                    if ($file != "." && $file != "..") {
412            require($skindir.$file."/info.php");
413            if($file=="iDB") { 
414        $themelist[$dirnum] =  "<option value=\"".$file."\" selected=\"selected\">".$ThemeInfo['ThemeName']."</option>"; }
415            if($file!="iDB") {
416            $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
417            ++$dirnum; } } }
418    closedir($handle); asort($themelist);
419    $themenum=count($themelist); $themei=0; 
420    while ($themei < $themenum) {
421    echo $themelist[$themei]."\n";
422    ++$themei; }
423 } ?></select></td>
424 </tr><tr>
425         <td style="width: 50%;"><label class="TextBoxLabel" for="SQLThemes">Store Themes in SQL Database:</label></td>
426         <td style="width: 50%;"><select id="SQLThemes" name="SQLThemes" class="TextBox">
427 <option selected="selected" value="off">Off</option>
428 <option value="on">On</option>
429 </select></td>
430 </tr><tr>
431         <td style="width: 50%;"><label class="TextBoxLabel" title="Might not work" for="unlink">Delete Installer?</label></td>
432         <td style="width: 50%;"><select id="unlink" name="unlink" class="TextBox">
433 <option value="true">Yes</option>
434 <option value="false">No</option>
435 </select></td>
436 </tr></table>
437 <table style="text-align: left;">
438 <tr style="text-align: left;">
439 <td style="width: 100%;">
440 <input type="hidden" name="charset" value="<?php echo $_POST['charset']; ?>" style="display: none;" />
441 <input type="hidden" name="SetupType" value="install" style="display: none;" />
442 <input type="hidden" name="DatabaseType" value="<?php echo $Settings['sqltype']; ?>" style="display: none;" />
443 <input type="hidden" name="act" value="Part4" style="display: none;" />
444 <input type="submit" class="Button" value="Install Board" name="Install_Board" />
445 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
446 </td></tr></table>
447 </form>
448 </td>
449 </tr>
450 <?php } ?>