OSDN Git Service

Small update.
[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: 10/25/2011 SVN 764 - 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(base64_encode($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 $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 "<span title=\"".$VerInfo['iDB_Full_Ver_Show']."\">".$VerInfo['iDB_Ver_Show']."</span>"; ?><!--&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%;"><span class="TextBoxLabel">Current PHP Version:</span></td>
544         <td style="width: 50%;"><?php echo "PHP Version ".phpversion(); ?></td>
545 </tr><tr style="text-align: left;">
546         <td style="width: 50%;"><span class="TextBoxLabel">Zend Engine Version:</span></td>
547         <td style="width: 50%;"><?php echo "Zend Version ".zend_version(); ?></td>
548 </tr><?php } ?><tr style="text-align: left;">
549         <td style="width: 50%;"><label class="TextBoxLabel" for="BoardURL">Insert The Board URL:</label></td>
550         <td style="width: 50%;"><input type="text" class="TextBox" name="BoardURL" size="20" id="BoardURL" value="<?php echo $Settings['idburl']; ?>" /></td>
551 </tr><tr style="text-align: left;">
552         <td style="width: 50%;"><label class="TextBoxLabel" for="WebURL">Insert The WebSite URL:</label></td>
553         <td style="width: 50%;"><input type="text" class="TextBox" name="WebURL" size="20" id="WebURL" value="<?php echo $Settings['weburl']; ?>" /></td>
554 </tr><tr style="text-align: left;">
555         <td style="width: 50%;"><label class="TextBoxLabel" for="PassHashType">Hash passwords with:</label></td>
556         <td style="width: 50%;"><select id="PassHashType" name="PassHashType" class="TextBox">
557 <?php // PHP 5 hash algorithms to functions :o 
558 if(function_exists('hash')&&function_exists('hash_algos')) {
559 if(in_array("md2",hash_algos())) { ?>
560 <option<?php if($Settings['use_hashtype']=="md2") { echo " selected=\"selected\""; } ?> value="md2">MD2</option>
561 <?php } if(in_array("md4",hash_algos())) { ?>
562 <option<?php if($Settings['use_hashtype']=="md4") { echo " selected=\"selected\""; } ?> value="md4">MD4</option>
563 <?php } if(in_array("md5",hash_algos())) { ?>
564 <option<?php if($Settings['use_hashtype']=="md5") { echo " selected=\"selected\""; } ?> value="md5">MD5</option>
565 <?php } if(in_array("gost",hash_algos())) { ?>
566 <option<?php if($Settings['use_hashtype']=="gost") { echo " selected=\"selected\""; } ?> value="gost">GOST</option>
567 <?php } if(in_array("joaat",hash_algos())) { ?>
568 <option<?php if($Settings['use_hashtype']=="joaat") { echo " selected=\"selected\""; } ?> value="joaat">JOAAT</option>
569 <?php } if(in_array("sha1",hash_algos())) { ?>
570 <option<?php if($Settings['use_hashtype']=="sha1") { echo " selected=\"selected\""; } ?> value="sha1">SHA1</option>
571 <?php } if(in_array("sha224",hash_algos())) { ?>
572 <option<?php if($Settings['use_hashtype']=="sha224") { echo " selected=\"selected\""; } ?> value="sha224">SHA224</option>
573 <?php } if(in_array("sha256",hash_algos())) { ?>
574 <option<?php if($Settings['use_hashtype']=="sha256") { echo " selected=\"selected\""; } ?> value="sha256">SHA256</option>
575 <?php } if(in_array("sha384",hash_algos())) { ?>
576 <option<?php if($Settings['use_hashtype']=="sha384") { echo " selected=\"selected\""; } ?> value="sha384">SHA384</option>
577 <?php } if(in_array("sha512",hash_algos())) { ?>
578 <option<?php if($Settings['use_hashtype']=="sha512") { echo " selected=\"selected\""; } ?> value="sha512">SHA512</option>
579 <?php } if(in_array("salsa10",hash_algos())) { ?>
580 <option<?php if($Settings['use_hashtype']=="salsa10") { echo " selected=\"selected\""; } ?> value="salsa10">SALSA10</option>
581 <?php } if(in_array("salsa20",hash_algos())) { ?>
582 <option<?php if($Settings['use_hashtype']=="salsa20") { echo " selected=\"selected\""; } ?> value="salsa20">SALSA20</option>
583 <?php } if(in_array("snefru256",hash_algos())) { ?>
584 <option<?php if($Settings['use_hashtype']=="snefru256") { echo " selected=\"selected\""; } ?> value="snefru256">SNEFRU256</option>
585 <?php } if(in_array("ripemd128",hash_algos())) { ?>
586 <option<?php if($Settings['use_hashtype']=="ripemd128") { echo " selected=\"selected\""; } ?> value="ripemd128">RIPEMD128</option>
587 <?php } if(in_array("ripemd160",hash_algos())) { ?>
588 <option<?php if($Settings['use_hashtype']=="ripemd160") { echo " selected=\"selected\""; } ?> value="ripemd160">RIPEMD160</option>
589 <?php } if(in_array("ripemd256",hash_algos())) { ?>
590 <option<?php if($Settings['use_hashtype']=="ripemd256") { echo " selected=\"selected\""; } ?> value="ripemd256">RIPEMD256</option>
591 <?php } if(in_array("ripemd320",hash_algos())) { ?>
592 <option<?php if($Settings['use_hashtype']=="ripemd320") { echo " selected=\"selected\""; } ?> value="ripemd320">RIPEMD320</option>
593 <?php } } 
594 if(!function_exists('hash')&&!function_exists('hash_algos')) { ?>
595 <option<?php if($Settings['use_hashtype']=="md5") { echo " selected=\"selected\""; } ?> value="md5">MD5</option>
596 <option<?php if($Settings['use_hashtype']=="sha1") { echo " selected=\"selected\""; } ?> value="sha1">SHA1</option>
597 <?php } ?>
598 </select></td>
599 </tr><tr style="text-align: left;">
600         <td style="width: 50%;"><label class="TextBoxLabel" for="GuestGroup">Insert The Guest Group:</label></td>
601         <td style="width: 50%;"><select id="GuestGroup" name="GuestGroup" class="TextBox">
602 <option selected="selected" value="<?php echo $Settings['GuestGroup']; ?>">Old Value (<?php echo $Settings['GuestGroup']; ?>)</option>
603 <?php $gi = 0; $gnum = count($MGroups);
604 while ($gi < $gnum) { ?>
605 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
606 <?php ++$gi; } ?>
607 </select></td>
608 </tr><tr style="text-align: left;">
609         <td style="width: 50%;"><label class="TextBoxLabel" for="MemberGroup">Insert The Member Group:</label></td>
610         <td style="width: 50%;"><select id="MemberGroup" name="MemberGroup" class="TextBox">
611 <option selected="selected" value="<?php echo $Settings['MemberGroup']; ?>">Old Value (<?php echo $Settings['MemberGroup']; ?>)</option>
612 <?php $gi = 0; $gnum = count($MGroups);
613 while ($gi < $gnum) { ?>
614 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
615 <?php ++$gi; } ?>
616 </select></td>
617 </tr><tr style="text-align: left;">
618         <td style="width: 50%;"><label class="TextBoxLabel" for="ValidateGroup">Insert The Validate Group:</label></td>
619         <td style="width: 50%;"><select id="ValidateGroup" name="ValidateGroup" class="TextBox">
620 <option selected="selected" value="<?php echo $Settings['ValidateGroup']; ?>">Old Value (<?php echo $Settings['ValidateGroup']; ?>)</option>
621 <?php $gi = 0; $gnum = count($MGroups);
622 while ($gi < $gnum) { ?>
623 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
624 <?php ++$gi; } ?>
625 </select></td>
626 </tr><tr style="text-align: left;">
627         <td style="width: 50%;"><label class="TextBoxLabel" for="AdminValidate">Enable validate new members:</label></td>
628         <td style="width: 50%;"><select size="1" class="TextBox" name="AdminValidate" id="AdminValidate">
629         <option<?php if($Settings['AdminValidate']=="off") { echo " selected=\"selected\""; } ?> value="off">no</option>
630         <option<?php if($Settings['AdminValidate']=="on") { echo " selected=\"selected\""; } ?> value="on">yes</option>
631         </select></td>
632 </tr><tr style="text-align: left;">
633         <td style="width: 50%;"><label class="TextBoxLabel" for="max_posts">Max replies per page:</label></td>
634         <td style="width: 50%;"><select id="max_posts" name="max_posts" class="TextBox">
635 <option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
636 <option value="5">5</option>
637 <option value="10">10</option>
638 <option value="15">15</option>
639 <option value="20">20</option>
640 <option value="25">25</option>
641 <option value="30">30</option>
642 <option value="30">35</option>
643 <option value="30">40</option>
644 </select></td>
645 </tr><tr style="text-align: left;">
646         <td style="width: 50%;"><label class="TextBoxLabel" for="max_topics">Max topics per page:</label></td>
647         <td style="width: 50%;"><select id="max_topics" name="max_topics" class="TextBox">
648 <option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
649 <option value="5">5</option>
650 <option value="10">10</option>
651 <option value="15">15</option>
652 <option value="20">20</option>
653 <option value="25">25</option>
654 <option value="30">30</option>
655 <option value="30">35</option>
656 <option value="30">40</option>
657 </select></td>
658 </tr><tr style="text-align: left;">
659         <td style="width: 50%;"><label class="TextBoxLabel" for="max_memlist">Max members per page:</label></td>
660         <td style="width: 50%;"><select id="max_memlist" name="max_memlist" class="TextBox">
661 <option selected="selected" value="<?php echo $Settings['max_memlist']; ?>">Old Value (<?php echo $Settings['max_memlist']; ?>)</option>
662 <option value="5">5</option>
663 <option value="10">10</option>
664 <option value="15">15</option>
665 <option value="20">20</option>
666 <option value="25">25</option>
667 <option value="30">30</option>
668 <option value="30">35</option>
669 <option value="30">40</option>
670 </select></td>
671 </tr><tr style="text-align: left;">
672         <td style="width: 50%;"><label class="TextBoxLabel" for="max_pmlist">Max pms per page:</label></td>
673         <td style="width: 50%;"><select id="max_pmlist" name="max_pmlist" class="TextBox">
674 <option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
675 <option value="5">5</option>
676 <option value="10">10</option>
677 <option value="15">15</option>
678 <option value="20">20</option>
679 <option value="25">25</option>
680 <option value="30">30</option>
681 <option value="30">35</option>
682 <option value="30">40</option>
683 </select></td>
684 </tr><tr style="text-align: left;">
685         <td style="width: 50%;"><label class="TextBoxLabel" for="hot_topic_num">Number of replies for hot topic:</label></td>
686         <td style="width: 50%;"><select id="hot_topic_num" name="hot_topic_num" class="TextBox">
687 <option selected="selected" value="<?php echo $Settings['hot_topic_num']; ?>">Old Value (<?php echo $Settings['hot_topic_num']; ?>)</option>
688 <option value="5">5</option>
689 <option value="10">10</option>
690 <option value="15">15</option>
691 <option value="20">20</option>
692 <option value="25">25</option>
693 <option value="30">30</option>
694 <option value="30">35</option>
695 <option value="30">40</option>
696 </select></td>
697 </tr><tr style="text-align: left;">
698         <td style="width: 50%;"><label class="TextBoxLabel" title="Can save some bandwidth." for="UseGzip">Enable HTTP Compression:</label></td>
699         <td style="width: 50%;"><select size="1" class="TextBox" name="UseGzip" id="UseGzip">
700         <option<?php if($Settings['use_gzip']=="off") { echo " selected=\"selected\""; } ?> value="off">No</option>
701         <option<?php if($Settings['use_gzip']=="on") { echo " selected=\"selected\""; } ?> value="on">Yes</option>
702         <option<?php if($Settings['use_gzip']=="gzip") { echo " selected=\"selected\""; } ?> value="gzip">Only GZip</option>
703         <option<?php if($Settings['use_gzip']=="deflate") { echo " selected=\"selected\""; } ?> value="deflate">Only Deflate</option>
704         </select></td>
705 </tr><tr style="text-align: left;">
706         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLType">HTML Type to use:</label></td>
707         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLType" id="HTMLType">
708         <option<?php if($Settings['html_type']=="xhtml10") { echo " selected=\"selected\""; } ?> value="xhtml10">XHTML 1.0</option>
709         <option<?php if($Settings['html_type']=="xhtml11") { echo " selected=\"selected\""; } ?> value="xhtml11">XHTML 1.1</option>
710         <option<?php if($Settings['html_type']=="html5") { echo " selected=\"selected\""; } ?> value="html5">HTML 5</option>
711         <option<?php if($Settings['html_type']=="xhtml5") { echo " selected=\"selected\""; } ?> value="xhtml5">XHTML 5</option>
712         </select></td>
713 </tr><tr style="text-align: left;">
714         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLLevel">HTML Level only for XHTML 1.0:</label></td>
715         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLLevel" id="HTMLLevel">
716         <option<?php if($Settings['html_level']=="Transitional") { echo " selected=\"selected\""; } ?> value="Transitional">Transitional</option>
717         <option<?php if($Settings['html_level']=="Strict") { echo " selected=\"selected\""; } ?> value="Strict">Strict</option>
718         </select></td>
719 </tr><tr style="text-align: left;">
720         <td style="width: 50%;"><label class="TextBoxLabel" for="OutPutType">Output file as:</label></td>
721         <td style="width: 50%;"><select size="1" class="TextBox" name="OutPutType" id="OutPutType">
722         <option<?php if($Settings['output_type']=="html") { echo " selected=\"selected\""; } ?> value="html">HTML</option>
723         <option<?php if($Settings['output_type']=="xhtml") { echo " selected=\"selected\""; } ?> value="xhtml">XHTML</option>
724         </select></td>
725 </tr><tr style="text-align: left;">
726         <td style="width: 50%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
727         <td style="width: 50%;"><select id="YourOffSet" name="YourOffSet" class="TextBox"><?php
728 $myofftime = $tsa['hour']; $mydstime = "off";
729 $plusi = 1; $minusi = 12;
730 $plusnum = 15; $minusnum = 0;
731 while ($minusi > $minusnum) {
732 if($myofftime==-$minusi) {
733 echo "<option selected=\"selected\" value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
734 if($myofftime!=-$minusi) {
735 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
736 --$minusi; }
737 if($myofftime==0) { ?>
738 <option selected="selected" value="0">GMT +/- 0:00 hours</option>
739 <?php } if($myofftime!=0) { ?>
740 <option value="0">GMT +/- 0:00 hours</option>
741 <?php }
742 while ($plusi < $plusnum) {
743 if($myofftime==$plusi) {
744 echo "<option selected=\"selected\" value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
745 if($myofftime!=$plusi) {
746 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
747 ++$plusi; }
748 ?></select></td>
749 </tr><tr style="text-align: left;">
750         <td style="width: 50%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
751         <td style="width: 50%;"><select id="MinOffSet" name="MinOffSet" class="TextBox"><?php
752 $mini = 0; $minnum = 60; $mymin = $tsa['minute'];
753 while ($mini < $minnum) {
754 if(strlen($mini)==2) { $showmin = $mini; }
755 if(strlen($mini)==1) { $showmin = "0".$mini; }
756 if($mini==$mymin) {
757 echo "\n<option selected=\"selected\" value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
758 if($mini!=$mymin) {
759 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
760 ++$mini; }
761 ?></select></td>
762 </tr><tr style="text-align: left;">
763         <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>
764         <td style="width: 50%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
765 <option<?php if($Settings['DefaultDST']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
766 <option<?php if($Settings['DefaultDST']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
767 </select></td>
768 </tr><tr style="text-align: left;">
769         <td style="width: 50%;"><label class="TextBoxLabel" for="DefaultTheme">Default Theme:</label></td>
770         <td style="width: 50%;"><select id="DefaultTheme" name="DefaultTheme" class="TextBox"><?php
771 if($Settings['SQLThemes']=="off") {
772 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
773 if ($handle = opendir($skindir)) { $dirnum = null;
774    while (false !== ($file = readdir($handle))) {
775            if ($dirnum==null) { $dirnum = 0; }
776            if (is_dir($skindir.$file)&&file_exists($skindir.$file."/info.php")) {
777                    if ($file != "." && $file != "..") {
778            include($skindir.$file."/info.php");
779            if($Settings['DefaultTheme']==$file) {
780            $themelist[$dirnum] =  "<option selected=\"selected\" value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
781            if($Settings['DefaultTheme']!=$file) {
782        $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
783            ++$dirnum; } } }
784    closedir($handle); asort($themelist);
785    $themenum=count($themelist); $themei=0; 
786    while ($themei < $themenum) {
787    echo $themelist[$themei]."\n";
788    ++$themei; } } }
789 if($Settings['SQLThemes']=="on") {
790 $sknquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" ORDER BY \"id\" ASC, \"Name\" ASC", array(null));
791 $sknresult=sql_query($sknquery,$SQLStat);
792 $sknum=sql_num_rows($sknresult);
793 $skni=0;
794 while ($skni < $sknum) {
795 $ThemeInfo['Name'] = sql_result($sknresult,$skni,"Name");
796 $ThemeInfo['ThemeName'] = sql_result($sknresult,$skni,"ThemeName");
797 if($Settings['DefaultTheme']==$ThemeInfo['Name']) {
798 echo "<option selected=\"selected\" value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n"; }
799 if($Settings['DefaultTheme']!=$ThemeInfo['Name']) {
800 echo "<option value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n"; }
801 ++$skni; }
802 } ?></select></td>
803 </tr><tr style="text-align: left;">
804         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_https">Enable HTTPS:</label></td>
805         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_https" id="enable_https">
806         <option<?php if($Settings['enable_https']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
807         <option<?php if($Settings['enable_https']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
808         </select></td>
809 </tr><tr style="text-align: left;">
810         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_rss">Enable RSS:</label></td>
811         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_rss" id="enable_rss">
812         <option<?php if($Settings['enable_rss']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
813         <option<?php if($Settings['enable_rss']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
814         </select></td>
815 </tr><tr style="text-align: left;">
816         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_search">Enable search:</label></td>
817         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_search" id="enable_search">
818         <option<?php if($Settings['enable_search']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
819         <option<?php if($Settings['enable_search']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
820         </select></td>
821 </tr><tr style="text-align: left;">
822         <td style="width: 50%;"><label class="TextBoxLabel" for="TestReferer">Test Referering URL:</label></td>
823         <td style="width: 50%;"><select id="TestReferer" name="TestReferer" class="TextBox">
824 <option<?php if($Settings['TestReferer']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
825 <option<?php if($Settings['TestReferer']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
826 </select></td>
827 </tr><tr style="text-align: left;">
828         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
829         <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>
830 </tr><tr style="text-align: left;">
831         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
832         <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>
833 </tr><tr style="text-align: left;">
834         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBHTTPLogger">Log Every HTTP Requests:</label></td>
835         <td style="width: 50%;"><select id="iDBHTTPLogger" name="iDBHTTPLogger" class="TextBox">
836 <option<?php if($Settings['log_http_request']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
837 <option<?php if($Settings['log_http_request']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
838 </select></td>
839 </tr><tr style="text-align: left;">
840         <td style="width: 50%;"><label class="TextBoxLabel" for="iDBLoggerFormat">Insert The Format for HTTP Logger:</label></td>
841         <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>
842 </tr></table>
843 <table style="text-align: left;">
844 <tr style="text-align: left;">
845 <td style="width: 100%;">
846 <?php if($GroupInfo['ViewDBInfo']=="yes") { ?>
847 <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>
848 <?php } ?>
849 <input type="hidden" name="act" value="settings" style="display: none;" />
850 <input type="hidden" name="update" value="now" style="display: none;" />
851 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
852 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
853 </td></tr></table>
854 </form>
855 </td>
856 </tr>
857 <tr class="TableMenuRow4">
858 <td class="TableMenuColumn4">&nbsp;</td>
859 </tr>
860 </table>
861 </div>
862 <?php } if($_POST['act']=="settings"&&$_POST['update']=="now"&&$_GET['act']=="settings"&&
863         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
864 $_POST  = array_map("rsq", $_POST);
865 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
866         $Settings['BoardUUID'] = rand_uuid("rand"); }
867 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
868 $Settings['board_name'] = fixbamps($Settings['board_name']);
869 $Settings['board_name'] = remove_spaces($Settings['board_name']);
870 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
871 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
872 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
873 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
874 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
875 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
876 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
877 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
878 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
879 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
880 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
881 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
882 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
883 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
884 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
885 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
886 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
887 $_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['charset']);
888 $_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
889 $_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
890 $_POST['WebURL'] = remove_spaces($_POST['WebURL']);
891 $_POST['iDBTimeFormat'] = convert_strftime($_POST['iDBTimeFormat']);
892 $_POST['iDBDateFormat'] = convert_strftime($_POST['iDBDateFormat']);
893 $Settings['idb_time_format'] = $_POST['iDBTimeFormat'];
894 $Settings['idb_date_format'] = $_POST['iDBDateFormat'];
895 $Settings['log_http_request'] = $_POST['iDBHTTPLogger'];
896 $Settings['log_config_format'] = $_POST['iDBLoggerFormat'];
897 if($_POST['HTMLType']=="xhtml11") { $_POST['HTMLLevel'] = "Strict"; }
898 if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
899 if($_POST['HTMLType']=="xhtml5") { $_POST['OutPutType'] = "xhtml"; }
900 if(!isset($_POST['PassHashType'])) {
901         $_POST['PassHashType'] = "sha1"; }
902 if(!function_exists('hash')||!function_exists('hash_algos')) {
903 if($_POST['PassHashType']!="md5"&&
904    $_POST['PassHashType']!="sha1") {
905         $_POST['PassHashType'] = "sha1"; } }
906 if(function_exists('hash')&&function_exists('hash_algos')) {
907 if(!in_array($_POST['PassHashType'],hash_algos())) {
908         $_POST['PassHashType'] = "sha1"; }
909 if($_POST['PassHashType']!="md2"&&
910    $_POST['PassHashType']!="md4"&&
911    $_POST['PassHashType']!="md5"&&
912    $_POST['PassHashType']!="sha1"&&
913    $_POST['PassHashType']!="sha224"&&
914    $_POST['PassHashType']!="sha256"&&
915    $_POST['PassHashType']!="sha384"&&
916    $_POST['PassHashType']!="sha512"&&
917    $_POST['PassHashType']!="ripemd128"&&
918    $_POST['PassHashType']!="ripemd160"&&
919    $_POST['PassHashType']!="ripemd256"&&
920    $_POST['PassHashType']!="ripemd320"&&
921    $_POST['PassHashType']!="salsa10"&&
922    $_POST['PassHashType']!="salsa20"&&
923    $_POST['PassHashType']!="snefru"&&
924    $_POST['PassHashType']!="snefru256"&&
925    $_POST['PassHashType']!="gost"&&
926    $_POST['PassHashType']!="joaat") {
927         $_POST['PassHashType'] = "sha1"; } }
928 $BoardSettings=$pretext2[0]."\n".
929 "\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n".
930 "\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n".
931 "\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n".
932 "\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n".
933 "\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n".
934 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
935 "\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n".
936 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
937 "\$Settings['idburl'] = ".null_string($_POST['BoardURL']).";\n".
938 "\$Settings['enable_https'] = ".null_string($_POST['enable_https']).";\n".
939 "\$Settings['weburl'] = ".null_string($_POST['WebURL']).";\n".
940 "\$Settings['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
941 "\$Settings['use_gzip'] = ".null_string($_POST['UseGzip']).";\n".
942 "\$Settings['html_type'] = ".null_string($_POST['HTMLType']).";\n".
943 "\$Settings['html_level'] = ".null_string($_POST['HTMLLevel']).";\n".
944 "\$Settings['output_type'] = ".null_string($_POST['OutPutType']).";\n".
945 "\$Settings['GuestGroup'] = ".null_string($_POST['GuestGroup']).";\n".
946 "\$Settings['MemberGroup'] = ".null_string($_POST['MemberGroup']).";\n".
947 "\$Settings['ValidateGroup'] = ".null_string($_POST['ValidateGroup']).";\n".
948 "\$Settings['AdminValidate'] = ".null_string($_POST['AdminValidate']).";\n".
949 "\$Settings['TestReferer'] = ".null_string($_POST['TestReferer']).";\n".
950 "\$Settings['DefaultTheme'] = ".null_string($_POST['DefaultTheme']).";\n".
951 "\$Settings['DefaultTimeZone'] = ".null_string($_POST['YourOffSet'].":".$_POST['MinOffSet']).";\n".
952 "\$Settings['DefaultDST'] = ".null_string($_POST['DST']).";\n".
953 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
954 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
955 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
956 "\$Settings['use_hashtype'] = ".null_string($_POST['PassHashType']).";\n".
957 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
958 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
959 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
960 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
961 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
962 "\$Settings['max_posts'] = ".null_string($_POST['max_posts']).";\n".
963 "\$Settings['max_topics'] = ".null_string($_POST['max_topics']).";\n".
964 "\$Settings['max_memlist'] = ".null_string($_POST['max_memlist']).";\n".
965 "\$Settings['max_pmlist'] = ".null_string($_POST['max_pmlist']).";\n".
966 "\$Settings['hot_topic_num'] = ".null_string($_POST['hot_topic_num']).";\n".
967 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
968 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
969 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
970 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
971 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
972 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
973 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
974 "\$Settings['enable_rss'] = ".null_string($_POST['enable_rss']).";\n".
975 "\$Settings['enable_search'] = ".null_string($_POST['enable_search']).";\n".
976 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
977 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
978 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
979 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
980 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
981 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
982 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
983 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
984 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
985 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
986 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
987 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
988 "\$Settings['BoardUUID'] = ".null_string(base64_encode($Settings['BoardUUID'])).";\n".
989 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
990 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
991 "\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n".
992 "\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n".
993 "\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n".
994 "\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n".
995 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
996 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
997 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
998 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
999 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
1000 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
1001 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
1002 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
1003 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
1004 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
1005 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
1006 $BoardSettings = $pretext.$settcheck.$BoardSettings;
1007 $fp = fopen("settings.php","w+");
1008 fwrite($fp, $BoardSettings);
1009 fclose($fp);
1010 //      cp("settings.php","settingsbak.php");
1011 $fp = fopen("settingsbak.php","w+");
1012 fwrite($fp, $BoardSettingsBak);
1013 fclose($fp); } if($_GET['act']=="sql"&&$_POST['update']!="now"&&$GroupInfo['ViewDBInfo']=="yes") {
1014 $admincptitle = " ".$ThemeSet['TitleDivider']." Database Manager";
1015 ?>
1016 <div class="TableMenuBorder">
1017 <?php if($ThemeSet['TableStyle']=="div") { ?>
1018 <div class="TableMenuRow1">
1019 <?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>
1020 <?php } ?>
1021 <table class="TableMenu" style="width: 100%;">
1022 <?php if($ThemeSet['TableStyle']=="table") { ?>
1023 <tr class="TableMenuRow1">
1024 <td class="TableMenuColumn1"><span style="float: left;">
1025 <?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>
1026 </span><span style="float: right;">&nbsp;</span></td>
1027 </tr><?php } ?>
1028 <tr class="TableMenuRow2">
1029 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
1030 <span style="float: left;">&nbsp;Editing SQL Settings for iDB: </span>
1031 <span style="float: right;">&nbsp;</span>
1032 </th>
1033 </tr>
1034 <tr class="TableMenuRow3">
1035 <td class="TableMenuColumn3">
1036 <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']); ?>">
1037 <table style="text-align: left;">
1038 <tr style="text-align: left;">
1039         <td style="width: 50%;"><span class="TextBoxLabel">Database Server:</span></td>
1040         <td style="width: 50%;"><?php echo $DBType['Server']; ?></td>
1041 </tr><?php if($Settings['sqltype']=="mysql"||
1042         $Settings['sqltype']=="mysqli"||
1043         $Settings['sqltype']=="pgsql"||
1044         $Settings['sqltype']=="cubrid") { 
1045 ?><tr style="text-align: left;">
1046         <td style="width: 50%;"><span class="TextBoxLabel">Database Client:</span></td>
1047         <td style="width: 50%;"><?php echo $DBType['Client']; ?></td>
1048 </tr><?php } if($Settings['sqltype']=="sqlite") { 
1049 ?><tr style="text-align: left;">
1050         <td style="width: 50%;"><span class="TextBoxLabel">Database File Size:</span></td>
1051         <td style="width: 50%;"><?php echo sprintf("%u", filesize($Settings['sqldb']))." bytes"; ?></td>
1052 </tr><?php } if($Settings['sqltype']=="cubrid") { ?><tr style="text-align: left;">
1053         <td style="width: 50%;"><span class="TextBoxLabel">CUBRID PHP:</span></td>
1054         <td style="width: 50%;"><?php echo $DBType['PHP']; ?></td>
1055 </tr><?php } ?><tr style="text-align: left;">
1056         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseUserName">Insert Database User Name:</label></td>
1057         <td style="width: 50%;"><input type="text" name="DatabaseUserName" class="TextBox" id="DatabaseUserName" size="20" value="<?php echo $Settings['sqluser']; ?>" /></td>
1058 </tr><tr style="text-align: left;">
1059         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabasePassword">Insert Database Password:</label></td>
1060         <td style="width: 50%;"><input type="password" name="DatabasePassword" class="TextBox" id="DatabasePassword" size="20" value="<?php echo $Settings['sqlpass']; ?>" /></td>
1061 </tr><tr style="text-align: left;">
1062         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseName">Insert Database Name:</label></td>
1063         <td style="width: 50%;"><input type="text" name="DatabaseName" class="TextBox" id="DatabaseName" size="20" value="<?php echo $Settings['sqldb']; ?>" /></td>
1064 </tr><tr style="text-align: left;">
1065         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseHost">Insert Database Host:</label></td>
1066         <td style="width: 50%;"><input type="text" name="DatabaseHost" class="TextBox" id="DatabaseHost" size="20" value="<?php echo $Settings['sqlhost']; ?>" /></td>
1067 </tr><tr style="text-align: left;">
1068         <td style="width: 50%;"><label class="TextBoxLabel" for="tableprefix">Insert Table Prefix:<br /></label></td>
1069         <td style="width: 50%;"><input type="text" name="tableprefix" class="TextBox" id="tableprefix" size="20" value="<?php echo $Settings['sqltable']; ?>" /></td>
1070 </tr></table>
1071 <table style="text-align: left;">
1072 <tr style="text-align: left;">
1073 <td style="width: 100%;">
1074 <input type="hidden" name="act" value="sql" style="display: none;" />
1075 <input type="hidden" name="update" value="now" style="display: none;" />
1076 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
1077 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
1078 </td></tr></table>
1079 </form>
1080 </td>
1081 </tr>
1082 <tr class="TableMenuRow4">
1083 <td class="TableMenuColumn4">&nbsp;</td>
1084 </tr>
1085 </table>
1086 </div>
1087 <?php } if($_POST['act']=="sql"&&$_POST['update']=="now"&&$_GET['act']=="sql"&&
1088         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes"&&
1089         $GroupInfo['ViewDBInfo']=="yes") {
1090 $_POST  = array_map("rsq", $_POST);
1091 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
1092         $Settings['BoardUUID'] = rand_uuid("rand"); }
1093 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
1094 $Settings['board_name'] = fixbamps($Settings['board_name']);
1095 $Settings['board_name'] = remove_spaces($Settings['board_name']);
1096 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
1097 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
1098 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
1099 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
1100 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
1101 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
1102 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
1103 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
1104 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
1105 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
1106 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
1107 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
1108 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
1109 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
1110 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
1111 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
1112 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
1113 $BoardSettings=$pretext2[0]."\n".
1114 "\$Settings['sqlhost'] = ".null_string($_POST['DatabaseHost']).";\n".
1115 "\$Settings['sqldb'] = ".null_string($_POST['DatabaseName']).";\n".
1116 "\$Settings['sqltable'] = ".null_string($_POST['tableprefix']).";\n".
1117 "\$Settings['sqluser'] = ".null_string($_POST['DatabaseUserName']).";\n".
1118 "\$Settings['sqlpass'] = ".null_string($_POST['DatabasePassword']).";\n".
1119 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
1120 "\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n".
1121 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
1122 "\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n".
1123 "\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n".
1124 "\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n".
1125 "\$Settings['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
1126 "\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n".
1127 "\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n".
1128 "\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n".
1129 "\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n".
1130 "\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n".
1131 "\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n".
1132 "\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n".
1133 "\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n".
1134 "\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n".
1135 "\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n".
1136 "\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n".
1137 "\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n".
1138 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
1139 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
1140 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
1141 "\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
1142 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
1143 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
1144 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
1145 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
1146 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
1147 "\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n".
1148 "\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n".
1149 "\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n".
1150 "\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n".
1151 "\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n".
1152 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
1153 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
1154 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
1155 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
1156 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
1157 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
1158 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
1159 "\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n".
1160 "\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n".
1161 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
1162 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
1163 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
1164 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
1165 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
1166 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
1167 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
1168 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
1169 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
1170 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
1171 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
1172 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
1173 "\$Settings['BoardUUID'] = ".null_string(base64_encode($Settings['BoardUUID'])).";\n".
1174 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
1175 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
1176 "\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n".
1177 "\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n".
1178 "\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n".
1179 "\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n".
1180 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
1181 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
1182 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
1183 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
1184 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
1185 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
1186 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
1187 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
1188 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
1189 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
1190 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
1191 $BoardSettings = $pretext.$settcheck.$BoardSettings;
1192 $fp = fopen("settings.php","w+");
1193 fwrite($fp, $BoardSettings);
1194 fclose($fp);
1195 //      cp("settings.php","settingsbak.php");
1196 $fp = fopen("settingsbak.php","w+");
1197 fwrite($fp, $BoardSettingsBak);
1198 fclose($fp); } if($_GET['act']=="info"&&$_POST['update']!="now") {
1199 $admincptitle = " ".$ThemeSet['TitleDivider']." Board Info Manager";
1200 ?>
1201 <div class="TableMenuBorder">
1202 <?php if($ThemeSet['TableStyle']=="div") { ?>
1203 <div class="TableMenuRow1">
1204 <?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>
1205 <?php } ?>
1206 <table class="TableMenu" style="width: 100%;">
1207 <?php if($ThemeSet['TableStyle']=="table") { ?>
1208 <tr class="TableMenuRow1">
1209 <td class="TableMenuColumn1"><span style="float: left;">
1210 <?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>
1211 </span><span style="float: right;">&nbsp;</span></td>
1212 </tr><?php } ?>
1213 <tr class="TableMenuRow2">
1214 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
1215 <span style="float: left;">&nbsp;Editing Board Info: </span>
1216 <span style="float: right;">&nbsp;</span>
1217 </th>
1218 </tr>
1219 <tr class="TableMenuRow3">
1220 <td class="TableMenuColumn3">
1221 <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']); ?>">
1222 <table style="text-align: left;">
1223 <tr style="text-align: left;">
1224         <td style="width: 50%;"><label class="TextBoxLabel" for="board_name">Insert board name:</label></td>
1225         <td style="width: 50%;"><input type="text" name="board_name" class="TextBox" id="board_name" size="20" value="<?php echo $SettInfo['board_name']; ?>" /></td>
1226 </tr><tr style="text-align: left;">
1227         <td style="width: 50%;"><label class="TextBoxLabel" for="Author">Insert boards admin name:</label></td>
1228         <td style="width: 50%;"><input type="text" name="Author" class="TextBox" id="Author" size="20" value="<?php echo $SettInfo['Author']; ?>" /></td>
1229 </tr><tr style="text-align: left;">
1230         <td style="width: 50%;"><label class="TextBoxLabel" for="Keywords">Insert keywords about this board:</label></td>
1231         <td style="width: 50%;"><input type="text" name="Keywords" class="TextBox" id="Keywords" size="20" value="<?php echo $SettInfo['Keywords']; ?>" /></td>
1232 </tr><tr style="text-align: left;">
1233         <td style="width: 50%;"><label class="TextBoxLabel" for="Description">Insert description about this board:<br /></label></td>
1234         <td style="width: 50%;"><input type="text" name="Description" class="TextBox" id="Description" size="20" value="<?php echo $SettInfo['Description']; ?>" /></td>
1235 </tr></table>
1236 <table style="text-align: left;">
1237 <tr style="text-align: left;">
1238 <td style="width: 100%;">
1239 <input type="hidden" name="act" value="info" style="display: none;" />
1240 <input type="hidden" name="update" value="now" style="display: none;" />
1241 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
1242 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
1243 </td></tr></table>
1244 </form>
1245 </td>
1246 </tr>
1247 <tr class="TableMenuRow4">
1248 <td class="TableMenuColumn4">&nbsp;</td>
1249 </tr>
1250 </table>
1251 </div>
1252 <?php } if($_POST['act']=="info"&&$_POST['update']=="now"&&$_GET['act']=="info"&&
1253         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
1254 $_POST  = array_map("rsq", $_POST);
1255 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
1256         $Settings['BoardUUID'] = rand_uuid("rand"); }
1257 $_POST['board_name'] = htmlspecialchars($_POST['board_name'], ENT_QUOTES, $Settings['charset']);
1258 $_POST['board_name'] = fixbamps($_POST['board_name']);
1259 $_POST['board_name'] = remove_spaces($_POST['board_name']);
1260 $_POST['board_name'] = str_replace("\&#039;", "&#039;", $_POST['board_name']);
1261 if($_POST['board_name']!=$Settings['board_name']&&
1262         $Settings['SQLThemes']=="on") {
1263         $logoquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."themes\" SET \"Logo\"='%s' WHERE \"Logo\"='%s'", array($_POST['board_name'],$Settings['board_name']));
1264         sql_query($logo,$SQLStat); }
1265 $_POST['Author'] = htmlspecialchars($_POST['Author'], ENT_QUOTES, $Settings['charset']);
1266 $_POST['Author'] = fixbamps($_POST['Author']);
1267 $_POST['Author'] = remove_spaces($_POST['Author']);
1268 $_POST['Author'] = str_replace("\&#039;", "&#039;", $_POST['Author']);
1269 $_POST['Keywords'] = htmlspecialchars($_POST['Keywords'], ENT_QUOTES, $Settings['charset']);
1270 $_POST['Keywords'] = fixbamps($_POST['Keywords']);
1271 $_POST['Keywords'] = remove_spaces($_POST['Keywords']);
1272 $_POST['Keywords'] = str_replace("\&#039;", "&#039;", $_POST['Keywords']);
1273 $_POST['Description'] = htmlspecialchars($_POST['Description'], ENT_QUOTES, $Settings['charset']);
1274 $_POST['Description'] = fixbamps($_POST['Description']);
1275 $_POST['Description'] = remove_spaces($_POST['Description']);
1276 $_POST['Description'] = str_replace("\&#039;", "&#039;", $_POST['Description']);
1277 $BoardSettings=$pretext2[0]."\n".
1278 "\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n".
1279 "\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n".
1280 "\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n".
1281 "\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n".
1282 "\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n".
1283 "\$Settings['sqltype'] = ".null_string($Settings['sqltype']).";\n".
1284 "\$Settings['board_name'] = ".null_string($_POST['board_name']).";\n".
1285 "\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n".
1286 "\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n".
1287 "\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n".
1288 "\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n".
1289 "\$Settings['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
1290 "\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n".
1291 "\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n".
1292 "\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n".
1293 "\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n".
1294 "\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n".
1295 "\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n".
1296 "\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n".
1297 "\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n".
1298 "\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n".
1299 "\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n".
1300 "\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n".
1301 "\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n".
1302 "\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
1303 "\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
1304 "\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
1305 "\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
1306 "\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
1307 "\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
1308 "\$Settings['sql_charset'] = ".null_string($Settings['sql_charset']).";\n".
1309 "\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n".
1310 "\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n".
1311 "\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n".
1312 "\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n".
1313 "\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n".
1314 "\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n".
1315 "\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n".
1316 "\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n".
1317 "\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n".
1318 "\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n".
1319 "\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n".
1320 "\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n".
1321 "\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n".
1322 "\$Settings['vercheck'] = ".null_string($Settings['vercheck']).";\n".
1323 "\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n".
1324 "\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n".
1325 "\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n".
1326 "\$Settings['fixpathinfo'] = ".null_string($OldSettings['fixpathinfo']).";\n".
1327 "\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
1328 "\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
1329 "\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\n".
1330 "\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n".
1331 "\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n".
1332 "\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n".
1333 "\$Settings['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
1334 "\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
1335 "\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
1336 "\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
1337 "\$Settings['BoardUUID'] = ".null_string(base64_encode($Settings['BoardUUID'])).";\n".
1338 "\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n".
1339 "\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n".
1340 "\$SettInfo['board_name'] = ".null_string($_POST['board_name']).";\n".
1341 "\$SettInfo['Author'] = ".null_string($_POST['Author']).";\n".
1342 "\$SettInfo['Keywords'] = ".null_string($_POST['Keywords']).";\n".
1343 "\$SettInfo['Description'] = ".null_string($_POST['Description']).";\n".$pretext2[2]."\n".
1344 "\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n".
1345 "\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n".
1346 "\$SettDir['logs'] = ".null_string($SettDir['logs']).";\n".
1347 "\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
1348 "\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
1349 "\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
1350 "\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
1351 "\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
1352 "\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
1353 "\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
1354 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
1355 $BoardSettings = $pretext.$settcheck.$BoardSettings;
1356 $fp = fopen("settings.php","w+");
1357 fwrite($fp, $BoardSettings);
1358 fclose($fp);
1359 //      cp("settings.php","settingsbak.php");
1360 $fp = fopen("settingsbak.php","w+");
1361 fwrite($fp, $BoardSettingsBak);
1362 fclose($fp); } if($_POST['update']=="now"&&$_GET['act']!=null) {
1363         $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
1364 </td></tr>
1365 <tr id="ProfileTitleEnd" class="TableMenuRow4">
1366 <td class="TableMenuColumn4">&nbsp;</td>
1367 </tr></table></div><?php } ?>
1368 </td></tr>
1369 </table>
1370 <div>&nbsp;</div>