OSDN Git Service

07a3839c27007450baf6e04d9c9e4cb338c72470
[idb/iDB.git.git] / inc / admin / main.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-2011 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: main.php - Last Update: 08/12/2011 SVN 748 - Author: cooldude2k $
15 */
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="main.php"||$File3Name=="/main.php") {
18         require('index.php');
19         exit(); }
20
21 // Check if we can goto admin cp
22 if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
23 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
24 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
25 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
26 if(!isset($_POST['update'])) { $_POST['update'] = null; }
27 if($_GET['act']=="sql"&&$GroupInfo['ViewDBInfo']!="yes") {
28 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
29 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
30 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
31 if(!isset($_POST['update'])) { $_POST['update'] = null; }
32 if($_GET['act']=="resyncthemes"&&$Settings['SQLThemes']!="on") { $_GET['act'] = "enablesthemes"; }
33 if($_GET['act']=="enablesthemes"&&$Settings['SQLThemes']!="off") { $_GET['act'] = "resyncthemes"; }
34 $iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
35 $iDBRSVN = $VER2[2]." ".$SubVerN;
36 $OutPutLog = null;
37 $LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
38 $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";
39 $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   */");
40 $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";
41 if(!isset($_POST['update'])) { $_POST['update'] = null; }
42 function bool_string($boolean) {
43 if(!is_bool($boolean)) {
44 return $boolean; }
45 if(is_bool($boolean)) { 
46 if($boolean==0||$boolean===false) { 
47 return "false"; }
48 if($boolean==1||$boolean===true) { 
49 return "true"; } } }
50 function null_string($string) {
51 $strtype = strtolower(gettype($string));
52 if($strtype=="string") {
53         return "'".$string."'"; }
54 if($strtype=="null") {
55         return "null"; }
56 if($strtype=="integer") {
57         return $string; } 
58         return "null"; }
59 function rsq($string) {
60 $string = preg_replace("/^(\')|$(\')/i","\'",$string);
61 return $string; }
62 $KarmaExp = explode("&",$Settings['KarmaBoostDays']);
63 $KarmaNum = count($KarmaExp); 
64 $Karmai = 0; $KarmaNex = 0; $KarmaTemp = null;
65 while ($Karmai < $KarmaNum) {
66 if(is_numeric($KarmaExp[$Karmai])) {
67 $KarmaTemp[$KarmaNex] = $KarmaExp[$Karmai];
68 ++$KarmaNex; }
69 ++$Karmai; }
70 $KarmaExp = $KarmaTemp;
71 $Settings['KarmaBoostDays'] = implode("&",$KarmaExp);
72 $KBoostPercent = explode("|",$Settings['KBoostPercent']);
73 if(count($KBoostPercent)<1) { 
74 $Settings['KBoostPercent'] = "6|10"; }
75 if(!is_numeric($KBoostPercent[0])) {
76 $Settings['KBoostPercent'] = "6|10"; }
77 if(count($KBoostPercent)==1) { 
78 $Settings['KBoostPercent'] = "6|10"; }
79 if(!is_numeric($KBoostPercent[1])) {
80 $Settings['KBoostPercent'] = "6|10"; }
81 if(count($KBoostPercent)>2) { 
82 $Settings['KBoostPercent'] = "6|10"; }
83 if($Settings['html_type']=="html5") {
84 $Settings['output_type'] = "html"; }
85 if(!isset($Settings['sqltype'])) {
86         $Settings['sqltype'] = "mysql"; }
87 $Settings['sqltype'] = strtolower($Settings['sqltype']);
88 if($Settings['sqltype']!="mysql"&&
89         $Settings['sqltype']!="mysqli"&&
90         $Settings['sqltype']!="pgsql"&&
91         $Settings['sqltype']!="sqlite"&&
92         $Settings['sqltype']!="cubrid") {
93         $Settings['sqltype'] = "mysql"; }
94 if($Settings['sqltype']=="mysql"||
95         $Settings['sqltype']=="mysqli") {
96 $DBType['Server'] = "MySQL ".sql_server_info($SQLStat);
97 $DBType['Client'] = "MySQL ".sql_client_info($SQLStat); }
98 if($Settings['sqltype']=="pgsql") {
99 $DBType['Server'] = "Postgres ".sql_server_info($SQLStat);
100 $DBType['Client'] = "Postgres ".sql_client_info($SQLStat); }
101 if($Settings['sqltype']=="sqlite") {
102 $DBType['Server'] = "SQLite ".sql_server_info($SQLStat);
103 $DBType['Client'] = sql_client_info($SQLStat); }
104 if($Settings['sqltype']=="cubrid") {
105 $DBType['Server'] = "CUBRID ".sql_server_info($SQLStat);
106 $DBType['Client'] = "CUBRID ".sql_client_info($SQLStat); 
107 $DBType['PHP'] = "CUBRID ".cubrid_version(); }
108 if(!isset($Settings['vercheck'])) { 
109         $Settings['vercheck'] = 2; }
110 if($Settings['vercheck']!=1&&
111         $Settings['vercheck']!=2) {
112         $Settings['vercheck'] = 2; }
113 if(!isset($Settings['start_date'])) {
114         $Settings['start_date'] = GMTimeStamp(); }
115 if(!isset($Settings['SQLThemes'])) {
116         $Settings['SQLThemes'] = 'off'; }
117 if($Settings['SQLThemes']!="on"&&
118         $Settings['SQLThemes']!="off") {
119         $Settings['SQLThemes'] = 'off'; }
120 if(!isset($Settings['board_name'])&&isset($SettInfo['board_name'])) {
121         $Settings['board_name'] = $SettInfo['board_name']; }
122 if(!isset($SettInfo['board_name'])&&isset($Settings['board_name'])) {
123         $SettInfo['board_name'] = $Settings['board_name']; }
124 if($Settings['board_name']!=$SettInfo['board_name']) {
125         $SettInfo['board_name'] = $Settings['board_name']; }
126 if(!isset($Settings['VerCheckURL'])) {
127         $Settings['VerCheckURL'] = ""; }
128 if(!isset($Settings['IPCheckURL'])) {
129         $Settings['IPCheckURL'] = ""; }
130 if(!isset($Settings['log_config_format'])) {
131         $Settings['log_config_format'] = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""; }
132 if(!isset($Settings['idb_time_format'])) { 
133         $Settings['idb_time_format'] = "g:i A"; }
134 if(!isset($Settings['idb_date_format'])) { 
135         $Settings['idb_date_format'] = "F j Y"; }
136 ?>
137 <table class="Table3">
138 <tr style="width: 100%; vertical-align: top;">
139         <td style="width: 15%; vertical-align: top;">
140 <?php 
141 require($SettDir['admin'].'table.php'); 
142 if($_GET['act']=="delsessions"&&$GroupInfo['ViewDBInfo']=="yes") {
143 $time = GMTimeStamp() - ini_get("session.gc_maxlifetime");
144 //$sqlg = sql_pre_query('DELETE FROM \"'.$Settings['sqltable'].'sessions\" WHERE \"expires\" < UNIX_TIMESTAMP();', array(null));
145 $sqlgc = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" < %i", array($time));
146 sql_query($sqlgc,$SQLStat);
147 $_POST['update'] = "now"; $_GET['act'] = "optimize"; }
148 if($_GET['act']=="enablesthemes"&&$GroupInfo['ViewDBInfo']=="yes"&&$Settings['SQLThemes']=="off") {
149 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
150 $Settings['board_name'] = fixbamps($Settings['board_name']);
151 $Settings['board_name'] = remove_spaces($Settings['board_name']);
152 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
153 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
154 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
155 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
156 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
157 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
158 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
159 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
160 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
161 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
162 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
163 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
164 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
165 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
166 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
167 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
168 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
169 $BoardSettings=$pretext2[0]."\n".
170 "\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n".
171 "\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n".
172 "\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n".
173 "\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n".
174 "\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n".
175 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
176 "\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n".
177 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
178 "\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n".
179 "\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n".
180 "\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n".
181 "\$Settings['SQLThemes'] = 'on';\n".
182 "\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n".
183 "\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n".
184 "\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n".
185 "\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n".
186 "\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n".
187 "\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n".
188 "\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n".
189 "\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n".
190 "\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n".
191 "\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n".
192 "\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n".
193 "\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n".
194 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
195 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
196 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
197 "\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
198 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
199 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
200 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
201 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
202 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
203 "\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n".
204 "\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n".
205 "\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n".
206 "\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n".
207 "\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n".
208 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
209 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
210 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
211 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
212 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
213 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
214 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
215 "\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n".
216 "\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n".
217 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
218 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
219 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
220 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
221 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
222 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
223 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
224 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
225 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
226 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
227 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
228 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
229 "\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n".
230 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
231 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
232 "\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n".
233 "\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n".
234 "\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n".
235 "\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n".
236 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
237 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
238 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
239 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
240 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
241 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
242 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
243 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
244 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
245 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
246 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
247 $BoardSettings = $pretext.$settcheck.$BoardSettings;
248 $fp = fopen("settings.php","w+");
249 fwrite($fp, $BoardSettings);
250 fclose($fp);
251 //      cp("settings.php","settingsbak.php");
252 $fp = fopen("settingsbak.php","w+");
253 fwrite($fp, $BoardSettingsBak);
254 fclose($fp);
255 $Settings['SQLThemes'] = "on";
256 $_POST['update'] = "now"; $_GET['act'] = "resyncthemes"; }
257 if(($_GET['act']=="themelist"&&$GroupInfo['ViewDBInfo']=="yes")||
258         ($_GET['act']=="gettheme"&&$_POST['act']=="gettheme"&&$GroupInfo['ViewDBInfo']=="yes")) {
259 if($_GET['act']=="gettheme"&&$_POST['act']=="gettheme"&&$_POST['GetTheme']==null) {
260 $_GET['act'] = "themelist"; $_POST['act'] = ""; }
261 if($_GET['act']=="gettheme"&&$_POST['act']=="gettheme"&&$_POST['GetTheme']=="None") {
262 $_GET['act'] = "themelist"; $_POST['act'] = ""; }
263 $conn_id = ftp_connect("ftp.berlios.de",21,90);
264 ftp_login($conn_id, "anonymous", "anonymous");
265 ftp_pasv($conn_id, true);
266 if($_GET['act']=="themelist") {
267 ftp_chdir($conn_id, "/pub/idb/themes/"); }
268 if($_GET['act']=="gettheme"&&$_POST['act']=="gettheme") {
269 ftp_chdir($conn_id, "/pub/idb/themes/".$_POST['GetTheme']."/"); 
270 ftp_get($conn_id, $SettDir['archive'].$_POST['GetTheme'].".tar", "./".$_POST['GetTheme'].".tar", FTP_BINARY); 
271 untar($SettDir['archive'].$_POST['GetTheme'].".tar",$SettDir['themes'].$_POST['GetTheme']."/");
272 unlink($SettDir['archive'].$_POST['GetTheme'].".tar"); 
273 if($Settings['SQLThemes']=="off") { $_POST['update'] = "now"; }
274 if($Settings['SQLThemes']=="on") {
275 $_POST['update'] = "now"; $_GET['act'] = "resyncthemes"; } }
276 if($_GET['act']=="themelist") {
277 $themelist = ftp_nlist($conn_id, ".");
278 $it = 0; $numt = count($themelist);
279 $themeact = url_maker($exfile['admin'],$Settings['file_ext'],"act=gettheme",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']);
280 $admincptitle = " ".$ThemeSet['TitleDivider']." Theme Setup";
281 ?>
282 </td>
283         <td style="width: 85%; vertical-align: top;">
284 <div class="TableMenuBorder">
285 <?php if($ThemeSet['TableStyle']=="div") { ?>
286 <div class="TableMenuRow1">
287 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $themeact; ?>">Theme Setup</a></div>
288 <?php } ?>
289 <table class="TableMenu" style="width: 100%;">
290 <?php if($ThemeSet['TableStyle']=="table") { ?>
291 <tr class="TableMenuRow1">
292 <td class="TableMenuColumn1"><span style="float: left;">
293 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $themeact; ?>">Theme Setup</a>
294 </span><span style="float: right;">&nbsp;</span></td>
295 </tr><?php } ?>
296 <tr id="ProfileTitle" class="TableMenuRow2">
297 <th class="TableMenuColumn2">Theme Setup</th>
298 </tr>
299 <tr class="TableMenuRow3" id="NotePadRow">
300 <td class="TableMenuColumn3">
301 <form style="display: inline;" method="post" action="<?php echo $themeact; ?>"><div style="text-align: center;">
302 <label class="TextBoxLabel" for="GetTheme">Install Theme:</label><br />
303 <select size="1" name="GetTheme" id="GetTheme" class="TextBox">
304 <option value="None">None</option>
305 <?php
306 while ($it < $numt) {
307 if(!file_exists($SettDir['themes'].$themelist[$it])) {
308 echo "<option value=\"".$themelist[$it]."\">".$themelist[$it]."</option>\n"; }
309 ++$it; }
310 ?>
311 </select><br />
312 <input type="hidden" name="act" value="gettheme" style="display: none;" />
313 <input type="submit" value="Install" />
314 </div></form></td>
315 </tr>
316 <tr id="ProfileEnd" class="TableMenuRow4">
317 <td class="TableMenuColumn4">&nbsp;</td>
318 </tr>
319 </table>
320 </div>
321 <?php } ftp_close($conn_id); }
322 if($_GET['act']=="resyncthemes"&&$GroupInfo['ViewDBInfo']=="yes"&&$Settings['SQLThemes']=="on") {
323 $time = GMTimeStamp() - ini_get("session.gc_maxlifetime");
324 //$sqlg = sql_pre_query('DELETE FROM \"'.$Settings['sqltable'].'sessions\" WHERE \"expires\" < UNIX_TIMESTAMP();', array(null));
325 if($Settings['sqltype']=="mysql"||
326         $Settings['sqltype']=="mysqli"||
327         $Settings['sqltype']=="cubrid") {
328 $sqlgc = sql_pre_query("TRUNCATE TABLE \"".$Settings['sqltable']."themes\"", array(null));
329 sql_query($sqlgc,$SQLStat);
330 $sqlgc = sql_pre_query("ALTER TABLE \"".$Settings['sqltable']."themes\" AUTO_INCREMENT=1", array(null));
331 sql_query($sqlgc,$SQLStat); }
332 if($Settings['sqltype']=="pgsql") {
333 $sqlgc = sql_pre_query("TRUNCATE TABLE \"".$Settings['sqltable']."themes\"", array(null));
334 sql_query($sqlgc,$SQLStat);
335 $sqlgc = sql_pre_query("SELECT setval('".$Settings['sqltable']."themes_id_seq', 1, false);", array(null));
336 sql_query($sqlgc,$SQLStat); }
337 if($Settings['sqltype']=="sqlite") {
338 $sqlgc = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."themes\";", array(null));
339 sql_query($sqlgc,$SQLStat); }
340 $skindir = dirname(realpath("sql.php"))."/".$SettDir['themes'];
341 if ($handle = opendir($skindir)) { $dirnum = null;
342    while (false !== ($file = readdir($handle))) {
343            if ($dirnum==null) { $dirnum = 0; }
344            if (is_dir($skindir.$file)) {
345            if (file_exists($skindir.$file."/info.php")) {
346                    if ($file != "." && $file != "..") {
347            include($skindir.$file."/info.php");
348        $themelist[$dirnum] =  $file;
349            ++$dirnum; } } } }
350    closedir($handle); asort($themelist);
351    $themenum=count($themelist); $themei=0; 
352    while ($themei < $themenum) {
353    include($skindir.$themelist[$themei]."/settings.php");
354    $query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."themes\" (\"Name\", \"ThemeName\", \"ThemeMaker\", \"ThemeVersion\", \"ThemeVersionType\", \"ThemeSubVersion\", \"MakerURL\", \"CopyRight\", \"WrapperString\", \"CSS\", \"CSSType\", \"FavIcon\", \"TableStyle\", \"MiniPageAltStyle\", \"PreLogo\", \"Logo\", \"LogoStyle\", \"SubLogo\", \"TopicIcon\", \"MovedTopicIcon\", \"HotTopic\", \"MovedHotTopic\", \"PinTopic\", \"AnnouncementTopic\", \"MovedPinTopic\", \"HotPinTopic\", \"MovedHotPinTopic\", \"ClosedTopic\", \"MovedClosedTopic\", \"HotClosedTopic\", \"MovedHotClosedTopic\", \"PinClosedTopic\", \"MovedPinClosedTopic\", \"HotPinClosedTopic\", \"MovedHotPinClosedTopic\", \"MessageRead\", \"MessageUnread\", \"Profile\", \"WWW\", \"PM\", \"TopicLayout\", \"AddReply\", \"FastReply\", \"NewTopic\", \"QuoteReply\", \"EditReply\", \"DeleteReply\", \"Report\", \"LineDivider\", \"ButtonDivider\", \"LineDividerTopic\", \"TitleDivider\", \"ForumStyle\", \"ForumIcon\", \"SubForumIcon\", \"RedirectIcon\", \"TitleIcon\", \"NavLinkIcon\", \"NavLinkDivider\", \"StatsIcon\", \"NoAvatar\", \"NoAvatarSize\") VALUES\n".
355    "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s');", array($themelist[$themei], $ThemeSet['ThemeName'], $ThemeSet['ThemeMaker'], $ThemeSet['ThemeVersion'], $ThemeSet['ThemeVersionType'], $ThemeSet['ThemeSubVersion'], $ThemeSet['MakerURL'], $ThemeSet['CopyRight'], $ThemeSet['WrapperString'], $ThemeSet['CSS'], $ThemeSet['CSSType'], $ThemeSet['FavIcon'], $ThemeSet['TableStyle'], $ThemeSet['MiniPageAltStyle'], $ThemeSet['PreLogo'], $ThemeSet['Logo'], $ThemeSet['LogoStyle'], $ThemeSet['SubLogo'], $ThemeSet['TopicIcon'], $ThemeSet['MovedTopicIcon'], $ThemeSet['HotTopic'], $ThemeSet['MovedHotTopic'], $ThemeSet['PinTopic'], $ThemeSet['AnnouncementTopic'], $ThemeSet['MovedPinTopic'], $ThemeSet['HotPinTopic'], $ThemeSet['MovedHotPinTopic'], $ThemeSet['ClosedTopic'], $ThemeSet['MovedClosedTopic'], $ThemeSet['HotClosedTopic'], $ThemeSet['MovedHotClosedTopic'], $ThemeSet['PinClosedTopic'], $ThemeSet['MovedPinClosedTopic'], $ThemeSet['HotPinClosedTopic'], $ThemeSet['MovedHotPinClosedTopic'], $ThemeSet['MessageRead'], $ThemeSet['MessageUnread'], $ThemeSet['Profile'], $ThemeSet['WWW'], $ThemeSet['PM'], $ThemeSet['TopicLayout'], $ThemeSet['AddReply'], $ThemeSet['FastReply'], $ThemeSet['NewTopic'], $ThemeSet['QuoteReply'], $ThemeSet['EditReply'], $ThemeSet['DeleteReply'], $ThemeSet['Report'], $ThemeSet['LineDivider'], $ThemeSet['ButtonDivider'], $ThemeSet['LineDividerTopic'], $ThemeSet['TitleDivider'], $ThemeSet['ForumStyle'], $ThemeSet['ForumIcon'], $ThemeSet['SubForumIcon'], $ThemeSet['RedirectIcon'], $ThemeSet['TitleIcon'], $ThemeSet['NavLinkIcon'], $ThemeSet['NavLinkDivider'], $ThemeSet['StatsIcon'], $ThemeSet['NoAvatar'], $ThemeSet['NoAvatarSize']));
356    sql_query($query,$SQLStat);
357    ++$themei; } }
358 $themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_GET['theme']));
359 $themeresult=sql_query($themequery,$SQLStat);
360 $themenum=sql_num_rows($themeresult);
361 require($SettDir['inc'].'sqlthemes.php');
362 $_POST['update'] = "now"; $_GET['act'] = "optimize"; }
363 if($_GET['act']=="optimize"&&$GroupInfo['ViewDBInfo']=="yes") {
364 $TablePreFix = $Settings['sqltable'];
365 function add_prefix($tarray) {
366 global $TablePreFix;
367 return $TablePreFix.$tarray; }
368 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "topics", "wordfilter");
369 $TableChCk = array_map("add_prefix",$TableChCk);
370 $tcount = count($TableChCk); $ti = 0;
371 $TblOptimized = 0;
372 if($Settings['sqltype']!="sqlite") {
373 while ($ti < $tcount) {
374 if(isset($OptimizeAr["Msg_text"])) { unset($OptimizeAr["Msg_text"]); }
375 if(isset($OptimizeAr[3])) { unset($OptimizeAr[3]); }
376 if($Settings['sqltype']=="mysql"||
377         $Settings['sqltype']=="mysqli") {
378 $OptimizeTea = sql_query(sql_pre_query("OPTIMIZE TABLE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
379 if($Settings['sqltype']=="cubrid") {
380 $OptimizeTea = sql_query(sql_pre_query("UPDATE STATISTICS ON \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
381 if($Settings['sqltype']=="pgsql") {
382 $OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
383 if($Settings['sqltype']=="mysql"||
384         $Settings['sqltype']=="mysqli"||
385         $Settings['sqltype']=="cubrid") {
386 $OptimizeAr = sql_fetch_array($OptimizeTea);
387 if(!isset($OptimizeAr["Msg_text"])&&
388         isset($OptimizeAr[3])) { $OptimizeAr["Msg_text"] = $OptimizeAr[3]; }
389 if($OptimizeAr["Msg_text"]=="OK") { 
390         ++$TblOptimized; } } ++$ti; } }
391 if($Settings['sqltype']=="sqlite") {
392 $OptimizeTea = sql_query(sql_pre_query("VACUUM", array(null)),$SQLStat); }
393 if($Settings['sqltype']=="mysql"||
394         $Settings['sqltype']=="mysqli"||
395         $Settings['sqltype']=="cubrid") {
396 $OutPutLog = "MySQL Output: ".$TblOptimized." tables optimized."; }
397 if($Settings['sqltype']=="pgsql") {
398 $OutPutLog = "PGSQL Output: All tables optimized."; }
399 if($Settings['sqltype']=="sqlite") {
400 $OutPutLog = "SQLite Output: All tables optimized."; }
401 if($Settings['sqltype']=="cubrid") {
402 $OutPutLog = "CUBRID Output: All tables optimized."; }
403 $_POST['update'] = "now"; $_GET['act'] = "view"; }
404 ?>
405 </td>
406         <td style="width: 85%; vertical-align: top;">
407 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
408 $updateact = url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
409 $admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
410 redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"3");
411 ?>
412 <div class="TableMenuBorder">
413 <?php if($ThemeSet['TableStyle']=="div") { ?>
414 <div class="TableMenuRow1">
415 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
416 <?php } ?>
417 <table class="TableMenu" style="width: 100%;">
418 <?php if($ThemeSet['TableStyle']=="table") { ?>
419 <tr class="TableMenuRow1">
420 <td class="TableMenuColumn1"><span style="float: left;">
421 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
422 </span><span style="float: right;">&nbsp;</span></td>
423 </tr><?php } ?>
424 <tr id="ProfileTitle" class="TableMenuRow2">
425 <th class="TableMenuColumn2">Updating Settings</th>
426 </tr>
427 <tr class="TableMenuRow3" id="ProfileUpdate">
428 <td class="TableMenuColumn3">
429 <div style="text-align: center;">
430 <?php if(isset($OutPutLog)) { echo "<br />".$OutPutLog; } ?>
431 <br />Settings have been updated <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">click here</a> to go back. ^_^<br />&nbsp;</div>
432 <?php } if($_GET['act']=="view"&&$_POST['update']!="now") {
433 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
434 $result=sql_query($query,$SQLStat);
435 $num=sql_num_rows($result);
436 $i=0;
437 $YourID=sql_result($result,$i,"id");
438 $Notes=sql_result($result,$i,"Notes");
439 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
440 $notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
441 $admincptitle = " ".$ThemeSet['TitleDivider']." Admin CP";
442 ?>
443 <div class="TableMenuBorder">
444 <?php if($ThemeSet['TableStyle']=="div") { ?>
445 <div class="TableMenuRow1">
446 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a></div>
447 <?php } ?>
448 <table class="TableMenu" style="width: 100%;">
449 <?php if($ThemeSet['TableStyle']=="table") { ?>
450 <tr class="TableMenuRow1">
451 <td class="TableMenuColumn1"><span style="float: left;">
452 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
453 </span><span style="float: right;">&nbsp;</span></td>
454 </tr><?php } ?>
455 <tr id="ProfileTitle" class="TableMenuRow2">
456 <th class="TableMenuColumn2">NotePad</th>
457 </tr>
458 <tr class="TableMenuRow3" id="NotePadRow">
459 <td class="TableMenuColumn3">
460 <form method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
461 <label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
462 <textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
463 <input type="hidden" name="act" value="view" style="display: none;" />
464 <input type="hidden" name="update" value="now" style="display: none;" />
465 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
466 </div></form></td>
467 </tr>
468 <tr id="ProfileEnd" class="TableMenuRow4">
469 <td class="TableMenuColumn4">&nbsp;</td>
470 </tr>
471 </table>
472 </div>
473 <?php } if($_GET['act']=="settings"&&$_POST['update']!="now") {
474 require('settings.php'); $admincptitle = " ".$ThemeSet['TitleDivider']." Settings Manager";
475 $ts_array = explode(":",$Settings['DefaultTimeZone']);
476 if(count($ts_array)!=2) {
477         if(!isset($ts_array[0])) { $ts_array[0] = "0"; }
478         if(!isset($ts_array[1])) { $ts_array[1] = "00"; }
479         $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
480 if(!is_numeric($ts_array[0])) { $ts_array[0] = "0"; }
481 if(!is_numeric($ts_array[1])) { $ts_array[1] = "00"; }
482 if($ts_array[1]<0) { $ts_array[1] = "00"; $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
483 $tsa = array("offset" => $Settings['DefaultTimeZone'], "hour" => $ts_array[0], "minute" => $ts_array[1]);
484 $mguerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE (\"Name\"<>'%s') ORDER BY \"id\" ASC", array("Admin"));
485 $mgresults=sql_query($mguerys,$SQLStat);
486 $mnum=sql_num_rows($mgresults);
487 $mi = 0;
488 while ($mi < $mnum) {
489 $MGroups[$mi]=sql_result($mgresults,$mi,"Name");
490 ++$mi; }
491 sql_free_result($mgresults);
492 if($Settings['vercheck']===1) {
493 $AdminCheckURL = url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck&redirect=on",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); }
494 if($Settings['vercheck']===2) {
495 $AdminCheckURL = url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck&vercheck=newtype&redirect=on",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); }
496 $AddChkURL = null;
497 if(isset($_GET['menu'])&&$_GET['menu']=="main") { $AddChkURL = "&menu=main"; }
498 ?>
499 <div class="TableMenuBorder">
500 <?php if($ThemeSet['TableStyle']=="div") { ?>
501 <div class="TableMenuRow1">
502 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Settings Manager</a></div>
503 <?php } ?>
504 <table class="TableMenu" style="width: 100%;">
505 <?php if($ThemeSet['TableStyle']=="table") { ?>
506 <tr class="TableMenuRow1">
507 <td class="TableMenuColumn1"><span style="float: left;">
508 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Settings Manager</a>
509 </span><span style="float: right;">&nbsp;</span></td>
510 </tr><?php } ?>
511 <tr class="TableMenuRow2">
512 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
513 <span style="float: left;">&nbsp;Editing Setting for iDB: </span>
514 <span style="float: right;">&nbsp;</span>
515 </th>
516 </tr>
517 <tr class="TableMenuRow3">
518 <td class="TableMenuColumn3">
519 <form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
520 <table style="text-align: left;">
521 <tr>
522         <td style="width: 50%;"><span class="TextBoxLabel" title="Using User Time Zone">[User TimeZone] Install Date:</span></td>
523         <td style="width: 50%;"><?php echo GMTimeChange($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat'],$Settings['start_date'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']); ?></td>
524 </tr><?php if($_SESSION['UserTimeZone']!=$Settings['DefaultTimeZone']||
525         $_SESSION['UserDST']!=$Settings['DefaultDST']) { ?><tr>
526         <td style="width: 50%;"><span class="TextBoxLabel" title="Using Board Time Zone">[Board TimeZone] Install Date:</span></td>
527         <td style="width: 50%;"><?php echo GMTimeChange($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat'],$Settings['start_date'],$Settings['DefaultTimeZone'],0,$Settings['DefaultDST']); ?></td>
528 </tr><?php } if($GroupInfo['ViewDBInfo']=="yes") { 
529 ?><tr style="text-align: left;">
530         <td style="width: 50%;"><span class="TextBoxLabel">Forum Software Version:</span></td>
531         <td style="width: 50%;"><?php echo $VerInfo['iDB_Ver_Show']; ?>&nbsp;<a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>" onclick="window.open(this.href);return false;"><img src="<?php echo $AdminCheckURL; ?>" alt="Version Check: Click to see more info." title="Version Check: Click to see more info." /></a></td>
532 </tr><tr>
533         <td style="width: 50%;"><span class="TextBoxLabel">Forum UUID:</span></td>
534         <td style="width: 50%;"><?php echo $Settings['BoardUUID']; ?></td>
535 </tr><tr id="clickhere" style="text-align: left;">
536         <td style="width: 50%;"><span class="TextBoxLabel">Version Checker:</span></td>
537         <td style="width: 50%;"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=settings".$AddChkURL,$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>#iverinfo" onclick="idbvercheck(); document.getElementById('clickhere').style.display = 'none';">Click Here</a></td>
538 </tr><?php if($OSType!=""&&isset($OSType)) { 
539 ?><tr style="text-align: left;">
540         <td style="width: 50%;"><span class="TextBoxLabel">Server Operating System:</span></td>
541         <td style="width: 50%;"><?php echo $OSType; ?></td>
542 </tr><?php } } ?><tr style="text-align: left;">
543         <td style="width: 50%;"><label class="TextBoxLabel" for="BoardURL">Insert The Board URL:</label></td>
544         <td style="width: 50%;"><input type="text" class="TextBox" name="BoardURL" size="20" id="BoardURL" value="<?php echo $Settings['idburl']; ?>" /></td>
545 </tr><tr style="text-align: left;">
546         <td style="width: 50%;"><label class="TextBoxLabel" for="WebURL">Insert The WebSite URL:</label></td>
547         <td style="width: 50%;"><input type="text" class="TextBox" name="WebURL" size="20" id="WebURL" value="<?php echo $Settings['weburl']; ?>" /></td>
548 </tr><tr style="text-align: left;">
549         <td style="width: 50%;"><label class="TextBoxLabel" for="GuestGroup">Insert The Guest Group:</label></td>
550         <td style="width: 50%;"><select id="GuestGroup" name="GuestGroup" class="TextBox">
551 <option selected="selected" value="<?php echo $Settings['GuestGroup']; ?>">Old Value (<?php echo $Settings['GuestGroup']; ?>)</option>
552 <?php $gi = 0; $gnum = count($MGroups);
553 while ($gi < $gnum) { ?>
554 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
555 <?php ++$gi; } ?>
556 </select></td>
557 </tr><tr style="text-align: left;">
558         <td style="width: 50%;"><label class="TextBoxLabel" for="MemberGroup">Insert The Member Group:</label></td>
559         <td style="width: 50%;"><select id="MemberGroup" name="MemberGroup" class="TextBox">
560 <option selected="selected" value="<?php echo $Settings['MemberGroup']; ?>">Old Value (<?php echo $Settings['MemberGroup']; ?>)</option>
561 <?php $gi = 0; $gnum = count($MGroups);
562 while ($gi < $gnum) { ?>
563 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
564 <?php ++$gi; } ?>
565 </select></td>
566 </tr><tr style="text-align: left;">
567         <td style="width: 50%;"><label class="TextBoxLabel" for="ValidateGroup">Insert The Validate Group:</label></td>
568         <td style="width: 50%;"><select id="ValidateGroup" name="ValidateGroup" class="TextBox">
569 <option selected="selected" value="<?php echo $Settings['ValidateGroup']; ?>">Old Value (<?php echo $Settings['ValidateGroup']; ?>)</option>
570 <?php $gi = 0; $gnum = count($MGroups);
571 while ($gi < $gnum) { ?>
572 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
573 <?php ++$gi; } ?>
574 </select></td>
575 </tr><tr style="text-align: left;">
576         <td style="width: 50%;"><label class="TextBoxLabel" for="AdminValidate">Enable validate new members:</label></td>
577         <td style="width: 50%;"><select size="1" class="TextBox" name="AdminValidate" id="AdminValidate">
578         <option<?php if($Settings['AdminValidate']=="off") { echo " selected=\"selected\""; } ?> value="off">no</option>
579         <option<?php if($Settings['AdminValidate']=="on") { echo " selected=\"selected\""; } ?> value="on">yes</option>
580         </select></td>
581 </tr><tr style="text-align: left;">
582         <td style="width: 50%;"><label class="TextBoxLabel" for="max_posts">Max replies per page:</label></td>
583         <td style="width: 50%;"><select id="max_posts" name="max_posts" class="TextBox">
584 <option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
585 <option value="5">5</option>
586 <option value="10">10</option>
587 <option value="15">15</option>
588 <option value="20">20</option>
589 <option value="25">25</option>
590 <option value="30">30</option>
591 <option value="30">35</option>
592 <option value="30">40</option>
593 </select></td>
594 </tr><tr style="text-align: left;">
595         <td style="width: 50%;"><label class="TextBoxLabel" for="max_topics">Max topics per page:</label></td>
596         <td style="width: 50%;"><select id="max_topics" name="max_topics" class="TextBox">
597 <option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
598 <option value="5">5</option>
599 <option value="10">10</option>
600 <option value="15">15</option>
601 <option value="20">20</option>
602 <option value="25">25</option>
603 <option value="30">30</option>
604 <option value="30">35</option>
605 <option value="30">40</option>
606 </select></td>
607 </tr><tr style="text-align: left;">
608         <td style="width: 50%;"><label class="TextBoxLabel" for="max_memlist">Max members per page:</label></td>
609         <td style="width: 50%;"><select id="max_memlist" name="max_memlist" class="TextBox">
610 <option selected="selected" value="<?php echo $Settings['max_memlist']; ?>">Old Value (<?php echo $Settings['max_memlist']; ?>)</option>
611 <option value="5">5</option>
612 <option value="10">10</option>
613 <option value="15">15</option>
614 <option value="20">20</option>
615 <option value="25">25</option>
616 <option value="30">30</option>
617 <option value="30">35</option>
618 <option value="30">40</option>
619 </select></td>
620 </tr><tr style="text-align: left;">
621         <td style="width: 50%;"><label class="TextBoxLabel" for="max_pmlist">Max pms per page:</label></td>
622         <td style="width: 50%;"><select id="max_pmlist" name="max_pmlist" class="TextBox">
623 <option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
624 <option value="5">5</option>
625 <option value="10">10</option>
626 <option value="15">15</option>
627 <option value="20">20</option>
628 <option value="25">25</option>
629 <option value="30">30</option>
630 <option value="30">35</option>
631 <option value="30">40</option>
632 </select></td>
633 </tr><tr style="text-align: left;">
634         <td style="width: 50%;"><label class="TextBoxLabel" for="hot_topic_num">Number of replies for hot topic:</label></td>
635         <td style="width: 50%;"><select id="hot_topic_num" name="hot_topic_num" class="TextBox">
636 <option selected="selected" value="<?php echo $Settings['hot_topic_num']; ?>">Old Value (<?php echo $Settings['hot_topic_num']; ?>)</option>
637 <option value="5">5</option>
638 <option value="10">10</option>
639 <option value="15">15</option>
640 <option value="20">20</option>
641 <option value="25">25</option>
642 <option value="30">30</option>
643 <option value="30">35</option>
644 <option value="30">40</option>
645 </select></td>
646 </tr><tr style="text-align: left;">
647         <td style="width: 50%;"><label class="TextBoxLabel" title="Can save some bandwidth." for="UseGzip">Enable HTTP Compression:</label></td>
648         <td style="width: 50%;"><select size="1" class="TextBox" name="UseGzip" id="UseGzip">
649         <option<?php if($Settings['use_gzip']=="off") { echo " selected=\"selected\""; } ?> value="off">No</option>
650         <option<?php if($Settings['use_gzip']=="on") { echo " selected=\"selected\""; } ?> value="on">Yes</option>
651         <option<?php if($Settings['use_gzip']=="gzip") { echo " selected=\"selected\""; } ?> value="gzip">Only GZip</option>
652         <option<?php if($Settings['use_gzip']=="deflate") { echo " selected=\"selected\""; } ?> value="deflate">Only Deflate</option>
653         </select></td>
654 </tr><tr style="text-align: left;">
655         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLType">HTML Type to use:</label></td>
656         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLType" id="HTMLType">
657         <option<?php if($Settings['html_type']=="xhtml10") { echo " selected=\"selected\""; } ?> value="xhtml10">XHTML 1.0</option>
658         <option<?php if($Settings['html_type']=="xhtml11") { echo " selected=\"selected\""; } ?> value="xhtml11">XHTML 1.1</option>
659         <option<?php if($Settings['html_type']=="html5") { echo " selected=\"selected\""; } ?> value="html5">HTML 5</option>
660         <option<?php if($Settings['html_type']=="xhtml5") { echo " selected=\"selected\""; } ?> value="xhtml5">XHTML 5</option>
661         </select></td>
662 </tr><tr style="text-align: left;">
663         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLLevel">HTML Level only for XHTML 1.0:</label></td>
664         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLLevel" id="HTMLLevel">
665         <option<?php if($Settings['html_level']=="Transitional") { echo " selected=\"selected\""; } ?> value="Transitional">Transitional</option>
666         <option<?php if($Settings['html_level']=="Strict") { echo " selected=\"selected\""; } ?> value="Strict">Strict</option>
667         </select></td>
668 </tr><tr style="text-align: left;">
669         <td style="width: 50%;"><label class="TextBoxLabel" for="OutPutType">Output file as:</label></td>
670         <td style="width: 50%;"><select size="1" class="TextBox" name="OutPutType" id="OutPutType">
671         <option<?php if($Settings['output_type']=="html") { echo " selected=\"selected\""; } ?> value="html">HTML</option>
672         <option<?php if($Settings['output_type']=="xhtml") { echo " selected=\"selected\""; } ?> value="xhtml">XHTML</option>
673         </select></td>
674 </tr><tr style="text-align: left;">
675         <td style="width: 50%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
676         <td style="width: 50%;"><select id="YourOffSet" name="YourOffSet" class="TextBox"><?php
677 $myofftime = $tsa['hour']; $mydstime = "off";
678 $plusi = 1; $minusi = 12;
679 $plusnum = 15; $minusnum = 0;
680 while ($minusi > $minusnum) {
681 if($myofftime==-$minusi) {
682 echo "<option selected=\"selected\" value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
683 if($myofftime!=-$minusi) {
684 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
685 --$minusi; }
686 if($myofftime==0) { ?>
687 <option selected="selected" value="0">GMT +/- 0:00 hours</option>
688 <?php } if($myofftime!=0) { ?>
689 <option value="0">GMT +/- 0:00 hours</option>
690 <?php }
691 while ($plusi < $plusnum) {
692 if($myofftime==$plusi) {
693 echo "<option selected=\"selected\" value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
694 if($myofftime!=$plusi) {
695 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
696 ++$plusi; }
697 ?></select></td>
698 </tr><tr style="text-align: left;">
699         <td style="width: 50%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
700         <td style="width: 50%;"><select id="MinOffSet" name="MinOffSet" class="TextBox"><?php
701 $mini = 0; $minnum = 60; $mymin = $tsa['minute'];
702 while ($mini < $minnum) {
703 if(strlen($mini)==2) { $showmin = $mini; }
704 if(strlen($mini)==1) { $showmin = "0".$mini; }
705 if($mini==$mymin) {
706 echo "\n<option selected=\"selected\" value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
707 if($mini!=$mymin) {
708 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
709 ++$mini; }
710 ?></select></td>
711 </tr><tr style="text-align: left;">
712         <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>
713         <td style="width: 50%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
714 <option<?php if($Settings['DefaultDST']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
715 <option<?php if($Settings['DefaultDST']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
716 </select></td>
717 </tr><tr style="text-align: left;">
718         <td style="width: 50%;"><label class="TextBoxLabel" for="DefaultTheme">Default Theme:</label></td>
719         <td style="width: 50%;"><select id="DefaultTheme" name="DefaultTheme" class="TextBox"><?php
720 if($Settings['SQLThemes']=="off") {
721 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
722 if ($handle = opendir($skindir)) { $dirnum = null;
723    while (false !== ($file = readdir($handle))) {
724            if ($dirnum==null) { $dirnum = 0; }
725            if (is_dir($skindir.$file)&&file_exists($skindir.$file."/info.php")) {
726                    if ($file != "." && $file != "..") {
727            include($skindir.$file."/info.php");
728            if($Settings['DefaultTheme']==$file) {
729            $themelist[$dirnum] =  "<option selected=\"selected\" value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
730            if($Settings['DefaultTheme']!=$file) {
731        $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
732            ++$dirnum; } } }
733    closedir($handle); asort($themelist);
734    $themenum=count($themelist); $themei=0; 
735    while ($themei < $themenum) {
736    echo $themelist[$themei]."\n";
737    ++$themei; } } }
738 if($Settings['SQLThemes']=="on") {
739 $sknquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" ORDER BY \"id\" ASC, \"Name\" ASC", array(null));
740 $sknresult=sql_query($sknquery,$SQLStat);
741 $sknum=sql_num_rows($sknresult);
742 $skni=0;
743 while ($skni < $sknum) {
744 $ThemeInfo['Name'] = sql_result($sknresult,$skni,"Name");
745 $ThemeInfo['ThemeName'] = sql_result($sknresult,$skni,"ThemeName");
746 if($Settings['DefaultTheme']==$ThemeInfo['Name']) {
747 echo "<option selected=\"selected\" value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n"; }
748 if($Settings['DefaultTheme']!=$ThemeInfo['Name']) {
749 echo "<option value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n"; }
750 ++$skni; }
751 } ?></select></td>
752 </tr><tr style="text-align: left;">
753         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_https">Enable HTTPS:</label></td>
754         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_https" id="enable_https">
755         <option<?php if($Settings['enable_https']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
756         <option<?php if($Settings['enable_https']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
757         </select></td>
758 </tr><tr style="text-align: left;">
759         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_rss">Enable RSS:</label></td>
760         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_rss" id="enable_rss">
761         <option<?php if($Settings['enable_rss']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
762         <option<?php if($Settings['enable_rss']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
763         </select></td>
764 </tr><tr style="text-align: left;">
765         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_search">Enable search:</label></td>
766         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_search" id="enable_search">
767         <option<?php if($Settings['enable_search']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
768         <option<?php if($Settings['enable_search']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
769         </select></td>
770 </tr><tr style="text-align: left;">
771         <td style="width: 50%;"><label class="TextBoxLabel" for="TestReferer">Test Referering URL:</label></td>
772         <td style="width: 50%;"><select id="TestReferer" name="TestReferer" class="TextBox">
773 <option<?php if($Settings['TestReferer']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
774 <option<?php if($Settings['TestReferer']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
775 </select></td>
776 </tr><tr style="text-align: left;">
777         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
778         <td style="width: 50%;"><input type="text" class="TextBox" name="iDBTimeFormat" size="20" id="iDBTimeFormat" value="<?php echo htmlentities($Settings['idb_time_format'], ENT_QUOTES, $Settings['charset']); ?>" /></td>
779 </tr><tr style="text-align: left;">
780         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
781         <td style="width: 50%;"><input type="text" class="TextBox" name="iDBDateFormat" size="20" id="iDBDateFormat" value="<?php echo htmlentities($Settings['idb_date_format'], ENT_QUOTES, $Settings['charset']); ?>" /></td>
782 </tr><tr style="text-align: left;">
783         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBHTTPLogger">Log Every HTTP Requests:</label></td>
784         <td style="width: 50%;"><select id="iDBHTTPLogger" name="iDBHTTPLogger" class="TextBox">
785 <option<?php if($Settings['log_http_request']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
786 <option<?php if($Settings['log_http_request']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
787 </select></td>
788 </tr><tr style="text-align: left;">
789         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBLoggerFormat">Insert The Format for HTTP Logger:</label></td>
790         <td style="width: 50%;"><input type="text" class="TextBox" name="iDBLoggerFormat" size="20" id="iDBLoggerFormat" value="<?php echo htmlentities($Settings['log_config_format'], ENT_QUOTES, $Settings['charset']); ?>" /></td>
791 </tr></table>
792 <table style="text-align: left;">
793 <tr style="text-align: left;">
794 <td style="width: 100%;">
795 <?php if($GroupInfo['ViewDBInfo']=="yes") { ?>
796 <span style="display: none;" id="iverinfo"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>#" onclick="idbvercheck();">Version Checker: Click Here</a><br /><br /></span>
797 <?php } ?>
798 <input type="hidden" name="act" value="settings" style="display: none;" />
799 <input type="hidden" name="update" value="now" style="display: none;" />
800 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
801 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
802 </td></tr></table>
803 </form>
804 </td>
805 </tr>
806 <tr class="TableMenuRow4">
807 <td class="TableMenuColumn4">&nbsp;</td>
808 </tr>
809 </table>
810 </div>
811 <?php } if($_POST['act']=="settings"&&$_POST['update']=="now"&&$_GET['act']=="settings"&&
812         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
813 $_POST  = array_map("rsq", $_POST);
814 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
815         $Settings['BoardUUID'] = rand_uuid("rand"); }
816 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
817 $Settings['board_name'] = fixbamps($Settings['board_name']);
818 $Settings['board_name'] = remove_spaces($Settings['board_name']);
819 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
820 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
821 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
822 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
823 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
824 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
825 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
826 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
827 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
828 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
829 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
830 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
831 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
832 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
833 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
834 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
835 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
836 $_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['charset']);
837 $_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
838 $_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
839 $_POST['WebURL'] = remove_spaces($_POST['WebURL']);
840 $_POST['iDBTimeFormat'] = convert_strftime($_POST['iDBTimeFormat']);
841 $_POST['iDBDateFormat'] = convert_strftime($_POST['iDBDateFormat']);
842 $Settings['idb_time_format'] = $_POST['iDBTimeFormat'];
843 $Settings['idb_date_format'] = $_POST['iDBDateFormat'];
844 $Settings['log_http_request'] = $_POST['iDBHTTPLogger'];
845 $Settings['log_config_format'] = $_POST['iDBLoggerFormat'];
846 if($_POST['HTMLType']=="xhtml11") { $_POST['HTMLLevel'] = "Strict"; }
847 if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
848 if($_POST['HTMLType']=="xhtml5") { $_POST['OutPutType'] = "xhtml"; }
849 $BoardSettings=$pretext2[0]."\n".
850 "\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n".
851 "\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n".
852 "\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n".
853 "\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n".
854 "\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n".
855 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
856 "\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n".
857 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
858 "\$Settings['idburl'] = ".null_string($_POST['BoardURL']).";\n".
859 "\$Settings['enable_https'] = ".null_string($_POST['enable_https']).";\n".
860 "\$Settings['weburl'] = ".null_string($_POST['WebURL']).";\n".
861 "\$Settings['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
862 "\$Settings['use_gzip'] = ".null_string($_POST['UseGzip']).";\n".
863 "\$Settings['html_type'] = ".null_string($_POST['HTMLType']).";\n".
864 "\$Settings['html_level'] = ".null_string($_POST['HTMLLevel']).";\n".
865 "\$Settings['output_type'] = ".null_string($_POST['OutPutType']).";\n".
866 "\$Settings['GuestGroup'] = ".null_string($_POST['GuestGroup']).";\n".
867 "\$Settings['MemberGroup'] = ".null_string($_POST['MemberGroup']).";\n".
868 "\$Settings['ValidateGroup'] = ".null_string($_POST['ValidateGroup']).";\n".
869 "\$Settings['AdminValidate'] = ".null_string($_POST['AdminValidate']).";\n".
870 "\$Settings['TestReferer'] = ".null_string($_POST['TestReferer']).";\n".
871 "\$Settings['DefaultTheme'] = ".null_string($_POST['DefaultTheme']).";\n".
872 "\$Settings['DefaultTimeZone'] = ".null_string($_POST['YourOffSet'].":".$_POST['MinOffSet']).";\n".
873 "\$Settings['DefaultDST'] = ".null_string($_POST['DST']).";\n".
874 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
875 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
876 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
877 "\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
878 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
879 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
880 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
881 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
882 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
883 "\$Settings['max_posts'] = ".null_string($_POST['max_posts']).";\n".
884 "\$Settings['max_topics'] = ".null_string($_POST['max_topics']).";\n".
885 "\$Settings['max_memlist'] = ".null_string($_POST['max_memlist']).";\n".
886 "\$Settings['max_pmlist'] = ".null_string($_POST['max_pmlist']).";\n".
887 "\$Settings['hot_topic_num'] = ".null_string($_POST['hot_topic_num']).";\n".
888 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
889 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
890 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
891 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
892 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
893 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
894 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
895 "\$Settings['enable_rss'] = ".null_string($_POST['enable_rss']).";\n".
896 "\$Settings['enable_search'] = ".null_string($_POST['enable_search']).";\n".
897 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
898 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
899 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
900 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
901 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
902 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
903 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
904 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
905 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
906 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
907 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
908 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
909 "\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n".
910 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
911 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
912 "\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n".
913 "\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n".
914 "\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n".
915 "\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n".
916 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
917 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
918 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
919 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
920 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
921 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
922 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
923 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
924 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
925 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
926 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
927 $BoardSettings = $pretext.$settcheck.$BoardSettings;
928 $fp = fopen("settings.php","w+");
929 fwrite($fp, $BoardSettings);
930 fclose($fp);
931 //      cp("settings.php","settingsbak.php");
932 $fp = fopen("settingsbak.php","w+");
933 fwrite($fp, $BoardSettingsBak);
934 fclose($fp); } if($_GET['act']=="sql"&&$_POST['update']!="now"&&$GroupInfo['ViewDBInfo']=="yes") {
935 require('settings.php'); $admincptitle = " ".$ThemeSet['TitleDivider']." Database Manager";
936 ?>
937 <div class="TableMenuBorder">
938 <?php if($ThemeSet['TableStyle']=="div") { ?>
939 <div class="TableMenuRow1">
940 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=sql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Database Manager</a></div>
941 <?php } ?>
942 <table class="TableMenu" style="width: 100%;">
943 <?php if($ThemeSet['TableStyle']=="table") { ?>
944 <tr class="TableMenuRow1">
945 <td class="TableMenuColumn1"><span style="float: left;">
946 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=sql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Database Manager</a>
947 </span><span style="float: right;">&nbsp;</span></td>
948 </tr><?php } ?>
949 <tr class="TableMenuRow2">
950 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
951 <span style="float: left;">&nbsp;Editing SQL Settings for iDB: </span>
952 <span style="float: right;">&nbsp;</span>
953 </th>
954 </tr>
955 <tr class="TableMenuRow3">
956 <td class="TableMenuColumn3">
957 <form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=sql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
958 <table style="text-align: left;">
959 <tr style="text-align: left;">
960         <td style="width: 50%;"><span class="TextBoxLabel">Database Server:</span></td>
961         <td style="width: 50%;"><?php echo $DBType['Server']; ?></td>
962 </tr><?php if($Settings['sqltype']=="mysql"||
963         $Settings['sqltype']=="mysqli"||
964         $Settings['sqltype']=="pgsql"||
965         $Settings['sqltype']=="cubrid") { 
966 ?><tr style="text-align: left;">
967         <td style="width: 50%;"><span class="TextBoxLabel">Database Client:</span></td>
968         <td style="width: 50%;"><?php echo $DBType['Client']; ?></td>
969 </tr><?php } if($Settings['sqltype']=="sqlite") { 
970 ?><tr style="text-align: left;">
971         <td style="width: 50%;"><span class="TextBoxLabel">Database File Size:</span></td>
972         <td style="width: 50%;"><?php echo sprintf("%u", filesize($Settings['sqldb']))." bytes"; ?></td>
973 </tr><?php } if($Settings['sqltype']=="cubrid") { ?><tr style="text-align: left;">
974         <td style="width: 50%;"><span class="TextBoxLabel">CUBRID PHP:</span></td>
975         <td style="width: 50%;"><?php echo $DBType['PHP']; ?></td>
976 </tr><?php } ?><tr style="text-align: left;">
977         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseUserName">Insert Database User Name:</label></td>
978         <td style="width: 50%;"><input type="text" name="DatabaseUserName" class="TextBox" id="DatabaseUserName" size="20" value="<?php echo $Settings['sqluser']; ?>" /></td>
979 </tr><tr style="text-align: left;">
980         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabasePassword">Insert Database Password:</label></td>
981         <td style="width: 50%;"><input type="password" name="DatabasePassword" class="TextBox" id="DatabasePassword" size="20" value="<?php echo $Settings['sqlpass']; ?>" /></td>
982 </tr><tr style="text-align: left;">
983         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseName">Insert Database Name:</label></td>
984         <td style="width: 50%;"><input type="text" name="DatabaseName" class="TextBox" id="DatabaseName" size="20" value="<?php echo $Settings['sqldb']; ?>" /></td>
985 </tr><tr style="text-align: left;">
986         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseHost">Insert Database Host:</label></td>
987         <td style="width: 50%;"><input type="text" name="DatabaseHost" class="TextBox" id="DatabaseHost" size="20" value="<?php echo $Settings['sqlhost']; ?>" /></td>
988 </tr><tr style="text-align: left;">
989         <td style="width: 50%;"><label class="TextBoxLabel" for="tableprefix">Insert Table Prefix:<br /></label></td>
990         <td style="width: 50%;"><input type="text" name="tableprefix" class="TextBox" id="tableprefix" size="20" value="<?php echo $Settings['sqltable']; ?>" /></td>
991 </tr></table>
992 <table style="text-align: left;">
993 <tr style="text-align: left;">
994 <td style="width: 100%;">
995 <input type="hidden" name="act" value="sql" style="display: none;" />
996 <input type="hidden" name="update" value="now" style="display: none;" />
997 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
998 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
999 </td></tr></table>
1000 </form>
1001 </td>
1002 </tr>
1003 <tr class="TableMenuRow4">
1004 <td class="TableMenuColumn4">&nbsp;</td>
1005 </tr>
1006 </table>
1007 </div>
1008 <?php } if($_POST['act']=="sql"&&$_POST['update']=="now"&&$_GET['act']=="sql"&&
1009         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes"&&
1010         $GroupInfo['ViewDBInfo']=="yes") {
1011 $_POST  = array_map("rsq", $_POST);
1012 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
1013         $Settings['BoardUUID'] = rand_uuid("rand"); }
1014 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
1015 $Settings['board_name'] = fixbamps($Settings['board_name']);
1016 $Settings['board_name'] = remove_spaces($Settings['board_name']);
1017 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
1018 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
1019 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
1020 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
1021 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
1022 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
1023 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
1024 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
1025 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
1026 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
1027 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
1028 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
1029 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
1030 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
1031 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
1032 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
1033 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
1034 $BoardSettings=$pretext2[0]."\n".
1035 "\$Settings['sqlhost'] = ".null_string($_POST['DatabaseHost']).";\n".
1036 "\$Settings['sqldb'] = ".null_string($_POST['DatabaseName']).";\n".
1037 "\$Settings['sqltable'] = ".null_string($_POST['tableprefix']).";\n".
1038 "\$Settings['sqluser'] = ".null_string($_POST['DatabaseUserName']).";\n".
1039 "\$Settings['sqlpass'] = ".null_string($_POST['DatabasePassword']).";\n".
1040 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
1041 "\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n".
1042 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
1043 "\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n".
1044 "\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n".
1045 "\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n".
1046 "\$Settings['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
1047 "\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n".
1048 "\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n".
1049 "\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n".
1050 "\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n".
1051 "\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n".
1052 "\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n".
1053 "\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n".
1054 "\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n".
1055 "\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n".
1056 "\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n".
1057 "\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n".
1058 "\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n".
1059 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
1060 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
1061 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
1062 "\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
1063 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
1064 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
1065 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
1066 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
1067 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
1068 "\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n".
1069 "\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n".
1070 "\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n".
1071 "\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n".
1072 "\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n".
1073 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
1074 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
1075 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
1076 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
1077 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
1078 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
1079 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
1080 "\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n".
1081 "\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n".
1082 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
1083 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
1084 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
1085 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
1086 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
1087 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
1088 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
1089 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
1090 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
1091 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
1092 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
1093 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
1094 "\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n".
1095 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
1096 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
1097 "\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n".
1098 "\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n".
1099 "\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n".
1100 "\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n".
1101 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
1102 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
1103 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
1104 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
1105 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
1106 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
1107 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
1108 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
1109 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
1110 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
1111 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
1112 $BoardSettings = $pretext.$settcheck.$BoardSettings;
1113 $fp = fopen("settings.php","w+");
1114 fwrite($fp, $BoardSettings);
1115 fclose($fp);
1116 //      cp("settings.php","settingsbak.php");
1117 $fp = fopen("settingsbak.php","w+");
1118 fwrite($fp, $BoardSettingsBak);
1119 fclose($fp); } if($_GET['act']=="info"&&$_POST['update']!="now") {
1120 require('settings.php'); $admincptitle = " ".$ThemeSet['TitleDivider']." Board Info Manager";
1121 ?>
1122 <div class="TableMenuBorder">
1123 <?php if($ThemeSet['TableStyle']=="div") { ?>
1124 <div class="TableMenuRow1">
1125 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=info",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Board Info Manager</a></div>
1126 <?php } ?>
1127 <table class="TableMenu" style="width: 100%;">
1128 <?php if($ThemeSet['TableStyle']=="table") { ?>
1129 <tr class="TableMenuRow1">
1130 <td class="TableMenuColumn1"><span style="float: left;">
1131 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=info",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Board Info Manager</a>
1132 </span><span style="float: right;">&nbsp;</span></td>
1133 </tr><?php } ?>
1134 <tr class="TableMenuRow2">
1135 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
1136 <span style="float: left;">&nbsp;Editing Board Info: </span>
1137 <span style="float: right;">&nbsp;</span>
1138 </th>
1139 </tr>
1140 <tr class="TableMenuRow3">
1141 <td class="TableMenuColumn3">
1142 <form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=info",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
1143 <table style="text-align: left;">
1144 <tr style="text-align: left;">
1145         <td style="width: 50%;"><label class="TextBoxLabel" for="board_name">Insert board name:</label></td>
1146         <td style="width: 50%;"><input type="text" name="board_name" class="TextBox" id="board_name" size="20" value="<?php echo $SettInfo['board_name']; ?>" /></td>
1147 </tr><tr style="text-align: left;">
1148         <td style="width: 50%;"><label class="TextBoxLabel" for="Author">Insert boards admin name:</label></td>
1149         <td style="width: 50%;"><input type="text" name="Author" class="TextBox" id="Author" size="20" value="<?php echo $SettInfo['Author']; ?>" /></td>
1150 </tr><tr style="text-align: left;">
1151         <td style="width: 50%;"><label class="TextBoxLabel" for="Keywords">Insert keywords about this board:</label></td>
1152         <td style="width: 50%;"><input type="text" name="Keywords" class="TextBox" id="Keywords" size="20" value="<?php echo $SettInfo['Keywords']; ?>" /></td>
1153 </tr><tr style="text-align: left;">
1154         <td style="width: 50%;"><label class="TextBoxLabel" for="Description">Insert description about this board:<br /></label></td>
1155         <td style="width: 50%;"><input type="text" name="Description" class="TextBox" id="Description" size="20" value="<?php echo $SettInfo['Description']; ?>" /></td>
1156 </tr></table>
1157 <table style="text-align: left;">
1158 <tr style="text-align: left;">
1159 <td style="width: 100%;">
1160 <input type="hidden" name="act" value="info" style="display: none;" />
1161 <input type="hidden" name="update" value="now" style="display: none;" />
1162 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
1163 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
1164 </td></tr></table>
1165 </form>
1166 </td>
1167 </tr>
1168 <tr class="TableMenuRow4">
1169 <td class="TableMenuColumn4">&nbsp;</td>
1170 </tr>
1171 </table>
1172 </div>
1173 <?php } if($_POST['act']=="info"&&$_POST['update']=="now"&&$_GET['act']=="info"&&
1174         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
1175 $_POST  = array_map("rsq", $_POST);
1176 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
1177         $Settings['BoardUUID'] = rand_uuid("rand"); }
1178 $_POST['board_name'] = htmlspecialchars($_POST['board_name'], ENT_QUOTES, $Settings['charset']);
1179 $_POST['board_name'] = fixbamps($_POST['board_name']);
1180 $_POST['board_name'] = remove_spaces($_POST['board_name']);
1181 $_POST['board_name'] = str_replace("\&#039;", "&#039;", $_POST['board_name']);
1182 if($_POST['board_name']!=$Settings['board_name']&&
1183         $Settings['SQLThemes']=="on") {
1184         $logoquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."themes\" SET \"Logo\"='%s' WHERE \"Logo\"='%s'", array($_POST['board_name'],$Settings['board_name']));
1185         sql_query($logo,$SQLStat); }
1186 $_POST['Author'] = htmlspecialchars($_POST['Author'], ENT_QUOTES, $Settings['charset']);
1187 $_POST['Author'] = fixbamps($_POST['Author']);
1188 $_POST['Author'] = remove_spaces($_POST['Author']);
1189 $_POST['Author'] = str_replace("\&#039;", "&#039;", $_POST['Author']);
1190 $_POST['Keywords'] = htmlspecialchars($_POST['Keywords'], ENT_QUOTES, $Settings['charset']);
1191 $_POST['Keywords'] = fixbamps($_POST['Keywords']);
1192 $_POST['Keywords'] = remove_spaces($_POST['Keywords']);
1193 $_POST['Keywords'] = str_replace("\&#039;", "&#039;", $_POST['Keywords']);
1194 $_POST['Description'] = htmlspecialchars($_POST['Description'], ENT_QUOTES, $Settings['charset']);
1195 $_POST['Description'] = fixbamps($_POST['Description']);
1196 $_POST['Description'] = remove_spaces($_POST['Description']);
1197 $_POST['Description'] = str_replace("\&#039;", "&#039;", $_POST['Description']);
1198 $BoardSettings=$pretext2[0]."\n".
1199 "\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n".
1200 "\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n".
1201 "\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n".
1202 "\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n".
1203 "\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n".
1204 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
1205 "\$Settings['board_name'] = ".null_string($_POST['board_name']).";\n".
1206 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
1207 "\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n".
1208 "\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n".
1209 "\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n".
1210 "\$Settings['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
1211 "\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n".
1212 "\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n".
1213 "\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n".
1214 "\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n".
1215 "\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n".
1216 "\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n".
1217 "\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n".
1218 "\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n".
1219 "\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n".
1220 "\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n".
1221 "\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n".
1222 "\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n".
1223 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
1224 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
1225 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
1226 "\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
1227 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
1228 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
1229 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
1230 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
1231 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
1232 "\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n".
1233 "\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n".
1234 "\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n".
1235 "\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n".
1236 "\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n".
1237 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
1238 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
1239 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
1240 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
1241 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
1242 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
1243 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
1244 "\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n".
1245 "\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n".
1246 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
1247 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
1248 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
1249 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
1250 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
1251 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
1252 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
1253 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
1254 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
1255 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
1256 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
1257 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
1258 "\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n".
1259 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
1260 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
1261 "\$SettInfo['board_name'] = ".null_string($_POST['board_name']).";\n".
1262 "\$SettInfo['Author'] = ".null_string($_POST['Author']).";\n".
1263 "\$SettInfo['Keywords'] = ".null_string($_POST['Keywords']).";\n".
1264 "\$SettInfo['Description'] = ".null_string($_POST['Description']).";\n".$pretext2[2]."\n".
1265 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
1266 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
1267 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
1268 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
1269 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
1270 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
1271 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
1272 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
1273 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
1274 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
1275 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
1276 $BoardSettings = $pretext.$settcheck.$BoardSettings;
1277 $fp = fopen("settings.php","w+");
1278 fwrite($fp, $BoardSettings);
1279 fclose($fp);
1280 //      cp("settings.php","settingsbak.php");
1281 $fp = fopen("settingsbak.php","w+");
1282 fwrite($fp, $BoardSettingsBak);
1283 fclose($fp); } if($_POST['update']=="now"&&$_GET['act']!=null) {
1284         $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
1285 </td></tr>
1286 <tr id="ProfileTitleEnd" class="TableMenuRow4">
1287 <td class="TableMenuColumn4">&nbsp;</td>
1288 </tr></table></div><?php } ?>
1289 </td></tr>
1290 </table>
1291 <div>&nbsp;</div>