3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
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.
11 Copyright 2004-2010 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
13 iDB Installer made by Game Maker 2k - http://idb.berlios.net/
15 $FileInfo: setup.php - Last Update: 09/05/2010 SVN 573 - Author: cooldude2k $
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="setup.php"||
$File3Name=="/setup.php") {
21 if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
22 if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
24 <tr
class="TableRow3">
25 <td
class="TableColumn3">
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 - http://idb.berlios.de/\n Copyright 2004-".$SVNDay[2]." Game Maker 2k - http://gamemaker2k.org/\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);
39 // cp("settings.php","settingsbak.php");
40 $fp = fopen("settingsbak.php","w+");
41 fwrite($fp, $BoardSettingsBak);
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")) { $Error="Yes";
50 echo "<span class=\"TableMessage\">You need to enbale a database php extension to install ".$VerInfo['iDB_Ver_Show']." on this server.<br />\n";
51 echo "You can use MySQL, MySQLi, PostgreSQL, or SQLite</span>"; }
53 $StatSQL = sql_connect_db($_POST['DatabaseHost'],$_POST['DatabaseUserName'],$_POST['DatabasePassword']);
54 if(!$StatSQL) { $Error="Yes";
55 echo "<span class=\"TableMessage\">";
56 echo "<br />".sql_errorno($StatSQL)."\n</span>\n"; } }
58 $pretext = "<?php\n/*\n This program is free software; you can redistribute it and/or modify\n it under the terms of the Revised BSD License.\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-2007 Cool Dude 2k - http://intdb.sourceforge.net/\n Copyright 2004-2007 Game Maker 2k - http://idb.berlios.de/support/category.php?act=view&id=2\n Emoticons made by Jcink http://tfbb.jcink.com/\n*/\n";
59 $BoardSettings=$pretext."\$Settings = array();\n\$Settings['sqlhost'] = '".$_POST['DatabaseHost']."';\n\$Settings['sqluser'] = '".$_POST['DatabaseUserName']."';\n\$Settings['sqlpass'] = '".$_POST['DatabasePassword']."';\n?>";
60 $fp = fopen("./settings.php","w+");
61 fwrite($fp, $BoardSettings);
63 // cp("settings.php","settingsbak.php");
64 $fp = fopen("./settingsbak.php","w+");
65 fwrite($fp, $BoardSettings);
68 <form style
="display: inline;" method
="post" id
="install" action
="install.php?act=Part4">
69 <table style
="text-align: left;">
70 <tr style
="text-align: left;">
71 <td style
="width: 50%;"><label
class="TextBoxLabel" for="NewBoardName">Insert Board Name
:</label
></td
>
72 <td style
="width: 50%;"><input type
="text" name
="NewBoardName" class="TextBox" id
="NewBoardName" size
="20" /></td
>
74 <td style
="width: 50%;"><label
class="TextBoxLabel" for="DatabaseName">Insert Database Name
:</label
></td
>
75 <td style
="width: 50%;"><input type
="text" name
="DatabaseName" class="TextBox" id
="DatabaseName" size
="20" />
76 <?php
/*<select id="dblist" name="dblist" class="TextBox" onchange="document.install.DatabaseName.value=this.value">
77 <option value=" ">none on list</option>
78 <?php $dblist = sql_list_dbs();
79 $num = count($dblist); $i = 0;
81 echo "<option value=\"".$dblist[$i]."\">";
82 echo $dblist[$i]."</option>\n";
84 } ?></select><?php */ ?
></td
>
86 <td style
="width: 50%;"><label
class="TextBoxLabel" for="tableprefix">Insert Table Prefix
:<br
/></label
></td
>
87 <td style
="width: 50%;"><input type
="text" name
="tableprefix" class="TextBox" id
="tableprefix" value
="idb_" size
="20" /></td
>
89 <td style
="width: 50%;"><label
class="TextBoxLabel" for="AdminUser">Insert Admin User Name
:</label
></td
>
90 <td style
="width: 50%;"><input type
="text" name
="AdminUser" class="TextBox" id
="AdminUser" size
="20" /></td
>
92 <td style
="width: 30%;"><label
class="TextBoxLabel" for="AdminEmail">Insert Admin Email
:</label
></td
>
93 <td style
="width: 70%;"><input type
="text" class="TextBox" name
="AdminEmail" size
="20" id
="AdminEmail" /></td
>
95 <td style
="width: 50%;"><label
class="TextBoxLabel" for="AdminPassword">Insert Admin Password
:</label
></td
>
96 <td style
="width: 50%;"><input type
="password" name
="AdminPasswords" class="TextBox" id
="AdminPassword" size
="20" maxlength
="30" /></td
>
98 <td style
="width: 50%;"><label
class="TextBoxLabel" for="ReaPassword">ReInsert Admin Password
:</label
></td
>
99 <td style
="width: 50%;"><input type
="password" class="TextBox" name
="ReaPassword" size
="20" id
="ReaPassword" maxlength
="30" /></td
>
101 <td style
="width: 50%;"><label
class="TextBoxLabel" for="BoardURL">Insert The Board URL
:</label
></td
>
102 <td style
="width: 50%;"><input type
="text" class="TextBox" name
="BoardURL" size
="20" id
="BoardURL" value
="<?php echo $prehost.$_SERVER['HTTP_HOST'].$this_dir; ?>" /></td
>
104 <td style
="width: 50%;"><label
class="TextBoxLabel" for="WebURL">Insert The WebSite URL
:</label
></td
>
105 <td style
="width: 50%;"><input type
="text" class="TextBox" name
="WebURL" size
="20" id
="WebURL" value
="<?php echo $prehost.$_SERVER['HTTP_HOST']."/"; ?>" /></td
>
107 <td style
="width: 50%;"><label
class="TextBoxLabel" title
="Can save some bandwidth." for="UseGzip">Enable HTTP Compression
:</label
></td
>
108 <td style
="width: 50%;"><select size
="1" class="TextBox" name
="GZip" id
="UseGzip">
109 <option value
="off">No
</option
>
110 <option value
="on">Yes
</option
>
111 <option value
="gzip">Only GZip
</option
>
112 <option value
="deflate">Only Deflate
</option
>
115 <td style
="width: 50%;"><label
class="TextBoxLabel" for="HTMLType">HTML Type to
use:</label
></td
>
116 <td style
="width: 50%;"><select size
="1" class="TextBox" name
="HTMLType" id
="HTMLType">
117 <option value
="xhtml10">XHTML
1.0</option
>
118 <option value
="xhtml11">XHTML
1.1</option
>
119 <option value
="html5">HTML
5</option
>
122 <td style
="width: 50%;"><label
class="TextBoxLabel" for="HTMLLevel">HTML Level only
for XHTML
1.0:</label
></td
>
123 <td style
="width: 50%;"><select size
="1" class="TextBox" name
="HTMLLevel" id
="HTMLLevel">
124 <option value
="Transitional">Transitional
</option
>
125 <option value
="Strict">Strict
</option
>
128 <td style
="width: 50%;"><label
class="TextBoxLabel" for="OutPutType">Output file
as:</label
></td
>
129 <td style
="width: 50%;"><select size
="1" class="TextBox" name
="OutPutType" id
="OutPutType">
130 <option value
="html">HTML
</option
>
131 <option value
="xhtml">XHTML
</option
>
134 <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
>
135 <td style
="width: 50%;"><select id
="storecookie" name
="storecookie" class="TextBox">
136 <option value
="true">Yes
</option
>
137 <option value
="false">No
</option
>
140 <td style
="width: 50%;"><label
class="TextBoxLabel" for="usehashtype">Hash user passwords with?
</label
></td
>
141 <td style
="width: 50%;"><select id
="usehashtype" name
="usehashtype" class="TextBox">
142 <?php
// PHP 5 hash algorithms to functions :o
143 if(function_exists('hash')&&function_exists('hash_algos')) {
144 if(in_array("md2",hash_algos())) { ?
>
145 <option value
="md2">MD2
</option
>
146 <?php
} if(in_array("md4",hash_algos())) { ?
>
147 <option value
="md4">MD4
</option
>
148 <?php
} if(in_array("md5",hash_algos())) { ?
>
149 <option value
="md5">MD5
</option
>
150 <?php
} if(in_array("sha1",hash_algos())) { ?
>
151 <option value
="sha1">SHA1
</option
>
152 <?php
} if(in_array("sha224",hash_algos())) { ?
>
153 <option value
="sha224">SHA224
</option
>
154 <?php
} if(in_array("sha256",hash_algos())) { ?
>
155 <option value
="sha256" selected
="selected">SHA256
</option
>
156 <?php
} if(in_array("sha384",hash_algos())) { ?
>
157 <option value
="sha384">SHA384
</option
>
158 <?php
} if(in_array("sha512",hash_algos())) { ?
>
159 <option value
="sha512">SHA512
</option
>
160 <?php
} if(in_array("salsa10",hash_algos())) { ?
>
161 <option value
="salsa10">SALSA10
</option
>
162 <?php
} if(in_array("salsa20",hash_algos())) { ?
>
163 <option value
="salsa20">SALSA20
</option
>
164 <?php
} if(in_array("ripemd128",hash_algos())) { ?
>
165 <option value
="ripemd128">RIPEMD128
</option
>
166 <?php
} if(in_array("ripemd160",hash_algos())) { ?
>
167 <option value
="ripemd160">RIPEMD160
</option
>
168 <?php
} if(in_array("ripemd256",hash_algos())) { ?
>
169 <option value
="ripemd256">RIPEMD256
</option
>
170 <?php
} if(in_array("ripemd320",hash_algos())) { ?
>
171 <option value
="ripemd320">RIPEMD320
</option
>
173 if(!function_exists('hash')&&!function_exists('hash_algos')) { ?
>
174 <option value
="md5">MD5
</option
>
175 <option value
="sha1" selected
="selected">SHA1
</option
>
179 <td style
="width: 50%;"><label
class="TextBoxLabel" for="YourOffSet">Your TimeZone
:</label
></td
>
180 <td style
="width: 50%;"><select id
="YourOffSet" name
="YourOffSet" class="TextBox"><?php
181 if(date("I")!=1) { $myofftime = SeverOffSet(); $mydstime = "off"; }
182 if(date("I")==1) { $myofftime = SeverOffSet()-1; $mydstime = "on"; }
183 $plusi = 1; $minusi = 12;
184 $plusnum = 15; $minusnum = 0;
185 while ($minusi > $minusnum) {
186 if($myofftime==-$minusi) {
187 echo "<option selected=\"selected\" value=\"-".$minusi."\">UTC - ".$minusi.":00 hours</option>\n"; }
188 if($myofftime!=-$minusi) {
189 echo "<option value=\"-".$minusi."\">UTC - ".$minusi.":00 hours</option>\n"; }
191 if($myofftime==0) { ?
>
192 <option selected
="selected" value
="0">UTC +
/- 0:00 hours
</option
>
193 <?php
} if($myofftime!=0) { ?
>
194 <option value
="0">UTC +
/- 0:00 hours
</option
>
196 while ($plusi < $plusnum) {
197 if($myofftime==$plusi) {
198 echo "<option selected=\"selected\" value=\"".$plusi."\">UTC + ".$plusi.":00 hours</option>\n"; }
199 if($myofftime!=$plusi) {
200 echo "<option value=\"".$plusi."\">UTC + ".$plusi.":00 hours</option>\n"; }
204 <td style
="width: 50%;"><label
class="TextBoxLabel" for="MinOffSet">Minute OffSet
:</label
></td
>
205 <td style
="width: 50%;"><select id
="MinOffSet" name
="MinOffSet" class="TextBox"><?php
206 $mini = 0; $minnum = 60;
207 while ($mini < $minnum) {
208 if(strlen($mini)==2) { $showmin = $mini; }
209 if(strlen($mini)==1) { $showmin = "0".$mini; }
211 echo "\n<option selected=\"selected\" value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
213 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
217 <td style
="width: 50%;"><label
class="TextBoxLabel" for="DST">Is
<span title
="Daylight Savings Time">DST
</span
> / <span title
="Summer Time">ST
</span
> on
or off
:</label
></td
>
218 <td style
="width: 50%;"><select id
="DST" name
="DST" class="TextBox"><?php
echo "\n" ?
>
219 <?php
if($mydstime=="off"||
$mydstime!="on") { ?
>
220 <option selected
="selected" value
="off">off
</option
><?php
echo "\n" ?
><option value
="on">on
</option
>
221 <?php
} if($mydstime=="on") { ?
>
222 <option selected
="selected" value
="on">on
</option
><?php
echo "\n" ?
><option value
="off">off
</option
>
223 <?php
} echo "\n" ?
></select
></td
>
225 <td style
="width: 50%;"><label
class="TextBoxLabel" for="TestReferer">Test Referering URL
:</label
></td
>
226 <td style
="width: 50%;"><select id
="TestReferer" name
="TestReferer" class="TextBox">
227 <option selected
="selected" value
="off">off
</option
>
228 <option value
="on">on
</option
>
231 <td style
="width: 50%;"><label
class="TextBoxLabel" for="DefaultTheme">Default Theme
</label
></td
>
232 <td style
="width: 50%;"><select id
="DefaultTheme" name
="DefaultTheme" class="TextBox"><?php
233 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
234 if ($handle = opendir($skindir)) { $dirnum = null;
235 while (false !== ($file = readdir($handle))) {
237 if ($dirnum==null) { $dirnum = 0; }
238 if (file_exists($skindir.$file."/info.php")) {
239 if ($file != "." && $file != "..") {
240 include($skindir.$file."/info.php");
242 $themelist[$dirnum] = "<option value=\"".$file."\" selected=\"selected\">".$ThemeInfo['ThemeName']."</option>"; }
244 $themelist[$dirnum] = "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
246 closedir($handle); asort($themelist);
247 $themenum=count($themelist); $themei=0;
248 while ($themei < $themenum) {
249 echo $themelist[$themei]."\n";
253 <td style
="width: 50%;"><label
class="TextBoxLabel" for="SQLThemes">Store Themes in SQL Database
:</label
></td
>
254 <td style
="width: 50%;"><select id
="SQLThemes" name
="SQLThemes" class="TextBox">
255 <option selected
="selected" value
="off">off
</option
>
256 <option value
="on">on
</option
>
259 <td style
="width: 50%;"><label
class="TextBoxLabel" title
="Might not work" for="unlink">Delete Installer?
</label
></td
>
260 <td style
="width: 50%;"><select id
="unlink" name
="unlink" class="TextBox">
261 <option value
="true">Yes
</option
>
262 <option value
="false">No
</option
>
265 <table style
="text-align: left;">
266 <tr style
="text-align: left;">
267 <td style
="width: 100%;">
268 <input type
="hidden" name
="charset" value
="<?php echo $_POST['charset']; ?>" style
="display: none;" />
269 <input type
="hidden" name
="SetupType" value
="install" style
="display: none;" />
270 <input type
="hidden" name
="DatabaseType" value
="<?php echo $Settings['sqltype']; ?>" style
="display: none;" />
271 <input type
="hidden" name
="act" value
="Part4" style
="display: none;" />
272 <input type
="submit" class="Button" value
="Install Board" name
="Install_Board" />
273 <input type
="reset" value
="Reset Form" class="Button" name
="Reset_Form" />