OSDN Git Service

Changed mysql functions to sql wrapper functions.
[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-2009 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: main.php - Last Update: 11/23/2009 SVN 359 - 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",$basedir.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']);
25 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
26 if(!isset($_POST['update'])) { $_POST['update'] = null; }
27 if($_GET['act']=="mysql"&&$GroupInfo['ViewDBInfo']!="yes") {
28 redirect("location",$basedir.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']);
30 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
31 if(!isset($_POST['update'])) { $_POST['update'] = null; }
32 $iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
33 $iDBRSVN = $VER2[2]." ".$SubVerN;
34 $OutPutLog = null;
35 $LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
36 $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";
37 $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   */");
38 $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";
39 if(!isset($_POST['update'])) { $_POST['update'] = null; }
40 function bool_string($boolean) {
41 if(!is_bool($boolean)) {
42 return $boolean; }
43 if(is_bool($boolean)) { 
44 if($boolean==0||$boolean===false) { 
45 return "false"; }
46 if($boolean==1||$boolean===true) { 
47 return "true"; } } }
48 function null_string($string) {
49 if(isset($string)) {
50         return "'".$string."'"; }
51 if(!isset($string)) {
52         return "null"; } }
53 function rsq($string) {
54 $string = preg_replace("/^(\')|$(\')/i","\'",$string);
55 return $string; }
56 if(!is_numeric($Settings['KarmaBoostDays'])) {
57 $Settings['KarmaBoostDays'] = null; }
58 $KBoostPercent = explode("|",$Settings['KBoostPercent']);
59 if(count($KBoostPercent)<1) { 
60 $Settings['KBoostPercent'] = "6|10"; }
61 if(!is_numeric($KBoostPercent[0])) {
62 $Settings['KBoostPercent'] = "6|10"; }
63 if(count($KBoostPercent)==1) { 
64 $Settings['KBoostPercent'] = "6|10"; }
65 if(!is_numeric($KBoostPercent[1])) {
66 $Settings['KBoostPercent'] = "6|10"; }
67 if(count($KBoostPercent)>2) { 
68 $Settings['KBoostPercent'] = "6|10"; }
69 ?>
70 <table class="Table3">
71 <tr style="width: 100%; vertical-align: top;">
72         <td style="width: 15%; vertical-align: top;">
73 <?php 
74 require($SettDir['admin'].'table.php'); 
75 if($_GET['act']=="delsessions"&&$GroupInfo['ViewDBInfo']=="yes") {
76 $time = GMTimeStamp() - ini_get("session.gc_maxlifetime");
77 //$sqlg = sql_pre_query('DELETE FROM `'.$Settings['sqltable'].'sessions` WHERE `expires` < UNIX_TIMESTAMP();', array(null));
78 $sqlgc = sql_pre_query('DELETE FROM `'.$Settings['sqltable'].'sessions` WHERE `expires` < %i', array($time));
79 sql_query($sqlgc);
80 $_POST['update'] = "now"; $_GET['act'] = "view"; }
81 if($_GET['act']=="optimize"&&$GroupInfo['ViewDBInfo']=="yes") {
82 $TablePreFix = $Settings['sqltable'];
83 function add_prefix($tarray) {
84 global $TablePreFix;
85 return $TablePreFix.$tarray; }
86 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "messenger", "permissions", "posts", "restrictedwords", "sessions", "smileys", "topics", "wordfilter");
87 $TableChCk = array_map("add_prefix",$TableChCk);
88 $tcount = count($TableChCk); $ti = 0;
89 $TblOptimized = 0;
90 while ($ti < $tcount) {
91 if(isset($OptimizeAr["Msg_text"])) { unset($OptimizeAr["Msg_text"]); }
92 if(isset($OptimizeAr[3])) { unset($OptimizeAr[3]); }
93 $OptimizeTea = sql_query(sql_pre_query("OPTIMIZE TABLE `".$TableChCk[$ti]."`", array(null))); 
94 $OptimizeAr = sql_fetch_array($OptimizeTea);
95 if(!isset($OptimizeAr["Msg_text"])&&
96         isset($OptimizeAr[3])) { $OptimizeAr["Msg_text"] = $OptimizeAr[3]; }
97 if($OptimizeAr["Msg_text"]=="OK") { 
98         ++$TblOptimized; } ++$ti; }
99 $OutPutLog = "MySQL Output: ".$TblOptimized." Tables optimized.";
100 $_POST['update'] = "now"; $_GET['act'] = "view"; }
101 ?>
102 </td>
103         <td style="width: 85%; vertical-align: top;">
104 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
105 $updateact = url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
106 $admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
107 redirect("refresh",$basedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"3");
108 ?>
109 <div class="TableMenuBorder">
110 <?php if($ThemeSet['TableStyle']=="div") { ?>
111 <div class="TableMenuRow1">
112 <?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>
113 <?php } ?>
114 <table class="TableMenu" style="width: 100%;">
115 <?php if($ThemeSet['TableStyle']=="table") { ?>
116 <tr class="TableMenuRow1">
117 <td class="TableMenuColumn1"><span style="float: left;">
118 <?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>
119 </span><span style="float: right;">&nbsp;</span></td>
120 </tr><?php } ?>
121 <tr id="ProfileTitle" class="TableMenuRow2">
122 <th class="TableMenuColumn2">Updating Settings</th>
123 </tr>
124 <tr class="TableMenuRow3" id="ProfileUpdate">
125 <td class="TableMenuColumn3">
126 <div style="text-align: center;">
127 <?php if(isset($OutPutLog)) { echo "<br />".$OutPutLog; } ?>
128 <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>
129 <?php } if($_GET['act']=="view"&&$_POST['update']!="now") {
130 $query = sql_pre_query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
131 $result=sql_query($query);
132 $num=sql_num_rows($result);
133 $i=0;
134 $YourID=sql_result($result,$i,"id");
135 $Notes=sql_result($result,$i,"Notes");
136 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
137 $notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
138 $admincptitle = " ".$ThemeSet['TitleDivider']." Admin CP";
139 ?>
140 <div class="TableMenuBorder">
141 <?php if($ThemeSet['TableStyle']=="div") { ?>
142 <div class="TableMenuRow1">
143 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a></div>
144 <?php } ?>
145 <table class="TableMenu" style="width: 100%;">
146 <?php if($ThemeSet['TableStyle']=="table") { ?>
147 <tr class="TableMenuRow1">
148 <td class="TableMenuColumn1"><span style="float: left;">
149 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
150 </span><span style="float: right;">&nbsp;</span></td>
151 </tr><?php } ?>
152 <tr id="ProfileTitle" class="TableMenuRow2">
153 <th class="TableMenuColumn2">NotePad</th>
154 </tr>
155 <tr class="TableMenuRow3" id="NotePadRow">
156 <td class="TableMenuColumn3">
157 <form method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
158 <label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
159 <textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
160 <input type="hidden" name="act" value="view" style="display: none;" />
161 <input type="hidden" name="update" value="now" style="display: none;" />
162 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
163 </div></form></td>
164 </tr>
165 <tr id="ProfileEnd" class="TableMenuRow4">
166 <td class="TableMenuColumn4">&nbsp;</td>
167 </tr>
168 </table>
169 </div>
170 <?php } if($_GET['act']=="settings"&&$_POST['update']!="now") {
171 require('settings.php'); $admincptitle = " ".$ThemeSet['TitleDivider']." Settings Manager";
172 $ts_array = explode(":",$Settings['DefaultTimeZone']);
173 if(count($ts_array)!=2) {
174         if(!isset($ts_array[0])) { $ts_array[0] = "0"; }
175         if(!isset($ts_array[1])) { $ts_array[1] = "00"; }
176         $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
177 if(!is_numeric($ts_array[0])) { $ts_array[0] = "0"; }
178 if($ts_array[0]>12) { $ts_array[0] = "12"; $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
179 if($ts_array[0]<-12) { $ts_array[0] = "-12"; $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
180 if(!is_numeric($ts_array[1])) { $ts_array[1] = "00"; }
181 if($ts_array[1]>59) { $ts_array[1] = "59"; $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
182 if($ts_array[1]<0) { $ts_array[1] = "00"; $Settings['DefaultTimeZone'] = $ts_array[0].":".$ts_array[1]; }
183 $tsa = array("offset" => $Settings['DefaultTimeZone'], "hour" => $ts_array[0], "minute" => $ts_array[1]);
184 $mguerys = sql_pre_query("SELECT * FROM `".$Settings['sqltable']."groups`", array(null));
185 $mgresults=sql_query($mguerys);
186 $mnum=sql_num_rows($mgresults);
187 $mi = 0;
188 while ($mi < $mnum) {
189 $MGroups[$mi]=sql_result($mgresults,$mi,"Name");
190 ++$mi; }
191 sql_free_result($mgresults);
192 ?>
193 <div class="TableMenuBorder">
194 <?php if($ThemeSet['TableStyle']=="div") { ?>
195 <div class="TableMenuRow1">
196 <?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>
197 <?php } ?>
198 <table class="TableMenu" style="width: 100%;">
199 <?php if($ThemeSet['TableStyle']=="table") { ?>
200 <tr class="TableMenuRow1">
201 <td class="TableMenuColumn1"><span style="float: left;">
202 <?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>
203 </span><span style="float: right;">&nbsp;</span></td>
204 </tr><?php } ?>
205 <tr class="TableMenuRow2">
206 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
207 <span style="float: left;">&nbsp;Editing Setting for iDB: </span>
208 <span style="float: right;">&nbsp;</span>
209 </th>
210 </tr>
211 <tr class="TableMenuRow3">
212 <td class="TableMenuColumn3">
213 <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']); ?>">
214 <table style="text-align: left;">
215 <tr style="text-align: left;">
216         <td style="width: 50%;"><label class="TextBoxLabel" for="BoardURL">Insert The Board URL or localhost to use any url:</label></td>
217         <td style="width: 50%;"><input type="text" class="TextBox" name="BoardURL" size="20" id="BoardURL" value="<?php echo $Settings['idburl']; ?>" /></td>
218 </tr><tr style="text-align: left;">
219         <td style="width: 50%;"><label class="TextBoxLabel" for="WebURL">Insert The WebSite URL:</label></td>
220         <td style="width: 50%;"><input type="text" class="TextBox" name="WebURL" size="20" id="WebURL" value="<?php echo $Settings['weburl']; ?>" /></td>
221 </tr><tr style="text-align: left;">
222         <td style="width: 50%;"><label class="TextBoxLabel" for="GuestGroup">Insert The Guest Group:</label></td>
223         <td style="width: 50%;"><select id="GuestGroup" name="GuestGroup" class="TextBox">
224 <option selected="selected" value="<?php echo $Settings['GuestGroup']; ?>">Old Value (<?php echo $Settings['GuestGroup']; ?>)</option>
225 <?php $gi = 0; $gnum = count($MGroups);
226 while ($gi < $gnum) { ?>
227 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
228 <?php ++$gi; } ?>
229 </select></td>
230 </tr><tr style="text-align: left;">
231         <td style="width: 50%;"><label class="TextBoxLabel" for="MemberGroup">Insert The Member Group:</label></td>
232         <td style="width: 50%;"><select id="MemberGroup" name="MemberGroup" class="TextBox">
233 <option selected="selected" value="<?php echo $Settings['MemberGroup']; ?>">Old Value (<?php echo $Settings['MemberGroup']; ?>)</option>
234 <?php $gi = 0; $gnum = count($MGroups);
235 while ($gi < $gnum) { ?>
236 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
237 <?php ++$gi; } ?>
238 </select></td>
239 </tr><tr style="text-align: left;">
240         <td style="width: 50%;"><label class="TextBoxLabel" for="ValidateGroup">Insert The Validate Group:</label></td>
241         <td style="width: 50%;"><select id="ValidateGroup" name="ValidateGroup" class="TextBox">
242 <option selected="selected" value="<?php echo $Settings['ValidateGroup']; ?>">Old Value (<?php echo $Settings['ValidateGroup']; ?>)</option>
243 <?php $gi = 0; $gnum = count($MGroups);
244 while ($gi < $gnum) { ?>
245 <option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
246 <?php ++$gi; } ?>
247 </select></td>
248 </tr><tr style="text-align: left;">
249         <td style="width: 50%;"><label class="TextBoxLabel" for="AdminValidate">Do you want to validate new members:</label></td>
250         <td style="width: 50%;"><select size="1" class="TextBox" name="AdminValidate" id="AdminValidate">
251         <option<?php if($Settings['AdminValidate']=="off") { echo " selected=\"selected\""; } ?> value="off">no</option>
252         <option<?php if($Settings['AdminValidate']=="on") { echo " selected=\"selected\""; } ?> value="on">yes</option>
253         </select></td>
254 </tr><tr style="text-align: left;">
255         <td style="width: 50%;"><label class="TextBoxLabel" for="max_posts">Max replies per page:</label></td>
256         <td style="width: 50%;"><select id="max_posts" name="max_posts" class="TextBox">
257 <option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
258 <option value="5">5</option>
259 <option value="10">10</option>
260 <option value="15">15</option>
261 <option value="20">20</option>
262 <option value="25">25</option>
263 <option value="30">30</option>
264 <option value="30">35</option>
265 <option value="30">40</option>
266 </select></td>
267 </tr><tr style="text-align: left;">
268         <td style="width: 50%;"><label class="TextBoxLabel" for="max_topics">Max topics per page:</label></td>
269         <td style="width: 50%;"><select id="max_topics" name="max_topics" class="TextBox">
270 <option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
271 <option value="5">5</option>
272 <option value="10">10</option>
273 <option value="15">15</option>
274 <option value="20">20</option>
275 <option value="25">25</option>
276 <option value="30">30</option>
277 <option value="30">35</option>
278 <option value="30">40</option>
279 </select></td>
280 </tr><tr style="text-align: left;">
281         <td style="width: 50%;"><label class="TextBoxLabel" for="max_memlist">Max members per page:</label></td>
282         <td style="width: 50%;"><select id="max_memlist" name="max_memlist" class="TextBox">
283 <option selected="selected" value="<?php echo $Settings['max_memlist']; ?>">Old Value (<?php echo $Settings['max_memlist']; ?>)</option>
284 <option value="5">5</option>
285 <option value="10">10</option>
286 <option value="15">15</option>
287 <option value="20">20</option>
288 <option value="25">25</option>
289 <option value="30">30</option>
290 <option value="30">35</option>
291 <option value="30">40</option>
292 </select></td>
293 </tr><tr style="text-align: left;">
294         <td style="width: 50%;"><label class="TextBoxLabel" for="max_pmlist">Max pms per page:</label></td>
295         <td style="width: 50%;"><select id="max_pmlist" name="max_pmlist" class="TextBox">
296 <option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
297 <option value="5">5</option>
298 <option value="10">10</option>
299 <option value="15">15</option>
300 <option value="20">20</option>
301 <option value="25">25</option>
302 <option value="30">30</option>
303 <option value="30">35</option>
304 <option value="30">40</option>
305 </select></td>
306 </tr><tr style="text-align: left;">
307         <td style="width: 50%;"><label class="TextBoxLabel" for="hot_topic_num">Number of replies for hot topic:</label></td>
308         <td style="width: 50%;"><select id="hot_topic_num" name="hot_topic_num" class="TextBox">
309 <option selected="selected" value="<?php echo $Settings['hot_topic_num']; ?>">Old Value (<?php echo $Settings['hot_topic_num']; ?>)</option>
310 <option value="5">5</option>
311 <option value="10">10</option>
312 <option value="15">15</option>
313 <option value="20">20</option>
314 <option value="25">25</option>
315 <option value="30">30</option>
316 <option value="30">35</option>
317 <option value="30">40</option>
318 </select></td>
319 </tr><tr style="text-align: left;">
320         <td style="width: 50%;"><label class="TextBoxLabel" title="Can save some bandwidth." for="UseGzip">Do you want to HTTP Content Compression:</label></td>
321         <td style="width: 50%;"><select size="1" class="TextBox" name="UseGzip" id="UseGzip">
322         <option<?php if($Settings['use_gzip']=="off") { echo " selected=\"selected\""; } ?> value="off">No</option>
323         <option<?php if($Settings['use_gzip']=="on") { echo " selected=\"selected\""; } ?> value="on">Yes</option>
324         <option<?php if($Settings['use_gzip']=="gzip") { echo " selected=\"selected\""; } ?> value="gzip">Only GZip</option>
325         <option<?php if($Settings['use_gzip']=="deflate") { echo " selected=\"selected\""; } ?> value="deflate">Only Deflate</option>
326         </select></td>
327 </tr><tr style="text-align: left;">
328         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLType">HTML Type to use:</label></td>
329         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLType" id="HTMLType">
330         <option<?php if($Settings['html_type']=="xhtml10") { echo " selected=\"selected\""; } ?> value="xhtml10">XHTML 1.0</option>
331         <option<?php if($Settings['html_type']=="xhtml11") { echo " selected=\"selected\""; } ?> value="xhtml11">XHTML 1.1</option>
332         </select></td>
333 </tr><tr style="text-align: left;">
334         <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLLevel">HTML level only for XHTML 1.0:</label></td>
335         <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLLevel" id="HTMLLevel">
336         <option<?php if($Settings['html_level']=="Transitional") { echo " selected=\"selected\""; } ?> value="Transitional">Transitional</option>
337         <option<?php if($Settings['html_level']=="Strict") { echo " selected=\"selected\""; } ?> value="Strict">Strict</option>
338         </select></td>
339 </tr><tr style="text-align: left;">
340         <td style="width: 50%;"><label class="TextBoxLabel" for="OutPutType">Output file as:</label></td>
341         <td style="width: 50%;"><select size="1" class="TextBox" name="OutPutType" id="OutPutType">
342         <option<?php if($Settings['output_type']=="html") { echo " selected=\"selected\""; } ?> value="html">HTML</option>
343         <option<?php if($Settings['output_type']=="xhtml") { echo " selected=\"selected\""; } ?> value="xhtml">XHTML</option>
344         </select></td>
345 </tr><tr style="text-align: left;">
346         <td style="width: 50%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
347         <td style="width: 50%;"><select id="YourOffSet" name="YourOffSet" class="TextBox"><?php
348 $myofftime = $tsa['hour']; $mydstime = "off";
349 $plusi = 1; $minusi = 12;
350 $plusnum = 13; $minusnum = 0;
351 while ($minusi > $minusnum) {
352 if($myofftime==-$minusi) {
353 echo "<option selected=\"selected\" value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
354 if($myofftime!=-$minusi) {
355 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
356 --$minusi; }
357 if($myofftime==0) { ?>
358 <option selected="selected" value="0">GMT +/- 0:00 hours</option>
359 <?php } if($myofftime!=0) { ?>
360 <option value="0">GMT +/- 0:00 hours</option>
361 <?php }
362 while ($plusi < $plusnum) {
363 if($myofftime==$plusi) {
364 echo "<option selected=\"selected\" value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
365 if($myofftime!=$plusi) {
366 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
367 ++$plusi; }
368 ?></select></td>
369 </tr><tr style="text-align: left;">
370         <td style="width: 50%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
371         <td style="width: 50%;"><select id="MinOffSet" name="MinOffSet" class="TextBox"><?php
372 $mini = 0; $minnum = 60; $mymin = $tsa['minute'];
373 while ($mini < $minnum) {
374 if(strlen($mini)==2) { $showmin = $mini; }
375 if(strlen($mini)==1) { $showmin = "0".$mini; }
376 if($mini==$mymin) {
377 echo "\n<option selected=\"selected\" value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
378 if($mini!=$mymin) {
379 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
380 ++$mini; }
381 ?></select></td>
382 </tr><tr style="text-align: left;">
383         <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>
384         <td style="width: 50%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
385 <option<?php if($Settings['DefaultDST']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
386 <option<?php if($Settings['DefaultDST']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
387 </select></td>
388 </tr><tr style="text-align: left;">
389         <td style="width: 50%;"><label class="TextBoxLabel" for="DefaultTheme">Default CSS Theme for board:</label></td>
390         <td style="width: 50%;"><select id="DefaultTheme" name="DefaultTheme" class="TextBox"><?php
391 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
392 if ($handle = opendir($skindir)) { $dirnum = null;
393    while (false !== ($file = readdir($handle))) {
394            if ($dirnum==null) { $dirnum = 0; }
395            if (file_exists($skindir.$file."/info.php")) {
396                    if ($file != "." && $file != "..") {
397            include($skindir.$file."/info.php");
398            if($Settings['DefaultTheme']==$file) {
399            $themelist[$dirnum] =  "<option selected=\"selected\" value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
400            if($Settings['DefaultTheme']!=$file) {
401        $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
402            ++$dirnum; } } }
403    closedir($handle); asort($themelist);
404    $themenum=count($themelist); $themei=0; 
405    while ($themei < $themenum) {
406    echo $themelist[$themei]."\n";
407    ++$themei; }
408 } ?></select></td>
409 </tr><tr style="text-align: left;">
410         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_https">Enable https:</label></td>
411         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_https" id="enable_https">
412         <option<?php if($Settings['enable_https']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
413         <option<?php if($Settings['enable_https']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
414         </select></td>
415 </tr><tr style="text-align: left;">
416         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_rss">Enable RSS:</label></td>
417         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_rss" id="enable_rss">
418         <option<?php if($Settings['enable_rss']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
419         <option<?php if($Settings['enable_rss']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
420         </select></td>
421 </tr><tr style="text-align: left;">
422         <td style="width: 50%;"><label class="TextBoxLabel" for="enable_search">Enable search:</label></td>
423         <td style="width: 50%;"><select size="1" class="TextBox" name="enable_search" id="enable_search">
424         <option<?php if($Settings['enable_search']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
425         <option<?php if($Settings['enable_search']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
426         </select></td>
427 </tr><tr style="text-align: left;">
428         <td style="width: 50%;"><label class="TextBoxLabel" for="TestReferer">Test Referering URL with host name:</label></td>
429         <td style="width: 50%;"><select id="TestReferer" name="TestReferer" class="TextBox">
430 <option<?php if($Settings['TestReferer']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
431 <option<?php if($Settings['TestReferer']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
432 </select></td>
433 </tr></table>
434 <table style="text-align: left;">
435 <tr style="text-align: left;">
436 <td style="width: 100%;">
437 <input type="hidden" name="act" value="settings" style="display: none;" />
438 <input type="hidden" name="update" value="now" style="display: none;" />
439 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
440 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
441 </td></tr></table>
442 </form>
443 </td>
444 </tr>
445 <tr class="TableMenuRow4">
446 <td class="TableMenuColumn4">&nbsp;</td>
447 </tr>
448 </table>
449 </div>
450 <?php } if($_POST['act']=="settings"&&$_POST['update']=="now"&&$_GET['act']=="settings"&&
451         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
452 $_POST  = array_map("rsq", $_POST);
453 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
454         $Settings['BoardUUID'] = uuid(false,true,false,$Settings['use_hashtype'],null); }
455 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
456 $Settings['board_name'] = fixbamps($Settings['board_name']);
457 $Settings['board_name'] = remove_spaces($Settings['board_name']);
458 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
459 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
460 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
461 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
462 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
463 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
464 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
465 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
466 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
467 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
468 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
469 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
470 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
471 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
472 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
473 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
474 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
475 $BoardSettings=$pretext2[0]."\n\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n\$Settings['idburl'] = ".null_string($_POST['BoardURL']).";\n\$Settings['enable_https'] = ".null_string($_POST['enable_https']).";\n\$Settings['weburl'] = ".null_string($_POST['WebURL']).";\n\$Settings['use_gzip'] = ".null_string($_POST['UseGzip']).";\n\$Settings['html_type'] = ".null_string($_POST['HTMLType']).";\n\$Settings['html_level'] = ".null_string($_POST['HTMLLevel']).";\n\$Settings['output_type'] = ".null_string($_POST['OutPutType']).";\n\$Settings['GuestGroup'] = ".null_string($_POST['GuestGroup']).";\n\$Settings['MemberGroup'] = ".null_string($_POST['MemberGroup']).";\n\$Settings['ValidateGroup'] = ".null_string($_POST['ValidateGroup']).";\n\$Settings['AdminValidate'] = ".null_string($_POST['AdminValidate']).";\n\$Settings['TestReferer'] = ".null_string($_POST['TestReferer']).";\n\$Settings['DefaultTheme'] = ".null_string($_POST['DefaultTheme']).";\n\$Settings['DefaultTimeZone'] = ".null_string($_POST['YourOffSet'].":".$_POST['MinOffSet']).";\n\$Settings['DefaultDST'] = ".null_string($_POST['DST']).";\n\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n\$Settings['charset'] = ".null_string($Settings['charset']).";\n\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n\$Settings['max_posts'] = ".null_string($_POST['max_posts']).";\n\$Settings['max_topics'] = ".null_string($_POST['max_topics']).";\n\$Settings['max_memlist'] = ".null_string($_POST['max_memlist']).";\n\$Settings['max_pmlist'] = ".null_string($_POST['max_pmlist']).";\n\$Settings['hot_topic_num'] = ".null_string($_POST['hot_topic_num']).";\n\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n\$Settings['enable_rss'] = ".null_string($_POST['enable_rss']).";\n\$Settings['enable_search'] = ".null_string($_POST['enable_search']).";\n\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n\$Settings['fixpathinfo'] = ".null_string($Settings['fixpathinfo']).";\n\$Settings['fixbasedir'] = ".null_string($Settings['fixbasedir']).";\n\$Settings['fixcookiedir'] = ".null_string($Settings['fixcookiedir']).";\n\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
476 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
477 $BoardSettings = $pretext.$settcheck.$BoardSettings;
478 $fp = fopen("settings.php","w+");
479 fwrite($fp, $BoardSettings);
480 fclose($fp);
481 //      cp("settings.php","settingsbak.php");
482 $fp = fopen("settingsbak.php","w+");
483 fwrite($fp, $BoardSettingsBak);
484 fclose($fp); } if($_GET['act']=="mysql"&&$_POST['update']!="now"&&$GroupInfo['ViewDBInfo']=="yes") {
485 require('settings.php'); $admincptitle = " ".$ThemeSet['TitleDivider']." Database Manager";
486 ?>
487 <div class="TableMenuBorder">
488 <?php if($ThemeSet['TableStyle']=="div") { ?>
489 <div class="TableMenuRow1">
490 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=mysql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Database Manager</a></div>
491 <?php } ?>
492 <table class="TableMenu" style="width: 100%;">
493 <?php if($ThemeSet['TableStyle']=="table") { ?>
494 <tr class="TableMenuRow1">
495 <td class="TableMenuColumn1"><span style="float: left;">
496 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=mysql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Database Manager</a>
497 </span><span style="float: right;">&nbsp;</span></td>
498 </tr><?php } ?>
499 <tr class="TableMenuRow2">
500 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
501 <span style="float: left;">&nbsp;Editing MySQL Settings for iDB: </span>
502 <span style="float: right;">&nbsp;</span>
503 </th>
504 </tr>
505 <tr class="TableMenuRow3">
506 <td class="TableMenuColumn3">
507 <form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=mysql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
508 <table style="text-align: left;">
509 <tr style="text-align: left;">
510         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseUserName">Insert Database User Name:</label></td>
511         <td style="width: 50%;"><input type="text" name="DatabaseUserName" class="TextBox" id="DatabaseUserName" size="20" value="<?php echo $Settings['sqluser']; ?>" /></td>
512 </tr><tr style="text-align: left;">
513         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabasePassword">Insert Database Password:</label></td>
514         <td style="width: 50%;"><input type="password" name="DatabasePassword" class="TextBox" id="DatabasePassword" size="20" value="<?php echo $Settings['sqlpass']; ?>" /></td>
515 </tr><tr style="text-align: left;">
516         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseName">Insert Database Name:</label></td>
517         <td style="width: 50%;"><input type="text" name="DatabaseName" class="TextBox" id="DatabaseName" size="20" value="<?php echo $Settings['sqldb']; ?>" /></td>
518 </tr><tr style="text-align: left;">
519         <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseHost">Insert Database Host:</label></td>
520         <td style="width: 50%;"><input type="text" name="DatabaseHost" class="TextBox" id="DatabaseHost" size="20" value="<?php echo $Settings['sqlhost']; ?>" /></td>
521 </tr><tr style="text-align: left;">
522         <td style="width: 50%;"><label class="TextBoxLabel" for="tableprefix">Insert Table Prefix:<br /></label></td>
523         <td style="width: 50%;"><input type="text" name="tableprefix" class="TextBox" id="tableprefix" size="20" value="<?php echo $Settings['sqltable']; ?>" /></td>
524 </tr></table>
525 <table style="text-align: left;">
526 <tr style="text-align: left;">
527 <td style="width: 100%;">
528 <input type="hidden" name="act" value="mysql" style="display: none;" />
529 <input type="hidden" name="update" value="now" style="display: none;" />
530 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
531 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
532 </td></tr></table>
533 </form>
534 </td>
535 </tr>
536 <tr class="TableMenuRow4">
537 <td class="TableMenuColumn4">&nbsp;</td>
538 </tr>
539 </table>
540 </div>
541 <?php } if($_POST['act']=="mysql"&&$_POST['update']=="now"&&$_GET['act']=="mysql"&&
542         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes"&&
543         $GroupInfo['ViewDBInfo']=="yes") {
544 $_POST  = array_map("rsq", $_POST);
545 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
546         $Settings['BoardUUID'] = uuid(false,true,false,$Settings['use_hashtype'],null); }
547 $Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
548 $Settings['board_name'] = fixbamps($Settings['board_name']);
549 $Settings['board_name'] = remove_spaces($Settings['board_name']);
550 $Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
551 $SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
552 $SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
553 $SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
554 $SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
555 $SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
556 $SettInfo['Author'] = fixbamps($SettInfo['Author']);
557 $SettInfo['Author'] = remove_spaces($SettInfo['Author']);
558 $SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
559 $SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
560 $SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
561 $SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
562 $SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
563 $SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
564 $SettInfo['Description'] = fixbamps($SettInfo['Description']);
565 $SettInfo['Description'] = remove_spaces($SettInfo['Description']);
566 $SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
567 $BoardSettings=$pretext2[0]."\n\$Settings['sqlhost'] = ".null_string($_POST['DatabaseHost']).";\n\$Settings['sqldb'] = ".null_string($_POST['DatabaseName']).";\n\$Settings['sqltable'] = ".null_string($_POST['tableprefix']).";\n\$Settings['sqluser'] = ".null_string($_POST['DatabaseUserName']).";\n\$Settings['sqlpass'] = ".null_string($_POST['DatabasePassword']).";\n\$Settings['board_name'] = ".null_string($Settings['board_name']).";\n\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n\$Settings['charset'] = ".null_string($Settings['charset']).";\n\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n\$Settings['fixpathinfo'] = ".null_string($Settings['fixpathinfo']).";\n\$Settings['fixbasedir'] = ".null_string($Settings['fixbasedir']).";\n\$Settings['fixcookiedir'] = ".null_string($Settings['fixcookiedir']).";\n\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n\$SettInfo['board_name'] = ".null_string($SettInfo['board_name']).";\n\$SettInfo['Author'] = ".null_string($SettInfo['Author']).";\n\$SettInfo['Keywords'] = ".null_string($SettInfo['Keywords']).";\n\$SettInfo['Description'] = ".null_string($SettInfo['Description']).";\n".$pretext2[2]."\n\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
568 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
569 $BoardSettings = $pretext.$settcheck.$BoardSettings;
570 $fp = fopen("settings.php","w+");
571 fwrite($fp, $BoardSettings);
572 fclose($fp);
573 //      cp("settings.php","settingsbak.php");
574 $fp = fopen("settingsbak.php","w+");
575 fwrite($fp, $BoardSettingsBak);
576 fclose($fp); } if($_GET['act']=="info"&&$_POST['update']!="now") {
577 require('settings.php'); $admincptitle = " ".$ThemeSet['TitleDivider']." Board Info Manager";
578 ?>
579 <div class="TableMenuBorder">
580 <?php if($ThemeSet['TableStyle']=="div") { ?>
581 <div class="TableMenuRow1">
582 <?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>
583 <?php } ?>
584 <table class="TableMenu" style="width: 100%;">
585 <?php if($ThemeSet['TableStyle']=="table") { ?>
586 <tr class="TableMenuRow1">
587 <td class="TableMenuColumn1"><span style="float: left;">
588 <?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>
589 </span><span style="float: right;">&nbsp;</span></td>
590 </tr><?php } ?>
591 <tr class="TableMenuRow2">
592 <th class="TableMenuColumn2" style="width: 100%; text-align: left;">
593 <span style="float: left;">&nbsp;Editing Board Info: </span>
594 <span style="float: right;">&nbsp;</span>
595 </th>
596 </tr>
597 <tr class="TableMenuRow3">
598 <td class="TableMenuColumn3">
599 <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']); ?>">
600 <table style="text-align: left;">
601 <tr style="text-align: left;">
602         <td style="width: 50%;"><label class="TextBoxLabel" for="board_name">Insert board name:</label></td>
603         <td style="width: 50%;"><input type="text" name="board_name" class="TextBox" id="board_name" size="20" value="<?php echo $SettInfo['board_name']; ?>" /></td>
604 </tr><tr style="text-align: left;">
605         <td style="width: 50%;"><label class="TextBoxLabel" for="Author">Insert boards admin name:</label></td>
606         <td style="width: 50%;"><input type="text" name="Author" class="TextBox" id="Author" size="20" value="<?php echo $SettInfo['Author']; ?>" /></td>
607 </tr><tr style="text-align: left;">
608         <td style="width: 50%;"><label class="TextBoxLabel" for="Keywords">Insert keywords about this board:</label></td>
609         <td style="width: 50%;"><input type="text" name="Keywords" class="TextBox" id="Keywords" size="20" value="<?php echo $SettInfo['Keywords']; ?>" /></td>
610 </tr><tr style="text-align: left;">
611         <td style="width: 50%;"><label class="TextBoxLabel" for="Description">Insert description about this board:<br /></label></td>
612         <td style="width: 50%;"><input type="text" name="Description" class="TextBox" id="Description" size="20" value="<?php echo $SettInfo['Description']; ?>" /></td>
613 </tr></table>
614 <table style="text-align: left;">
615 <tr style="text-align: left;">
616 <td style="width: 100%;">
617 <input type="hidden" name="act" value="info" style="display: none;" />
618 <input type="hidden" name="update" value="now" style="display: none;" />
619 <input type="submit" class="Button" value="Apply" name="Apply_Changes" />
620 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
621 </td></tr></table>
622 </form>
623 </td>
624 </tr>
625 <tr class="TableMenuRow4">
626 <td class="TableMenuColumn4">&nbsp;</td>
627 </tr>
628 </table>
629 </div>
630 <?php } if($_POST['act']=="info"&&$_POST['update']=="now"&&$_GET['act']=="info"&&
631         $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
632 $_POST  = array_map("rsq", $_POST);
633 if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
634         $Settings['BoardUUID'] = uuid(false,true,false,$Settings['use_hashtype'],null); }
635 $_POST['board_name'] = htmlspecialchars($_POST['board_name'], ENT_QUOTES, $Settings['charset']);
636 $_POST['board_name'] = fixbamps($_POST['board_name']);
637 $_POST['board_name'] = remove_spaces($_POST['board_name']);
638 $_POST['board_name'] = str_replace("\&#039;", "&#039;", $_POST['board_name']);
639 $_POST['Author'] = htmlspecialchars($_POST['Author'], ENT_QUOTES, $Settings['charset']);
640 $_POST['Author'] = fixbamps($_POST['Author']);
641 $_POST['Author'] = remove_spaces($_POST['Author']);
642 $_POST['Author'] = str_replace("\&#039;", "&#039;", $_POST['Author']);
643 $_POST['Keywords'] = htmlspecialchars($_POST['Keywords'], ENT_QUOTES, $Settings['charset']);
644 $_POST['Keywords'] = fixbamps($_POST['Keywords']);
645 $_POST['Keywords'] = remove_spaces($_POST['Keywords']);
646 $_POST['Keywords'] = str_replace("\&#039;", "&#039;", $_POST['Keywords']);
647 $_POST['Description'] = htmlspecialchars($_POST['Description'], ENT_QUOTES, $Settings['charset']);
648 $_POST['Description'] = fixbamps($_POST['Description']);
649 $_POST['Description'] = remove_spaces($_POST['Description']);
650 $_POST['Description'] = str_replace("\&#039;", "&#039;", $_POST['Description']);
651 $BoardSettings=$pretext2[0]."\n\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n\$Settings['sqltable'] = ".null_string($Settings['sqltable']).";\n\$Settings['sqluser'] = ".null_string($Settings['sqluser']).";\n\$Settings['sqlpass'] = ".null_string($Settings['sqlpass']).";\n\$Settings['board_name'] = ".null_string($_POST['board_name']).";\n\$Settings['idbdir'] = ".null_string($Settings['idbdir']).";\n\$Settings['idburl'] = ".null_string($Settings['idburl']).";\n\$Settings['enable_https'] = ".null_string($Settings['enable_https']).";\n\$Settings['weburl'] = ".null_string($Settings['weburl']).";\n\$Settings['use_gzip'] = ".null_string($Settings['use_gzip']).";\n\$Settings['html_type'] = ".null_string($Settings['html_type']).";\n\$Settings['html_level'] = ".null_string($Settings['html_level']).";\n\$Settings['output_type'] = ".null_string($Settings['output_type']).";\n\$Settings['GuestGroup'] = ".null_string($Settings['GuestGroup']).";\n\$Settings['MemberGroup'] = ".null_string($Settings['MemberGroup']).";\n\$Settings['ValidateGroup'] = ".null_string($Settings['ValidateGroup']).";\n\$Settings['AdminValidate'] = ".null_string($Settings['AdminValidate']).";\n\$Settings['TestReferer'] = ".null_string($Settings['TestReferer']).";\n\$Settings['DefaultTheme'] = ".null_string($Settings['DefaultTheme']).";\n\$Settings['DefaultTimeZone'] = ".null_string($Settings['DefaultTimeZone']).";\n\$Settings['DefaultDST'] = ".null_string($Settings['DefaultDST']).";\n\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n\$Settings['charset'] = ".null_string($Settings['charset']).";\n\$Settings['add_power_by'] = ".null_string($Settings['add_power_by']).";\n\$Settings['send_pagesize'] = ".null_string($Settings['send_pagesize']).";\n\$Settings['max_posts'] = ".null_string($Settings['max_posts']).";\n\$Settings['max_topics'] = ".null_string($Settings['max_topics']).";\n\$Settings['max_memlist'] = ".null_string($Settings['max_memlist']).";\n\$Settings['max_pmlist'] = ".null_string($Settings['max_pmlist']).";\n\$Settings['hot_topic_num'] = ".null_string($Settings['hot_topic_num']).";\n\$Settings['qstr'] = ".null_string($Settings['qstr']).";\n\$Settings['qsep'] = ".null_string($Settings['qsep']).";\n\$Settings['file_ext'] = ".null_string($Settings['file_ext']).";\n\$Settings['rss_ext'] = ".null_string($Settings['rss_ext']).";\n\$Settings['js_ext'] = ".null_string($Settings['js_ext']).";\n\$Settings['showverinfo'] = ".null_string($Settings['showverinfo']).";\n\$Settings['enable_rss'] = ".null_string($Settings['enable_rss']).";\n\$Settings['enable_search'] = ".null_string($Settings['enable_search']).";\n\$Settings['sessionid_in_urls'] = ".null_string($Settings['sessionid_in_urls']).";\n\$Settings['fixpathinfo'] = ".null_string($Settings['fixpathinfo']).";\n\$Settings['fixbasedir'] = ".null_string($Settings['fixbasedir']).";\n\$Settings['fixcookiedir'] = ".null_string($Settings['fixcookiedir']).";\n\$Settings['enable_pathinfo'] = ".null_string($Settings['enable_pathinfo']).";\n\$Settings['rssurl'] = ".null_string($Settings['rssurl']).";\n\$Settings['board_offline'] = ".null_string($Settings['board_offline']).";\n\$Settings['BoardUUID'] = ".null_string($Settings['BoardUUID']).";\n\$Settings['KarmaBoostDays'] = ".null_string($Settings['KarmaBoostDays']).";\n\$Settings['KBoostPercent'] = ".null_string($Settings['KBoostPercent']).";\n".$pretext2[1]."\n\$SettInfo['board_name'] = ".null_string($_POST['board_name']).";\n\$SettInfo['Author'] = ".null_string($_POST['Author']).";\n\$SettInfo['Keywords'] = ".null_string($_POST['Keywords']).";\n\$SettInfo['Description'] = ".null_string($_POST['Description']).";\n".$pretext2[2]."\n\$SettDir['maindir'] = ".null_string($SettDir['maindir']).";\n\$SettDir['inc'] = ".null_string($SettDir['inc']).";\n\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
652 $BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
653 $BoardSettings = $pretext.$settcheck.$BoardSettings;
654 $fp = fopen("settings.php","w+");
655 fwrite($fp, $BoardSettings);
656 fclose($fp);
657 //      cp("settings.php","settingsbak.php");
658 $fp = fopen("settingsbak.php","w+");
659 fwrite($fp, $BoardSettingsBak);
660 fclose($fp); } if($_POST['update']=="now"&&$_GET['act']!=null) {
661         $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
662 </td></tr>
663 <tr id="ProfileTitleEnd" class="TableMenuRow4">
664 <td class="TableMenuColumn4">&nbsp;</td>
665 </tr></table></div><?php } ?>
666 </td></tr>
667 </table>
668 <div>&nbsp;</div>