Yet another small update.
[iDB.git] / inc / function.php
blob50346e10493076a94169ea4c4d8dfc2f249c9611
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.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: function.php - Last Update: 05/25/2011 SVN 658 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="function.php"||$File3Name=="/function.php") {
18 require('index.php');
19 exit(); }
20 require_once($SettDir['misc'].'functions.php');
21 require_once($SettDir['misc'].'ibbcode.php');
22 require_once($SettDir['misc'].'iuntar.php');
23 /* Change Some PHP Settings Fix the & to &amp;
24 if($Settings['use_iniset']==true&&$Settings['qstr']!="/") {
25 ini_set("arg_separator.output",htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']));
26 ini_set("arg_separator.input",$Settings['qstr']);
27 ini_set("arg_separator",htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset'])); }
28 //$basepath = pathinfo($_SERVER['REQUEST_URI']);
29 if(dirname($_SERVER['REQUEST_URI'])!="."||
30 dirname($_SERVER['REQUEST_URI'])!=null) {
31 $basedir = dirname($_SERVER['REQUEST_URI'])."/"; }*/
32 // Get the base dir name
33 /*if(dirname($_SERVER['SCRIPT_NAME'])!="."||
34 dirname($_SERVER['SCRIPT_NAME'])!=null) {
35 $basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
36 if($basedir==null||$basedir==".") {
37 if(dirname($_SERVER['SCRIPT_NAME'])=="."||
38 dirname($_SERVER['SCRIPT_NAME'])==null) {
39 $basedir = dirname($_SERVER['PHP_SELF'])."/"; } }
40 if($basedir=="\/") { $basedir="/"; }
41 $basedir = str_replace("//", "/", $basedir);*/
42 if($Settings['qstr']!="/") {
43 $iDBURLCHK = $Settings['idburl']; }
44 if($Settings['qstr']=="/") {
45 $iDBURLCHK = preg_replace("/\/$/","",$Settings['idburl']); }
46 $basecheck = parse_url($iDBURLCHK);
47 $basedir = $basecheck['path'];
48 $cbasedir = $basedir;
49 $rbasedir = $basedir;
50 if($Settings['fixbasedir']!=null&&$Settings['fixbasedir']!="off") {
51 $basedir = $Settings['fixbasedir']; }
52 if($Settings['fixcookiedir']!=null&&$Settings['fixcookiedir']!="") {
53 $cbasedir = $Settings['fixcookiedir']; }
54 if($Settings['fixredirectdir']!=null) {
55 $rbasedir = $Settings['fixredirectdir']; }
56 $BaseURL = $basedir;
57 // Get our Host Name and Referer URL's Host Name
58 if(!isset($_SERVER['HTTP_REFERER'])) { $_SERVER['HTTP_REFERER'] = null; }
59 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
60 if(!isset($REFERERurl['host'])) { $REFERERurl['host'] = null; }
61 $URL['REFERER'] = $REFERERurl['host'];
62 $URL['HOST'] = $basecheck['host'];
63 $REFERERurl = null;
64 // Function made by Howard Yeend
65 // http://php.net/manual/en/function.trigger-error.php#92016
66 // http://www.puremango.co.uk/
67 function output_error($message, $level=E_USER_ERROR) {
68 $caller = next(debug_backtrace());
69 trigger_error($message.' in <strong>'.$caller['function'].'</strong> called from <strong>'.$caller['file'].'</strong> on line <strong>'.$caller['line'].'</strong>'."\n<br />error handler", $level); }
70 $Names['D'] = "Dagmara";
71 define("_dagmara_", $Names['D']);
72 // http://us.php.net/manual/en/function.uniqid.php#94959
73 /**
74 * Generates an UUID
76 * @author Andrew Moore
77 * @url http://us.php.net/manual/en/function.uniqid.php#94959
79 function uuid($uuidver = "v4", $rndty = "rand", $namespace = null, $name = null) {
80 if($uuidver!="v3"&&$uuidver!="v4"&&$uuidver!="v5") { $uuidver = "v4"; }
81 if($uuidver=="v4") {
82 return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
83 $rndty(0, 0xffff), $rndty(0, 0xffff),
84 $rndty(0, 0xffff),
85 $rndty(0, 0x0fff) | 0x4000,
86 $rndty(0, 0x3fff) | 0x8000,
87 $rndty(0, 0xffff), $rndty(0, 0xffff), $rndty(0, 0xffff) ); }
88 if($uuidver=="v3"||$uuidver=="v5") {
89 if($namespace===null) {
90 $namespace = uuid("v4",$rndty); }
91 $nhex = str_replace(array('-','{','}'), '', $namespace);
92 $nstr = '';
93 for($i = 0; $i < strlen($nhex); $i+=2) {
94 if(isset($nhex[$i+1])) {
95 $nstr .= chr(hexdec($nhex[$i].$nhex[$i+1])); }
96 if(!isset($nhex[$i+1])) {
97 $nstr .= chr(hexdec($nhex[$i])); }
99 if($name===null) { $name = salt_hmac(); }
100 // Calculate hash value
101 if($uuidver=="v3") {
102 $uuidverid = 0x3000;
103 if (function_exists('hash')) {
104 $hash = hash("md5", $nstr . $name); }
105 if (!function_exists('hash')) {
106 $hash = md5($nstr . $name); } }
107 if($uuidver=="v5") {
108 $uuidverid = 0x5000;
109 if (function_exists('hash')) {
110 $hash = hash("sha1", $nstr . $name); }
111 if (!function_exists('hash')) {
112 $hash = sha1($nstr . $name); } }
113 return sprintf('%08s-%04s-%04x-%04x-%12s',
114 substr($hash, 0, 8),
115 substr($hash, 8, 4),
116 (hexdec(substr($hash, 12, 4)) & 0x0fff) | $uuidverid,
117 (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
118 substr($hash, 20, 12) ); } }
119 function rand_uuid($rndty = "rand", $namespace = null, $name = null) {
120 $rand_array = array(1 => "v3", 2 => "v4", 3 => "v5");
121 if($name===null) { $name = salt_hmac(); }
122 $my_uuid = $rand_array[$rndty(1,3)];
123 if($my_uuid=="v4") { return uuid("v4",$rndty); }
124 if($my_uuid=="v3"||$my_uuid=="v5") {
125 return uuid($my_uuid,$rndty,$name); } }
126 // unserialize sessions variables
127 function unserialize_session($data) {
128 $vars=preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/',
129 $data,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
130 $i = 0;
131 for($i=0; isset($vars[$i]); $i++) {
132 $l = $i + 1;
133 if(!isset($vars[$i])) { $vars[$i] = null; }
134 if(!isset($vars[$l])) { $vars[$l] = null; }
135 $result[$vars[$i]]=unserialize($vars[$l]);
136 $i++; }
137 if(!isset($result)) { $result = null; }
138 return $result;
140 // Make the Query String if we are not useing &=
141 function qstring($qstr=";",$qsep="=")
142 { $_GET = array(); $_GET = null;
143 if (!isset($_SERVER['QUERY_STRING'])) {
144 $_SERVER['QUERY_STRING'] = getenv('QUERY_STRING'); }
145 ini_set("arg_separator.input", $qstr);
146 $_SERVER['QUERY_STRING'] = urldecode($_SERVER['QUERY_STRING']);
147 $preqs = explode($qstr,$_SERVER["QUERY_STRING"]);
148 $qsnum = count($preqs); $qsi = 0;
149 while ($qsi < $qsnum) {
150 $preqst = explode($qsep,$preqs[$qsi],2);
151 $fix1 = array(" ",'$'); $fix2 = array("_","_");
152 $preqst[0] = str_replace($fix1, $fix2, $preqst[0]);
153 $preqst[0] = killbadvars($preqst[0]);
154 if($preqst[0]!=null) {
155 $_GET[$preqst[0]] = $preqst[1]; }
156 ++$qsi; } return true; }
157 if($Settings['qstr']!="&"&&
158 $Settings['qstr']!="/") {
159 qstring($Settings['qstr'],$Settings['qsep']);
160 if(!isset($_GET['page'])) { $_GET['page'] = null; }
161 if(!isset($_GET['act'])) { $_GET['act'] = null; }
162 if(!isset($_POST['act'])) { $_POST['act'] = null; }
163 if(!isset($_GET['id'])) { $_GET['id'] = null; }
164 if(!isset($_GET['debug'])) { $_GET['debug'] = "false"; }
165 if(!isset($_GET['post'])) { $_GET['post'] = null; }
166 if(!isset($_POST['License'])) { $_POST['License'] = null; } }
167 if($_SERVER['PATH_INFO']==null) {
168 if(getenv('PATH_INFO')!=null&&getenv('PATH_INFO')!="1") {
169 $_SERVER['PATH_INFO'] = getenv('PATH_INFO'); }
170 if(getenv('PATH_INFO')==null) {
171 $myscript = $_SERVER["SCRIPT_NAME"];
172 $myphpath = $_SERVER["PHP_SELF"];
173 $mypathinfo = str_replace($myscript, "", $myphpath);
174 @putenv("PATH_INFO=".$mypathinfo); } }
175 // Change raw post data to POST array
176 // Not sure why I made but alwell. :P
177 function parse_post_data()
178 { $_POST = array(); $_POST = null;
179 $postdata = file_get_contents("php://input");
180 if (!isset($postdata)) { $postdata = null; }
181 $postdata = urldecode($postdata);
182 $preqs = explode("&",$postdata);
183 $qsnum = count($preqs); $qsi = 0;
184 while ($qsi < $qsnum) {
185 $preqst = explode("=",$preqs[$qsi],2);
186 $fix1 = array(" ",'$'); $fix2 = array("_","_");
187 $preqst[0] = str_replace($fix1, $fix2, $preqst[0]);
188 $preqst[0] = killbadvars($preqst[0]);
189 if($preqst[0]!=null) {
190 $_POST[$preqst[0]] = $preqst[1]; }
191 ++$qsi; } return true; }
192 // Change Path info to Get Vars :
193 function mrstring() {
194 $urlvar = explode('/',$_SERVER['PATH_INFO']);
195 $num=count($urlvar); $i=1;
196 while ($i < $num) {
197 //$urlvar[$i] = urldecode($urlvar[$i]);
198 if(!isset($_GET[$urlvar[$i]])) { $_GET[$urlvar[$i]] = null; }
199 if(!isset($urlvar[$i])) { $urlvar[$i] = null; }
200 if($_GET[$urlvar[$i]]==null&&$urlvar[$i]!=null) {
201 $fix1 = array(" ",'$'); $fix2 = array("_","_");
202 $urlvar[$i] = str_replace($fix1, $fix2, $urlvar[$i]);
203 $urlvar[$i] = killbadvars($urlvar[$i]);
204 $_GET[$urlvar[$i]] = $urlvar[$i+1]; }
205 ++$i; ++$i; } return true; }
206 // Redirect to another file with ether timed or nontimed redirect
207 function redirect($type,$file,$time=0,$url=null,$dbsr=true) {
208 if($type!="location"&&$type!="refresh") { $type=="location"; }
209 if($url!=null) { $file = $url.$file; }
210 if($dbsr===true) { $file = str_replace("//", "/", $file); }
211 if($type=="refresh") { header("Refresh: ".$time."; URL=".$file); }
212 if($type=="location") { session_write_close();
213 header("Location: ".$file); } return true; }
214 function redirects($type,$url,$time=0) {
215 if($type!="location"&&$type!="refresh") { $type=="location"; }
216 if($type=="refresh") { header("Refresh: ".$time."; URL=".$url); }
217 if($type=="location") { header("Location: ".$url); } return true; }
218 // Make xhtml tags
219 function html_tag_make($name="br",$emptytag=true,$attbvar=null,$attbval=null,$extratest=null) {
220 $var_num = count($attbvar); $value_num = count($attbval);
221 if($var_num!=$value_num) {
222 output_error("Erorr Number of Var and Values dont match!",E_USER_ERROR);
223 return false; } $i = 0;
224 while ($i < $var_num) {
225 if($i==0) { $mytag = "<".$name." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
226 if($i>=1) { $mytag = $mytag." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
227 if($i==$var_num-1) {
228 if($emptytag===false) { $mytag = $mytag.">"; }
229 if($emptytag===true) { $mytag = $mytag." />"; } } ++$i; }
230 if($attbvar==null&&$attbval==null) { $mytag = "<".$name;
231 if($emptytag===true) { $mytag = $mytag." />"; }
232 if($emptytag===false) { $mytag = $mytag.">"; } }
233 if($emptytag===false&&$extratest!=null) {
234 $mytag = $mytag.$extratest; $mytag = $mytag."</".$name.">"; }
235 return $mytag; }
236 // Start a xml document
237 function xml_tag_make($type,$attbs,$retval=false) {
238 $renee1 = explode("&",$attbs);
239 $reneenum=count($renee1);
240 $reneei=0; $attblist = null;
241 while ($reneei < $reneenum) {
242 $renee2 = explode("=",$renee1[$reneei]);
243 if($renee2[0]!=null||$renee2[1]!=null) {
244 $attblist = $attblist.' '.$renee2[0].'="'.$renee2[1].'"'; }
245 ++$reneei; }
246 if($retval!==false&&$retval!==true) { $retval=false; }
247 if($retval===false) {
248 echo '<?'.$type.$attblist.'?>'."\n"; }
249 if($retval===true) {
250 return '<?'.$type.$attblist.'?>'."\n"; } }
251 // Start a xml document (old version)
252 function xml_doc_start($ver,$encode,$retval=false) {
253 if($retval===false) {
254 echo xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); }
255 if($retval===true) {
256 return xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); } }
257 $icharset = $Settings['charset'];
258 $debug_on = false;
259 if(isset($_GET['debug'])) {
260 if($_GET['debug']=="true"||
261 $_GET['debug']=="on") {
262 $debug_on = true; } }
263 $BoardURL = $Settings['idburl'];
264 // Change URLs to Links
265 function pre_url2link($matches) {
266 global $BoardURL; $opennew = true;
267 $burlCHCK = parse_url($BoardURL);
268 $urlCHCK = parse_url($matches[0]);
269 if($urlCHCK['host']==$burlCHCK['host']) {
270 $opennew = false; }
271 $outurl = $urlCHCK['scheme']."://";
272 if(isset($urlCHCK['user'])) {
273 $outurl = $outurl.$urlCHCK['user'];
274 if(isset($urlCHCK['pass'])) {
275 $outurl = $outurl.":".$urlCHCK['pass']; }
276 $outurl = $outurl."@"; }
277 $outurl = $outurl.$urlCHCK['host'];
278 if(isset($urlCHCK['path'])) {
279 $outurl = $outurl.$urlCHCK['path']; }
280 if(!isset($urlCHCK['path'])) {
281 $outurl = $outurl."/"; }
282 if(isset($urlCHCK['query'])) {
283 $urlCHCK['query'] = str_replace(" ", "+", $urlCHCK['query']);
284 $outurl = $outurl."?".$urlCHCK['query']; }
285 if(isset($urlCHCK['fragment'])) {
286 $urlCHCK['fragment'] = str_replace(" ", "+", $urlCHCK['fragment']);
287 $outurl = $outurl."#".$urlCHCK['fragment']; }
288 if($opennew===true) {
289 $outlink = "<a onclick=\"window.open(this.href); return false;\" href=\"".$outurl."\">".$outurl."</a>"; }
290 if($opennew===false) {
291 $outlink = "<a href=\"".$outurl."\">".$outurl."</a>"; }
292 return $outlink; }
293 function url2link($string) {
294 return preg_replace_callback("/(?<![\">])\b([a-zA-Z]+)\:\/\/([a-z0-9\-\.]+)(\:[0-9]+)?\/([A-Za-z0-9\.\/%\?\-_\:;\~]+)?(\?)?([A-Za-z0-9\.\/%&=\?\-_\:;\+]+)?(\#)?([A-Za-z0-9\.\/%&=\?\-_\:;\+]+)?/is", "pre_url2link", $string); }
295 function urlcheck($string) {
296 global $BoardURL;
297 $retnum = preg_match_all("/([a-zA-Z]+)\:\/\/([a-z0-9\-\.]+)(\:[0-9]+)?\/([A-Za-z0-9\.\/%\?\-_\:;\~]+)?(\?)?([A-Za-z0-9\.\/%&=\?\-_\:;\+]+)?(\#)?([A-Za-z0-9\.\/%&=\?\-_\:;\+]+)?/is", $string, $urlcheck);
298 if(isset($urlcheck[0][0])) { $url = $urlcheck[0][0]; }
299 if(!isset($urlcheck[0][0])) { $url = $BoardURL; }
300 return $url; }
301 //Check to make sure theme exists
302 $BoardTheme = $Settings['DefaultTheme'];
303 $ThemeDir = $SettDir['themes'];
304 function chack_themes($theme) {
305 global $BoardTheme,$ThemeDir;
306 if(!isset($theme)) { $theme = null; }
307 if(preg_match("/([a-zA-Z]+)\:/isU",$theme)) {
308 $theme = $BoardTheme; }
309 if(!preg_match("/^[a-z0-9]+$/isU",$theme)) {
310 $theme = $BoardTheme; }
311 require('settings.php');
312 $ckskindir = dirname(realpath("settings.php"))."/".$ThemeDir;
313 if ($handle = opendir($ckskindir)) { $dirnum = null;
314 while (false !== ($ckfile = readdir($handle))) {
315 if ($dirnum==null) { $dirnum = 0; }
316 if (file_exists($ckskindir.$ckfile."/info.php")) {
317 if ($ckfile != "." && $ckfile != "..") {
318 //include($ckskindir.$ckfile."/info.php");
319 $cktheme[$dirnum] = $ckfile;
320 ++$dirnum; } } }
321 closedir($handle); asort($cktheme); }
322 $theme=preg_replace("/(.*?)\.\/(.*?)/", $BoardTheme, $theme);
323 if(!in_array($theme,$cktheme)||strlen($theme)>26) {
324 $theme = $BoardTheme; } return $theme; }
325 // Make a url with query string
326 function url_maker($file="index",$ext=".php",$qvarstr=null,$qstr=";",$qsep="=",$prexqstr=null,$exqstr=null,$fixhtml=true) {
327 global $sidurls, $icharset, $debug_on;
328 $fileurl = null; if(!isset($ext)) { $ext = null; }
329 if($ext==null) { $ext = ".php"; }
330 if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $ext = null; }
331 $file = $file.$ext;
332 if($sidurls=="on"&&$qstr!="/") {
333 if(defined('SID')) {
334 if($qvarstr==null) { $qvarstr = SID; }
335 if($qvarstr!=null) { $qvarstr = SID."&".$qvarstr; } } }
336 if($debug_on===true) {
337 if($qvarstr==null) { $qvarstr = "debug=on"; }
338 if($qvarstr!=null) { $qvarstr = $qvarstr."&debug=on"; } }
339 if($qvarstr==null) { $fileurl = $file; }
340 if($fixhtml===true) {
341 $qstr = htmlentities($qstr, ENT_QUOTES, $icharset);
342 $qsep = htmlentities($qsep, ENT_QUOTES, $icharset); }
343 if($prexqstr!=null) {
344 $rene1 = explode("&",$prexqstr);
345 $renenum=count($rene1);
346 $renei=0;
347 $reneqstr = "index.php?";
348 if($qstr!="/") { $fileurl = $file."?"; }
349 if($qstr=="/") { $fileurl = $file."/"; }
350 while ($renei < $renenum) {
351 $rene2 = explode("=",$rene1[$renei]);
352 if(!isset($rene2[0])) { $rene2[0] = null; }
353 $rene2[1] = urlencode($rene2[1]);
354 if(!isset($rene2[0])) { $rene2[0] = null; }
355 $rene2[1] = urlencode($rene2[1]);
356 if($qstr!="/") {
357 $fileurl = $fileurl.$rene2[0].$qsep.$rene2[1]; }
358 if($qstr=="/") {
359 $fileurl = $fileurl.$rene2[0]."/".$rene2[1]."/"; }
360 $reneis = $renei + 1;
361 if($qstr!="/") {
362 if($reneis < $renenum) { $fileurl = $fileurl.$qstr; } }
363 ++$renei; } }
364 if($qvarstr!=null&&$qstr!="/") { $fileurl = $fileurl.$qstr; }
365 if($qvarstr!=null) {
366 if($prexqstr==null) {
367 if($qstr!="/") { $fileurl = $file."?"; }
368 if($qstr=="/") { $fileurl = $file."/"; } }
369 $cind1 = explode("&",$qvarstr);
370 $cindnum=count($cind1);
371 $cindi=0;
372 $cindqstr = "index.php?";
373 while ($cindi < $cindnum) {
374 $cind2 = explode("=",$cind1[$cindi]);
375 if(!isset($cind2[0])) { $cind2[0] = null; }
376 $cind2[0] = urlencode($cind2[0]);
377 if(!isset($cind2[1])) { $cind2[1] = null; }
378 $cind2[1] = urlencode($cind2[1]);
379 if($qstr!="/") {
380 $fileurl = $fileurl.$cind2[0].$qsep.$cind2[1]; }
381 if($qstr=="/") {
382 $fileurl = $fileurl.$cind2[0]."/".$cind2[1]."/"; }
383 $cindis = $cindi + 1;
384 if($qstr!="/") {
385 if($cindis < $cindnum) { $fileurl = $fileurl.$qstr; } }
386 ++$cindi; } }
387 if($exqstr!=null&&$qstr!="/") { $fileurl = $fileurl.$qstr; }
388 if($exqstr!=null) {
389 if($qvarstr==null&&$prexqstr==null) {
390 if($qstr!="/") { $fileurl = $file."?"; }
391 if($qstr=="/") { $fileurl = $file."/"; } }
392 $sand1 = explode("&",$exqstr);
393 $sanum=count($sand1);
394 $sandi=0;
395 $sandqstr = "index.php?";
396 while ($sandi < $sanum) {
397 $sand2 = explode("=",$sand1[$sandi]);
398 if(!isset($sand2[0])) { $sand2[0] = null; }
399 $sand2[0] = urlencode($sand2[0]);
400 if(!isset($sand2[1])) { $sand2[1] = null; }
401 $sand2[1] = urlencode($sand2[1]);
402 if($qstr!="/") {
403 $fileurl = $fileurl.$sand2[0].$qsep.$sand2[1]; }
404 if($qstr=="/") {
405 $fileurl = $fileurl.$sand2[0]."/".$sand2[1]."/"; }
406 $sandis = $sandi + 1;
407 if($qstr!="/") {
408 if($sandis < $sanum) { $fileurl = $fileurl.$qstr; } }
409 ++$sandi; } }
410 return $fileurl; }
411 $thisdir = dirname(realpath("Preindex.php"))."/";
412 // Get the Query String
413 function GetQueryStr($qstr=";",$qsep="=",$fixhtml=true)
414 { $pregqstr = preg_quote($qstr,"/");
415 $pregqsep = preg_quote($qsep,"/");
416 $oqstr = $qstr; $oqsep = $qsep;
417 if($fixhtml===true||$fixhtml==null) {
418 $qstr = htmlentities($qstr, ENT_QUOTES, $icharset);
419 $qsep = htmlentities($qsep, ENT_QUOTES, $icharset); }
420 $OldBoardQuery = preg_replace("/".$pregqstr."/isxS", $qstr, $_SERVER['QUERY_STRING']);
421 $BoardQuery = "?".$OldBoardQuery;
422 return $BoardQuery; }