OSDN Git Service

Small update
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Thu, 26 Jan 2017 09:52:26 +0000 (03:52 -0600)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Thu, 26 Jan 2017 09:52:26 +0000 (03:52 -0600)
110 files changed:
LICENSE.bak [deleted file]
README.bak [deleted file]
admin.php.bak [deleted file]
archive/index.php.bak [deleted file]
calendar.php.bak [deleted file]
category.php.bak [deleted file]
event.php.bak [deleted file]
forum.php.bak [deleted file]
inc/admin/categories.php.bak [deleted file]
inc/admin/forums.php.bak [deleted file]
inc/admin/groups.php.bak [deleted file]
inc/admin/index.php.bak [deleted file]
inc/admin/main.php.bak [deleted file]
inc/admin/members.php.bak [deleted file]
inc/admin/sqldumper/cubrid.php.bak [deleted file]
inc/admin/sqldumper/index.php.bak [deleted file]
inc/admin/sqldumper/mysql.php.bak [deleted file]
inc/admin/sqldumper/pgsql.php.bak [deleted file]
inc/admin/sqldumper/sqlite.php.bak [deleted file]
inc/admin/table.php.bak [deleted file]
inc/calendars.php.bak [deleted file]
inc/categories.php.bak [deleted file]
inc/endpage.php.bak [deleted file]
inc/events.php.bak [deleted file]
inc/filename.php.bak [deleted file]
inc/fonts/index.php.bak [deleted file]
inc/forums.php.bak [deleted file]
inc/function.php.bak [deleted file]
inc/groupsetup.php.bak [deleted file]
inc/html5.php.bak [deleted file]
inc/index.php.bak [deleted file]
inc/iwrapper.php.bak [deleted file]
inc/javascript.php.bak [deleted file]
inc/lowcategories.php.bak [deleted file]
inc/lowforums.php.bak [deleted file]
inc/lowreplies.php.bak [deleted file]
inc/lowsubcategories.php.bak [deleted file]
inc/lowsubforums.php.bak [deleted file]
inc/lowtopics.php.bak [deleted file]
inc/members.php.bak [deleted file]
inc/messages.php.bak [deleted file]
inc/misc/compression.php.bak [deleted file]
inc/misc/functions.php.bak [deleted file]
inc/misc/ibbcode.php.bak [deleted file]
inc/misc/index.php.bak [deleted file]
inc/misc/iuntar.php.bak [deleted file]
inc/misc/killglobals.php.bak [deleted file]
inc/misc/setcheck.php.bak [deleted file]
inc/misc/sql/cubrid.php.bak [deleted file]
inc/misc/sql/index.php.bak [deleted file]
inc/misc/sql/mysql.php.bak [deleted file]
inc/misc/sql/mysqli.php.bak [deleted file]
inc/misc/sql/pgsql.php.bak [deleted file]
inc/misc/sql/sqlite.php.bak [deleted file]
inc/misc/useragents.php.bak [deleted file]
inc/misc/utf8.php.bak [deleted file]
inc/mod/index.php.bak [deleted file]
inc/mplayer/index.php.bak [deleted file]
inc/navbar.php.bak [deleted file]
inc/prelogin.php.bak [deleted file]
inc/profilemain.php.bak [deleted file]
inc/replies.php.bak [deleted file]
inc/rssfeed.php.bak [deleted file]
inc/searches.php.bak [deleted file]
inc/sqlthemes.php.bak [deleted file]
inc/stats.php.bak [deleted file]
inc/subcategories.php.bak [deleted file]
inc/subforums.php.bak [deleted file]
inc/topics.php.bak [deleted file]
inc/versioninfo.php
inc/versioninfo.php.bak [deleted file]
index.php.bak [deleted file]
install.php.bak [deleted file]
javascript.js.bak [deleted file]
logs/index.php.bak [deleted file]
member.php.bak [deleted file]
messenger.php.bak [deleted file]
preindex.php.bak [deleted file]
profile.php.bak [deleted file]
rss.php.bak [deleted file]
search.php.bak [deleted file]
setup/convert/index.php.bak [deleted file]
setup/convert/info.php.bak [deleted file]
setup/html5.php.bak [deleted file]
setup/index.php.bak [deleted file]
setup/license.php.bak [deleted file]
setup/mkconfig.php.bak [deleted file]
setup/preinstall.php.bak [deleted file]
setup/presetup.php.bak [deleted file]
setup/setup.php.bak [deleted file]
setup/sql/cubrid.php
setup/sql/cubrid.php.bak [deleted file]
setup/sql/index.php.bak [deleted file]
setup/sql/mysql.php
setup/sql/mysql.php.bak [deleted file]
setup/sql/pgsql.php
setup/sql/pgsql.php.bak [deleted file]
setup/sql/sqlite.php
setup/sql/sqlite.php.bak [deleted file]
sql.php.bak [deleted file]
subcategory.php.bak [deleted file]
subforum.php.bak [deleted file]
themes/Gray/index.php.bak [deleted file]
themes/Gray/info.php.bak [deleted file]
themes/Gray/settings.php.bak [deleted file]
themes/iDB/index.php.bak [deleted file]
themes/iDB/info.php.bak [deleted file]
themes/iDB/settings.php.bak [deleted file]
themes/index.php.bak [deleted file]
topic.php.bak [deleted file]

diff --git a/LICENSE.bak b/LICENSE.bak
deleted file mode 100644 (file)
index f47c059..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-  $FileInfo: LICENSE - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $ 
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-                   Revised BSD License
-
-Copyright (c) 2004-2015 Game Maker 2k. 
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-  1. Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimer.
-
-  2. Redistributions in binary form must reproduce the above copyright 
-     notice, this list of conditions and the following disclaimer in 
-     the documentation and/or other materials provided with the distribution.
-
-  3. Neither the name of Game Maker 2k nor the names of its contributors
-     may be used to endorse or promote products derived from this software
-     without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
-THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those of the
-authors and should not be interpreted as representing official policies, either expressed
-or implied, of <copyright holder>.
-
-  Important Note: The Emoticons distributed with the Software were
-created by Jcink; its usage is not governed under the terms of this 
-license agreement. Information regarding its usage can be found on 
-textfileBB's Web site at https://launchpad.net/tfbb
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\ No newline at end of file
diff --git a/README.bak b/README.bak
deleted file mode 100644 (file)
index 6b3daf4..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//        $FileInfo: README - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $          
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//                       __________________________________________
-//                      //        Internet Discussion Boards      \\
-//                     || Made by Game Maker 2k - iDB Support Team ||
-//                     ||  Cool Dude 2k ( http://gamemaker2k.org ) ||
-//                     ||    Kazuki P. ( http://idb.berlios.de )   ||
-//                     ||  Rene J.( http://intdb.sourceforge.net ) ||
-//                     ||  Help to make Internet Discussion Boards ||
-//                     ||         Jcink ( http://jcink.com/ )      ||
-//                     ||  Dubbs Rules/Dubbz4president ( unknown ) ||
-//                     || Lone Wolf ( http://kolibrios.net46.net ) ||
-//                     ||  Renee S (http://renee.everywebhost.com) ||
-//                     ||      deat ( http://www.gprogress.com )   ||
-//                     || SSS/Stephen (http://sss2005.s1.jcink.com)||
-//                     ||      Sean J ( http://seanj.jcink.com )   ||
-//                     ||Shadow Dude (http://sd2k.everywebhost.com)||
-//                     ||              Renate ( unknown )          ||
-//                     ||             Jonathan ( unknown )         ||
-//                     ||             czambran ( unknown )         ||
-//                      \\       (c) 2004-2015 Game Maker 2k      //
-//                       """"""""""""""""""""""""""""""""""""""""""
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// UTF8 helper functions
-// author: Scott Michael Reynen "scott@randomchaos.com"
-// url: http://www.randomchaos.com/document.php?source=php_and_unicode
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// utf8_substr by frank at jkelloggs dot dk
-// http://us3.php.net/manual/en/function.substr.php#55107
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// PhpCaptcha - A visual and audio CAPTCHA generation library
-// Software License Agreement (BSD License)
-// Copyright (C) 2005-2006, Edward Eliot.
-// All rights reserved.
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// Copyright 2004-2015 Cool Dude 2k - http://intdb.sourceforge.net/ http://idb.berlios.net/
-// Copyright 2004-2015 Game Maker 2k - http://upload.idb.s1.jcink.com/ 
-// http://s1.jcink.com/s/host/idb/  http://idb.everywebhost.com/  http://cooldude2k.id.funpic.org/
-//             Game Maker 2k Copyright 2000-2009 Cool Dude 2k (Kazuki Przyborowski), Ren Johnson
-// Emoticons made by Jcink for TextfileBB (https://launchpad.net/tfbb) Under GPL License
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// iDB Installer made by Game Maker 2k - http://upload.idb.s1.jcink.com/
-// How to delete installer if error happens:
-// Delete install.php file and the setup folder/dir and everyting inside it also.
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// DejaVu fonts 2.26 (c)2004-2015 DejaVu fonts team
-// The DejaVu fonts are a font family based on the Bitstream Vera Fonts
-// (http://gnome.org/fonts/). Its purpose is to provide a wider range of
-// characters (see status.txt for more information) while maintaining the
-// original look and feel.
-// DejaVu fonts are based on Bitstream Vera fonts version 1.10.
-// For more information go to http://dejavu.sourceforge.net/.
-// Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah:
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// PhpCaptcha - A visual and audio CAPTCHA generation library
-// Software License Agreement (BSD License)
-// Copyright (C) 2005-2006, Edward Eliot.
-// All rights reserved.
-// Documentation is available at http://www.ejeliot.com/pages/2
-// WebSite is at http://www.ejeliot.com/pages/php-captcha
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// Important Note: The Emoticons distributed with the Software were
-// created by Jcink; its usage is not governed under the terms of
-// this license agreement. Information regarding its usage can be
-// found on textfileBB's Web site at https://launchpad.net/tfbb.
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// Emoticons made by Jcink for TextfileBB (https://launchpad.net/tfbb) 
-// under GPL 2 License (http://www.gnu.org/licenses/gpl-2.0.txt)
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//                         ______________________________________
-//                        //     Also Get PHP-Quick-Arcade      \\
-//                        ||          And TextFileBB             ||
-//                        ||Website:http://quickarcade.jcink.com ||
-//                        || Website:https://launchpad.net/tfbb  ||
-//                        ||   by: Jcink ( http://jcink.com/ )   ||
-//                        ||         (c) 2009 Jcink              ||
-//                        \\                                    //
-//                         """"""""""""""""""""""""""""""""""""""
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// This program is free software; you can redistribute it and/or modify           
-// it under the terms of the Revised BSD License.                                        
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// This program is distributed in the hope that it will be useful,                    
-// but WITHOUT ANY WARRANTY; without even the implied warranty of         
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         
-// Revised BSD License for more details.                                              
-// Read LICENSE for more info.
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.     
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//                                  About Free Software: 
-// Free software is not just free of cost (like "free beer").
-// It is free as in freedom (like "free speech").
-// Free software gives you the freedom to use a program,
-// study how it works, improve it, and share it with others.
-// For more information, visit the Free Software Foundation.(http://www.fsf.org/)
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// List Can be fond at http://upload.idb.s1.jcink.com/index.php/topic,103.0.html
-// Free WebHosts
-// Hosts that iDB Works on
-//     * http://freejcinkhosting.afraid.org:81/
-//     * http://funpic.org/
-//     * http://5gigs.com/
-//     * http://www.lycos.co.uk/
-//     * http://www.100webspace.com/
-//     * http://www.globalweb.com.ru/ 
-// Hosts that iDB dose not work on
-//     * http://awardspace.com/
-// Paid WebHosts
-// Hosts that iDB Works on
-//     * Unknow
-// Hosts that iDB dose not works on
-//     * Unknow
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/admin.php.bak b/admin.php.bak
deleted file mode 100644 (file)
index a87d440..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: admin.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['admin'].$usefileext.$_SERVER['PATH_INFO'];
-if($GroupInfo['ViewDBInfo']=="yes") {
-if($_GET['act']=="settings"||$_GET['act']=="sql") {
-?>
-
-<?php $iWrappers['EXTRALINKS'] = null;
-if($Settings['vercheck']===1) { 
-ob_start("idb_suboutput_handler"); ?>
-<script type="text/javascript" src="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck&redirect=js",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>"></script>
-<?php $iWrappers['EXTRALINKS'] = ob_get_clean(); } if($Settings['vercheck']===2) { 
-ob_start("idb_suboutput_handler"); ?>
-<script type="text/javascript" src="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck&vercheck=newtype&redirect=js",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>"></script>
-<?php $iWrappers['EXTRALINKS'] = ob_get_clean(); } } } ?>
-<?php
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Board index";
-if(!isset($_GET['subact'])) { $_GET['subact'] = null; }
-if(!isset($_POST['subact'])) { $_POST['subact'] = null; }
-if(!isset($_GET['menu'])) { $_GET['menu'] = null; }
-$AdminMenu = null;
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_GET['act']==null) {
-       $_GET['act']="view"; }
-if($_GET['act']=="view"&&$GroupInfo['ViewDBInfo']!="yes") {
-       $_GET['act']="view"; }
-if($_GET['act']=="vercheck"&&$GroupInfo['ViewDBInfo']=="yes") {
-       if($Settings['vercheck']!=1&&$Settings['vercheck']!=2) {
-       $Settings['vercheck'] = 1; }
-       if($Settings['vercheck']===1) {
-       $addredirect = null;
-       if(isset($_GET['redirect'])) { $addredirect = "&redirect=".urlencode($_GET['redirect']); }
-       header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName).$addredirect); $urlstatus = 302; 
-       gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-       if($Settings['vercheck']===2) {
-       $addredirect = null;
-       if(isset($_GET['redirect'])) { $addredirect = "&redirect=".urlencode($_GET['redirect']); }
-       header("Location: ".$VerCheckURL."&bid=".$Settings['bid']."&vercheck=newtype".$addredirect); $urlstatus = 302; 
-       gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($_GET['act']=="view")
-{ $AdminMenu = "menu";
-if($_GET['menu']==null) {
-   $AdminMenu = "main"; }
-require($SettDir['admin'].'main.php'); }
-if($_GET['act']=="settings"||
-       $_GET['act']=="sql"||
-       $_GET['act']=="info"||
-       $_GET['act']=="gettheme"||
-       $_GET['act']=="optimize"||
-       $_GET['act']=="themelist"||
-       $_GET['act']=="delsessions"||
-       $_GET['act']=="resyncthemes"||
-       $_GET['act']=="enablesthemes")
-{ $AdminMenu = "main";
-require($SettDir['admin'].'main.php'); }
-if($_GET['act']=="addforum"||
-       $_GET['act']=="editforum"||
-       $_GET['act']=="deleteforum"||
-       $_GET['act']=="retopics"||
-       $_GET['act']=="rereplies"||
-       $_GET['act']=="fixrnames"||
-       $_GET['act']=="fixtnames"||
-       $_GET['act']=="fpermissions")
-{ $AdminMenu = "forums";
-require($SettDir['admin'].'forums.php'); }
-if($_GET['act']=="addcategory"||
-       $_GET['act']=="editcategory"||
-       $_GET['act']=="deletecategory"||
-       $_GET['act']=="cpermissions")
-{ $AdminMenu = "categories";
-require($SettDir['admin'].'categories.php'); }
-if($_GET['act']=="validate"||
-       $_GET['act']=="editmember"||
-       $_GET['act']=="deletemember")
-{ $AdminMenu = "members";
-require($SettDir['admin'].'members.php'); }
-if($_GET['act']=="addgroup"||
-       $_GET['act']=="editgroup"||
-       $_GET['act']=="deletegroup")
-{ $AdminMenu = "groups";
-require($SettDir['admin'].'groups.php'); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php'); 
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($admincptitle)) { $admincptitle = null; }
-?>
-</body>
-</html>
-<?php
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($admincptitle==null) {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Admin CP",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($admincptitle!=null) {
-change_title($Settings['board_name'].$admincptitle,$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/archive/index.php.bak b/archive/index.php.bak
deleted file mode 100644 (file)
index 0c7c8e2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../index.php');
-?>
\ No newline at end of file
diff --git a/calendar.php.bak b/calendar.php.bak
deleted file mode 100644 (file)
index caf5f33..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: calendar.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['calendar'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("view", "create");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']==null) {
-$_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if($_GET['act']=="view")
-{ require($SettDir['inc'].'calendars.php'); }
-if($_GET['act']=="create") 
-{ require($SettDir['inc'].'events.php'); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php'); 
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler"); ?>
-</body>
-</html>
-<?php
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($_GET['act']=="view") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Viewing Calendar",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="create") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making a Event",$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/category.php.bak b/category.php.bak
deleted file mode 100644 (file)
index cdf7ef7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: category.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$checklowview = true;
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['category'].$usefileext.$_SERVER['PATH_INFO'];
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-$idbactcheck = array("view", "lowview", "stats");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']!="lowview") {
-require($SettDir['inc'].'navbar.php'); }
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-$CatCheck = null;
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-if($_GET['act']=="view")
-{ require($SettDir['inc'].'categories.php'); }
-if($_GET['act']=="lowview")
-{ require($SettDir['inc'].'lowcategories.php'); }
-if($_GET['act']=="view"||$_GET['act']=="stats")
-{ require($SettDir['inc'].'stats.php'); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($CategoryName)) { $CategoryName = null; }
-?>
-</body>
-</html>
-<?php
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$CategoryName,$Settings['use_gzip'],$GZipEncode['Type']);
-?>
diff --git a/event.php.bak b/event.php.bak
deleted file mode 100644 (file)
index 3979656..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: event.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['event'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("view", "create", "makeevent");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id']))
-{ $_GET['id']="1"; }
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']=="event"||$_GET['act']==null) { 
-       $_GET['act']="view"; }
-if($_GET['act']=="view"||$_GET['act']=="create"||
-       $_GET['act']=="makeevent"||$_POST['act']=="makeevents") {
-require($SettDir['inc'].'events.php'); } 
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($EventName)) { $EventName = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($_GET['act']=="view") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$EventName,$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="create"||$_GET['act']=="makeevent"||$_POST['act']=="makeevents") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making a Event",$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/forum.php.bak b/forum.php.bak
deleted file mode 100644 (file)
index cc6d7cc..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: forum.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$checklowview = true;
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['forum'].$usefileext.$_SERVER['PATH_INFO'];
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-$idbactcheck = array("view", "create", "maketopic", "lowview", "oldrss", "rss", "atom", "opml");
-$iWrappers['EXTRALINKS'] = null;
-if($Settings['enable_rss']=="on") {
-ob_start("idb_suboutput_handler");
-?>
-<link rel="alternate" type="application/xml" title="Forum Topics RSS 1.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=oldrss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<link rel="alternate" type="application/rss+xml" title="Forum Topics RSS 2.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<link rel="alternate" type="application/atom+xml" title="Forum Topics Atom Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=atom&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<?php $iWrappers['EXTRALINKS'] = ob_get_clean(); } ?>
-<?php ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']!="lowview") {
-require($SettDir['inc'].'navbar.php'); }
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-$ForumCheck = null;
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-if($_GET['act']=="view"||$_GET['act']=="create"||
-       $_GET['act']=="maketopic"||$_POST['act']=="maketopics")
-{ require($SettDir['inc'].'topics.php'); } 
-if($_GET['act']=="lowview")
-{ require($SettDir['inc'].'lowtopics.php'); }
-if($_GET['act']=="oldrss"||$_GET['act']=="rss"||$_GET['act']=="atom"||$_GET['act']=="opml") {
-redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($ForumName)) { $ForumName = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($_GET['act']=="view"||$_GET['act']=="lowview") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$ForumName,$Settings['use_gzip'],$GZipEncode['Type']); } 
-if($_GET['act']=="create") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="maketopic"&&$_POST['act']=="maketopics") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/inc/admin/categories.php.bak b/inc/admin/categories.php.bak
deleted file mode 100644 (file)
index 11761d3..0000000
+++ /dev/null
@@ -1,918 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: categories.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="categories.php"||$File3Name=="/categories.php") {
-       require('index.php');
-       exit(); }
-
-// Check if we can goto admin cp
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-$Error = null; $errorstr = null;
-?>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-<?php 
-require($SettDir['admin'].'table.php'); 
-?>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php if($_GET['act']=="addcategory"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Adding new Category";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Adding new Category: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryID">Insert ID for category:</label></td>
-       <td style="width: 50%;"><input type="text" name="CategoryID" class="TextBox" id="CategoryID" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="OrderID">Insert order id category:</label></td>
-       <td style="width: 50%;"><input type="text" name="OrderID" class="TextBox" id="OrderID" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryName">Insert name for category:</label></td>
-       <td style="width: 50%;"><input type="text" name="CategoryName" class="TextBox" id="CategoryName" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryDesc">Insert description for category:</label></td>
-       <td style="width: 50%;"><input type="text" name="CategoryDesc" class="TextBox" id="CategoryDesc" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ShowCategory">Show category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ShowCategory" id="ShowCategory">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryType">Insert category type:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CategoryType" id="CategoryType">
-       <option selected="selected" value="category">Category</option>
-       <option value="subcategory">SubCategory</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="InSubCategory">In SubCategory:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="InSubCategory" id="InSubCategory">
-       <option selected="selected" value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"InSubCategory\"=0 AND \"CategoryType\"='subcategory' ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InCategoryID=sql_result($fr,$fi,"id");
-$InCategoryName=sql_result($fr,$fi,"Name");
-$InCategoryType=sql_result($fr,$fi,"CategoryType");
-$AiFiInSubCategory=sql_result($fr,$fi,"InSubCategory");
-if ($AiFiInSubCategory=="0") {
-?>
-       <option value="<?php echo $InCategoryID; ?>"><?php echo $InCategoryName; ?></option>
-<?php } ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumPostView">Number of posts to view category:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumPostView" id="NumPostView" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumKarmaView">Amount of karma to view category:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumKarmaView" id="NumKarmaView" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="addcategory" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Add Category" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="addcategory"&&$_POST['update']=="now"&&$_GET['act']=="addcategory") {
-$_POST['CategoryName'] = stripcslashes(htmlspecialchars($_POST['CategoryName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['CategoryName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryName']);
-$_POST['CategoryName'] = remove_spaces($_POST['CategoryName']);
-$_POST['CategoryDesc'] = stripcslashes(htmlspecialchars($_POST['CategoryDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['CategoryDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryDesc']);
-$_POST['CategoryDesc'] = remove_spaces($_POST['CategoryDesc']);
-$sql_id_check = sql_query(sql_pre_query("SELECT \"id\" FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i LIMIT 1", array($_POST['CategoryID'])),$SQLStat);
-$sql_order_check = sql_query(sql_pre_query("SELECT \"OrderID\" FROM \"".$Settings['sqltable']."categories\" WHERE \"OrderID\"=%i LIMIT 1", array($_POST['OrderID'])),$SQLStat);
-$id_check = sql_num_rows($sql_id_check); $order_check = sql_num_rows($sql_order_check);
-sql_free_result($sql_id_check); sql_free_result($sql_order_check);
-$errorstr = "";
-if ($_POST['NumPostView']==null||
-       !is_numeric($_POST['NumPostView'])) {
-       $_POST['NumPostView'] = 0; }
-if ($_POST['NumKarmaView']==null||
-       !is_numeric($_POST['NumKarmaView'])) {
-       $_POST['NumKarmaView'] = 0; }
-if ($_POST['CategoryName']==null||
-       $_POST['CategoryName']=="ShowMe") { $Error="Yes";
-$errorstr = $errorstr."You need to enter a category name.<br />\n"; } 
-if ($_POST['CategoryDesc']==null) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a description.<br />\n"; } 
-if ($_POST['CategoryID']==null||
-       !is_numeric($_POST['CategoryID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a category id.<br />\n"; } 
-if($id_check > 0) { $Error="Yes";
-$errorstr = $errorstr."This ID number is already used.<br />\n"; } 
-if($order_check > 0) { $Error="Yes"; 
-$errorstr = $errorstr."This order number is already used.<br />\n"; } 
-if (pre_strlen($_POST['CategoryName'])>"150") { $Error="Yes";
-$errorstr = $errorstr."Your category name is too big.<br />\n"; } 
-if (pre_strlen($_POST['CategoryDesc'])>"300") { $Error="Yes";
-$errorstr = $errorstr."Your category description is too big.<br />\n"; } 
-if ($Error!="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."categories\" (\"id\", \"OrderID\", \"Name\", \"ShowCategory\", \"CategoryType\", \"SubShowForums\", \"InSubCategory\", \"PostCountView\", \"KarmaCountView\", \"Description\") VALUES\n".
-"(%i, %i, '%s', '%s', '%s', 'yes', %i, %i, %i, '%s')", array($_POST['CategoryID'],$_POST['OrderID'],$_POST['CategoryName'],$_POST['ShowCategory'],$_POST['CategoryType'],$_POST['InSubCategory'],$_POST['NumPostView'],$_POST['NumKarmaView'],$_POST['CategoryDesc']));
-sql_query($query,$SQLStat);
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="sqlite") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"PermissionID\" FROM \"".$Settings['sqltable']."catpermissions\" ORDER BY \"PermissionID\" ASC", array(null)); }
-if($Settings['sqltype']=="cubrid") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"permissionid\" FROM \"".$Settings['sqltable']."catpermissions\" ORDER BY \"PermissionID\" ASC", array(null)); }
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0; 
-//$nextperid = sql_get_next_id($Settings['sqltable'],"catpermissions",$SQLStat);
-$nextperid = null;
-while ($getperidi < $getperidnum) {
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$getperidID=sql_result($getperidr,$getperidi,"PermissionID"); }
-if($Settings['sqltype']=="sqlite") {
-$getperidID=sql_result($getperidr,$getperidi,"\"PermissionID\""); }
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"PermissionID\"=%i", array($getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$getperidName=sql_result($getperidr2,0,"Name");
-sql_free_result($getperidr2);
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES (%i, '%s', %i, 'yes')", array($getperidID,$getperidName,$_POST['CategoryID'])); 
-sql_query($query,$SQLStat);
-++$getperidi; /*++$nextperid;*/ }
-sql_free_result($getperidr); } } 
-if($_GET['act']=="deletecategory"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Deleting a Category";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Deleting a Category: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletecategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelCategories">Delete all categories in subcategory:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelCategories" id="DelCategories">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelForums">Delete all forums in (sub)category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelForums" id="DelForums">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelTopics">Delete all topics in (sub)category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelTopics" id="DelTopics">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelPermission">Delete all permission sets in (sub)category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelPermission" id="DelPermission">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelID">Delete Category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelID" id="DelID">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InCategoryID=sql_result($fr,$fi,"id");
-$InCategoryName=sql_result($fr,$fi,"Name");
-$InCategoryType=sql_result($fr,$fi,"CategoryType");
-$AiFiInSubCategory=sql_result($fr,$fi,"InSubCategory");
-?>
-       <option value="<?php echo $InCategoryID; ?>"><?php echo $InCategoryName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="deletecategory" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Delete Category" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="deletecategory"&&$_POST['update']=="now"&&$_GET['act']=="deletecategory") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i LIMIT 1", array($_POST['DelID']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$errorstr = ""; $Error = null;
-if (!is_numeric($_POST['DelID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum ID.<br />\n"; } 
-if($prenum>0&&$Error!="Yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i", array($_POST['DelID']));
-sql_query($dtquery,$SQLStat);
-if($_POST['DelCategories']=="yes") {
-$dscquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."categories\" WHERE \"InSubCategory\"=%i", array($_POST['DelID']));
-sql_query($dscquery,$SQLStat); }
-if($_POST['DelForums']=="yes") {
-$dsfquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."forums\" WHERE \"CategoryID\"=%i", array($_POST['DelID']));
-sql_query($dsfquery,$SQLStat); }
-if($_POST['DelForums']=="yes") {
-$dstquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."topics\" WHERE \"CategoryID\"=%i", array($_POST['DelID']));
-sql_query($dstquery,$SQLStat); }
-if($_POST['DelForums']=="yes") {
-$dstquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."topics\" WHERE \"CategoryID\"=%i", array($_POST['DelID']));
-sql_query($dstquery,$SQLStat);
-$dstquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"CategoryID\"=%i", array($_POST['DelID']));
-sql_query($dstquery,$SQLStat); }
-if($_POST['DelPermission']=="yes") {
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"CategoryID\"=%i ORDER BY \"OrderID\" ASC, \"id\" ASC", array($_POST['DelID']));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$DelForumID=sql_result($apcresult,$apci,"id");
-if($_POST['DelPermission']=="yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."permissions\" WHERE \"ForumID\"=%i", array($DelForumID));
-sql_query($dtquery,$SQLStat); }
-++$apci; }
-sql_free_result($apcresult); } }
-if($_POST['DelPermission']=="yes") {
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"InSubCategory\"=%i ORDER BY \"OrderID\" ASC, \"id\" ASC", array($_POST['DelID']));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$DelSubsCategoryID=sql_result($apcresult,$apci,"id");
-if($_POST['DelPermission']=="yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"CategoryID\"=%i", array($DelSubsCategoryID));
-sql_query($dtquery,$SQLStat); }
-++$apci; }
-sql_free_result($apcresult); } }
-?>
-<?php } } if($_GET['act']=="editcategory"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Editing a Category";
-if(!isset($_POST['id'])) {
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing a Category: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Category to Edit:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InCategoryID=sql_result($fr,$fi,"id");
-$InCategoryName=sql_result($fr,$fi,"Name");
-$InCategoryType=sql_result($fr,$fi,"CategoryType");
-$AiFiInSubCategory=sql_result($fr,$fi,"InSubCategory");
-?>
-       <option value="<?php echo $InCategoryID; ?>"><?php echo $InCategoryName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editcategory" style="display: none;" />
-<input type="submit" class="Button" value="Edit Category" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])) { 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$CategoryID=sql_result($preresult,0,"id");
-$CategoryOrder=sql_result($preresult,0,"OrderID");
-$CategoryName=sql_result($preresult,0,"Name");
-$ShowCategory=sql_result($preresult,0,"ShowCategory");
-$CategoryType=sql_result($preresult,0,"CategoryType");
-$SubShowForums=sql_result($preresult,0,"SubShowForums");
-$InSubCategory=sql_result($preresult,0,"InSubCategory");
-$CategoryDescription=sql_result($preresult,0,"Description");
-$KarmaCountView=sql_result($preresult,0,"KarmaCountView");
-$PostCountView=sql_result($preresult,0,"PostCountView");
-sql_free_result($preresult);
-$CategoryType = strtolower($CategoryType);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Category Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing a Category: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryID">Insert id for category:</label></td>
-       <td style="width: 50%;"><input type="text" name="CategoryID" class="TextBox" id="CategoryID" size="20" value="<?php echo $CategoryID; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="OrderID">Insert order id category:</label></td>
-       <td style="width: 50%;"><input type="text" name="OrderID" class="TextBox" id="OrderID" size="20" value="<?php echo $CategoryOrder; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryName">Insert name for category:</label></td>
-       <td style="width: 50%;"><input type="text" name="CategoryName" class="TextBox" id="CategoryName" size="20" value="<?php echo $CategoryName; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryDesc">Insert description for category:</label></td>
-       <td style="width: 50%;"><input type="text" name="CategoryDesc" class="TextBox" id="CategoryDesc" size="20" value="<?php echo $CategoryDescription; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ShowCategory">Show category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ShowCategory" id="ShowCategory">
-       <option <?php if($ShowCategory=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($ShowCategory=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CategoryType">Insert category type:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CategoryType" id="CategoryType">
-       <option <?php if($CategoryType=="category") { echo "selected=\"selected\" "; } ?>value="category">Category</option>
-       <option <?php if($CategoryType=="subcategory") { echo "selected=\"selected\" "; } ?>value="subcategory">SubCategory</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="InSubCategory">In SubCategory:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="InSubCategory" id="InSubCategory">
-       <option selected="selected" value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"InSubCategory\"=0 AND \"id\"<>%i AND \"CategoryType\"='subcategory' ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InCategoryID=sql_result($fr,$fi,"id");
-$InCategoryName=sql_result($fr,$fi,"Name");
-$InCategoryType=sql_result($fr,$fi,"CategoryType");
-$AiFiInSubCategory=sql_result($fr,$fi,"InSubCategory");
-if ($AiFiInSubCategory=="0") {
-if($InSubCategory==$InCategoryID) {
-?>
-       <option value="<?php echo $InCategoryID; ?>" selected="selected"><?php echo $InCategoryName; ?></option>
-<?php } if($InSubCategory!=$InCategoryID) { ?>
-       <option value="<?php echo $InCategoryID; ?>"><?php echo $InCategoryName; ?></option>
-<?php } } ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumPostView">Number of posts to view categories:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumPostView" id="NumPostView" value="<?php echo $PostCountView; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumKarmaView">Amount of karma to view categories:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumKarmaView" id="NumKarmaView" value="<?php echo $KarmaCountView; ?>" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editcategory" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $CategoryID; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Category" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } } } if($_POST['act']=="editcategory"&&$_POST['update']=="now"&&$_GET['act']=="editcategory"&&
-       isset($_POST['id'])) {
-$_POST['CategoryName'] = stripcslashes(htmlspecialchars($_POST['CategoryName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['CategoryName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryName']);
-$_POST['CategoryName'] = remove_spaces($_POST['CategoryName']);
-$_POST['CategoryDesc'] = stripcslashes(htmlspecialchars($_POST['CategoryDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['CategoryDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryDesc']);
-$_POST['CategoryDesc'] = remove_spaces($_POST['CategoryDesc']);
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$OldID=sql_result($preresult,0,"id");
-$OldOrder=sql_result($preresult,0,"OrderID");
-sql_free_result($preresult);
-$sql_id_check = sql_query(sql_pre_query("SELECT \"id\" FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i LIMIT 1", array($_POST['ForumID'])),$SQLStat);
-$sql_order_check = sql_query(sql_pre_query("SELECT \"OrderID\" FROM \"".$Settings['sqltable']."categories\" WHERE \"OrderID\"=%i LIMIT 1", array($_POST['OrderID'])),$SQLStat);
-$id_check = sql_num_rows($sql_id_check); $order_check = sql_num_rows($sql_order_check);
-sql_free_result($sql_id_check); sql_free_result($sql_order_check);
-if ($_POST['NumPostView']==null||
-       !is_numeric($_POST['NumPostView'])) {
-       $_POST['NumPostView'] = 0; }
-if ($_POST['NumKarmaView']==null||
-       !is_numeric($_POST['NumKarmaView'])) {
-       $_POST['NumKarmaView'] = 0; }
-if ($_POST['CategoryName']==null||
-       $_POST['CategoryName']=="ShowMe") { $Error="Yes";
-$errorstr = $errorstr."You need to enter a category name.<br />\n"; } 
-if ($_POST['CategoryDesc']==null) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a description.<br />\n"; } 
-if ($_POST['CategoryID']==null||
-       !is_numeric($_POST['CategoryID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a category ID.<br />\n"; } 
-if($id_check > 0&&$_POST['CategoryID']!=$OldID) { $Error="Yes";
-$errorstr = $errorstr."This ID number is already used.<br />\n"; } 
-if($order_check > 0&&$_POST['OrderID']!=$OldOrder) { $Error="Yes"; 
-$errorstr = $errorstr."This order number is already used.<br />\n"; } 
-if (pre_strlen($_POST['CategoryName'])>"150") { $Error="Yes";
-$errorstr = $errorstr."Your category name is too big.<br />\n"; } 
-if (pre_strlen($_POST['CategoryDesc'])>"300") { $Error="Yes";
-$errorstr = $errorstr."Your category description is too big.<br />\n"; } 
-if ($Error!="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."categories\" SET \"id\"=%i,\"OrderID\"=%i,\"Name\"='%s',\"ShowCategory\"='%s',\"CategoryType\"='%s',\"InSubCategory\"=%i,\"Description\"='%s',\"PostCountView\"=%i,\"KarmaCountView\"=%i WHERE \"id\"=%i", array($_POST['CategoryID'],$_POST['OrderID'],$_POST['CategoryName'],$_POST['ShowCategory'],$_POST['CategoryType'],$_POST['InSubCategory'],$_POST['CategoryDesc'],$_POST['NumPostView'],$_POST['NumKarmaView'],$_POST['id']));
-sql_query($query,$SQLStat); 
-$queryz = sql_pre_query("UPDATE \"".$Settings['sqltable']."catpermissions\" SET \"CategoryID\"=%i WHERE \"CategoryID\"=%i", array($_POST['CategoryID'],$_POST['id']));
-sql_query($queryz,$SQLStat); 
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"CategoryID\"=%i WHERE \"CategoryID\"=%i", array($_POST['CategoryID'],$_POST['id']));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"CategoryID\"=%i,\"OldCategoryID\"=%i WHERE \"CategoryID\"=%i", array($_POST['CategoryID'],$_POST['CategoryID'],$_POST['id']));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"CategoryID\"=%i WHERE \"CategoryID\"=%i", array($_POST['CategoryID'],$_POST['id']));
-sql_query($query,$SQLStat); } } } 
-if($_GET['act']=="cpermissions"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Category Permissions Manager";
-if(!isset($_POST['id'])) {
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Category Permissions Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Permission to view:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="sqlite") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"PermissionID\" FROM \"".$Settings['sqltable']."catpermissions\"", array(null)); }
-if($Settings['sqltype']=="cubrid") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"permissionid\" FROM \"".$Settings['sqltable']."catpermissions\"", array(null)); }
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0;
-while ($getperidi < $getperidnum) {
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$getperidID=sql_result($getperidr,$getperidi,"PermissionID"); }
-if($Settings['sqltype']=="sqlite") {
-$getperidID=sql_result($getperidr,$getperidi,"\"PermissionID\""); }
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"PermissionID\"=%i ORDER BY \"CategoryID\" ASC", array($getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$getperidName=sql_result($getperidr2,0,"Name");
-sql_free_result($getperidr2);
-?>
-       <option value="<?php echo $getperidID; ?>"><?php echo $getperidName; ?></option>
-<?php ++$getperidi; }
-sql_free_result($getperidr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="cpermissions" style="display: none;" />
-<input type="submit" class="Button" value="View Permission" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&$_POST['subact']==null) { ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Category Permissions Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InCategoryID=sql_result($fr,$fi,"id");
-$InCategoryName=sql_result($fr,$fi,"Name");
-$getperidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"PermissionID\"=%i AND \"CategoryID\"=%i LIMIT 1", array($_POST['id'],$InCategoryID));
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidNumz = null;
-$getperidID = null;
-if($getperidnum>0) {
-$getperidNumz=sql_result($getperidr,0,"id");
-$getperidID=sql_result($getperidr,0,"PermissionID"); }
-?>
-<form style="display: inline;" method="post" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<?php if($getperidnum>0) { ?>
-Permissions for <?php echo $InCategoryName; ?> are set: <br />
-<input type="hidden" name="act" value="cpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="edit" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $getperidNumz; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Permissions" name="Apply_Changes" />
-<?php } if($getperidnum<=0) { ?>
-Permissions for <?php echo $InCategoryName; ?> are not set: <br />
-<input type="hidden" name="act" value="cpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="create" style="display: none;" />
-<input type="hidden" name="permid" value="<?php echo $_POST['id']; ?>" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $InCategoryID; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Create Permissions" name="Apply_Changes" />
-<?php } ?>
-</td></tr></table>
-</form>
-<?php 
-sql_free_result($getperidr);
-++$fi; }
-sql_free_result($fr); ?>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&$_POST['subact']=="edit") {
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$PermissionNum=sql_result($preresult,0,"id"); 
-$PermissionID=sql_result($preresult,0,"PermissionID"); 
-$PermissionName=sql_result($preresult,0,"Name"); 
-$PermissionCategoryID=sql_result($preresult,0,"CategoryID"); 
-$CanViewCategory=sql_result($preresult,0,"CanViewCategory");
-sql_free_result($preresult); }
-$PermissionName = stripcslashes(htmlspecialchars($PermissionName, ENT_QUOTES, $Settings['charset']));
-//$_POST['CategoryName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryName']);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Category Permissions: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewCategory">Can view Category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewCategory" id="CanViewCategory">
-       <option <?php if($CanViewCategory=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanViewCategory=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="cpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="editnow" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $PermissionNum; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Permissions" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&$_POST['subact']=="editnow") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."catpermissions\" SET \"CanViewCategory\"='%s' WHERE \"id\"=%i", array($_POST['CanViewCategory'], $_POST['id']));
-sql_query($query,$SQLStat); } if(isset($_POST['id'])&&$_POST['subact']=="create") { 
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Category Permissions: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewCategory">Can view category:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewCategory" id="CanViewCategory">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="cpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="makenow" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $_POST['id']; ?>" style="display: none;" />
-<input type="hidden" name="permid" value="<?php echo $_POST['permid']; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Create Permissions" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"id\"=%i LIMIT 1", array($_POST['permid']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$PermissionName=sql_result($preresult,0,"Name"); 
-sql_free_result($preresult); }
-//$nextidnum = sql_get_next_id($Settings['sqltable'],"catpermissions",$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(%i, '%s', %i, '%s')", array($_POST['permid'], $PermissionName, $_POST['id'], $_POST['CanViewCategory'])); 
-sql_query($query,$SQLStat); } } $doupdate = false;
-if(isset($_POST['id'])&&$_POST['subact']=="editnow") { 
-       $doupdate = true; }
-if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") { 
-       $doupdate = true; }
-if($_POST['act']=="addcategory"&&$_POST['update']=="now"&&$_GET['act']=="addcategory") { 
-       $doupdate = true; }
-if($_GET['act']=="deletecategory"&&$_POST['update']=="now"&&$_GET['act']=="deletecategory") { 
-       $doupdate = true; }
-if($_POST['act']=="editcategory"&&$_POST['update']=="now"&&$_GET['act']=="editcategory"&&
-       isset($_POST['id'])) { 
-       $doupdate = true; }
-if($doupdate===true&&$Error!="Yes") { ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<?php if(isset($_POST['id'])&&$_POST['subact']=="editnow") { ?>
-<div style="text-align: center;">
-       <br />The permission was edited successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") { ?>
-<div style="text-align: center;">
-       <br />The permission was created successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_POST['act']=="addcategory"&&$_POST['update']=="now"&&$_GET['act']=="addcategory") { ?>
-<div style="text-align: center;">
-       <br />The category was created successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_GET['act']=="deletecategory"&&$_POST['update']=="now"&&$_GET['act']=="deletecategory") { ?>
-<div style="text-align: center;">
-       <br />The category was deleted successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_POST['act']=="editcategory"&&$_POST['update']=="now"&&$_GET['act']=="editcategory"&&
-       isset($_POST['id'])) { ?>
-<div style="text-align: center;">
-       <br />The category was edited successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } ?>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } if ($_GET['act']!=null&&$Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br /><?php echo $errorstr; ?>
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-       </div>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } ?>
-</td></tr>
-</table>
-<div>&nbsp;</div>
diff --git a/inc/admin/forums.php.bak b/inc/admin/forums.php.bak
deleted file mode 100644 (file)
index 10ea3f4..0000000
+++ /dev/null
@@ -1,1551 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: forums.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="forums.php"||$File3Name=="/forums.php") {
-       require('index.php');
-       exit(); }
-
-// Check if we can goto admin cp
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-$Error = null; $errorstr = null;
-?>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-<?php 
-require($SettDir['admin'].'table.php'); 
-?>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php if($_GET['act']=="retopics") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Recounting Topics";
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$tquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i ORDER BY \"Pinned\" DESC, \"LastUpdate\" DESC", array($ForumID));
-$tresult=sql_query($tquery,$SQLStat);
-$tnum=sql_num_rows($tresult);
-$rquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"ForumID\"=%i ORDER BY \"TimeStamp\" ASC", array($ForumID));
-$rresult=sql_query($rquery,$SQLStat);
-$rnum=sql_num_rows($rresult);
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($rnum,$tnum,$ForumID));
-sql_query($query,$SQLStat);
-sql_free_result($tresult);
-sql_free_result($rresult);
-++$i; }
-sql_free_result($result);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Recounting Topics</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Recounting Topics</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Recounting Topics: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br />Forums Topics &amp; Posts stats recounted.<br />
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-</div>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="rereplies") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Recounting Replies";
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" ORDER BY \"Pinned\" DESC, \"LastUpdate\" DESC", array(null));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-while ($i < $num) {
-$TopicID=sql_result($result,$i,"id");
-$rquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($TopicID));
-$rresult=sql_query($rquery,$SQLStat);
-$rnum=sql_num_rows($rresult);
-$Nrnum = $rnum - 1;
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumReply\"=%i WHERE \"id\"=%i", array($Nrnum,$TopicID));
-sql_query($query,$SQLStat);
-sql_free_result($rresult);
-++$i; }
-sql_free_result($result);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Recounting Replies</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Recounting Replies</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Recounting Replies: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br />Topics Replys stats recounted.<br />
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-</div>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="fixtnames") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Fixing Topic User Names";
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" ORDER BY \"TimeStamp\" ASC", array(null));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-while ($i < $num) {
-$TopicID=sql_result($result,$i,"id");
-$UsersID=sql_result($result,$i,"UserID");
-$GuestsName=sql_result($result,$i,"GuestName");
-$NewUserID = $UsersID;
-$NewGuestsName = $GuestsName;
-$NewGuestsName = GetUserName($NewUserID,$Settings['sqltable']);
-$NewGuestsName = $NewGuestsName['Name'];
-if($UsersID==-1&&$GuestsName!=null) { $NewGuestsName = $GuestsName; }
-if($NewGuestsName==null&&$GuestsName!=null&&$UsersID!==0) {
-$NewUserID = -1; $NewGuestsName = $GuestsName; }
-if($UsersID==-1&&$GuestsName==null) {
-$NewUserID = -1; $NewGuestsName = "Guest"; }
-if($UsersID===0&&$GuestsName!=null) {
-$NewUserID = -1; $NewGuestsName = "Guest"; }
-if($UsersID===0&&$GuestsName==null) {
-$NewUserID = -1; $NewGuestsName = "Guest"; }
-if($UsersID==$NewUserID&&$GuestsName==$NewGuestsName) {
-$NewUserID = $UsersID; $NewGuestsName = $GuestsName; }
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"UserID\"=%i,\"GuestName\"='%s' WHERE \"id\"=%i", array($NewUserID,$NewGuestsName,$TopicID));
-sql_query($query,$SQLStat);
-++$i; }
-sql_free_result($result);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Fixing Topic User Names</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Fixing Topic User Names</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Fixing Topic User Names: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br />Topic User Names fixed.<br />
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-</div>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="fixrnames") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Fixing Reply User Names";
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" ORDER BY \"TimeStamp\" ASC", array(null));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-while ($i < $num) {
-$PostID=sql_result($result,$i,"id");
-$UsersID=sql_result($result,$i,"UserID");
-$GuestsName=sql_result($result,$i,"GuestName");
-$NewUserID = $UsersID;
-$NewGuestsName = $GuestsName;
-$NewGuestsName = GetUserName($NewUserID,$Settings['sqltable']);
-$NewGuestsName = $NewGuestsName['Name'];
-if($UsersID==-1&&$GuestsName!=null) { $NewGuestsName = $GuestsName; }
-if($NewGuestsName==null&&$GuestsName!=null&&$UsersID!==0) {
-$NewUserID = -1; $NewGuestsName = $GuestsName; }
-if($UsersID==-1&&$GuestsName==null) {
-$NewUserID = -1; $NewGuestsName = "Guest"; }
-if($UsersID===0&&$GuestsName!=null) {
-$NewUserID = -1; $NewGuestsName = "Guest"; }
-if($UsersID===0&&$GuestsName==null) {
-$NewUserID = -1; $NewGuestsName = "Guest"; }
-if($UsersID==$NewUserID&&$GuestsName==$NewGuestsName) {
-$NewUserID = $UsersID; $NewGuestsName = $GuestsName; }
-$EditUserID=sql_result($result,$i,"EditUser");
-$EditUserName=sql_result($result,$i,"EditUserName");
-$NewEditUserID = $EditUserID;
-$NewEditUserName = $EditUserName;
-$NewEditUserName = GetUserName($NewEditUserID,$Settings['sqltable']);
-$NewEditUserName = $NewEditUserName['Name'];
-if($EditUserID==-1&&$EditUserName!=null) { $NewEditUserName = $EditUserName; }
-if($NewEditUserName==null&&$EditUserName!=null&&$EditUserID!==0) {
-$NewEditUserID = -1; $NewEditUserName = $EditUserName; }
-if($EditUserID==-1&&$EditUserName==null) {
-$NewEditUserID = -1; $NewEditUserName = "Guest"; }
-if($EditUserID===0&&$EditUserName!=null) {
-$NewEditUserID = "0"; $NewEditUserName = null; }
-if($EditUserID===0&&$EditUserName==null) {
-$NewEditUserID = "0"; $NewEditUserName = null; }
-if($EditUserID==$NewEditUserID&&$EditUserName==$NewEditUserName) {
-$NewEditUserID = $EditUserID; $NewEditUserName = $EditUserName; }
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"UserID\"=%i,\"GuestName\"='%s',\"EditUser\"=%i,\"EditUserName\"='%s' WHERE \"id\"=%i", array($NewUserID,$NewGuestsName,$NewEditUserID,$NewEditUserName,$PostID));
-sql_query($query,$SQLStat);
-++$i; }
-sql_free_result($result);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Fixing Reply User Names</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Fixing Reply User Names</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Fixing Reply User Names: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br />Reply User Names fixed.<br />
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-</div>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="addforum"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Adding new Forum";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Adding new Forum: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumID">Insert ID for forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="ForumID" class="TextBox" id="ForumID" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="OrderID">Insert order id forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="OrderID" class="TextBox" id="OrderID" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumCatID">Select category for forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ForumCatID" id="ForumCatID">
-<?php 
-$cq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$cr=sql_query($cq,$SQLStat);
-$eu=sql_num_rows($cr);
-$nu=0;
-while ($nu < $eu) {
-$InCatID=sql_result($cr,$nu,"id");
-$InCatName=sql_result($cr,$nu,"Name");
-$EuNuMai = "Eu nu mai vreau";
-?>
-       <option value="<?php echo $InCatID; ?>"><?php echo $InCatName; ?></option>
-<?php ++$nu; }
-sql_free_result($cr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumName">Insert name for forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="ForumName" class="TextBox" id="ForumName" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumDesc">Insert description for forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="ForumDesc" class="TextBox" id="ForumDesc" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ShowForum">Show forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ShowForum" id="ShowForum">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumType">Insert forum type:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ForumType" id="ForumType">
-       <option selected="selected" value="forum">Forum</option>
-       <option value="subforum">SubForum</option>
-       <option value="redirect">Redirect</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="RedirectURL">Insert Redirect URL for redirect forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="RedirectURL" class="TextBox" id="RedirectURL" size="20" value="http://" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="InSubForum">In SubForum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="InSubForum" id="InSubForum">
-       <option selected="selected" value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"InSubForum\"=0 AND \"ForumType\"='subforum' ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InForumID=sql_result($fr,$fi,"id");
-$InForumName=sql_result($fr,$fi,"Name");
-$InForumType=sql_result($fr,$fi,"ForumType");
-$AiFiInSubForum=sql_result($fr,$fi,"InSubForum");
-if ($InForumType!="redirect"&&$AiFiInSubForum=="0") {
-?>
-       <option value="<?php echo $InForumID; ?>"><?php echo $InForumName; ?></option>
-<?php } ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PostCountAdd">Add to post count:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="PostCountAdd" id="PostCountAdd">
-       <option selected="selected" value="on">yes</option>
-       <option value="off">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumPostView">Number of posts to view forum:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumPostView" id="NumPostView" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumKarmaView">Amount of karma to view forum:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumKarmaView" id="NumKarmaView" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanHaveTopics">Allow topics in forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanHaveTopics" id="CanHaveTopics">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumPostHotTopic">Number of posts for hot topic:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumPostHotTopic" id="NumPostHotTopic" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CPermissions">Copy permissions from:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CPermissions" id="CPermissions">
-       <option selected="selected" value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InForumID=sql_result($fr,$fi,"id");
-$InForumName=sql_result($fr,$fi,"Name");
-$InForumType=sql_result($fr,$fi,"ForumType");
-$AiFiInSubForum=sql_result($fr,$fi,"InSubForum");
-?>
-       <option value="<?php echo $InForumID; ?>"><?php echo $InForumName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="addforum" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Add Forum" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="addforum"&&$_POST['update']=="now"&&$_GET['act']=="addforum") {
-$_POST['ForumName'] = stripcslashes(htmlspecialchars($_POST['ForumName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ForumName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumName']);
-$_POST['ForumName'] = remove_spaces($_POST['ForumName']);
-$_POST['ForumDesc'] = stripcslashes(htmlspecialchars($_POST['ForumDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ForumDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumDesc']);
-$_POST['ForumDesc'] = remove_spaces($_POST['ForumDesc']);
-$sql_id_check = sql_query(sql_pre_query("SELECT \"id\" FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($_POST['ForumID'])),$SQLStat);
-$sql_order_check = sql_query(sql_pre_query("SELECT \"OrderID\" FROM \"".$Settings['sqltable']."forums\" WHERE \"OrderID\"=%i AND \"CategoryID\"=%i AND \"InSubForum\"=%i LIMIT 1", array($_POST['OrderID'],$_POST['ForumCatID'],$_POST['InSubForum'])),$SQLStat);
-$id_check = sql_num_rows($sql_id_check); $order_check = sql_num_rows($sql_order_check);
-sql_free_result($sql_id_check); sql_free_result($sql_order_check);
-$errorstr = "";
-if ($_POST['NumPostView']==null||
-       !is_numeric($_POST['NumPostView'])) {
-       $_POST['NumPostView'] = 0; }
-if ($_POST['NumKarmaView']==null||
-       !is_numeric($_POST['NumKarmaView'])) {
-       $_POST['NumKarmaView'] = 0; }
-if ($Settings['hot_topic_num']==null||
-       !is_numeric($Settings['hot_topic_num'])) {
-       $Settings['hot_topic_num'] = 10; }
-if ($_POST['NumPostHotTopic']==null||
-       !is_numeric($_POST['NumPostHotTopic'])) {
-       $_POST['NumPostHotTopic'] = $Settings['hot_topic_num']; }
-if ($_POST['ForumName']==null||
-       $_POST['ForumName']=="ShowMe") { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum name.<br />\n"; } 
-if ($_POST['ForumDesc']==null) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a description.<br />\n"; } 
-if ($_POST['ForumID']==null||
-       !is_numeric($_POST['ForumID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum ID.<br />\n"; } 
-if($id_check > 0) { $Error="Yes";
-$errorstr = $errorstr."This ID number is already used.<br />\n"; } 
-if($order_check > 0) { $Error="Yes"; 
-$errorstr = $errorstr."This order number is already used.<br />\n"; } 
-if (pre_strlen($_POST['ForumName'])>"150") { $Error="Yes";
-$errorstr = $errorstr."Your Forum Name is too big.<br />\n"; } 
-if (pre_strlen($_POST['ForumDesc'])>"300") { $Error="Yes";
-$errorstr = $errorstr."Your Forum Description is too big.<br />\n"; } 
-if ($Error!="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."forums\" (\"id\", \"CategoryID\", \"OrderID\", \"Name\", \"ShowForum\", \"ForumType\", \"InSubForum\", \"RedirectURL\", \"Redirects\", \"NumViews\", \"Description\", \"PostCountAdd\", \"PostCountView\", \"KarmaCountView\", \"CanHaveTopics\", \"HotTopicPosts\", \"NumPosts\", \"NumTopics\") VALUES\n".
-"(%i, %i, %i, '%s', '%s', '%s', %i, '%s', 0, 0, '%s', '%s', %i, %i, '%s', %i, 0, 0)", array($_POST['ForumID'],$_POST['ForumCatID'],$_POST['OrderID'],$_POST['ForumName'],$_POST['ShowForum'],$_POST['ForumType'],$_POST['InSubForum'],$_POST['RedirectURL'],$_POST['ForumDesc'],$_POST['PostCountAdd'],$_POST['NumPostView'],$_POST['NumKarmaView'],$_POST['CanHaveTopics'],$_POST['NumPostHotTopic']));
-sql_query($query,$SQLStat);
-if(!is_numeric($_POST['CPermissions'])) { $_POST['CPermissions'] = "0"; }
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="sqlite") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"PermissionID\" FROM \"".$Settings['sqltable']."permissions\" ORDER BY \"PermissionID\" ASC", array(null)); }
-if($Settings['sqltype']=="cubrid") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"permissionid\" FROM \"".$Settings['sqltable']."permissions\" ORDER BY \"PermissionID\" ASC", array(null)); }
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0; 
-$nextperid = null;
-/*
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$nextperid = sql_get_next_id($Settings['sqltable'],"permissions",$SQLStat); }
-if($Settings['sqltype']=="sqlite") {
-$nextperid = sql_get_next_id($Settings['sqltable'],"\"permissions\"",$SQLStat); }
-*/
-while ($getperidi < $getperidnum) {
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$getperidID=sql_result($getperidr,$getperidi,"PermissionID"); }
-if($Settings['sqltype']=="sqlite") {
-$getperidID=sql_result($getperidr,$getperidi,"\"PermissionID\""); }
-if($_POST['CPermissions']=="0") {
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i", array($getperidID)); }
-if($_POST['CPermissions']!="0") {
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i AND \"ForumID\"=%i", array($getperidID,$_POST['CPermissions'])); }
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$PermissionNum=sql_result($getperidr2,0,"id"); 
-$PermissionID=sql_result($getperidr2,0,"PermissionID"); 
-$PermissionName=sql_result($getperidr2,0,"Name"); 
-$PermissionForumID=sql_result($getperidr2,0,"ForumID"); 
-$CanViewForum=sql_result($getperidr2,0,"CanViewForum"); 
-$CanMakePolls=sql_result($getperidr2,0,"CanMakePolls");
-$CanMakeTopics=sql_result($getperidr2,0,"CanMakeTopics"); 
-$CanMakeReplys=sql_result($getperidr2,0,"CanMakeReplys"); 
-$CanMakeReplysCT=sql_result($getperidr2,0,"CanMakeReplysCT"); 
-$CanEditTopics=sql_result($getperidr2,0,"CanEditTopics"); 
-$CanEditTopicsCT=sql_result($getperidr2,0,"CanEditTopicsCT"); 
-$CanEditReplys=sql_result($getperidr2,0,"CanEditReplys"); 
-$CanEditReplysCT=sql_result($getperidr2,0,"CanEditReplysCT"); 
-$CanDeleteTopics=sql_result($getperidr2,0,"CanDeleteTopics"); 
-$CanDeleteTopicsCT=sql_result($getperidr2,0,"CanDeleteTopicsCT"); 
-$CanDeleteReplys=sql_result($getperidr2,0,"CanDeleteReplys"); 
-$CanDeleteReplysCT=sql_result($getperidr2,0,"CanDeleteReplysCT"); 
-$CanCloseTopics=sql_result($getperidr2,0,"CanCloseTopics"); 
-$CanPinTopics=sql_result($getperidr2,0,"CanPinTopics"); 
-$CanExecPHP=sql_result($getperidr2,0,"CanExecPHP"); 
-$CanDoHTML=sql_result($getperidr2,0,"CanDoHTML"); 
-$CanUseBBTags=sql_result($getperidr2,0,"CanUseBBTags"); 
-$CanModForum=sql_result($getperidr2,0,"CanModForum"); 
-sql_free_result($getperidr2);
-if($_POST['CPermissions']=="0") {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES (%i, '%s', %i, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no')", array($PermissionID,$PermissionName,$_POST['ForumID'])); }
-if($_POST['CPermissions']!="0") {
-if($getperidnum2>0) {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES (%i, '%s', %i, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", array($PermissionID,$PermissionName,$_POST['ForumID'],$CanViewForum,$CanMakePolls,$CanMakeTopics,$CanMakeReplys,$CanMakeReplysCT,$CanEditTopics,$CanEditTopicsCT,$CanEditReplys,$CanEditReplysCT,$CanDeleteTopics,$CanDeleteTopicsCT,$CanDeleteReplys,$CanDeleteReplysCT,$CanCloseTopics,$CanPinTopics,$CanExecPHP,$CanDoHTML,$CanUseBBTags,$CanModForum)); }
-if($getperidnum2<=0) {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES (%i, '%s', %i, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no')", array($PermissionID,$PermissionName,$_POST['ForumID'])); } }
-sql_query($query,$SQLStat);
-++$getperidi; /*++$nextperid;*/ }
-sql_free_result($getperidr); } } 
-if($_GET['act']=="deleteforum"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Deleting a Forum";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Deleting a Forum: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deleteforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelForums">Delete all forums in subforum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelForums" id="DelForums">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelTopics">Delete all topics in (sub)forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelTopics" id="DelTopics">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelPermission">Delete all permission sets in (sub)forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelPermission" id="DelPermission">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelID">Delete Forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelID" id="DelID">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InForumID=sql_result($fr,$fi,"id");
-$InForumName=sql_result($fr,$fi,"Name");
-$InForumType=sql_result($fr,$fi,"ForumType");
-$AiFiInSubForum=sql_result($fr,$fi,"InSubForum");
-?>
-       <option value="<?php echo $InForumID; ?>"><?php echo $InForumName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="deleteforum" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Delete Forum" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="deleteforum"&&$_POST['update']=="now"&&$_GET['act']=="deleteforum") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($_POST['DelID']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$errorstr = ""; $Error = null;
-if (!is_numeric($_POST['DelID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum ID.<br />\n"; } 
-if($prenum>0&&$Error!="Yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i", array($_POST['DelID']));
-sql_query($dtquery,$SQLStat);
-if($_POST['DelForums']=="yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i", array($_POST['DelID']));
-sql_query($dtquery,$SQLStat);
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"ForumID\"=%i", array($_POST['DelID']));
-sql_query($dtquery,$SQLStat); }
-if($_POST['DelPermission']=="yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."permissions\" WHERE \"ForumID\"=%i", array($_POST['DelID']));
-sql_query($dtquery,$SQLStat); }
-if($_POST['DelForums']=="yes") {
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"InSubForum\"=%i ORDER BY \"OrderID\" ASC, \"id\" ASC", array($_POST['DelID']));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$DelSubsForumID=sql_result($apcresult,$apci,"id");
-if($_POST['DelForums']=="yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i", array($DelSubsForumID));
-sql_query($dtquery,$SQLStat);
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"ForumID\"=%i", array($DelSubsForumID));
-sql_query($dtquery,$SQLStat); }
-if($_POST['DelPermission']=="yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."permissions\" WHERE \"ForumID\"=%i", array($DelSubsForumID));
-sql_query($dtquery,$SQLStat); }
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i", array($DelSubsForumID));
-sql_query($dtquery,$SQLStat);
-++$apci; }
-sql_free_result($apcresult); } }
-?>
-<?php } } if($_GET['act']=="editforum"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Editing a Forum";
-if(!isset($_POST['id'])) {
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing a Forum: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Forum to Edit:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" ORDER BY \"id\" ASC, \"OrderID\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InForumID=sql_result($fr,$fi,"id");
-$InForumName=sql_result($fr,$fi,"Name");
-$InForumType=sql_result($fr,$fi,"ForumType");
-$AiFiInSubForum=sql_result($fr,$fi,"InSubForum");
-?>
-       <option value="<?php echo $InForumID; ?>"><?php echo $InForumName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editforum" style="display: none;" />
-<input type="submit" class="Button" value="Edit Forum" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])) { 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$ForumID=sql_result($preresult,0,"id");
-$ForumCatID=sql_result($preresult,0,"CategoryID");
-$ForumOrder=sql_result($preresult,0,"OrderID");
-$ForumName=sql_result($preresult,0,"Name");
-$ShowForum=sql_result($preresult,0,"ShowForum");
-$ForumType=sql_result($preresult,0,"ForumType");
-$InSubForum=sql_result($preresult,0,"InSubForum");
-$RedirectURL=sql_result($preresult,0,"RedirectURL");
-$RedirectTimes=sql_result($preresult,0,"Redirects");
-$NumberViews=sql_result($preresult,0,"NumViews");
-$ForumDescription=sql_result($preresult,0,"Description");
-$PostCountAdd=sql_result($preresult,0,"PostCountAdd");
-$PostCountView=sql_result($preresult,0,"PostCountView");
-$KarmaCountView=sql_result($preresult,0,"KarmaCountView");
-$CanHaveTopics=sql_result($preresult,0,"CanHaveTopics");
-$HotTopicPosts=sql_result($preresult,0,"HotTopicPosts");
-$NumberPosts=sql_result($preresult,0,"NumPosts");
-$NumberTopics=sql_result($preresult,0,"NumTopics");
-sql_free_result($preresult);
-$ForumType = strtolower($ForumType); $CanHaveTopics = strtolower($CanHaveTopics);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Forum Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing a Forum: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumID">Insert ID for forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="ForumID" class="TextBox" id="ForumID" size="20" value="<?php echo $ForumID; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="OrderID">Insert order id forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="OrderID" class="TextBox" id="OrderID" size="20" value="<?php echo $ForumOrder; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumCatID">Select category for forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ForumCatID" id="ForumCatID">
-<?php 
-$cq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" ORDER BY \"OrderID\" ASC, \"id\" ASC", array(null));
-$cr=sql_query($cq,$SQLStat);
-$eu=sql_num_rows($cr);
-$nu=0;
-while ($nu < $eu) {
-$InCatID=sql_result($cr,$nu,"id");
-$InCatName=sql_result($cr,$nu,"Name");
-$EuNuMai = "Eu nu mai vreau";
-if($ForumCatID==$InCatID) {
-?>
-       <option value="<?php echo $InCatID; ?>" selected="selected"><?php echo $InCatName; ?></option>
-<?php } if($ForumCatID!=$InCatID) { ?>
-       <option value="<?php echo $InCatID; ?>"><?php echo $InCatName; ?></option>
-<?php } ++$nu; }
-sql_free_result($cr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumName">Insert name for forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="ForumName" class="TextBox" id="ForumName" size="20" value="<?php echo $ForumName; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumDesc">Insert description for forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="ForumDesc" class="TextBox" id="ForumDesc" size="20" value="<?php echo $ForumDescription; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ShowForum">Show forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ShowForum" id="ShowForum">
-       <option <?php if($ShowForum=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($ShowForum=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ForumType">Insert forum type:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ForumType" id="ForumType">
-       <option <?php if($ForumType=="forum") { echo "selected=\"selected\" "; } ?>value="forum">Forum</option>
-       <option <?php if($ForumType=="subforum") { echo "selected=\"selected\" "; } ?>value="subforum">SubForum</option>
-       <option <?php if($ForumType=="redirect") { echo "selected=\"selected\" "; } ?>value="redirect">Redirect</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="RedirectURL">Insert Redirect URL for redirect forum:</label></td>
-       <td style="width: 50%;"><input type="text" name="RedirectURL" class="TextBox" id="RedirectURL" size="20" value="<?php echo htmlentities($RedirectURL, ENT_QUOTES, $Settings['charset']); ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="InSubForum">In SubForum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="InSubForum" id="InSubForum">
-       <option selected="selected" value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"InSubForum\"=0 AND \"id\"<>%i AND \"ForumType\"='subforum' ORDER BY \"id\" ASC, \"OrderID\" ASC", array($ForumID));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InForumID=sql_result($fr,$fi,"id");
-$InForumName=sql_result($fr,$fi,"Name");
-$InForumType=sql_result($fr,$fi,"ForumType");
-$AiFiInSubForum=sql_result($fr,$fi,"InSubForum");
-if ($InForumType!="redirect"&&$AiFiInSubForum=="0") {
-if($InSubForum==$InForumID) {
-?>
-       <option value="<?php echo $InForumID; ?>" selected="selected"><?php echo $InForumName; ?></option>
-<?php } if($InSubForum!=$InForumID) { ?>
-       <option value="<?php echo $InForumID; ?>"><?php echo $InForumName; ?></option>
-<?php } } ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PostCountAdd">Add to post count:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="PostCountAdd" id="PostCountAdd">
-       <option <?php if($PostCountAdd=="on") { echo "selected=\"selected\" "; } ?>value="on">yes</option>
-       <option <?php if($PostCountAdd=="off") { echo "selected=\"selected\" "; } ?>value="off">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumPostView">Number of posts to view forum:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumPostView" id="NumPostView" value="<?php echo $PostCountView; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumKarmaView">Amount of karma to view forum:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumKarmaView" id="NumKarmaView" value="<?php echo $KarmaCountView; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanHaveTopics">Allow topics in forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanHaveTopics" id="CanHaveTopics">
-       <option <?php if($CanHaveTopics=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanHaveTopics=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NumPostHotTopic">Number of posts for hot topic:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" size="20" name="NumPostHotTopic" id="NumPostHotTopic" value="<?php echo $HotTopicPosts; ?>" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editforum" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $ForumID; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Forum" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } } } if($_POST['act']=="editforum"&&$_POST['update']=="now"&&$_GET['act']=="editforum"&&
-       isset($_POST['id'])) {
-$_POST['ForumName'] = stripcslashes(htmlspecialchars($_POST['ForumName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ForumName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumName']);
-$_POST['ForumName'] = remove_spaces($_POST['ForumName']);
-$_POST['ForumDesc'] = stripcslashes(htmlspecialchars($_POST['ForumDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ForumDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumDesc']);
-$_POST['ForumDesc'] = remove_spaces($_POST['ForumDesc']);
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$OldID=sql_result($preresult,0,"id");
-$OldOrder=sql_result($preresult,0,"OrderID");
-sql_free_result($preresult);
-$sql_id_check = sql_query(sql_pre_query("SELECT \"id\" FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($_POST['ForumID'])),$SQLStat);
-$sql_order_check = sql_query(sql_pre_query("SELECT \"OrderID\" FROM \"".$Settings['sqltable']."forums\" WHERE \"OrderID\"=%i AND \"CategoryID\"=%i AND \"InSubForum\"=%i LIMIT 1", array($_POST['OrderID'],$_POST['ForumCatID'],$_POST['InSubForum'])),$SQLStat);
-$id_check = sql_num_rows($sql_id_check); $order_check = sql_num_rows($sql_order_check);
-sql_free_result($sql_id_check); sql_free_result($sql_order_check);
-if ($_POST['NumPostView']==null||
-       !is_numeric($_POST['NumPostView'])) {
-       $_POST['NumPostView'] = 0; }
-if ($_POST['NumKarmaView']==null||
-       !is_numeric($_POST['NumKarmaView'])) {
-       $_POST['NumKarmaView'] = 0; }
-if ($Settings['hot_topic_num']==null||
-       !is_numeric($Settings['hot_topic_num'])) {
-       $Settings['hot_topic_num'] = 10; }
-if ($_POST['NumPostHotTopic']==null||
-       !is_numeric($_POST['NumPostHotTopic'])) {
-       $_POST['NumPostHotTopic'] = $Settings['hot_topic_num']; }
-if ($_POST['ForumName']==null||
-       $_POST['ForumName']=="ShowMe") { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum name.<br />\n"; } 
-if ($_POST['ForumDesc']==null) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a description.<br />\n"; } 
-if ($_POST['ForumID']==null||
-       !is_numeric($_POST['ForumID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum ID.<br />\n"; } 
-if($id_check > 0&&$_POST['ForumID']!=$OldID) { $Error="Yes";
-$errorstr = $errorstr."This ID number is already used.<br />\n"; } 
-if($order_check > 0&&$_POST['OrderID']!=$OldOrder) { $Error="Yes"; 
-$errorstr = $errorstr."This order number is already used.<br />\n"; } 
-if (pre_strlen($_POST['ForumName'])>"150") { $Error="Yes";
-$errorstr = $errorstr."Your Forum Name is too big.<br />\n"; } 
-if (pre_strlen($_POST['ForumDesc'])>"300") { $Error="Yes";
-$errorstr = $errorstr."Your Forum Description is too big.<br />\n"; } 
-if ($Error!="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"id\"=%i,\"CategoryID\"=%i,\"OrderID\"=%i,\"Name\"='%s',\"ShowForum\"='%s',\"ForumType\"='%s',\"InSubForum\"=%i,\"RedirectURL\"='%s',\"Description\"='%s',\"PostCountAdd\"='%s',\"PostCountView\"=%i,\"KarmaCountView\"=%i,\"CanHaveTopics\"='%s',\"HotTopicPosts\"=%i WHERE \"id\"=%i", array($_POST['ForumID'],$_POST['ForumCatID'],$_POST['OrderID'],$_POST['ForumName'],$_POST['ShowForum'],$_POST['ForumType'],$_POST['InSubForum'],$_POST['RedirectURL'],$_POST['ForumDesc'],$_POST['PostCountAdd'],$_POST['NumPostView'],$_POST['NumKarmaView'],$_POST['CanHaveTopics'],$_POST['NumPostHotTopic'],$_POST['id']));
-sql_query($query,$SQLStat);
-if($_POST['ForumID']!=$_POST['id']) { 
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"InSubForum\"=%i WHERE \"InSubForum\"=%i", array($_POST['ForumID'],$_POST['id']));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"ForumID\"=%i,\"OldForumID\"=%i WHERE \"ForumID\"=%i", array($_POST['ForumID'],$_POST['ForumID'],$_POST['id']));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"ForumID\"=%i WHERE \"ForumID\"=%i", array($_POST['ForumID'],$_POST['id']));
-sql_query($query,$SQLStat); }
-$queryz = sql_pre_query("UPDATE \"".$Settings['sqltable']."permissions\" SET \"ForumID\"=%i WHERE \"ForumID\"=%i", array($_POST['ForumID'],$_POST['id']));
-sql_query($queryz,$SQLStat); } } } 
-if($_GET['act']=="fpermissions"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Forum Permissions Manager";
-if(!isset($_POST['id'])) {
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Forum Permissions Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Permission to view:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="sqlite") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"PermissionID\" FROM \"".$Settings['sqltable']."permissions\"", array(null)); }
-if($Settings['sqltype']=="cubrid") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"permissionid\" FROM \"".$Settings['sqltable']."permissions\"", array(null)); }
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0;
-while ($getperidi < $getperidnum) {
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$getperidID=sql_result($getperidr,$getperidi,"PermissionID"); }
-if($Settings['sqltype']=="sqlite") {
-$getperidID=sql_result($getperidr,$getperidi,"\"PermissionID\""); }
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i ORDER BY \"ForumID\" ASC", array($getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$getperidName=sql_result($getperidr2,0,"Name");
-sql_free_result($getperidr2);
-?>
-       <option value="<?php echo $getperidID; ?>"><?php echo $getperidName; ?></option>
-<?php ++$getperidi; }
-sql_free_result($getperidr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="fpermissions" style="display: none;" />
-<input type="submit" class="Button" value="View Permission" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&$_POST['subact']==null) { ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Forum Permissions Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" ORDER BY \"id\" ASC, \"OrderID\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$InForumID=sql_result($fr,$fi,"id");
-$InForumName=sql_result($fr,$fi,"Name");
-$getperidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i AND \"ForumID\"=%i LIMIT 1", array($_POST['id'],$InForumID));
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidNumz = null;
-$getperidID = null;
-if($getperidnum>0) {
-$getperidNumz=sql_result($getperidr,0,"id");
-$getperidID=sql_result($getperidr,0,"PermissionID"); }
-?>
-<form style="display: inline;" method="post" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<?php if($getperidnum>0) { ?>
-Permissions for <?php echo $InForumName; ?> are set: <br />
-<input type="hidden" name="act" value="fpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="edit" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $getperidNumz; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Permissions" name="Apply_Changes" />
-<?php } if($getperidnum<=0) { ?>
-Permissions for <?php echo $InForumName; ?> are not set: <br />
-<input type="hidden" name="act" value="fpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="create" style="display: none;" />
-<input type="hidden" name="permid" value="<?php echo $_POST['id']; ?>" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $InForumID; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Create Permissions" name="Apply_Changes" />
-<?php } ?>
-</td></tr></table>
-</form>
-<?php 
-sql_free_result($getperidr);
-++$fi; }
-sql_free_result($fr); ?>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&$_POST['subact']=="edit") {
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$PermissionNum=sql_result($preresult,0,"id"); 
-$PermissionID=sql_result($preresult,0,"PermissionID"); 
-$PermissionName=sql_result($preresult,0,"Name"); 
-$PermissionForumID=sql_result($preresult,0,"ForumID"); 
-$CanViewForum=sql_result($preresult,0,"CanViewForum"); 
-$CanMakePolls=sql_result($preresult,0,"CanMakePolls");
-$CanMakeTopics=sql_result($preresult,0,"CanMakeTopics"); 
-$CanMakeReplys=sql_result($preresult,0,"CanMakeReplys"); 
-$CanMakeReplysCT=sql_result($preresult,0,"CanMakeReplysCT"); 
-$CanEditTopics=sql_result($preresult,0,"CanEditTopics"); 
-$CanEditTopicsCT=sql_result($preresult,0,"CanEditTopicsCT"); 
-$CanEditReplys=sql_result($preresult,0,"CanEditReplys"); 
-$CanEditReplysCT=sql_result($preresult,0,"CanEditReplysCT"); 
-$CanDeleteTopics=sql_result($preresult,0,"CanDeleteTopics"); 
-$CanDeleteTopicsCT=sql_result($preresult,0,"CanDeleteTopicsCT"); 
-$CanDeleteReplys=sql_result($preresult,0,"CanDeleteReplys"); 
-$CanDeleteReplysCT=sql_result($preresult,0,"CanDeleteReplysCT"); 
-$CanCloseTopics=sql_result($preresult,0,"CanCloseTopics"); 
-$CanPinTopics=sql_result($preresult,0,"CanPinTopics"); 
-$CanExecPHP=sql_result($preresult,0,0,"CanExecPHP");
-$CanDoHTML=sql_result($preresult,0,"CanDoHTML"); 
-$CanUseBBTags=sql_result($preresult,0,"CanUseBBTags"); 
-$CanModForum=sql_result($preresult,0,"CanModForum"); 
-sql_free_result($preresult); }
-$PermissionName = stripcslashes(htmlspecialchars($PermissionName, ENT_QUOTES, $Settings['charset']));
-//$_POST['ForumName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumName']);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Forum Permissions: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewForum">Can view forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewForum" id="CanViewForum">
-       <option <?php if($CanViewForum=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanViewForum=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakeTopics">Can make topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakeTopics" id="CanMakeTopics">
-       <option <?php if($CanMakeTopics=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanMakeTopics=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakePolls">Can make polls:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakePolls" id="CanMakePolls">
-       <option <?php if($CanMakePolls=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanMakePolls=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakeReplys">Can make replys in own:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakeReplys" id="CanMakeReplys">
-       <option <?php if($CanMakeReplys=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanMakeReplys=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakeReplysCT">Can make replys other users topic:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakeReplysCT" id="CanMakeReplysCT">
-       <option <?php if($CanMakeReplysCT=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanMakeReplysCT=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditTopics">Can edit own topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditTopics" id="CanEditTopics">
-       <option <?php if($CanEditTopics=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanEditTopics=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditTopicsCT">Can edit other users topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditTopicsCT" id="CanEditTopicsCT">
-       <option <?php if($CanEditTopicsCT=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanEditTopicsCT=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditReplys">Can edit own replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditReplys" id="CanEditReplys">
-       <option <?php if($CanEditReplys=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanEditReplys=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditReplysCT">Can edit other users replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditReplysCT" id="CanEditReplysCT">
-       <option <?php if($CanEditReplysCT=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanEditReplysCT=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDeleteTopics">Can delete own topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteTopics" id="CanDeleteTopics">
-       <option <?php if($CanDeleteTopics=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanDeleteTopics=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="Can delete other users topics">Can delete other users topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteTopicsCT" id="CanDeleteTopicsCT">
-       <option <?php if($CanDeleteTopicsCT=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanDeleteTopicsCT=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDeleteReplys">Can delete own replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteReplys" id="CanDeleteReplys">
-       <option <?php if($CanDeleteReplys=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanDeleteReplys=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDeleteReplysCT">Can delete other users replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteReplysCT" id="CanDeleteReplysCT">
-       <option <?php if($CanDeleteReplysCT=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanDeleteReplysCT=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanCloseTopics">Can close topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanCloseTopics" id="CanCloseTopics">
-       <option <?php if($CanCloseTopics=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanCloseTopics=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanPinTopics">Can pin topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanPinTopics" id="CanPinTopics">
-       <option <?php if($CanPinTopics=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanPinTopics=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDoHTML">Can DoHTML:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDoHTML" id="CanDoHTML">
-       <option <?php if($CanDoHTML=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanDoHTML=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanUseBBTags">Can use BBTags:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanUseBBTags" id="CanUseBBTags">
-       <option <?php if($CanUseBBTags=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanUseBBTags=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanModForum">Can moderate forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanModForum" id="CanModForum">
-       <option <?php if($CanModForum=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanModForum=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="fpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="editnow" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $PermissionNum; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Permissions" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&$_POST['subact']=="editnow") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."permissions\" SET \"CanViewForum\"='%s', \"CanMakePolls\"='%s', \"CanMakeTopics\"='%s', \"CanMakeReplys\"='%s', \"CanMakeReplysCT\"='%s', \"CanEditTopics\"='%s', \"CanEditTopicsCT\"='%s', \"CanEditReplys\"='%s', \"CanEditReplysCT\"='%s', \"CanDeleteTopics\"='%s', \"CanDeleteTopicsCT\"='%s', \"CanDeleteReplys\"='%s', \"CanDeleteReplysCT\"='%s', \"CanCloseTopics\"='%s', \"CanPinTopics\"='%s', \"CanDoHTML\"='%s', \"CanUseBBTags\"='%s', \"CanModForum\"='%s' WHERE \"id\"=%i", array($_POST['CanViewForum'], $_POST['CanMakePolls'], $_POST['CanMakeTopics'], $_POST['CanMakeReplys'], $_POST['CanMakeReplysCT'], $_POST['CanEditTopics'], $_POST['CanEditTopicsCT'], $_POST['CanEditReplys'], $_POST['CanEditReplysCT'], $_POST['CanDeleteTopics'], $_POST['CanDeleteTopicsCT'], $_POST['CanDeleteReplys'], $_POST['CanDeleteReplysCT'], $_POST['CanCloseTopics'], $_POST['CanPinTopics'], $_POST['CanDoHTML'], $_POST['CanUseBBTags'], $_POST['CanModForum'], $_POST['id']));
-sql_query($query,$SQLStat); } if(isset($_POST['id'])&&$_POST['subact']=="create") { 
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Forum Permissions: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewForum">Can view forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewForum" id="CanViewForum">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakePolls">Can make polls:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakePolls" id="CanMakePolls">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr>
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakeTopics">Can make topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakeTopics" id="CanMakeTopics">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakeReplys">Can make replys in own:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakeReplys" id="CanMakeReplys">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanMakeReplysCT">Can make replys other users topic:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanMakeReplysCT" id="CanMakeReplysCT">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditTopics">Can edit own topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditTopics" id="CanEditTopics">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditTopicsCT">Can edit other users topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditTopicsCT" id="CanEditTopicsCT">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditReplys">Can edit own replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditReplys" id="CanEditReplys">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditReplysCT">Can edit other users replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditReplysCT" id="CanEditReplysCT">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDeleteTopics">Can delete own topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteTopics" id="CanDeleteTopics">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="Can delete other users topics">Can delete other users topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteTopicsCT" id="CanDeleteTopicsCT">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDeleteReplys">Can delete own replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteReplys" id="CanDeleteReplys">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDeleteReplysCT">Can delete other users replys:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDeleteReplysCT" id="CanDeleteReplysCT">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanCloseTopics">Can close topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanCloseTopics" id="CanCloseTopics">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanPinTopics">Can pin topics:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanPinTopics" id="CanPinTopics">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDoHTML">Can DoHTML:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDoHTML" id="CanDoHTML">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanUseBBTags">Can use BBTags:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanUseBBTags" id="CanUseBBTags">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr> 
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanModForum">Can moderate forum:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanModForum" id="CanModForum">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="fpermissions" style="display: none;" />
-<input type="hidden" name="subact" value="makenow" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $_POST['id']; ?>" style="display: none;" />
-<input type="hidden" name="permid" value="<?php echo $_POST['permid']; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Create Permissions" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"id\"=%i LIMIT 1", array($_POST['permid']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$PermissionName=sql_result($preresult,0,"Name"); 
-sql_free_result($preresult); }
-//$nextidnum = sql_get_next_id($Settings['sqltable'],"permissions",$SQLStat);
-$nextidnum = null;
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(%i, '%s', %i, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 'no', '%s', '%s', '%s')", array($_POST['permid'], $PermissionName, $_POST['id'], $_POST['CanViewForum'], $_POST['CanMakePolls'], $_POST['CanMakeTopics'], $_POST['CanMakeReplys'], $_POST['CanMakeReplysCT'], $_POST['CanEditTopics'], $_POST['CanEditTopicsCT'], $_POST['CanEditReplys'], $_POST['CanEditReplysCT'], $_POST['CanDeleteTopics'], $_POST['CanDeleteTopicsCT'], $_POST['CanDeleteReplys'], $_POST['CanDeleteReplysCT'], $_POST['CanCloseTopics'], $_POST['CanPinTopics'], $_POST['CanDoHTML'], $_POST['CanUseBBTags'], $_POST['CanModForum'])); 
-sql_query($query,$SQLStat); } } 
-$doupdate = false;
-if(isset($_POST['id'])&&$_POST['subact']=="editnow") { 
-       $doupdate = true; }
-if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") { 
-       $doupdate = true; }
-if($_POST['act']=="addforum"&&$_POST['update']=="now"&&$_GET['act']=="addforum") { 
-       $doupdate = true; }
-if($_GET['act']=="deleteforum"&&$_POST['update']=="now"&&$_GET['act']=="deleteforum") { 
-       $doupdate = true; }
-if($_POST['act']=="editforum"&&$_POST['update']=="now"&&$_GET['act']=="editforum"&&
-       isset($_POST['id'])) { 
-       $doupdate = true; }
-if($doupdate===true&&$Error!="Yes") { ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<?php if(isset($_POST['id'])&&$_POST['subact']=="editnow") { ?>
-<div style="text-align: center;">
-       <br />The permission was edited successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") { ?>
-<div style="text-align: center;">
-       <br />The permission was created successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_POST['act']=="addforum"&&$_POST['update']=="now"&&$_GET['act']=="addforum") { ?>
-<div style="text-align: center;">
-       <br />The forum was created successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_GET['act']=="deleteforum"&&$_POST['update']=="now"&&$_GET['act']=="deleteforum") { ?>
-<div style="text-align: center;">
-       <br />The forum was deleted successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_POST['act']=="editforum"&&$_POST['update']=="now"&&$_GET['act']=="editforum"&&
-       isset($_POST['id'])) { ?>
-<div style="text-align: center;">
-       <br />The forum was edited successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } ?>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } if ($_GET['act']!=null&&$Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br /><?php echo $errorstr; ?>
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-       </div>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } ?>
-</td></tr>
-</table>
-<div>&nbsp;</div>
diff --git a/inc/admin/groups.php.bak b/inc/admin/groups.php.bak
deleted file mode 100644 (file)
index 0ea1389..0000000
+++ /dev/null
@@ -1,838 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: groups.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="groups.php"||$File3Name=="/groups.php") {
-       require('index.php');
-       exit(); }
-
-// Check if we can goto admin cp
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-$Error = null; $errorstr = null;
-?>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-<?php 
-require($SettDir['admin'].'table.php'); 
-?>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php if($_GET['act']=="addgroup"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Adding new Group";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Adding new Group: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GroupName">Insert name for group:</label></td>
-       <td style="width: 50%;"><input type="text" name="GroupName" class="TextBox" id="GroupName" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GroupPerm">Copy Permissions from:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="GroupPerm" id="GroupPerm">
-       <option selected="selected" value="0">none</option>
-<?php 
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="sqlite") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"PermissionID\" FROM \"".$Settings['sqltable']."permissions\"", array(null)); }
-if($Settings['sqltype']=="cubrid") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"permissionid\" FROM \"".$Settings['sqltable']."permissions\"", array(null)); }
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0;
-while ($getperidi < $getperidnum) {
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$getperidID=sql_result($getperidr,$getperidi,"PermissionID"); }
-if($Settings['sqltype']=="sqlite") {
-$getperidID=sql_result($getperidr,$getperidi,"\"PermissionID\""); }
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i ORDER BY \"ForumID\" ASC", array($getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$getperidName=sql_result($getperidr2,0,"Name");
-sql_free_result($getperidr2);
-?>
-       <option value="<?php echo $getperidID; ?>"><?php echo $getperidName; ?></option>
-<?php ++$getperidi; }
-sql_free_result($getperidr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PermissionID">Permission ID:</label></td>
-       <td style="width: 50%;"><input type="text" name="PermissionID" class="TextBox" id="PermissionID" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NamePrefix">Name Prefix:</label></td>
-       <td style="width: 50%;"><input type="text" name="NamePrefix" class="TextBox" id="NamePrefix" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NameSuffix">Name Subfix:</label></td>
-       <td style="width: 50%;"><input type="text" name="NameSuffix" class="TextBox" id="NameSuffix" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewBoard">Can View Board:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewBoard" id="CanViewBoard">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewOffLine">Can View OffLine Board:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewOffLine" id="CanViewOffLine">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditProfile">Can Edit Profile:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditProfile" id="CanEditProfile">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanAddEvents">Can Add Events:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanAddEvents" id="CanAddEvents">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanPM">Can PM:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanPM" id="CanPM">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanSearch">Can Search:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanSearch" id="CanSearch">
-       <option selected="selected" value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDoHTML">Can DoHTML:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDoHTML" id="CanDoHTML">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanUseBBTags">Can use BBTags:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanUseBBTags" id="CanUseBBTags">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="FloodControl">Flood Control in seconds:</label></td>
-       <td style="width: 50%;"><input type="text" name="FloodControl" class="TextBox" id="FloodControl" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="SearchFlood">Search Flood Control in seconds:</label></td>
-       <td style="width: 50%;"><input type="text" name="SearchFlood" class="TextBox" id="SearchFlood" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PromoteTo">Promote To Group:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="PromoteTo" id="PromoteTo">
-       <option selected="selected" value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" ORDER BY \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$ProGroupID=sql_result($fr,$fi,"id");
-$ProGroupName=sql_result($fr,$fi,"Name");
-?>
-       <option value="<?php echo $ProGroupID; ?>"><?php echo $ProGroupName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PromotePosts">Amount of Posts needed:</label></td>
-       <td style="width: 50%;"><input type="text" name="PromotePosts" class="TextBox" id="PromotePosts" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PromoteKarma">Amount of Karma needed:</label></td>
-       <td style="width: 50%;"><input type="text" name="PromoteKarma" class="TextBox" id="PromoteKarma" size="20" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HasModCP">Can view Mod CP:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HasModCP" id="HasModCP">
-       <option selected="selected" value="off">no</option>
-       <option value="on">yes</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HasAdminCP">Can view Admin CP:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HasAdminCP" id="HasAdminCP">
-       <option selected="selected" value="off">no</option>
-       <option value="on">yes</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewIPAddress">Can view IP Address:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewIPAddress" id="CanViewIPAddress">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewUserAgent">Can view user agent:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewUserAgent" id="CanViewUserAgent">
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ViewDBInfo">Can view Database info:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ViewDBInfo" id="ViewDBInfo">
-       <option selected="selected" value="off">no</option>
-       <option value="on">yes</option>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="addgroup" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Add Group" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="addgroup"&&$_POST['update']=="now"&&$_GET['act']=="addgroup") {
-$_POST['GroupName'] = stripcslashes(htmlspecialchars($_POST['GroupName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GroupName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GroupName']);
-$_POST['GroupName'] = remove_spaces($_POST['GroupName']);
-$_POST['NamePrefix'] = stripcslashes(htmlspecialchars($_POST['NamePrefix'], ENT_QUOTES, $Settings['charset']));
-//$_POST['NamePrefix'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NamePrefix']);
-$_POST['NamePrefix'] = remove_spaces($_POST['NamePrefix']);
-$_POST['NameSuffix'] = stripcslashes(htmlspecialchars($_POST['NameSuffix'], ENT_QUOTES, $Settings['charset']));
-//$_POST['NameSuffix'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NameSuffix']);
-$_POST['NameSuffix'] = remove_spaces($_POST['NameSuffix']);
-$sql_name_check = sql_query(sql_pre_query("SELECT \"Name\" FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s'", array($_POST['GroupName'])),$SQLStat);
-$sql_id_check = sql_query(sql_pre_query("SELECT \"id\" FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i LIMIT 1", array($_POST['PermissionID'])),$SQLStat);
-$name_check = sql_num_rows($sql_name_check); $id_check = sql_num_rows($sql_id_check);
-sql_free_result($sql_name_check);
-$errorstr = "";
-if (!isset($_POST['PromotePosts'])) {
-       $_POST['PromotePosts'] = 0; }
-if ($_POST['PromotePosts']==null||
-       !is_numeric($_POST['PromotePosts'])) {
-       $_POST['PromotePosts'] = 0; }
-if (!isset($_POST['PromoteKarma'])) {
-       $_POST['PromoteKarma'] = 0; }
-if ($_POST['PromoteKarma']==null||
-       !is_numeric($_POST['PromoteKarma'])) {
-       $_POST['NPromoteKarma'] = 0; }
-if ($_POST['GroupName']==null||
-       $_POST['GroupName']=="ShowMe") { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum name.<br />\n"; } 
-if($id_check > 0) { $Error="Yes";
-$errorstr = $errorstr."This ID number is already used.<br />\n"; } 
-if($name_check > 0) { $Error="Yes";
-$errorstr = $errorstr."This Group Name is already used.<br />\n"; } 
-if (pre_strlen($_POST['GroupName'])>"150") { $Error="Yes";
-$errorstr = $errorstr."Your Group Name is too big.<br />\n"; } 
-if ($Error!="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('%s', %i, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 'no', '%s', '%s', '%s', '%s', '%s', %i, %i, %i, %i, %i, '%s', '%s', '%s')", array($_POST['GroupName'],$_POST['PermissionID'],$_POST['NamePrefix'],$_POST['NameSuffix'],$_POST['CanViewBoard'],$_POST['CanViewOffLine'],$_POST['CanEditProfile'],$_POST['CanAddEvents'],$_POST['CanPM'],$_POST['CanSearch'],$_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['HasModCP'],$_POST['CanViewIPAddress'],$_POST['CanViewUserAgent'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['PromoteTo'],$_POST['PromotePosts'],$_POST['PromoteKarma'],$_POST['HasModCP'],$_POST['HasAdminCP'],$_POST['ViewDBInfo']));
-sql_query($query,$SQLStat);
-if(!is_numeric($_POST['GroupPerm'])) { $_POST['GroupPerm'] = "0"; }
-$getperidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" ORDER BY \"id\" ASC", array(null));
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0; 
-$nextperid = null;
-/*
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$nextperid = sql_get_next_id($Settings['sqltable'],"permissions",$SQLStat); }
-if($Settings['sqltype']=="sqlite") {
-$nextperid = sql_get_next_id($Settings['sqltable'],"\"permissions\"",$SQLStat); }
-*/
-while ($getperidi < $getperidnum) {
-$getperidID=sql_result($getperidr,$getperidi,"id");
-if($_POST['GroupPerm']!="0") {
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i AND \"ForumID\"=%i", array($_POST['GroupPerm'],$getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$PermissionNum=sql_result($getperidr2,0,"id"); 
-$PermissionID=$_POST['PermissionID']; 
-$PermissionName=$_POST['GroupName']; 
-$PermissionForumID=sql_result($getperidr2,0,"ForumID"); 
-$CanViewForum=sql_result($getperidr2,0,"CanViewForum");
-$CanMakePolls=sql_result($getperidr2,0,"CanMakePolls");
-$CanMakeTopics=sql_result($getperidr2,0,"CanMakeTopics"); 
-$CanMakeReplys=sql_result($getperidr2,0,"CanMakeReplys"); 
-$CanMakeReplysCT=sql_result($getperidr2,0,"CanMakeReplysCT"); 
-$CanEditTopics=sql_result($getperidr2,0,"CanEditTopics"); 
-$CanEditTopicsCT=sql_result($getperidr2,0,"CanEditTopicsCT"); 
-$CanEditReplys=sql_result($getperidr2,0,"CanEditReplys"); 
-$CanEditReplysCT=sql_result($getperidr2,0,"CanEditReplysCT"); 
-$CanDeleteTopics=sql_result($getperidr2,0,"CanDeleteTopics"); 
-$CanDeleteTopicsCT=sql_result($getperidr2,0,"CanDeleteTopicsCT"); 
-$CanDeleteReplys=sql_result($getperidr2,0,"CanDeleteReplys"); 
-$CanDeleteReplysCT=sql_result($getperidr2,0,"CanDeleteReplysCT"); 
-$CanCloseTopics=sql_result($getperidr2,0,"CanCloseTopics"); 
-$CanPinTopics=sql_result($getperidr2,0,"CanPinTopics"); 
-$CanExecPHP=sql_result($getperidr2,0,"CanExecPHP"); 
-$CanDoHTML=sql_result($getperidr2,0,"CanDoHTML"); 
-$CanUseBBTags=sql_result($getperidr2,0,"CanUseBBTags"); 
-$CanModForum=sql_result($getperidr2,0,"CanModForum"); 
-sql_free_result($getperidr2); }
-if($_POST['GroupPerm']=="0") {
-$PermissionID=$_POST['PermissionID']; 
-$PermissionName=$_POST['GroupName']; 
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES (%i, '%s', %i, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no')", array($PermissionID,$PermissionName,$getperidID)); }
-if($_POST['GroupPerm']!="0") {
-if($getperidnum2>0) {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES (%i, '%s', %i, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", array($PermissionID,$PermissionName,$getperidID,$CanViewForum,$CanMakePolls,$CanMakeTopics,$CanMakeReplys,$CanMakeReplysCT,$CanEditTopics,$CanEditTopicsCT,$CanEditReplys,$CanEditReplysCT,$CanDeleteTopics,$CanDeleteTopicsCT,$CanDeleteReplys,$CanDeleteReplysCT,$CanCloseTopics,$CanPinTopics,$CanExecPHP,$CanDoHTML,$CanUseBBTags,$CanModForum)); }
-if($getperidnum2<=0) {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES (%i, '%s', %i, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no')", array($PermissionID,$PermissionName,$getperidID)); } }
-sql_query($query,$SQLStat);
-++$getperidi; /*++$nextperid;*/ }
-sql_free_result($getperidr);
-if(!is_numeric($_POST['GroupPerm'])) { $_POST['GroupPerm'] = "0"; }
-$getperidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" ORDER BY \"id\" ASC", array(null));
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0; 
-$nextperid = null;
-/*
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$nextperid = sql_get_next_id($Settings['sqltable'],"permissions",$SQLStat); }
-if($Settings['sqltype']=="sqlite") {
-$nextperid = sql_get_next_id($Settings['sqltable'],"\"permissions\"",$SQLStat); }
-*/
-while ($getperidi < $getperidnum) {
-$getperidID=sql_result($getperidr,$getperidi,"id");
-if($_POST['GroupPerm']!="0") {
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"PermissionID\"=%i AND \"CategoryID\"=%i", array($_POST['GroupPerm'],$getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$PermissionNum=sql_result($getperidr2,0,"id"); 
-$PermissionID=$_POST['PermissionID']; 
-$PermissionName=$_POST['GroupName']; 
-$PermissionCatID=sql_result($getperidr2,0,"CategoryID"); 
-$CanViewCategory=sql_result($getperidr2,0,"CanViewCategory"); 
-sql_free_result($getperidr2); }
-if($_POST['GroupPerm']=="0") {
-$PermissionID=$_POST['PermissionID']; 
-$PermissionName=$_POST['GroupName']; 
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES (%i, '%s', %i, 'yes')", array($PermissionID,$PermissionName,$getperidID)); }
-if($_POST['GroupPerm']!="0") {
-if($getperidnum2>0) {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES (%i, '%s', %i, '%s')", array($PermissionID,$PermissionName,$getperidID,$CanViewCategory)); }
-if($getperidnum2<=0) {
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES (%i, '%s', %i, 'yes')", array($PermissionID,$PermissionName,$getperidID)); } }
-sql_query($query,$SQLStat);
-++$getperidi; /*++$nextperid;*/ }
-sql_free_result($getperidr); } } 
-if($_GET['act']=="deletegroup"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Deleting a Forum";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Deleting a Group: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletegroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DelID">Delete Group:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DelID" id="DelID">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE (\"Name\"<>'%s' AND \"Name\"<>'%s' AND \"Name\"<>'%s' AND \"Name\"<>'%s') ORDER BY \"id\" ASC", array($Settings['GuestGroup'],$Settings['MemberGroup'],$Settings['ValidateGroup'],"Admin"));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$GroupID=sql_result($fr,$fi,"id");
-$GroupName=sql_result($fr,$fi,"Name");
-?>
-       <option value="<?php echo $GroupID; ?>"><?php echo $GroupName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="deletegroup" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Delete Group" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="deletegroup"&&$_POST['update']=="now"&&$_GET['act']=="deletegroup") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i AND (\"Name\"<>'%s' AND \"Name\"<>'%s' AND \"Name\"<>'%s' AND \"Name\"<>'%s') LIMIT 1", array($_POST['DelID'],$Settings['GuestGroup'],$Settings['MemberGroup'],$Settings['ValidateGroup'],"Admin"));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$GroupName=sql_result($preresult,0,"Name");
-$errorstr = ""; $Error = null;
-if (!is_numeric($_POST['DelID'])) { $Error="Yes";
-$errorstr = $errorstr."You need to enter a group ID.<br />\n"; } 
-if($prenum>0&&$Error!="Yes") {
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i", array($_POST['DelID']));
-sql_query($dtquery,$SQLStat);
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"Name\"='%s'", array($GroupName));
-sql_query($dtquery,$SQLStat);
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."permissions\" WHERE \"Name\"='%s'", array($GroupName));
-sql_query($dtquery,$SQLStat);
-$gquerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['MemberGroup']));
-$gresults=sql_query($gquerys,$SQLStat);
-$MemGroup=sql_result($gresults,0,"id");
-sql_free_result($gresults);
-$dtquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"=%i WHERE \"GroupID\"=%i", array($MemGroup,$_POST['DelID']));
-sql_query($dtquery,$SQLStat); } }
-if($_GET['act']=="editgroup"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Editing a Group";
-if(!isset($_POST['id'])) {
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing a Group: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Group to Edit:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" ORDER BY \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$GroupID=sql_result($fr,$fi,"id");
-$GroupName=sql_result($fr,$fi,"Name");
-?>
-       <option value="<?php echo $GroupID; ?>"><?php echo $GroupName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editgroup" style="display: none;" />
-<input type="submit" class="Button" value="Edit Group" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if(isset($_POST['id'])) { 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$GroupID = sql_result($preresult,0,"id");
-$GroupName = sql_result($preresult,0,"Name");
-$PermissionID = sql_result($preresult,0,"PermissionID");
-$NamePrefix = sql_result($preresult,0,"NamePrefix");
-$NameSuffix = sql_result($preresult,0,"NameSuffix");
-$CanViewBoard = sql_result($preresult,0,"CanViewBoard");
-$CanViewOffLine = sql_result($preresult,0,"CanViewOffLine");
-$CanEditProfile = sql_result($preresult,0,"CanEditProfile");
-$CanAddEvents = sql_result($preresult,0,"CanAddEvents");
-$CanPM = sql_result($preresult,0,"CanPM");
-$CanSearch = sql_result($preresult,0,"CanSearch");
-$CanDoHTML = sql_result($preresult,0,"CanDoHTML");
-$CanUseBBTags = sql_result($preresult,0,"CanUseBBTags");
-$CanViewIPAddress = sql_result($preresult,0,"CanViewIPAddress");
-$CanViewUserAgent = sql_result($preresult,0,"CanViewUserAgent");
-$FloodControl = sql_result($preresult,0,"FloodControl");
-$SearchFlood = sql_result($preresult,0,"SearchFlood");
-$PromoteTo = sql_result($preresult,0,"PromoteTo");
-$PromotePosts = sql_result($preresult,0,"PromotePosts");
-$PromoteKarma = sql_result($preresult,0,"PromoteKarma");
-$HasModCP = sql_result($preresult,0,"HasModCP");
-$HasAdminCP = sql_result($preresult,0,"HasAdminCP");
-$ViewDBInfo = sql_result($preresult,0,"ViewDBInfo");
-sql_free_result($preresult);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">iDB Group Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing a Group: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GroupName">Insert name for group:</label></td>
-       <td style="width: 50%;"><input type="text" name="GroupName" class="TextBox" id="GroupName" size="20" value="<?php echo $GroupName; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NamePrefix">Name Prefix:</label></td>
-       <td style="width: 50%;"><input type="text" name="NamePrefix" class="TextBox" id="NamePrefix" size="20" value="<?php echo $NamePrefix; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NameSuffix">Name Subfix:</label></td>
-       <td style="width: 50%;"><input type="text" name="NameSuffix" class="TextBox" id="NameSuffix" size="20" value="<?php echo $NameSuffix; ?>" /></td>
-<?php if($GroupID!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewBoard">Can View Board:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewBoard" id="CanViewBoard">
-       <option selected="selected" value="<?php echo $CanViewBoard; ?>">Old Value (<?php echo $CanViewBoard; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewOffLine">Can View OffLine Board:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewOffLine" id="CanViewOffLine">
-       <option selected="selected" value="<?php echo $CanViewOffLine; ?>">Old Value (<?php echo $CanViewOffLine; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditProfile">Can Edit Profile:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditProfile" id="CanEditProfile">
-       <option selected="selected" value="<?php echo $CanEditProfile; ?>">Old Value (<?php echo $CanEditProfile; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanAddEvents">Can Add Events:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanAddEvents" id="CanAddEvents">
-       <option selected="selected" value="<?php echo $CanAddEvents; ?>">Old Value (<?php echo $CanAddEvents; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanPM">Can PM:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanPM" id="CanPM">
-       <option selected="selected" value="<?php echo $CanPM; ?>">Old Value (<?php echo $CanPM; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanSearch">Can Search:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanSearch" id="CanSearch">
-       <option selected="selected" value="<?php echo $CanSearch; ?>">Old Value (<?php echo $CanSearch; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-<?php } ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDoHTML">Can DoHTML:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDoHTML" id="CanDoHTML">
-       <option <?php if($CanDoHTML=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanDoHTML=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanUseBBTags">Can use BBTags:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanUseBBTags" id="CanUseBBTags">
-       <option <?php if($CanUseBBTags=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($CanUseBBTags=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="FloodControl">Flood Control in seconds:</label></td>
-       <td style="width: 50%;"><input type="text" name="FloodControl" class="TextBox" id="FloodControl" size="20" value="<?php echo $FloodControl; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="SearchFlood">Search Flood Control in seconds:</label></td>
-       <td style="width: 50%;"><input type="text" name="SearchFlood" class="TextBox" id="SearchFlood" size="20" value="<?php echo $SearchFlood; ?>" /></td>
-<?php if($GroupID!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PromoteTo">Promote To Group:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="PromoteTo" id="PromoteTo">
-       <option selected="selected" value="<?php echo $PromoteTo; ?>">Old Value (<?php echo $PromoteTo; ?>)</option>
-       <option value="0">none</option>
-<?php 
-$fq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" ORDER BY \"id\" ASC", array(null));
-$fr=sql_query($fq,$SQLStat);
-$ai=sql_num_rows($fr);
-$fi=0;
-while ($fi < $ai) {
-$ProGroupID=sql_result($fr,$fi,"id");
-$ProGroupName=sql_result($fr,$fi,"Name");
-?>
-       <option value="<?php echo $ProGroupID; ?>"><?php echo $ProGroupName; ?></option>
-<?php ++$fi; }
-sql_free_result($fr); ?>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PromotePosts">Amount of Posts needed:</label></td>
-       <td style="width: 50%;"><input type="text" name="PromotePosts" class="TextBox" id="PromotePosts" size="20" value="<?php echo $PromotePosts; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PromoteKarma">Amount of Karma needed:</label></td>
-       <td style="width: 50%;"><input type="text" name="PromoteKarma" class="TextBox" id="PromoteKarma" size="20" value="<?php echo $PromoteKarma; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HasModCP">Can view Mod CP:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HasModCP" id="HasModCP">
-       <option selected="selected" value="<?php echo $HasModCP; ?>">Old Value (<?php echo $HasModCP; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HasAdminCP">Can view Admin CP:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HasAdminCP" id="HasAdminCP">
-       <option selected="selected" value="<?php echo $HasAdminCP; ?>">Old Value (<?php echo $HasAdminCP; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewIPAddress">Can view IP Address:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewIPAddress" id="CanViewIPAddress">
-       <option selected="selected" value="<?php echo $CanViewIPAddress; ?>">Old Value (<?php echo $CanViewIPAddress; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewUserAgent">Can view user agent:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewUserAgent" id="CanViewUserAgent">
-       <option selected="selected" value="<?php echo $CanViewUserAgent; ?>">Old Value (<?php echo $CanViewUserAgent; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ViewDBInfo">Can view Database info:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ViewDBInfo" id="ViewDBInfo">
-       <option selected="selected" value="<?php echo $ViewDBInfo; ?>">Old Value (<?php echo $ViewDBInfo; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-<?php } ?>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editgroup" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $GroupID; ?>" style="display: none;" />
-<input type="submit" class="Button" value="Edit Group" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } } } if($_POST['act']=="editgroup"&&$_POST['update']=="now"&&$_GET['act']=="editgroup"&&
-       isset($_POST['id'])) {
-$_POST['GroupName'] = stripcslashes(htmlspecialchars($_POST['GroupName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GroupName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GroupName']);
-$_POST['GroupName'] = remove_spaces($_POST['GroupName']);
-$_POST['NamePrefix'] = stripcslashes(htmlspecialchars($_POST['NamePrefix'], ENT_QUOTES, $Settings['charset']));
-//$_POST['NamePrefix'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NamePrefix']);
-$_POST['NamePrefix'] = remove_spaces($_POST['NamePrefix']);
-$_POST['NameSuffix'] = stripcslashes(htmlspecialchars($_POST['NameSuffix'], ENT_QUOTES, $Settings['charset']));
-//$_POST['NameSuffix'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NameSuffix']);
-$_POST['NameSuffix'] = remove_spaces($_POST['NameSuffix']);
-$name_check = 0;
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$OldGroupName=sql_result($preresult,0,"Name");
-sql_free_result($preresult);
-if($_POST['GroupName']!=$OldGroupName) {
-$sql_name_check = sql_query(sql_pre_query("SELECT \"Name\" FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s'", array($_POST['GroupName'])),$SQLStat);
-$name_check = sql_num_rows($sql_name_check);
-sql_free_result($sql_name_check); }
-$errorstr = "";
-if (!isset($_POST['PromotePosts'])) {
-       $_POST['PromotePosts'] = 0; }
-if ($_POST['PromotePosts']==null||
-       !is_numeric($_POST['PromotePosts'])) {
-       $_POST['PromotePosts'] = 0; }
-if (!isset($_POST['PromoteKarma'])) {
-       $_POST['PromoteKarma'] = 0; }
-if ($_POST['PromoteKarma']==null||
-       !is_numeric($_POST['PromoteKarma'])) {
-       $_POST['NPromoteKarma'] = 0; }
-if ($_POST['GroupName']==null||
-       $_POST['GroupName']=="ShowMe") { $Error="Yes";
-$errorstr = $errorstr."You need to enter a forum name.<br />\n"; } 
-if($name_check > 0) { $Error="Yes";
-$errorstr = $errorstr."This Group Name is already used.<br />\n"; } 
-if (pre_strlen($_POST['GroupName'])>"150") { $Error="Yes";
-$errorstr = $errorstr."Your Group Name is too big.<br />\n"; } 
-if ($Error!="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-if($_POST['GroupName']!=$OldGroupName) {
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."permissions\" SET \"Name\"='%s' WHERE \"Name\"='%s'", array($_POST['GroupName'],$OldGroupName));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."catpermissions\" SET \"Name\"='%s' WHERE \"Name\"='%s'", array($_POST['GroupName'],$OldGroupName));
-sql_query($query,$SQLStat); }
-if($_POST['id']!=1) {
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."groups\" SET \"Name\"='%s',\"NamePrefix\"='%s',\"NameSuffix\"='%s',\"CanViewBoard\"='%s',\"CanViewOffLine\"='%s',\"CanEditProfile\"='%s',\"CanAddEvents\"='%s',\"CanPM\"='%s',\"CanSearch\"='%s',\"CanDoHTML\"='%s',\"CanUseBBTags\"='%s',CanViewIPAddress='%s',CanViewUserAgent='%s',\"FloodControl\"=%i,\"SearchFlood\"=%i,\"PromoteTo\"=%i,\"PromotePosts\"=%i,\"PromoteKarma\"=%i,\"HasModCP\"='%s',\"HasAdminCP\"='%s',\"ViewDBInfo\"='%s' WHERE \"id\"=%i", array($_POST['GroupName'],$_POST['NamePrefix'],$_POST['NameSuffix'],$_POST['CanViewBoard'],$_POST['CanViewOffLine'],$_POST['CanEditProfile'],$_POST['CanAddEvents'],$_POST['CanPM'],$_POST['CanSearch'],$_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['CanViewIPAddress'],$_POST['CanViewUserAgent'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['PromoteTo'],$_POST['PromotePosts'],$_POST['PromoteKarma'],$_POST['HasModCP'],$_POST['HasAdminCP'],$_POST['ViewDBInfo'],$_POST['id'])); }
-if($_POST['id']==1) {
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."groups\" SET \"Name\"='%s',\"NamePrefix\"='%s',\"NameSuffix\"='%s',\"CanDoHTML\"='%s',\"CanUseBBTags\"='%s',\"FloodControl\"=%i,\"SearchFlood\"=%i WHERE \"id\"=%i", array($_POST['GroupName'],$_POST['NamePrefix'],$_POST['NameSuffix'],$_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['id'])); }
-sql_query($query,$SQLStat); } } }  
-$doupdate = false;
-if(isset($_POST['id'])&&$_POST['subact']=="editnow") { 
-       $doupdate = true; }
-if(isset($_POST['id'])&&isset($_POST['permid'])&&$_POST['subact']=="makenow") { 
-       $doupdate = true; }
-if($_POST['act']=="addgroup"&&$_POST['update']=="now"&&$_GET['act']=="addgroup") { 
-       $doupdate = true; }
-if($_GET['act']=="deletegroup"&&$_POST['update']=="now"&&$_GET['act']=="deletegroup") { 
-       $doupdate = true; }
-if($_POST['act']=="editgroup"&&$_POST['update']=="now"&&$_GET['act']=="editgroup"&&
-       isset($_POST['id'])) { 
-       $doupdate = true; }
-if($doupdate===true&&$Error!="Yes") { ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<?php if($_POST['act']=="addgroup"&&$_POST['update']=="now"&&$_GET['act']=="addgroup") { ?>
-<div style="text-align: center;">
-       <br />The group was created successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_GET['act']=="deletegroup"&&$_POST['update']=="now"&&$_GET['act']=="deletegroup") { ?>
-<div style="text-align: center;">
-       <br />The group was deleted successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } if($_POST['act']=="editgroup"&&$_POST['update']=="now"&&$_GET['act']=="editgroup"&&
-       isset($_POST['id'])) { ?>
-<div style="text-align: center;">
-       <br />The group was edited successfully. <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to go back. ^_^<br />&nbsp;
-       </div>
-<?php } ?>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } if ($_GET['act']!=null&&$Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br /><?php echo $errorstr; ?>
-       <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-       </div>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } ?>
-</td></tr>
-</table>
-<div>&nbsp;</div>
diff --git a/inc/admin/index.php.bak b/inc/admin/index.php.bak
deleted file mode 100644 (file)
index de16c80..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/admin/main.php.bak b/inc/admin/main.php.bak
deleted file mode 100644 (file)
index c4d653c..0000000
+++ /dev/null
@@ -1,1472 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: main.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="main.php"||$File3Name=="/main.php") {
-       require('index.php');
-       exit(); }
-
-// Check if we can goto admin cp
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-if($_GET['act']=="sql"&&$GroupInfo['ViewDBInfo']!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-if($_GET['act']=="resyncthemes"&&$Settings['SQLThemes']!="on") { $_GET['act'] = "enablesthemes"; }
-if($_GET['act']=="enablesthemes"&&$Settings['SQLThemes']!="off") { $_GET['act'] = "resyncthemes"; }
-$iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
-$iDBRSVN = $VER2[2]." ".$SubVerN;
-$OutPutLog = null;
-$LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
-$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";
-$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   */");
-$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";
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-function bool_string($boolean) {
-if(!is_bool($boolean)) {
-return $boolean; }
-if(is_bool($boolean)) { 
-if($boolean==0||$boolean===false) { 
-return "false"; }
-if($boolean==1||$boolean===true) { 
-return "true"; } } }
-function null_string($string) {
-$strtype = strtolower(gettype($string));
-if($strtype=="string") {
-       return "'".$string."'"; }
-if($strtype=="null") {
-       return "null"; }
-if($strtype=="integer") {
-       return $string; } 
-       return "null"; }
-function rsq($string) {
-$string = preg_replace("/^(\')|$(\')/i","\'",$string);
-return $string; }
-$KarmaExp = explode("&",$Settings['KarmaBoostDays']);
-$KarmaNum = count($KarmaExp); 
-$Karmai = 0; $KarmaNex = 0; $KarmaTemp = null;
-while ($Karmai < $KarmaNum) {
-if(is_numeric($KarmaExp[$Karmai])) {
-$KarmaTemp[$KarmaNex] = $KarmaExp[$Karmai];
-++$KarmaNex; }
-++$Karmai; }
-$KarmaExp = $KarmaTemp;
-$Settings['KarmaBoostDays'] = implode("&",$KarmaExp);
-$KBoostPercent = explode("|",$Settings['KBoostPercent']);
-if(count($KBoostPercent)<1) { 
-$Settings['KBoostPercent'] = "6|10"; }
-if(!is_numeric($KBoostPercent[0])) {
-$Settings['KBoostPercent'] = "6|10"; }
-if(count($KBoostPercent)==1) { 
-$Settings['KBoostPercent'] = "6|10"; }
-if(!is_numeric($KBoostPercent[1])) {
-$Settings['KBoostPercent'] = "6|10"; }
-if(count($KBoostPercent)>2) { 
-$Settings['KBoostPercent'] = "6|10"; }
-if($Settings['html_type']=="html5") {
-$Settings['output_type'] = "html"; }
-if(!isset($Settings['sqltype'])) {
-       $Settings['sqltype'] = "mysql"; }
-$Settings['sqltype'] = strtolower($Settings['sqltype']);
-if($Settings['sqltype']!="mysql"&&
-       $Settings['sqltype']!="mysqli"&&
-       $Settings['sqltype']!="pgsql"&&
-       $Settings['sqltype']!="sqlite"&&
-       $Settings['sqltype']!="cubrid") {
-       $Settings['sqltype'] = "mysql"; }
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli") {
-$DBType['Server'] = "MySQL ".sql_server_info($SQLStat);
-$DBType['Client'] = "MySQL ".sql_client_info($SQLStat); }
-if($Settings['sqltype']=="pgsql") {
-$DBType['Server'] = "Postgres ".sql_server_info($SQLStat);
-$DBType['Client'] = "Postgres ".sql_client_info($SQLStat); }
-if($Settings['sqltype']=="sqlite") {
-$DBType['Server'] = "SQLite ".sql_server_info($SQLStat);
-$DBType['Client'] = sql_client_info($SQLStat); }
-if($Settings['sqltype']=="cubrid") {
-$DBType['Server'] = "CUBRID ".sql_server_info($SQLStat);
-$DBType['Client'] = "CUBRID ".sql_client_info($SQLStat); 
-$DBType['PHP'] = "CUBRID ".cubrid_version(); }
-if(!isset($Settings['vercheck'])) { 
-       $Settings['vercheck'] = 2; }
-if($Settings['vercheck']!=1&&
-       $Settings['vercheck']!=2) {
-       $Settings['vercheck'] = 2; }
-if(!isset($Settings['start_date'])) {
-       $Settings['start_date'] = $utccurtime->getTimestamp(); }
-if(!isset($Settings['SQLThemes'])) {
-       $Settings['SQLThemes'] = 'off'; }
-if($Settings['SQLThemes']!="on"&&
-       $Settings['SQLThemes']!="off") {
-       $Settings['SQLThemes'] = 'off'; }
-if(!isset($Settings['board_name'])&&isset($SettInfo['board_name'])) {
-       $Settings['board_name'] = $SettInfo['board_name']; }
-if(!isset($SettInfo['board_name'])&&isset($Settings['board_name'])) {
-       $SettInfo['board_name'] = $Settings['board_name']; }
-if($Settings['board_name']!=$SettInfo['board_name']) {
-       $SettInfo['board_name'] = $Settings['board_name']; }
-if(!isset($Settings['VerCheckURL'])) {
-       $Settings['VerCheckURL'] = ""; }
-if(!isset($Settings['IPCheckURL'])) {
-       $Settings['IPCheckURL'] = ""; }
-if(!isset($Settings['log_config_format'])) {
-       $Settings['log_config_format'] = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""; }
-if(!isset($Settings['idb_time_format'])) { 
-       $Settings['idb_time_format'] = "g:i A"; }
-if(!isset($Settings['idb_date_format'])) { 
-       $Settings['idb_date_format'] = "F j Y"; }
-?>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-<?php 
-require($SettDir['admin'].'table.php'); 
-if($_GET['act']=="delsessions"&&$GroupInfo['ViewDBInfo']=="yes") {
-$time = $utccurtime->getTimestamp() - ini_get("session.gc_maxlifetime");
-//$sqlg = sql_pre_query('DELETE FROM \"'.$Settings['sqltable'].'sessions\" WHERE \"expires\" < UNIX_TIMESTAMP();', array(null));
-$sqlgc = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" < %i", array($time));
-sql_query($sqlgc,$SQLStat);
-$_POST['update'] = "now"; $_GET['act'] = "optimize"; }
-if($_GET['act']=="enablesthemes"&&$GroupInfo['ViewDBInfo']=="yes"&&$Settings['SQLThemes']=="off") {
-$Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
-$Settings['board_name'] = fixbamps($Settings['board_name']);
-$Settings['board_name'] = remove_spaces($Settings['board_name']);
-$Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
-$SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
-$SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
-$SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
-$SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Author'] = fixbamps($SettInfo['Author']);
-$SettInfo['Author'] = remove_spaces($SettInfo['Author']);
-$SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
-$SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
-$SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
-$SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
-$SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Description'] = fixbamps($SettInfo['Description']);
-$SettInfo['Description'] = remove_spaces($SettInfo['Description']);
-$SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
-$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['sqltype'] = ".null_string($Settings['sqltype']).";\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['SQLThemes'] = 'on';\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['start_date'] = ".null_string($Settings['start_date']).";\n".
-"\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
-"\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
-"\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
-"\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
-"\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
-"\$Settings['sql_charset'] = ".null_string($Settings['sql_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['vercheck'] = ".null_string($Settings['vercheck']).";\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($OldSettings['fixpathinfo']).";\n".
-"\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
-"\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
-"\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\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['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
-"\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
-"\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
-"\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
-"\$Settings['BoardUUID'] = ".null_string(base64_encode($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['logs'] = ".null_string($SettDir['logs']).";\n".
-"\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
-"\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
-"\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
-"\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
-"\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
-"\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
-"\$SettDir['mplayer'] = ".null_string($SettDir['mplayer']).";\n".
-"\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
-$BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
-$BoardSettings = $pretext.$settcheck.$BoardSettings;
-$fp = fopen("settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("settingsbak.php","w+");
-fwrite($fp, $BoardSettingsBak);
-fclose($fp);
-$Settings['SQLThemes'] = "on";
-$_POST['update'] = "now"; $_GET['act'] = "resyncthemes"; }
-if(($_GET['act']=="themelist"&&$GroupInfo['ViewDBInfo']=="yes")||
-       ($_GET['act']=="gettheme"&&$_POST['act']=="gettheme"&&$GroupInfo['ViewDBInfo']=="yes")) {
-if($_GET['act']=="gettheme"&&$_POST['act']=="gettheme"&&$_POST['GetTheme']==null) {
-$_GET['act'] = "themelist"; $_POST['act'] = ""; }
-if($_GET['act']=="gettheme"&&$_POST['act']=="gettheme"&&$_POST['GetTheme']=="None") {
-$_GET['act'] = "themelist"; $_POST['act'] = ""; }
-$conn_id = ftp_connect("ftp.berlios.de",21,90);
-ftp_login($conn_id, "anonymous", "anonymous");
-ftp_pasv($conn_id, true);
-if($_GET['act']=="themelist") {
-ftp_chdir($conn_id, "/pub/idb/themes/"); }
-if($_GET['act']=="gettheme"&&$_POST['act']=="gettheme") {
-ftp_chdir($conn_id, "/pub/idb/themes/".$_POST['GetTheme']."/"); 
-ftp_get($conn_id, $SettDir['archive'].$_POST['GetTheme'].".tar", "./".$_POST['GetTheme'].".tar", FTP_BINARY); 
-untar($SettDir['archive'].$_POST['GetTheme'].".tar",$SettDir['themes'].$_POST['GetTheme']."/");
-unlink($SettDir['archive'].$_POST['GetTheme'].".tar"); 
-if($Settings['SQLThemes']=="off") { $_POST['update'] = "now"; }
-if($Settings['SQLThemes']=="on") {
-$_POST['update'] = "now"; $_GET['act'] = "resyncthemes"; } }
-if($_GET['act']=="themelist") {
-$themelist = ftp_nlist($conn_id, ".");
-$it = 0; $numt = count($themelist);
-$themeact = url_maker($exfile['admin'],$Settings['file_ext'],"act=gettheme",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']);
-$admincptitle = " ".$ThemeSet['TitleDivider']." Theme Setup";
-?>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $themeact; ?>">Theme Setup</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $themeact; ?>">Theme Setup</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Theme Setup</th>
-</tr>
-<tr class="TableMenuRow3" id="NotePadRow">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $themeact; ?>"><div style="text-align: center;">
-<label class="TextBoxLabel" for="GetTheme">Install Theme:</label><br />
-<select size="1" name="GetTheme" id="GetTheme" class="TextBox">
-<option value="None">None</option>
-<?php
-while ($it < $numt) {
-if(!file_exists($SettDir['themes'].$themelist[$it])) {
-echo "<option value=\"".$themelist[$it]."\">".$themelist[$it]."</option>\n"; }
-++$it; }
-?>
-</select><br />
-<input type="hidden" name="act" value="gettheme" style="display: none;" />
-<input type="submit" value="Install" />
-</div></form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } ftp_close($conn_id); }
-if($_GET['act']=="resyncthemes"&&$GroupInfo['ViewDBInfo']=="yes"&&$Settings['SQLThemes']=="on") {
-$time = $utccurtime->getTimestamp() - ini_get("session.gc_maxlifetime");
-//$sqlg = sql_pre_query('DELETE FROM \"'.$Settings['sqltable'].'sessions\" WHERE \"expires\" < UNIX_TIMESTAMP();', array(null));
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="cubrid") {
-$sqlgc = sql_pre_query("TRUNCATE TABLE \"".$Settings['sqltable']."themes\"", array(null));
-sql_query($sqlgc,$SQLStat);
-$sqlgc = sql_pre_query("ALTER TABLE \"".$Settings['sqltable']."themes\" AUTO_INCREMENT=1", array(null));
-sql_query($sqlgc,$SQLStat); }
-if($Settings['sqltype']=="pgsql") {
-$sqlgc = sql_pre_query("TRUNCATE TABLE \"".$Settings['sqltable']."themes\"", array(null));
-sql_query($sqlgc,$SQLStat);
-$sqlgc = sql_pre_query("SELECT setval('".$Settings['sqltable']."themes_id_seq', 1, false);", array(null));
-sql_query($sqlgc,$SQLStat); }
-if($Settings['sqltype']=="sqlite") {
-$sqlgc = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."themes\";", array(null));
-sql_query($sqlgc,$SQLStat); }
-$skindir = dirname(realpath("sql.php"))."/".$SettDir['themes'];
-if ($handle = opendir($skindir)) { $dirnum = null;
-   while (false !== ($file = readdir($handle))) {
-          if ($dirnum==null) { $dirnum = 0; }
-          if (is_dir($skindir.$file)) {
-          if (file_exists($skindir.$file."/info.php")) {
-                  if ($file != "." && $file != "..") {
-          include($skindir.$file."/info.php");
-       $themelist[$dirnum] =  $file;
-          ++$dirnum; } } } }
-   closedir($handle); asort($themelist);
-   $themenum=count($themelist); $themei=0; 
-   while ($themei < $themenum) {
-   include($skindir.$themelist[$themei]."/settings.php");
-   $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".
-   "('%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']));
-   sql_query($query,$SQLStat);
-   ++$themei; } }
-$themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_GET['theme']));
-$themeresult=sql_query($themequery,$SQLStat);
-$themenum=sql_num_rows($themeresult);
-require($SettDir['inc'].'sqlthemes.php');
-$_POST['update'] = "now"; $_GET['act'] = "optimize"; }
-if($_GET['act']=="optimize"&&$GroupInfo['ViewDBInfo']=="yes") {
-$TablePreFix = $Settings['sqltable'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TableChCk = array_map("add_prefix",$TableChCk);
-$tcount = count($TableChCk); $ti = 0;
-$TblOptimized = 0;
-if($Settings['sqltype']!="sqlite") {
-while ($ti < $tcount) {
-if(isset($OptimizeAr["Msg_text"])) { unset($OptimizeAr["Msg_text"]); }
-if(isset($OptimizeAr[3])) { unset($OptimizeAr[3]); }
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli") {
-if(isset($_GET['subact']) && $_GET['subact']=="repair") {
-       $RepairTea = sql_query(sql_pre_query("REPAIR TABLE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
-$OptimizeTea = sql_query(sql_pre_query("OPTIMIZE TABLE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
-if($Settings['sqltype']=="cubrid") {
-$OptimizeTea = sql_query(sql_pre_query("UPDATE STATISTICS ON \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
-if($Settings['sqltype']=="pgsql") {
-$OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="cubrid") {
-$OptimizeAr = sql_fetch_array($OptimizeTea);
-if(!isset($OptimizeAr["Msg_text"])&&
-       isset($OptimizeAr[3])) { $OptimizeAr["Msg_text"] = $OptimizeAr[3]; }
-if($OptimizeAr["Msg_text"]=="OK") { 
-       ++$TblOptimized; } } ++$ti; } }
-if($Settings['sqltype']=="sqlite") {
-$OptimizeTea = sql_query(sql_pre_query("VACUUM", array(null)),$SQLStat); }
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="cubrid") {
-$OutPutLog = "MySQL Output: ".$TblOptimized." tables optimized."; }
-if($Settings['sqltype']=="pgsql") {
-$OutPutLog = "PGSQL Output: All tables optimized."; }
-if($Settings['sqltype']=="sqlite") {
-$OutPutLog = "SQLite Output: All tables optimized."; }
-if($Settings['sqltype']=="cubrid") {
-$OutPutLog = "CUBRID Output: All tables optimized."; }
-$_POST['update'] = "now"; $_GET['act'] = "view"; }
-?>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php if($_POST['update']=="now"&&$_GET['act']!=null) {
-$updateact = url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"3");
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?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>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?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>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-<?php if(isset($OutPutLog)) { echo "<br />".$OutPutLog; } ?>
-<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>
-<?php } if($_GET['act']=="view"&&$_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$Notes=sql_result($result,$i,"Notes");
-$noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
-$admincptitle = " ".$ThemeSet['TitleDivider']." Admin CP";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">NotePad</th>
-</tr>
-<tr class="TableMenuRow3" id="NotePadRow">
-<td class="TableMenuColumn3">
-<form method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
-<label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
-<textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
-<input type="hidden" name="act" value="view" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
-</div></form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_GET['act']=="settings"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Settings Manager";
-$mguerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE (\"Name\"<>'%s') ORDER BY \"id\" ASC", array("Admin"));
-$mgresults=sql_query($mguerys,$SQLStat);
-$mnum=sql_num_rows($mgresults);
-$mi = 0;
-while ($mi < $mnum) {
-$MGroups[$mi]=sql_result($mgresults,$mi,"Name");
-++$mi; }
-sql_free_result($mgresults);
-if($Settings['vercheck']===1) {
-$AdminCheckURL = url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck&redirect=on",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); }
-if($Settings['vercheck']===2) {
-$AdminCheckURL = url_maker($exfile['admin'],$Settings['file_ext'],"act=vercheck&vercheck=newtype&redirect=on",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); }
-$AddChkURL = null;
-if(isset($_GET['menu'])&&$_GET['menu']=="main") { $AddChkURL = "&menu=main"; }
-// http://www.tutorialspoint.com/php/php_function_timezone_identifiers_list.htm
-$timezone_identifiers = DateTimeZone::listIdentifiers();
-//$timezone_identifiers = timezone_identifiers_list();
-$zonelist['africa'] = array();
-$zonelist['america'] = array();
-$zonelist['antarctica'] = array();
-$zonelist['asia'] = array();
-$zonelist['atlantic'] = array();
-$zonelist['australia'] = array();
-$zonelist['europe'] = array();
-$zonelist['indian'] = array();
-$zonelist['pacific'] = array();
-$zonelist['etcetera'] = array();
-for ($i=0; $i < count($timezone_identifiers); $i++) {
-    $zonelookup = explode("/", $timezone_identifiers[$i]);
-    if(count($zonelookup)==1) { array_push($zonelist['etcetera'], array($timezone_identifiers[$i], $timezone_identifiers[$i])); }
-    if(count($zonelookup)>1) { 
-        if($zonelookup[0]=="Africa") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['africa'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['africa'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="America") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['america'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['america'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Antarctica") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['antarctica'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['antarctica'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Asia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['asia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['asia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Atlantic") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['atlantic'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['atlantic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Australia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['australia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['australia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Europe") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['europe'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['europe'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Indian") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['indian'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['indian'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Pacific") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['pacific'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['pacific'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-    }
-}
-
-$deftzstarttime = new DateTime();
-$deftzstarttime->setTimestamp($Settings['start_date']);
-$deftzstarttime->setTimezone($deftz);
-$utctzstarttime = new DateTime();
-$utctzstarttime->setTimestamp($Settings['start_date']);
-$utctzstarttime->setTimezone($utctz);
-$servtzstarttime = new DateTime();
-$servtzstarttime->setTimestamp($Settings['start_date']);
-$servtzstarttime->setTimezone($servtz);
-$usertzstarttime = new DateTime();
-$usertzstarttime->setTimestamp($Settings['start_date']);
-$usertzstarttime->setTimezone($usertz);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?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>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?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>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Setting for iDB: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<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']); ?>">
-<table style="text-align: left;">
-<tr>
-       <td style="width: 50%;"><span class="TextBoxLabel" title="Using User Time Zone">[User TimeZone] Install Date:</span></td>
-       <td style="width: 50%;"><?php echo $usertzstarttime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']." P"); ?></td>
-</tr><tr>
-       <td style="width: 50%;"><span class="TextBoxLabel" title="Using Board Time Zone">[Board TimeZone] Install Date:</span></td>
-       <td style="width: 50%;"><?php echo $servtzstarttime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']." P"); ?></td>
-</tr><tr>
-       <td style="width: 50%;"><span class="TextBoxLabel" title="Using Server Time Zone">[Server TimeZone] Install Date:</span></td>
-       <td style="width: 50%;"><?php echo $deftzstarttime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']." P"); ?></td>
-</tr><tr>
-       <td style="width: 50%;"><span class="TextBoxLabel" title="Using UTC Time Zone">[UTC TimeZone] Install Date:</span></td>
-       <td style="width: 50%;"><?php echo $utctzstarttime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']." P"); ?></td>
-</tr><?php if($GroupInfo['ViewDBInfo']=="yes") { 
-?><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Forum Software Version:</span></td>
-       <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>
-</tr><tr>
-       <td style="width: 50%;"><span class="TextBoxLabel">Forum UUID:</span></td>
-       <td style="width: 50%;"><?php echo $Settings['BoardUUID']; ?></td>
-</tr><tr id="clickhere" style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Version Checker:</span></td>
-       <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>
-</tr><?php if($OSType!=""&&isset($OSType)) { 
-?><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Server Operating System:</span></td>
-       <td style="width: 50%;"><?php echo $OSType; ?></td>
-</tr><?php } ?><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Current PHP Version:</span></td>
-       <td style="width: 50%;"><?php echo "PHP Version ".phpversion(); ?></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Zend Engine Version:</span></td>
-       <td style="width: 50%;"><?php echo "Zend Version ".zend_version(); ?></td>
-</tr><?php } ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="BoardURL">Insert The Board URL:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="BoardURL" size="20" id="BoardURL" value="<?php echo $Settings['idburl']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="WebURL">Insert The WebSite URL:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="WebURL" size="20" id="WebURL" value="<?php echo $Settings['weburl']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="PassHashType">Hash passwords with:</label></td>
-       <td style="width: 50%;"><select id="PassHashType" name="PassHashType" class="TextBox">
-<?php // PHP 5 hash algorithms to functions :o 
-if(function_exists('hash')&&function_exists('hash_algos')) {
-if(in_array("md2",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="md2") { echo " selected=\"selected\""; } ?> value="md2">MD2</option>
-<?php } if(in_array("md4",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="md4") { echo " selected=\"selected\""; } ?> value="md4">MD4</option>
-<?php } if(in_array("md5",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="md5") { echo " selected=\"selected\""; } ?> value="md5">MD5</option>
-<?php } if(in_array("gost",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="gost") { echo " selected=\"selected\""; } ?> value="gost">GOST</option>
-<?php } if(in_array("joaat",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="joaat") { echo " selected=\"selected\""; } ?> value="joaat">JOAAT</option>
-<?php } if(in_array("sha1",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="sha1") { echo " selected=\"selected\""; } ?> value="sha1">SHA1</option>
-<?php } if(in_array("sha224",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="sha224") { echo " selected=\"selected\""; } ?> value="sha224">SHA224</option>
-<?php } if(in_array("sha256",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="sha256") { echo " selected=\"selected\""; } ?> value="sha256">SHA256</option>
-<?php } if(in_array("sha384",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="sha384") { echo " selected=\"selected\""; } ?> value="sha384">SHA384</option>
-<?php } if(in_array("sha512",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="sha512") { echo " selected=\"selected\""; } ?> value="sha512">SHA512</option>
-<?php } if(in_array("ripemd128",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="ripemd128") { echo " selected=\"selected\""; } ?> value="ripemd128">RIPEMD128</option>
-<?php } if(in_array("ripemd160",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="ripemd160") { echo " selected=\"selected\""; } ?> value="ripemd160">RIPEMD160</option>
-<?php } if(in_array("ripemd256",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="ripemd256") { echo " selected=\"selected\""; } ?> value="ripemd256">RIPEMD256</option>
-<?php } if(in_array("ripemd320",hash_algos())) { ?>
-<option<?php if($Settings['use_hashtype']=="ripemd320") { echo " selected=\"selected\""; } ?> value="ripemd320">RIPEMD320</option>
-<?php } } 
-if(!function_exists('hash')&&!function_exists('hash_algos')) { ?>
-<option<?php if($Settings['use_hashtype']=="md5") { echo " selected=\"selected\""; } ?> value="md5">MD5</option>
-<option<?php if($Settings['use_hashtype']=="sha1") { echo " selected=\"selected\""; } ?> value="sha1">SHA1</option>
-<?php } ?>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestGroup">Insert The Guest Group:</label></td>
-       <td style="width: 50%;"><select id="GuestGroup" name="GuestGroup" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['GuestGroup']; ?>">Old Value (<?php echo $Settings['GuestGroup']; ?>)</option>
-<?php $gi = 0; $gnum = count($MGroups);
-while ($gi < $gnum) { ?>
-<option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
-<?php ++$gi; } ?>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemberGroup">Insert The Member Group:</label></td>
-       <td style="width: 50%;"><select id="MemberGroup" name="MemberGroup" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['MemberGroup']; ?>">Old Value (<?php echo $Settings['MemberGroup']; ?>)</option>
-<?php $gi = 0; $gnum = count($MGroups);
-while ($gi < $gnum) { ?>
-<option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
-<?php ++$gi; } ?>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ValidateGroup">Insert The Validate Group:</label></td>
-       <td style="width: 50%;"><select id="ValidateGroup" name="ValidateGroup" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['ValidateGroup']; ?>">Old Value (<?php echo $Settings['ValidateGroup']; ?>)</option>
-<?php $gi = 0; $gnum = count($MGroups);
-while ($gi < $gnum) { ?>
-<option value="<?php echo $MGroups[$gi]; ?>"><?php echo $MGroups[$gi]; ?></option>
-<?php ++$gi; } ?>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="AdminValidate">Enable validate new members:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="AdminValidate" id="AdminValidate">
-       <option<?php if($Settings['AdminValidate']=="off") { echo " selected=\"selected\""; } ?> value="off">no</option>
-       <option<?php if($Settings['AdminValidate']=="on") { echo " selected=\"selected\""; } ?> value="on">yes</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="max_posts">Max replies per page:</label></td>
-       <td style="width: 50%;"><select id="max_posts" name="max_posts" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="max_topics">Max topics per page:</label></td>
-       <td style="width: 50%;"><select id="max_topics" name="max_topics" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="max_memlist">Max members per page:</label></td>
-       <td style="width: 50%;"><select id="max_memlist" name="max_memlist" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_memlist']; ?>">Old Value (<?php echo $Settings['max_memlist']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="max_pmlist">Max pms per page:</label></td>
-       <td style="width: 50%;"><select id="max_pmlist" name="max_pmlist" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="hot_topic_num">Number of replies for hot topic:</label></td>
-       <td style="width: 50%;"><select id="hot_topic_num" name="hot_topic_num" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['hot_topic_num']; ?>">Old Value (<?php echo $Settings['hot_topic_num']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" title="Can save some bandwidth." for="UseGzip">Enable HTTP Compression:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="UseGzip" id="UseGzip">
-       <option<?php if($Settings['use_gzip']=="off") { echo " selected=\"selected\""; } ?> value="off">No</option>
-       <option<?php if($Settings['use_gzip']=="on") { echo " selected=\"selected\""; } ?> value="on">Yes</option>
-       <option<?php if($Settings['use_gzip']=="gzip") { echo " selected=\"selected\""; } ?> value="gzip">Only GZip</option>
-       <option<?php if($Settings['use_gzip']=="deflate") { echo " selected=\"selected\""; } ?> value="deflate">Only Deflate</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLType">HTML Type to use:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLType" id="HTMLType">
-       <!--<option<?php if($Settings['html_type']=="xhtml10") { echo " selected=\"selected\""; } ?> value="xhtml10">XHTML 1.0</option>-->
-       <!--<option<?php if($Settings['html_type']=="xhtml11") { echo " selected=\"selected\""; } ?> value="xhtml11">XHTML 1.1</option>-->
-       <option<?php if($Settings['html_type']=="html5") { echo " selected=\"selected\""; } ?> value="html5">HTML 5</option>
-       <option<?php if($Settings['html_type']=="xhtml5") { echo " selected=\"selected\""; } ?> value="xhtml5">XHTML 5</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="OutPutType">Output file as:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="OutPutType" id="OutPutType">
-       <option<?php if($Settings['output_type']=="html") { echo " selected=\"selected\""; } ?> value="html">HTML</option>
-       <option<?php if($Settings['output_type']=="xhtml") { echo " selected=\"selected\""; } ?> value="xhtml">XHTML</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
-       <td style="width: 50%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
-<optgroup label="Africa">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['africa']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['africa'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['africa'][$i][1]."\">".str_replace("_", " ", $zonelist['africa'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="America">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['america']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['america'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['america'][$i][1]."\">".str_replace("_", " ", $zonelist['america'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Antarctica">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['antarctica']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['antarctica'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['antarctica'][$i][1]."\">".str_replace("_", " ", $zonelist['antarctica'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Asia">
-<?php
-for ($i=0; $i < count($zonelist['asia']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['asia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['asia'][$i][1]."\">".str_replace("_", " ", $zonelist['asia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Atlantic">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['atlantic']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['atlantic'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['atlantic'][$i][1]."\">".str_replace("_", " ", $zonelist['atlantic'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Australia">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['australia']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['australia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['australia'][$i][1]."\">".str_replace("_", " ", $zonelist['australia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Europe">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['europe']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['europe'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['europe'][$i][1]."\">".str_replace("_", " ", $zonelist['europe'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Indian">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['indian']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['indian'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['indian'][$i][1]."\">".str_replace("_", " ", $zonelist['indian'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Pacific">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['pacific']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['pacific'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['pacific'][$i][1]."\">".str_replace("_", " ", $zonelist['pacific'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Etcetera">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['etcetera']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['etcetera'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['etcetera'][$i][1]."\">".str_replace("_", " ", $zonelist['etcetera'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DefaultTheme">Default Theme:</label></td>
-       <td style="width: 50%;"><select id="DefaultTheme" name="DefaultTheme" class="TextBox"><?php
-if($Settings['SQLThemes']=="off") {
-$skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
-if ($handle = opendir($skindir)) { $dirnum = null;
-   while (false !== ($file = readdir($handle))) {
-          if ($dirnum==null) { $dirnum = 0; }
-          if (is_dir($skindir.$file)&&file_exists($skindir.$file."/info.php")) {
-                  if ($file != "." && $file != "..") {
-          include($skindir.$file."/info.php");
-          if($Settings['DefaultTheme']==$file) {
-          $themelist[$dirnum] =  "<option selected=\"selected\" value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
-          if($Settings['DefaultTheme']!=$file) {
-       $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
-          ++$dirnum; } } }
-   closedir($handle); asort($themelist);
-   $themenum=count($themelist); $themei=0; 
-   while ($themei < $themenum) {
-   echo $themelist[$themei]."\n";
-   ++$themei; } } }
-if($Settings['SQLThemes']=="on") {
-$sknquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" ORDER BY \"id\" ASC, \"Name\" ASC", array(null));
-$sknresult=sql_query($sknquery,$SQLStat);
-$sknum=sql_num_rows($sknresult);
-$skni=0;
-while ($skni < $sknum) {
-$ThemeInfo['Name'] = sql_result($sknresult,$skni,"Name");
-$ThemeInfo['ThemeName'] = sql_result($sknresult,$skni,"ThemeName");
-if($Settings['DefaultTheme']==$ThemeInfo['Name']) {
-echo "<option selected=\"selected\" value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n"; }
-if($Settings['DefaultTheme']!=$ThemeInfo['Name']) {
-echo "<option value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n"; }
-++$skni; }
-} ?></select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="enable_https">Enable HTTPS:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="enable_https" id="enable_https">
-       <option<?php if($Settings['enable_https']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
-       <option<?php if($Settings['enable_https']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="enable_rss">Enable RSS:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="enable_rss" id="enable_rss">
-       <option<?php if($Settings['enable_rss']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
-       <option<?php if($Settings['enable_rss']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="enable_search">Enable search:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="enable_search" id="enable_search">
-       <option<?php if($Settings['enable_search']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
-       <option<?php if($Settings['enable_search']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="TestReferer">Test Referering URL:</label></td>
-       <td style="width: 50%;"><select id="TestReferer" name="TestReferer" class="TextBox">
-<option<?php if($Settings['TestReferer']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
-<option<?php if($Settings['TestReferer']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
-       <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>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
-       <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>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBHTTPLogger">Log Every HTTP Requests:</label></td>
-       <td style="width: 50%;"><select id="iDBHTTPLogger" name="iDBHTTPLogger" class="TextBox">
-<option<?php if($Settings['log_http_request']=="on") { echo " selected=\"selected\""; } ?> value="on">on</option>
-<option<?php if($Settings['log_http_request']=="off") { echo " selected=\"selected\""; } ?> value="off">off</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBLoggerFormat">Insert The Format for HTTP Logger:</label></td>
-       <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>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<?php if($GroupInfo['ViewDBInfo']=="yes") { ?>
-<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>
-<?php } ?>
-<input type="hidden" name="act" value="settings" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Apply" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="settings"&&$_POST['update']=="now"&&$_GET['act']=="settings"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
-$_POST  = array_map("rsq", $_POST);
-if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
-       $Settings['BoardUUID'] = rand_uuid("rand"); }
-$Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
-$Settings['board_name'] = fixbamps($Settings['board_name']);
-$Settings['board_name'] = remove_spaces($Settings['board_name']);
-$Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
-$SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
-$SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
-$SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
-$SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Author'] = fixbamps($SettInfo['Author']);
-$SettInfo['Author'] = remove_spaces($SettInfo['Author']);
-$SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
-$SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
-$SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
-$SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
-$SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Description'] = fixbamps($SettInfo['Description']);
-$SettInfo['Description'] = remove_spaces($SettInfo['Description']);
-$SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
-$_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['charset']);
-$_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
-$_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
-$_POST['WebURL'] = remove_spaces($_POST['WebURL']);
-$_POST['iDBTimeFormat'] = convert_strftime($_POST['iDBTimeFormat']);
-$_POST['iDBDateFormat'] = convert_strftime($_POST['iDBDateFormat']);
-$Settings['idb_time_format'] = $_POST['iDBTimeFormat'];
-$Settings['idb_date_format'] = $_POST['iDBDateFormat'];
-$Settings['log_http_request'] = $_POST['iDBHTTPLogger'];
-$Settings['log_config_format'] = $_POST['iDBLoggerFormat'];
-if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
-if($_POST['HTMLType']=="xhtml5") { $_POST['OutPutType'] = "xhtml"; }
-if(!isset($_POST['PassHashType'])) {
-       $_POST['PassHashType'] = "sha1"; }
-if(!function_exists('hash')||!function_exists('hash_algos')) {
-if($_POST['PassHashType']!="md5"&&
-   $_POST['PassHashType']!="sha1") {
-       $_POST['PassHashType'] = "sha1"; } }
-if(function_exists('hash')&&function_exists('hash_algos')) {
-if(!in_array($_POST['PassHashType'],hash_algos())) {
-       $_POST['PassHashType'] = "sha1"; }
-if($_POST['PassHashType']!="md2"&&
-   $_POST['PassHashType']!="md4"&&
-   $_POST['PassHashType']!="md5"&&
-   $_POST['PassHashType']!="sha1"&&
-   $_POST['PassHashType']!="sha224"&&
-   $_POST['PassHashType']!="sha256"&&
-   $_POST['PassHashType']!="sha384"&&
-   $_POST['PassHashType']!="sha512"&&
-   $_POST['PassHashType']!="ripemd128"&&
-   $_POST['PassHashType']!="ripemd160"&&
-   $_POST['PassHashType']!="ripemd256"&&
-   $_POST['PassHashType']!="ripemd320") {
-       $_POST['PassHashType'] = "sha1"; } }
-$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['sqltype'] = ".null_string($Settings['sqltype']).";\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['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\n".
-"\$Settings['use_gzip'] = ".null_string($_POST['UseGzip']).";\n".
-"\$Settings['html_type'] = ".null_string($_POST['HTMLType']).";\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']).";\n".
-"\$Settings['start_date'] = ".null_string($Settings['start_date']).";\n".
-"\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
-"\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
-"\$Settings['use_hashtype'] = ".null_string($_POST['PassHashType']).";\n".
-"\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
-"\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
-"\$Settings['sql_charset'] = ".null_string($Settings['sql_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['vercheck'] = ".null_string($Settings['vercheck']).";\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($OldSettings['fixpathinfo']).";\n".
-"\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
-"\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
-"\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\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['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
-"\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
-"\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
-"\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
-"\$Settings['BoardUUID'] = ".null_string(base64_encode($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['logs'] = ".null_string($SettDir['logs']).";\n".
-"\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
-"\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
-"\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
-"\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
-"\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
-"\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
-"\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
-$BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
-$BoardSettings = $pretext.$settcheck.$BoardSettings;
-$fp = fopen("settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("settingsbak.php","w+");
-fwrite($fp, $BoardSettingsBak);
-fclose($fp); } if($_GET['act']=="sql"&&$_POST['update']!="now"&&$GroupInfo['ViewDBInfo']=="yes") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Database Manager";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?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>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?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>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing SQL Settings for iDB: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<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']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Database Server:</span></td>
-       <td style="width: 50%;"><?php echo $DBType['Server']; ?></td>
-</tr><?php if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||
-       $Settings['sqltype']=="cubrid") { 
-?><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Database Client:</span></td>
-       <td style="width: 50%;"><?php echo $DBType['Client']; ?></td>
-</tr><?php } if($Settings['sqltype']=="sqlite") { 
-?><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Database File Size:</span></td>
-       <td style="width: 50%;"><?php echo sprintf("%u", filesize($Settings['sqldb']))." bytes"; ?></td>
-</tr><?php } if($Settings['sqltype']=="cubrid") { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">CUBRID PHP:</span></td>
-       <td style="width: 50%;"><?php echo $DBType['PHP']; ?></td>
-</tr><?php } ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseUserName">Insert Database User Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="DatabaseUserName" class="TextBox" id="DatabaseUserName" size="20" value="<?php echo $Settings['sqluser']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabasePassword">Insert Database Password:</label></td>
-       <td style="width: 50%;"><input type="password" name="DatabasePassword" class="TextBox" id="DatabasePassword" size="20" value="<?php echo $Settings['sqlpass']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseName">Insert Database Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="DatabaseName" class="TextBox" id="DatabaseName" size="20" value="<?php echo $Settings['sqldb']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseHost">Insert Database Host:</label></td>
-       <td style="width: 50%;"><input type="text" name="DatabaseHost" class="TextBox" id="DatabaseHost" size="20" value="<?php echo $Settings['sqlhost']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="tableprefix">Insert Table Prefix:<br /></label></td>
-       <td style="width: 50%;"><input type="text" name="tableprefix" class="TextBox" id="tableprefix" size="20" value="<?php echo $Settings['sqltable']; ?>" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="sql" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Apply" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="sql"&&$_POST['update']=="now"&&$_GET['act']=="sql"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes"&&
-       $GroupInfo['ViewDBInfo']=="yes") {
-$_POST  = array_map("rsq", $_POST);
-if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
-       $Settings['BoardUUID'] = rand_uuid("rand"); }
-$Settings['board_name'] = htmlspecialchars($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
-$Settings['board_name'] = fixbamps($Settings['board_name']);
-$Settings['board_name'] = remove_spaces($Settings['board_name']);
-$Settings['board_name'] = str_replace("\&#039;", "&#039;", $Settings['board_name']);
-$SettInfo['board_name'] = htmlspecialchars($SettInfo['board_name'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['board_name'] = fixbamps($SettInfo['board_name']);
-$SettInfo['board_name'] = remove_spaces($SettInfo['board_name']);
-$SettInfo['board_name'] = str_replace("\&#039;", "&#039;", $SettInfo['board_name']);
-$SettInfo['Author'] = htmlspecialchars($SettInfo['Author'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Author'] = fixbamps($SettInfo['Author']);
-$SettInfo['Author'] = remove_spaces($SettInfo['Author']);
-$SettInfo['Author'] = str_replace("\&#039;", "&#039;", $SettInfo['Author']);
-$SettInfo['Keywords'] = htmlspecialchars($SettInfo['Keywords'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Keywords'] = fixbamps($SettInfo['Keywords']);
-$SettInfo['Keywords'] = remove_spaces($SettInfo['Keywords']);
-$SettInfo['Keywords'] = str_replace("\&#039;", "&#039;", $SettInfo['Keywords']);
-$SettInfo['Description'] = htmlspecialchars($SettInfo['Description'], ENT_QUOTES, $Settings['charset']);
-$SettInfo['Description'] = fixbamps($SettInfo['Description']);
-$SettInfo['Description'] = remove_spaces($SettInfo['Description']);
-$SettInfo['Description'] = str_replace("\&#039;", "&#039;", $SettInfo['Description']);
-$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['sqltype'] = ".null_string($Settings['sqltype']).";\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['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\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['start_date'] = ".null_string($Settings['start_date']).";\n".
-"\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
-"\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
-"\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
-"\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
-"\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
-"\$Settings['sql_charset'] = ".null_string($Settings['sql_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['vercheck'] = ".null_string($Settings['vercheck']).";\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($OldSettings['fixpathinfo']).";\n".
-"\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
-"\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
-"\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\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['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
-"\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
-"\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
-"\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
-"\$Settings['BoardUUID'] = ".null_string(base64_encode($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['logs'] = ".null_string($SettDir['logs']).";\n".
-"\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
-"\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
-"\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
-"\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
-"\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
-"\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
-"\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
-$BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
-$BoardSettings = $pretext.$settcheck.$BoardSettings;
-$fp = fopen("settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("settingsbak.php","w+");
-fwrite($fp, $BoardSettingsBak);
-fclose($fp); } if($_GET['act']=="info"&&$_POST['update']!="now") {
-$admincptitle = " ".$ThemeSet['TitleDivider']." Board Info Manager";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?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>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?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>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Board Info: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<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']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="board_name">Insert board name:</label></td>
-       <td style="width: 50%;"><input type="text" name="board_name" class="TextBox" id="board_name" size="20" value="<?php echo $SettInfo['board_name']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="Author">Insert boards admin name:</label></td>
-       <td style="width: 50%;"><input type="text" name="Author" class="TextBox" id="Author" size="20" value="<?php echo $SettInfo['Author']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="Keywords">Insert keywords about this board:</label></td>
-       <td style="width: 50%;"><input type="text" name="Keywords" class="TextBox" id="Keywords" size="20" value="<?php echo $SettInfo['Keywords']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="Description">Insert description about this board:<br /></label></td>
-       <td style="width: 50%;"><input type="text" name="Description" class="TextBox" id="Description" size="20" value="<?php echo $SettInfo['Description']; ?>" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="info" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Apply" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="info"&&$_POST['update']=="now"&&$_GET['act']=="info"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']&&$GroupInfo['HasAdminCP']=="yes") {
-$_POST  = array_map("rsq", $_POST);
-if(!isset($Settings['BoardUUID'])||$Settings['BoardUUID']===null) {
-       $Settings['BoardUUID'] = rand_uuid("rand"); }
-$_POST['board_name'] = htmlspecialchars($_POST['board_name'], ENT_QUOTES, $Settings['charset']);
-$_POST['board_name'] = fixbamps($_POST['board_name']);
-$_POST['board_name'] = remove_spaces($_POST['board_name']);
-$_POST['board_name'] = str_replace("\&#039;", "&#039;", $_POST['board_name']);
-if($_POST['board_name']!=$Settings['board_name']&&
-       $Settings['SQLThemes']=="on") {
-       $logoquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."themes\" SET \"Logo\"='%s' WHERE \"Logo\"='%s'", array($_POST['board_name'],$Settings['board_name']));
-       sql_query($logo,$SQLStat); }
-$_POST['Author'] = htmlspecialchars($_POST['Author'], ENT_QUOTES, $Settings['charset']);
-$_POST['Author'] = fixbamps($_POST['Author']);
-$_POST['Author'] = remove_spaces($_POST['Author']);
-$_POST['Author'] = str_replace("\&#039;", "&#039;", $_POST['Author']);
-$_POST['Keywords'] = htmlspecialchars($_POST['Keywords'], ENT_QUOTES, $Settings['charset']);
-$_POST['Keywords'] = fixbamps($_POST['Keywords']);
-$_POST['Keywords'] = remove_spaces($_POST['Keywords']);
-$_POST['Keywords'] = str_replace("\&#039;", "&#039;", $_POST['Keywords']);
-$_POST['Description'] = htmlspecialchars($_POST['Description'], ENT_QUOTES, $Settings['charset']);
-$_POST['Description'] = fixbamps($_POST['Description']);
-$_POST['Description'] = remove_spaces($_POST['Description']);
-$_POST['Description'] = str_replace("\&#039;", "&#039;", $_POST['Description']);
-$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['sqltype'] = ".null_string($Settings['sqltype']).";\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['SQLThemes'] = ".null_string($Settings['SQLThemes']).";\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['start_date'] = ".null_string($Settings['start_date']).";\n".
-"\$Settings['idb_time_format'] = ".null_string($Settings['idb_time_format']).";\n".
-"\$Settings['idb_date_format'] = ".null_string($Settings['idb_date_format']).";\n".
-"\$Settings['use_hashtype'] = ".null_string($Settings['use_hashtype']).";\n".
-"\$Settings['charset'] = ".null_string($Settings['charset']).";\n".
-"\$Settings['sql_collate'] = ".null_string($Settings['sql_collate']).";\n".
-"\$Settings['sql_charset'] = ".null_string($Settings['sql_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['vercheck'] = ".null_string($Settings['vercheck']).";\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($OldSettings['fixpathinfo']).";\n".
-"\$Settings['fixbasedir'] = ".null_string($OldSettings['fixbasedir']).";\n".
-"\$Settings['fixcookiedir'] = ".null_string($OldSettings['fixcookiedir']).";\n".
-"\$Settings['fixredirectdir'] = ".null_string($OldSettings['fixredirectdir']).";\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['VerCheckURL'] = ".null_string($Settings['VerCheckURL']).";\n".
-"\$Settings['IPCheckURL'] = ".null_string($Settings['IPCheckURL']).";\n".
-"\$Settings['log_http_request'] = ".null_string($Settings['log_http_request']).";\n".
-"\$Settings['log_config_format'] = ".null_string($Settings['log_config_format']).";\n".
-"\$Settings['BoardUUID'] = ".null_string(base64_encode($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['logs'] = ".null_string($SettDir['logs']).";\n".
-"\$SettDir['archive'] = ".null_string($SettDir['archive']).";\n".
-"\$SettDir['misc'] = ".null_string($SettDir['misc']).";\n".
-"\$SettDir['sql'] = ".null_string($SettDir['sql']).";\n".
-"\$SettDir['admin'] = ".null_string($SettDir['admin']).";\n".
-"\$SettDir['sqldumper'] = ".null_string($SettDir['sqldumper']).";\n".
-"\$SettDir['mod'] = ".null_string($SettDir['mod']).";\n".
-"\$SettDir['themes'] = ".null_string($SettDir['themes']).";\n".$pretext2[3]."\n?>";
-$BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
-$BoardSettings = $pretext.$settcheck.$BoardSettings;
-$fp = fopen("settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("settingsbak.php","w+");
-fwrite($fp, $BoardSettingsBak);
-fclose($fp); } if($_POST['update']=="now"&&$_GET['act']!=null) {
-       $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div><?php } ?>
-</td></tr>
-</table>
-<div>&nbsp;</div>
diff --git a/inc/admin/members.php.bak b/inc/admin/members.php.bak
deleted file mode 100644 (file)
index 0bb31e8..0000000
+++ /dev/null
@@ -1,813 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: members.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="members.php"||$File3Name=="/members.php") {
-       require('index.php');
-       exit(); }
-
-// Check if we can goto admin cp
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-if(!isset($_POST['gid'])) { $_POST['gid'] = "0"; }
-if(!isset($_POST['search'])) { $_POST['search'] = "%"; }
-if(!is_numeric($_POST['gid'])) { $_POST['gid'] = "0"; }
-$Error = null; $errorstr = null;
-?>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-<?php 
-require($SettDir['admin'].'table.php'); 
-?>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php if($_POST['act']=="validate"&&$_POST['update']=="now"&&$_GET['act']=="validate"&&$_POST['id']=="0") {
-       $_POST['act'] = null; $_POST['update'] = null; }
-if($_GET['act']=="validate"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Validating Members";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=validate",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Validating Members Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=validate",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Validating Members Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Validating Members Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=validate",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Member to validate:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-$gquerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['ValidateGroup']));
-$gresults=sql_query($gquerys,$SQLStat);
-$VGroupID=sql_result($gresults,0,"id");
-sql_free_result($gresults);
-$getmemidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE (\"GroupID\"=%i AND \"id\"<>-1) OR (\"Validated\"='no' AND \"id\"<>-1)", array($VGroupID));
-$getmemidr=sql_query($getmemidq,$SQLStat);
-$getmemidnum=sql_num_rows($getmemidr);
-$getmemidi = 0;
-if($getmemidnum<1) { ?>
-       <option value="0">None</option>
-<?php }
-while ($getmemidi < $getmemidnum) {
-$getmemidID=sql_result($getmemidr,$getmemidi,"id");
-$getmemidName=sql_result($getmemidr,$getmemidi,"Name");
-?>
-<option value="<?php echo $getmemidID; ?>"><?php echo $getmemidName; ?></option>
-<?php ++$getmemidi; }
-sql_free_result($getmemidr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="validate" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Validate Member" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="validate"&&$_POST['update']=="now"&&$_GET['act']=="validate"&&$_POST['id']!="0") { 
-$mguerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['MemberGroup']));
-$mgresults=sql_query($mguerys,$SQLStat);
-$MGroupID=sql_result($mgresults,0,"id");
-sql_free_result($mgresults);
-$gquerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['ValidateGroup']));
-$gresults=sql_query($gquerys,$SQLStat);
-$VGroupID=sql_result($gresults,0,"id");
-sql_free_result($gresults);
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$VMemName=sql_result($result,$i,"Name");
-$VMemGroup=sql_result($result,$i,"GroupID");
-$VMemValidated=sql_result($result,$i,"Validated");
-$admincptitle = " ".$ThemeSet['TitleDivider']." Validating Members";
-redirect("refresh",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],FALSE),"4");
-if($VMemGroup==$VGroupID) {
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"='%s', \"Validated\"='%s' WHERE \"id\"=%i", array($MGroupID, "yes", $_POST['id']));
-sql_query($query,$SQLStat); }
-if($VMemGroup!=$VGroupID&&$VMemValidated=="no") {
-$query = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Validated\"='%s' WHERE \"id\"=%i", array("yes", $_POST['id']));
-sql_query($query,$SQLStat); }
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br /><?php echo $VMemName; ?> was validated successfully.<br /> <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-       </div>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } if($_POST['act']=="deletemember"&&$_POST['update']=="now"&&$_GET['act']=="deletemember"&&
-       ($_POST['id']=="0"||$_POST['id']=="1"||$_POST['id']=="-1")) {
-       $_POST['act'] = null; $_POST['update'] = null; }
-if($_GET['act']=="deletemember"&&$_POST['update']!="now") { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Deleting Members";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Deleting Members Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Deleting Members Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Deleting Members Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Member to delete:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-$getmemidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE (\"id\"<>-1 AND \"id\"<>1)", array(null));
-$getmemidr=sql_query($getmemidq,$SQLStat);
-$getmemidnum=sql_num_rows($getmemidr);
-$getmemidi = 0;
-if($getmemidnum<1) { ?>
-       <option value="0">None</option>
-<?php }
-while ($getmemidi < $getmemidnum) {
-$getmemidID=sql_result($getmemidr,$getmemidi,"id");
-$getmemidName=sql_result($getmemidr,$getmemidi,"Name");
-?>
-<option value="<?php echo $getmemidID; ?>"><?php echo $getmemidName; ?></option>
-<?php ++$getmemidi; }
-sql_free_result($getmemidr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="deletemember" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Delete Member" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="deletemember"&&$_POST['update']=="now"&&$_GET['act']=="deletemember"&&
-       ($_POST['id']!="0"||$_POST['id']!="1"||$_POST['id']!="-1")) { 
-$DMemName = GetUserName($_POST['id'],$Settings['sqltable']);
-$DMemName = $DMemName['Name'];
-if($DMemName!==null&&($_POST['id']!="0"||$_POST['id']!="1"||$_POST['id']!="-1")) { 
-$dmquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i", array($_POST['id']));
-sql_query($dmquery,$SQLStat);
-$dmquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i", array($_POST['id']));
-sql_query($dmquery,$SQLStat); 
-$dmgquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."events\" SET \"GuestName\"='%s',\"UserID\"=-1 WHERE \"UserID\"=%i", array($DMemName,$_POST['id']));
-sql_query($dmgquery,$SQLStat);
-$dmgquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."messenger\" SET \"GuestName\"='%s',\"SenderID\"=-1 WHERE \"SenderID\"=%i", array($DMemName,$_POST['id']));
-sql_query($dmgquery,$SQLStat);
-$dmgquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"GuestName\"='%s',\"UserID\"=-1 WHERE \"UserID\"=%i", array($DMemName,$_POST['id']));
-sql_query($dmgquery,$SQLStat);
-$dmgquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"GuestName\"='%s',\"UserID\"=-1 WHERE \"UserID\"=%i", array($DMemName,$_POST['id']));
-sql_query($dmgquery,$SQLStat); }
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br /><?php echo $DMemName; ?> was deleted successfully.<br /> <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-       </div>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } if($_POST['act']=="editmember"&&$_POST['update']=="now"&&$_GET['act']=="editmember"&&
-       ($_POST['id']=="0"||$_POST['id']=="-1")) {
-       $_POST['act'] = null; $_POST['update'] = null; }
-if($_GET['act']=="editmember"&&$_POST['update']!="now"&&!isset($_POST['id'])) { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Editing Members";
-$_POST['search'] = stripcslashes(htmlspecialchars($_POST['search'], ENT_QUOTES, $Settings['charset']));
-//$_POST['search'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['search']);
-$_POST['search'] = remove_spaces($_POST['search']);
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Editing Members Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Editing Members Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Members Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acpstool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="search">Search for member name:</label></td>
-       <td style="width: 50%;"><input type="text" name="search" class="TextBox" id="search" size="20" value="<?php echo $_POST['search']; ?>" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="submit" class="Button" value="Search" name="Apply_Changes" />
-</td></tr></table>
-</form>
-<?php if(isset($_POST['search'])) { ?>
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="id">Member to edit:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="id" id="id">
-<?php 
-$getmemidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\" LIKE '%s' AND (\"id\"<>-1)", array($_POST['search']));
-$getmemidr=sql_query($getmemidq,$SQLStat);
-$getmemidnum=sql_num_rows($getmemidr);
-$getmemidi = 0;
-if($getmemidnum<1) { ?>
-       <option value="0">None</option>
-<?php }
-while ($getmemidi < $getmemidnum) {
-$getmemidID=sql_result($getmemidr,$getmemidi,"id");
-$getmemidName=sql_result($getmemidr,$getmemidi,"Name");
-?>
-<option value="<?php echo $getmemidID; ?>"><?php echo $getmemidName; ?></option>
-<?php ++$getmemidi; }
-sql_free_result($getmemidr); ?>
-       </select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editmember" style="display: none;" />
-<input type="submit" class="Button" value="Edit Member" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form><?php } ?>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="editmember"&&$_POST['update']!="now"&&$_GET['act']=="editmember"&&
-       ($_POST['id']!="0"||$_POST['id']!="-1")) { 
-$admincptitle = " ".$ThemeSet['TitleDivider']." Editing Members";
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-if($num<1) {
-redirect("location",$rbasedir.url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$EditMem['ID']=sql_result($result,0,"id");
-$EditMem['Name']=sql_result($result,0,"Name");
-$EditMem['Email']=sql_result($result,0,"Email");
-$EditMem['GroupID']=sql_result($result,0,"GroupID");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($EditMem['GroupID']));
-$gresult=sql_query($gquery,$SQLStat);
-$EditMem['Group']=sql_result($gresult,0,"Name");
-sql_free_result($gresult);
-$EditMem['LevelID']=sql_result($result,0,"LevelID");
-$lquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($EditMem['LevelID']));
-$lresult=sql_query($lquery,$SQLStat);
-$EditMem['Level']=sql_result($lresult,0,"Name");
-sql_free_result($lresult);
-$EditMem['Validated']=sql_result($result,0,"Validated");
-$EditMem['HiddenMember']=sql_result($result,0,"HiddenMember");
-$EditMem['WarnLevel']=sql_result($result,0,"WarnLevel");
-$EditMem['BanTime']=sql_result($result,0,"BanTime");
-if($EditMem['BanTime']!=""&&$EditMem['BanTime']>1) {
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($EditMem['BanTime']);
-$tmpusrcurtime->setTimezone($utctz);
-$BanMonth=$tmpusrcurtime->format("m");
-$BanDay=$tmpusrcurtime->format("d");
-$BanYear=$tmpusrcurtime->format("Y");
-$EditMem['BanTime'] = $BanMonth."/".$BanDay."/".$BanYear; }
-$EditMem['Interests']=sql_result($result,0,"Interests");
-$EditMem['Signature']=sql_result($result,0,"Signature");
-$EditMem['Avatar']=sql_result($result,0,"Avatar");
-$EditMem['AvatarSize']=sql_result($result,0,"AvatarSize");
-$EditMem['Title']=sql_result($result,0,"Title");
-$EditMem['Website']=sql_result($result,0,"Website");
-$EditMem['Gender']=sql_result($result,0,"Gender");
-$EditMem['PostCount']=sql_result($result,0,"PostCount");
-$EditMem['Karma']=sql_result($result,0,"Karma");
-$EditMem['TimeZone']=sql_result($result,0,"TimeZone");
-$EditMem['DST']=sql_result($result,0,"DST");
-$EditMem['IP']=sql_result($result,0,"IP");
-$mpquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
-$mpresult=sql_query($mpquery,$SQLStat);
-$mpnum=sql_num_rows($mpresult);
-$EditMemPerm['PermissionID'] = sql_result($mpresult,0,"PermissionID");
-$EditMemPerm['CanViewBoard'] = sql_result($mpresult,0,"CanViewBoard");
-$EditMemPerm['CanViewOffLine'] = sql_result($mpresult,0,"CanViewOffLine");
-$EditMemPerm['CanEditProfile'] = sql_result($mpresult,0,"CanEditProfile");
-$EditMemPerm['CanAddEvents'] = sql_result($mpresult,0,"CanAddEvents");
-$EditMemPerm['CanPM'] = sql_result($mpresult,0,"CanPM");
-$EditMemPerm['CanSearch'] = sql_result($mpresult,0,"CanSearch");
-$EditMemPerm['CanDoHTML'] = sql_result($mpresult,0,"CanDoHTML");
-$EditMemPerm['CanUseBBTags'] = sql_result($mpresult,0,"CanUseBBTags");
-$EditMemPerm['CanViewIPAddress'] = sql_result($mpresult,0,"CanViewIPAddress");
-$EditMemPerm['CanViewUserAgent'] = sql_result($mpresult,0,"CanViewUserAgent");
-$EditMemPerm['FloodControl'] = sql_result($mpresult,0,"FloodControl");
-$EditMemPerm['SearchFlood'] = sql_result($mpresult,0,"SearchFlood");
-$EditMemPerm['HasModCP'] = sql_result($mpresult,0,"HasModCP");
-$EditMemPerm['HasAdminCP'] = sql_result($mpresult,0,"HasAdminCP");
-$EditMemPerm['ViewDBInfo'] = sql_result($mpresult,0,"ViewDBInfo");
-$MemIPList[0] = $EditMem['IP'];
-$MemIPArrayNum = 1;
-$MemPostIP = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"UserID\"=%i ORDER BY \"TimeStamp\" ASC ", array($EditMem['ID']));
-$mppresult = sql_query($MemPostIP,$SQLStat);
-$mppnum = sql_num_rows($mppresult);
-$mppi = 0;
-while ($mppi < $mppnum) {
-$MemPostCheckIP=sql_result($mppresult,$mppi,"IP");
-if(!in_array($MemPostCheckIP, $MemIPList)) {
-$MemIPList[$MemIPArrayNum] = $MemPostCheckIP;
-++$MemIPArrayNum; }
-$MemPostCheckEditIP=sql_result($mppresult,$mppi,"EditIP");
-if(!in_array($MemPostCheckEditIP, $MemIPList) && $MemPostCheckEditIP!="0") {
-$MemIPList[$MemIPArrayNum] = $MemPostCheckEditIP;
-++$MemIPArrayNum; }
-++$mppi; }
-sql_free_result($mppresult);
-$MemEventIP = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"UserID\"=%i ORDER BY \"TimeStamp\" ASC ", array($EditMem['ID']));
-$mepresult = sql_query($MemEventIP,$SQLStat);
-$mepnum = sql_num_rows($mepresult);
-$mepi = 0;
-while ($mepi < $mepnum) {
-$MemEventCheckIP=sql_result($mepresult,$mepi,"IP");
-if(!in_array($MemEventCheckIP, $MemIPList)) {
-$MemIPList[$MemIPArrayNum] = $MemEventCheckIP;
-++$MemIPArrayNum; }
-++$mepi; }
-sql_free_result($mepresult);
-$fullistnum = count($MemIPList);
-$fullisti = 0;
-$fulliplist = null;
-while($fullisti < $fullistnum) {
-$fulliplist = $fulliplist." <a onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$MemIPList[$fullisti])."\">".$MemIPList[$fullisti]."</a>";
-++$fullisti; }
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Editing Members Manager</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Editing Members Manager</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Editing Members Manager: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<tr class="TableMenuRow3">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" id="acptool" action="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">
-<table style="text-align: left;">
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?>
-<tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Members IP:</span></td>
-       <td style="width: 50%;"><a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$EditMem['IP']); ?>"><?php echo $EditMem['IP']; ?></a></td>
-</tr>
-<?php if($fulliplist!=null && $fullistnum>1) { ?>
-<tr style="text-align: left;">
-       <td style="width: 50%;"><span class="TextBoxLabel">Members Old IPs:</span></td>
-       <td style="width: 50%;"><?php echo $fulliplist; ?></td>
-</tr><?php } } ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemName">Members Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="MemName" class="TextBox" id="MemName" size="20" value="<?php echo $EditMem['Name']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemEmail">Members Email:</label></td>
-       <td style="width: 50%;"><input type="text" name="MemEmail" class="TextBox" id="MemEmail" size="20" value="<?php echo $EditMem['Email']; ?>" /></td>
-<?php if($EditMem['ID']!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="gid">New Group for Member:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="gid" id="gid">
-<?php 
-$getgrpidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE (\"Name\"<>'%s' AND \"Name\"<>'%s')", array($Settings['GuestGroup'],$Settings['ValidateGroup']));
-$getgrpidr=sql_query($getgrpidq,$SQLStat);
-$getgrpidnum=sql_num_rows($getgrpidr);
-$getgrpidi = 0;
-if($getgrpidnum<1) { ?>
-       <option value="0">None</option>
-<?php }
-while ($getgrpidi < $getgrpidnum) {
-$getgrpidID=sql_result($getgrpidr,$getgrpidi,"id");
-$getgrpidName=sql_result($getgrpidr,$getgrpidi,"Name");
-$GIDselected = null;
-if($getgrpidID==$EditMem['GroupID']) { 
-       $GIDselected = " selected=\"selected\""; }
-?>
-<option value="<?php echo $getgrpidID; ?>"<?php echo $GIDselected; ?>><?php echo $getgrpidName; ?></option>
-<?php ++$getgrpidi; }
-sql_free_result($getgrpidr); ?>
-       </select></td>
-<?php /*}*/ ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="lid">New Level for Member:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="lid" id="lid">
-<?php 
-$getlevidq = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE (\"Name\"<>'%s' AND \"id\"<>%i)", array("Guest",-1));
-$getlevidr=sql_query($getlevidq,$SQLStat);
-$getlevidnum=sql_num_rows($getlevidr);
-$getlevidi = 0;
-if($getlevidnum<1) { ?>
-       <option value="0">None</option>
-<?php }
-while ($getlevidi < $getlevidnum) {
-$getlevidID=sql_result($getlevidr,$getlevidi,"id");
-$getlevidName=sql_result($getlevidr,$getlevidi,"Name");
-$LIDselected = null;
-if($getlevidID==$EditMem['LevelID']) { 
-       $LIDselected = " selected=\"selected\""; }
-?>
-<option value="<?php echo $getlevidID; ?>"<?php echo $LIDselected; ?>><?php echo $getlevidName; ?></option>
-<?php ++$getlevidi; }
-sql_free_result($getlevidr); ?>
-       </select></td>
-<?php } ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemHidden">Hidden Member:</label></td>
-       <td style="width: 50%;"><select id="MemHidden" name="MemHidden" class="TextBox">
-<option selected="selected" value="<?php echo $EditMem['HiddenMember']; ?>">Old Value (<?php echo $EditMem['HiddenMember']; ?>)</option>
-<option value="no">No</option>
-<option value="yes">Yes</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemWarnLevel">Members Warn Level:</label></td>
-       <td style="width: 50%;"><input type="text" name="MemWarnLevel" class="TextBox" id="MemWarnLevel" size="20" value="<?php echo $EditMem['WarnLevel']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemBanTime" title="Enter date till user is banned in MM/DD/YYYY format. 0 means no ban and -1 means permanent ban.">Members Ban Time:</label></td>
-       <td style="width: 50%;"><input type="text" name="MemBanTime" class="TextBox" id="MemBanTime" size="20" value="<?php echo $EditMem['BanTime']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemPostCount">Members Post Count:</label></td>
-       <td style="width: 50%;"><input type="text" name="MemPostCount" class="TextBox" id="MemPostCount" size="20" value="<?php echo $EditMem['PostCount']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemKarma">Members Karma Count:</label></td>
-       <td style="width: 50%;"><input type="text" name="MemKarma" class="TextBox" id="MemKarma" size="20" value="<?php echo $EditMem['Karma']; ?>" /></td>
-<?php if($EditMem['ID']!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MemPermID">Members Permission ID:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="MemPermID" id="MemPermID">
-       <option <?php if($EditMemPerm['PermissionID']=="0") { echo "selected=\"selected\" "; } ?>value="0">use group info</option>
-<?php 
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="sqlite") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"PermissionID\" FROM \"".$Settings['sqltable']."permissions\"", array(null)); }
-if($Settings['sqltype']=="cubrid") {
-$getperidq = sql_pre_query("SELECT DISTINCT \"permissionid\" FROM \"".$Settings['sqltable']."permissions\"", array(null)); }
-$getperidr=sql_query($getperidq,$SQLStat);
-$getperidnum=sql_num_rows($getperidr);
-$getperidi = 0;
-while ($getperidi < $getperidnum) {
-if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||$Settings['sqltype']=="cubrid") {
-$getperidID=sql_result($getperidr,$getperidi,"PermissionID"); }
-if($Settings['sqltype']=="sqlite") {
-$getperidID=sql_result($getperidr,$getperidi,"\"PermissionID\""); }
-$getperidq2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i ORDER BY \"PermissionID\" ASC", array($getperidID));
-$getperidr2=sql_query($getperidq2,$SQLStat);
-$getperidnum2=sql_num_rows($getperidr2);
-$getperidName=sql_result($getperidr2,0,"Name");
-sql_free_result($getperidr2);
-?>
-       <option <?php if($EditMemPerm['PermissionID']==$getperidID) { echo "selected=\"selected\" "; } ?>value="<?php echo $getperidID; ?>"><?php echo $getperidName; ?></option>
-<?php ++$getperidi; }
-sql_free_result($getperidr); ?>
-       </select></td>
-<?php } if($EditMem['ID']!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewBoard">Can View Board:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewBoard" id="CanViewBoard">
-       <option selected="selected" value="<?php echo $EditMemPerm['CanViewBoard']; ?>">Old Value (<?php echo $EditMemPerm['CanViewBoard']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewOffLine">Can View OffLine Board:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewOffLine" id="CanViewOffLine">
-       <option selected="selected" value="<?php echo $EditMemPerm['CanViewOffLine']; ?>">Old Value (<?php echo $EditMemPerm['CanViewOffLine']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanEditProfile">Can Edit Profile:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanEditProfile" id="CanEditProfile">
-       <option selected="selected" value="<?php echo $EditMemPerm['CanEditProfile']; ?>">Old Value (<?php echo $EditMemPerm['CanEditProfile']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanAddEvents">Can Add Events:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanAddEvents" id="CanAddEvents">
-       <option selected="selected" value="<?php echo $EditMemPerm['CanAddEvents']; ?>">Old Value (<?php echo $EditMemPerm['CanAddEvents']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanPM">Can PM:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanPM" id="CanPM">
-       <option selected="selected" value="<?php echo $EditMemPerm['CanPM']; ?>">Old Value (<?php echo $EditMemPerm['CanPM']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanSearch">Can Search:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanSearch" id="CanSearch">
-       <option selected="selected" value="<?php echo $EditMemPerm['CanSearch']; ?>">Old Value (<?php echo $EditMemPerm['CanSearch']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-<?php } ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanDoHTML">Can DoHTML:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanDoHTML" id="CanDoHTML">
-       <option <?php if($EditMemPerm['CanDoHTML']=="group") { echo "selected=\"selected\" "; } ?>value="group">use group info</option>
-       <option <?php if($EditMemPerm['CanDoHTML']=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($EditMemPerm['CanDoHTML']=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanUseBBTags">Can use BBTags:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanUseBBTags" id="CanUseBBTags">
-       <option <?php if($EditMemPerm['CanUseBBTags']=="group") { echo "selected=\"selected\" "; } ?>value="group">use group info</option>
-       <option <?php if($EditMemPerm['CanUseBBTags']=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($EditMemPerm['CanUseBBTags']=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-<?php if($EditMem['ID']!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewIPAddress">Can view IP Address:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewIPAddress" id="CanViewIPAddress">
-       <option <?php if($EditMemPerm['CanViewIPAddress']=="group") { echo "selected=\"selected\" "; } ?>value="group">use group info</option>
-       <option <?php if($EditMemPerm['CanViewIPAddress']=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($EditMemPerm['CanViewIPAddress']=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="CanViewUserAgent">Can view user agent:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="CanViewUserAgent" id="CanViewUserAgent">
-       <option <?php if($EditMemPerm['CanViewUserAgent']=="group") { echo "selected=\"selected\" "; } ?>value="group">use group info</option>
-       <option <?php if($EditMemPerm['CanViewUserAgent']=="yes") { echo "selected=\"selected\" "; } ?>value="yes">yes</option>
-       <option <?php if($EditMemPerm['CanViewUserAgent']=="no") { echo "selected=\"selected\" "; } ?>value="no">no</option>
-       </select></td>
-<?php } ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="FloodControl">Flood Control in seconds:</label></td>
-       <td style="width: 50%;"><input type="text" name="FloodControl" class="TextBox" id="FloodControl" size="20" value="<?php echo $EditMemPerm['FloodControl']; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="SearchFlood">Search Flood Control in seconds:</label></td>
-       <td style="width: 50%;"><input type="text" name="SearchFlood" class="TextBox" id="SearchFlood" size="20" value="<?php echo $EditMemPerm['SearchFlood']; ?>" /></td>
-<?php if($EditMem['ID']!=1) { ?>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HasModCP">Can view Mod CP:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HasModCP" id="HasModCP">
-       <option selected="selected" value="<?php echo $EditMemPerm['HasModCP']; ?>">Old Value (<?php echo $EditMemPerm['HasModCP']; ?>)</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HasAdminCP">Can view Admin CP:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HasAdminCP" id="HasAdminCP">
-       <option selected="selected" value="<?php echo $EditMemPerm['HasAdminCP']; ?>">Old Value (<?php echo $EditMemPerm['HasAdminCP']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ViewDBInfo">Can view Database info:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="ViewDBInfo" id="ViewDBInfo">
-       <option selected="selected" value="<?php echo $EditMemPerm['ViewDBInfo']; ?>">Old Value (<?php echo $EditMemPerm['ViewDBInfo']; ?>)</option>
-       <option value="group">use group info</option>
-       <option value="yes">yes</option>
-       <option value="no">no</option>
-       </select></td>
-<?php } ?>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="editmember" style="display: none;" />
-<input type="hidden" name="id" value="<?php echo $_POST['id']; ?>" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Edit Member" name="Apply_Changes" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php } if($_POST['act']=="editmember"&&$_POST['update']=="now"&&$_GET['act']=="editmember"&&
-       ($_POST['id']!="0"||$_POST['id']!="-1")) { 
-$ggidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
-$ggidresult=sql_query($ggidquery,$SQLStat);
-$GuestGroupID=sql_result($ggidresult,0,"id");
-sql_free_result($ggidresult);
-$vgidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['ValidateGroup']));
-$vgidresult=sql_query($vgidquery,$SQLStat);
-$ValidateGroupID=sql_result($vgidresult,0,"id");
-sql_free_result($vgidresult);
-$DMemName = GetUserName($_POST['id'],$Settings['sqltable']);
-$DMemName = $DMemName['Name'];
-$_POST['MemName'] = stripcslashes(htmlspecialchars($_POST['MemName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['MemName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['MemName']);
-$_POST['MemName'] = remove_spaces($_POST['MemName']);
-$_POST['MemEmail'] = remove_spaces($_POST['MemEmail']);
-$username_check = null;
-if($_POST['MemName']!=$DMemName) {
-$tquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"GuestName\"='%s' WHERE \"UserID\"=%i", array($_POST['MemName'],$_POST['id']));
-sql_query($tquery,$SQLStat);
-$r1query = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"GuestName\"='%s' WHERE \"UserID\"=%i", array($_POST['MemName'],$_POST['id']));
-sql_query($r1query,$SQLStat);
-$r2query = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"EditUserName\"='%s' WHERE \"EditUser\"=%i", array($_POST['MemName'],$_POST['id']));
-sql_query($r2query,$SQLStat);
-$sql_username_check = sql_query(sql_pre_query("SELECT \"Name\" FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s'", array($_POST['MemName'])),$SQLStat);
-$username_check = sql_num_rows($sql_username_check);
-sql_free_result($sql_username_check); }
-if($_POST['MemHidden']!="yes"&&$_POST['MemHidden']!="no") {
-       $_POST['MemHidden'] = "no"; }
-if(!is_numeric($_POST['MemWarnLevel'])) { $_POST['MemWarnLevel'] = "0"; }
-if(!is_numeric($_POST['MemPostCount'])) { $_POST['MemPostCount'] = "0"; }
-if(!is_numeric($_POST['MemKarma'])) { $_POST['MemKarma'] = "0"; }
-       if($_POST['MemBanTime']!=null&&$_POST['MemBanTime']>1) {
-       $BirthExpl = explode("/",$_POST['MemBanTime']);
-       if(count($BirthExpl)!="3") { 
-       $_POST['MemBanTime'] = "0"; $BirthExpl[0] = "0"; $BirthExpl[1] = "0"; $BirthExpl[2] = "0"; }
-       if(!is_numeric($BirthExpl[0])) { $BirthExpl[0] = "0"; }
-       if(!is_numeric($BirthExpl[1])) { $BirthExpl[1] = "0"; }
-       if(!is_numeric($BirthExpl[2])) { $BirthExpl[2] = "0"; }
-       if(count($BirthExpl)=="3"&&checkdate($BirthExpl[0],$BirthExpl[1],$BirthExpl[2])===true) {
-       if(is_numeric($BirthExpl[0])&&is_numeric($BirthExpl[1])&&is_numeric($BirthExpl[2])) {
-       if(pre_strlen($BirthExpl[0])=="1") { $BirthExpl[0] = "0".$BirthExpl[0]; }
-       if(pre_strlen($BirthExpl[1])=="1") { $BirthExpl[1] = "0".$BirthExpl[1]; }
-       if(pre_strlen($BirthExpl[0])=="2"&&pre_strlen($BirthExpl[1])=="2"&&pre_strlen($BirthExpl[2])=="4") {
-       $BirthIn = mktime(12,12,12,$BirthExpl[0],$BirthExpl[1],$BirthExpl[2]);
-       $tmpusrcurtime = new DateTime();
-       $tmpusrcurtime->setTimestamp($BirthIn);
-       $tmpusrcurtime->setTimezone($utctz);
-       $BirthMonth=$tmpusrcurtime->format("m");
-       $BirthDay=$tmpusrcurtime->format("d");
-       $BirthYear=$tmpusrcurtime->format("Y"); 
-       $_POST['MemBanTime'] = $BirthIn; }
-       if(pre_strlen($BirthExpl[0])!="2"||pre_strlen($BirthExpl[1])!="2"||pre_strlen($BirthExpl[2])!="4") { 
-               $_POST['MemBanTime'] = "0"; $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
-       if (!is_numeric($BirthExpl[0])||!is_numeric($BirthExpl[1])||!is_numeric($BirthExpl[2])) { 
-               $_POST['MemBanTime'] = "0"; $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
-       if(count($BirthExpl)=="3"&&
-       checkdate($BirthExpl[0],$BirthExpl[1],$BirthExpl[2])===false) {
-       $_POST['MemBanTime'] = "0"; $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; }
-       if(count($BirthExpl)!="3") { 
-       $_POST['MemBanTime'] = "0"; $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
-if($DMemName!==null&&($_POST['id']!="0"||$_POST['id']!="-1")&&
-       ($_POST['gid']!=$GuestGroupID||$_POST['gid']!=$ValidateGroupID)) { 
-if($_POST['MemName']==$DMemName||$username_check>=1) {
-if($_POST['id']!=1) {
-if(!is_numeric($_POST['MemPermID'])) { $_POST['MemPermID'] = "0"; }
-$dmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"=%i,\"LevelID\"=%i,\"HiddenMember\"='%s',\"WarnLevel\"=%i,\"BanTime\"=%i,\"PostCount\"=%i,\"Karma\"=%i WHERE \"id\"=%i", array($_POST['gid'],$_POST['lid'],$_POST['MemHidden'],$_POST['MemWarnLevel'],$_POST['MemBanTime'],$_POST['MemPostCount'],$_POST['MemKarma'],$_POST['id'])); 
-$dpmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."mempermissions\" SET \"PermissionID\"=%i,\"CanViewBoard\"='%s',\"CanViewOffLine\"='%s',\"CanEditProfile\"='%s',\"CanAddEvents\"='%s',\"CanPM\"='%s',\"CanSearch\"='%s',\"CanDoHTML\"='%s',\"CanUseBBTags\"='%s',\"CanViewIPAddress\"='%s',\"CanViewUserAgent\"='%s',\"FloodControl\"=%i,\"SearchFlood\"=%i,\"HasModCP\"='%s',\"HasAdminCP\"='%s',\"ViewDBInfo\"='%s' WHERE \"id\"=%i", array($_POST['MemPermID'],$_POST['CanViewBoard'],$_POST['CanViewOffLine'],$_POST['CanEditProfile'],$_POST['CanAddEvents'],$_POST['CanPM'],$_POST['CanSearch'],$_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['CanViewIPAddress'],$_POST['CanViewUserAgent'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['HasModCP'],$_POST['HasAdminCP'],$_POST['ViewDBInfo'],$_POST['id'])); }
-if($_POST['id']==1) {
-$dmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"HiddenMember\"='%s',\"WarnLevel\"=%i,\"BanTime\"=%i,\"PostCount\"=%i,\"Karma\"=%i WHERE \"id\"=%i", array($_POST['MemHidden'],$_POST['MemWarnLevel'],$_POST['MemBanTime'],$_POST['MemPostCount'],$_POST['MemKarma'],$_POST['id'])); 
-$dpmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."mempermissions\" SET \"CanDoHTML\"='%s',\"CanUseBBTags\"='%s',\"FloodControl\"=%i,\"SearchFlood\"=%i WHERE \"id\"=%i", array($_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['id'])); } }
-if($_POST['MemName']!=$DMemName&&$username_check<1) {
-if($_POST['id']!=1) {
-if(!is_numeric($_POST['MemPermID'])) { $_POST['MemPermID'] = "0"; }
-$dmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Name\"='%s',\"GroupID\"=%i,\"LevelID\"=%i,\"HiddenMember\"='%s',\"WarnLevel\"=%i,\"BanTime\"=%i,\"PostCount\"=%i,\"Karma\"=%i WHERE \"id\"=%i", array($_POST['MemName'],$_POST['gid'],$_POST['lid'],$_POST['MemHidden'],$_POST['MemWarnLevel'],$_POST['MemBanTime'],$_POST['MemPostCount'],$_POST['MemKarma'],$_POST['id'])); 
-$dpmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."mempermissions\" SET \"PermissionID\"=%i,\"CanViewBoard\"='%s',\"CanViewOffLine\"='%s',\"CanEditProfile\"='%s',\"CanAddEvents\"='%s',\"CanPM\"='%s',\"CanSearch\"='%s',\"CanDoHTML\"='%s',\"CanUseBBTags\"='%s',\"CanViewIPAddress\"='%s',\"CanViewUserAgent\"='%s',\"FloodControl\"=%i,\"SearchFlood\"=%i,\"HasModCP\"='%s',\"HasAdminCP\"='%s',\"ViewDBInfo\"='%s' WHERE \"id\"=%i", array($_POST['MemPermID'],$_POST['CanViewBoard'],$_POST['CanViewOffLine'],$_POST['CanEditProfile'],$_POST['CanAddEvents'],$_POST['CanPM'],$_POST['CanSearch'],$_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['CanViewIPAddress'],$_POST['CanViewUserAgent'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['HasModCP'],$_POST['HasAdminCP'],$_POST['ViewDBInfo'],$_POST['id'])); } 
-if($_POST['id']==1) {
-$dmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Name\"='%s',\"HiddenMember\"='%s',\"WarnLevel\"=%i,\"BanTime\"=%i,\"PostCount\"=%i,\"Karma\"=%i WHERE \"id\"=%i", array($_POST['MemName'],$_POST['MemHidden'],$_POST['MemWarnLevel'],$_POST['MemBanTime'],$_POST['MemPostCount'],$_POST['MemKarma'],$_POST['id'])); 
-$dpmquery = sql_pre_query("UPDATE \"".$Settings['sqltable']."mempermissions\" SET \"CanViewBoard\"='%s',\"CanViewOffLine\"='%s',\"CanEditProfile\"='%s',\"CanAddEvents\"='%s',\"CanPM\"='%s',\"CanSearch\"='%s',\"CanDoHTML\"='%s',\"CanUseBBTags\"='%s',\"CanViewIPAddress\"='%s',\"CanViewUserAgent\"='%s',\"FloodControl\"=%i,\"SearchFlood\"=%i WHERE \"id\"=%i", array($_POST['CanViewBoard'],$_POST['CanViewOffLine'],$_POST['CanEditProfile'],$_POST['CanAddEvents'],$_POST['CanPM'],$_POST['CanSearch'],$_POST['CanDoHTML'],$_POST['CanUseBBTags'],$_POST['CanViewIPAddress'],$_POST['CanViewUserAgent'],$_POST['FloodControl'],$_POST['SearchFlood'],$_POST['id'])); } }
-sql_query($dmquery,$SQLStat);
-sql_query($dpmquery,$SQLStat); }
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-       <br /><?php echo $DMemName; ?>&#39;s member info was changed successfully.<br /> <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Click here</a> to back to admin cp.<br />&nbsp;
-       </div>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } ?>
-</td></tr>
-</table>
-<div>&nbsp;</div>
diff --git a/inc/admin/sqldumper/cubrid.php.bak b/inc/admin/sqldumper/cubrid.php.bak
deleted file mode 100644 (file)
index 06273cb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: cubrid.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="cubrid.php"||$File3Name=="/cubrid.php") {
-       require('index.php');
-       exit(); }
-
-//Nothing here for now :P 
-echo $TheProgrammerNaps;
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die();
-?>
diff --git a/inc/admin/sqldumper/index.php.bak b/inc/admin/sqldumper/index.php.bak
deleted file mode 100644 (file)
index fa2d8e3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/admin/sqldumper/mysql.php.bak b/inc/admin/sqldumper/mysql.php.bak
deleted file mode 100644 (file)
index aa87b65..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: mysql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="mysql.php"||$File3Name=="/mysql.php") {
-       require('index.php');
-       exit(); }
-
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($Settings['sqltype']!="mysql"&&$Settings['sqltype']!="mysqli") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_GET['outtype'])) { $_GET['outtype'] = "UTF-8"; }
-header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
-header("Cache-Control: private",false); 
-header("Content-Description: File Transfer");
-if(!isset($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if(!is_numeric($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if($_GET['comlevel']>9||$_GET['comlevel']<-1) {
-       $_GET['comlevel'] = -1; }
-if(!isset($_GET['compress'])) {
-       $_GET['compress'] = "none"; }
-if($_GET['compress']=="gzip") {
-       $_GET['compress'] = "gzencode"; }
-if($_GET['compress']=="bzip"||
-       $_GET['compress']=="bzip2") {
-       $_GET['compress'] = "bzcompress"; }
-if($_GET['compress']!="none"&&
-       $_GET['compress']!="gzencode"&&
-       $_GET['compress']!="gzcompress"&&
-       $_GET['compress']!="gzdeflate"&&
-       $_GET['compress']!="bzcompress") {
-       $_GET['compress'] = "none"; }
-if(!extension_loaded("zlib")) {
-if($_GET['compress']=="gzencode"&&
-       $_GET['compress']=="gzcompress"&&
-       $_GET['compress']=="gzdeflate") {
-       $_GET['compress'] = "none"; } }
-if(!extension_loaded("bz2")) {
-if($_GET['compress']=="bzcompress") {
-       $_GET['compress'] = "none"; } }
-if($_GET['compress']=="bzcompress") {
-if($_GET['comlevel']>9||$_GET['comlevel']<0) {
-       $_GET['comlevel'] = 4; } }
-$fname = null;
-if(isset($Settings['sqldb'])&&$Settings['sqldb']!="") {
-$fname = str_replace("_","", $Settings['sqldb'])."_"; }
-if($_GET['compress']=="none") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql"; }
-if($_GET['compress']=="gzencode") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzdeflate") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="bzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.bz2"; }
-header("Content-Disposition: attachment; filename=".$fname);
-header("Content-Type: application/octet-stream");
-header("Content-Transfer-Encoding: binary");
-if(!isset($AltSQLDumper)||$AltSQLDumper===null) {
-       $SQLDumper = "SQL Dumper"; }
-if(isset($AltSQLDumper)&&$AltSQLDumper!==null) {
-       $SQLDumper = $AltSQLDumper; }
-function GetAllRows($table) { $rene_j = 0; $trowout = null;
-global $SQLStat;
-$tresult = sql_query("SELECT * FROM \"".$table."\"",$SQLStat);
-while ($trow = sql_fetch_assoc($tresult)) {
-$trowout[$rene_j] = $trow;
-++$rene_j; }
-sql_free_result($tresult);
-return $trowout; }
-$TablePreFix = $Settings['sqltable'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TableChCk = array_map("add_prefix",$TableChCk);
-if(!isset($_GET['outtype'])||$_GET['outtype']=="UTF-8") {
-header("Content-Type: text/plain; charset=UTF-8"); }
-if($_GET['outtype']=="latin1") {
-header("Content-Type: text/plain; charset=ISO-8859-1"); }
-if($_GET['outtype']=="latin15") {
-header("Content-Type: text/plain; charset=ISO-8859-15"); }
-$sql = "SHOW TABLES LIKE '".$Settings['sqltable']."%'";
-$result = sql_query($sql,$SQLStat);
-if (!$result) {
-echo "DB Error, could not list tables\n";
-echo 'MySQL Error: ' . sql_error($SQLStat);
-exit; }
-$DropTable = null; $CreateTable = null; $TableNames = null; $l = 0;
-while ($row = sql_fetch_row($result)) { 
-if(in_array($row[0],$TableChCk)) {
-$TableNames[$l] = $row[0];
-$DropTable[$l] = "DROP TABLE IF EXISTS \"".$row[0]."\";\n";
-$CreateTable[$l] = "CREATE TABLE IF NOT EXISTS \"".$row[0]."\" (\n";
-$CreateTable[$l] = null;
-$result2 = sql_query("SHOW COLUMNS FROM ".$row[0],$SQLStat);
-$tabsta = sql_query("SHOW TABLE STATUS LIKE '".$row[0]."'",$SQLStat);
-$tabstats = sql_fetch_array($tabsta); $AutoIncrement = " ";
-$tabstaz = sql_query("SHOW CREATE TABLE \"".$row[0]."\"",$SQLStat);
-$tabstatz = sql_fetch_array($tabstaz);
-$FullTable[$l] = $DropTable[$l].$tabstatz[1].";\n";
-$tabstats = sql_fetch_array($tabsta); $AutoIncrement = " ";
-/*
-if($tabstats["Auto_increment"]!="") {
-$AutoIncrement = " AUTO_INCREMENT=".$tabstats["Auto_increment"]." "; }
-       $TableInfo[$l] = null; $TableStats = null; $i = 0;
-       while ($row2 = sql_fetch_assoc($result2)) {
-               $row2["Default"] = "'".$row2["Default"]."'"; 
-               if($i==0) { $row2["Default"] = null; } $DefaVaule = null;
-               if($row2["Default"]!=null) { $DefaVaule = " default ".$row2["Default"]; }
-               if($row2["Extra"]!="") { $row2["Extra"] = " ".$row2["Extra"]; }
-       if($row2["Type"]=="text") { $DefaVaule = null; }
-       if(isset($PrimaryKey[$l])) { 
-       if($row2["Key"]=="PRI"||$row2["Key"]=="UNI") {
-       $PrimaryKey[$l] .= ",\n"; } }
-       if(!isset($PrimaryKey[$l])) { $PrimaryKey[$l] = null; }
-        $TableInfo[$l] .= "  \"".$row2["Field"]."\" ".$row2["Type"]." NOT NULL".$DefaVaule.$row2["Extra"].",\n";
-               if($row2["Key"]=="PRI") { $PrimaryKey[$l] .= "  PRIMARY KEY (\"".$row2["Field"]."\")"; }
-               if($row2["Key"]=="UNI") { $PrimaryKey[$l] .= "  UNIQUE KEY \"".$row2["Field"]."\" (\"".$row2["Field"]."\")"; }
-       ++$i; } */
-       /*
-       $TableStats[$l] = ") ENGINE=".$tabstats["Engine"]." DEFAULT CHARSET=".mysql_client_encoding()." COLLATE=".$tabstats["Collation"].$AutoIncrement.";\n";
-       $TableInfo[$l] .= $PrimaryKey[$l]."\n".$TableStats[$l];
-       $FullTable[$l] = $DropTable[$l].$CreateTable[$l].$TableInfo[$l];
-        }
-       $TableStats[$l] = ") ENGINE=".$tabstats["Engine"]." DEFAULT CHARSET=".mysql_client_encoding()." COLLATE=".$tabstats["Collation"].$AutoIncrement.";\n";
-       $TableInfo[$l] .= $PrimaryKey[$l]."\n".$TableStats[$l];
-       $FullTable[$l] = $DropTable[$l].$CreateTable[$l].$TableInfo[$l]; */ }
-if (!$result2) {
-    echo 'Could not run query: ' . sql_error($SQLStat);
-    exit; }
-sql_free_result($result2);
-sql_free_result($tabsta);
-++$l; } $tableout = null;
-$num = count($TableNames); $renee_s = 0;
-$sqldump = "-- ".$OrgName." ".$SQLDumper."\n";
-$sqldump .= "-- version ".$VerInfo['iDB_Ver_SVN']."\n";
-$sqldump .= "-- ".$iDBHome."support/\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Host: ".$Settings['sqlhost']."\n";
-$sqldump .= "-- Generation Time: ".$usercurtime->format('F d, Y \a\t h:i A')."\n";
-$sqldump .= "-- Server version: ".sql_server_info($SQLStat)."\n";
-$sqldump .= "-- PHP Version: ".phpversion()."\n\n";
-$sqldump .= "SET SESSION SQL_MODE='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO';\n\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Database: \"".$Settings['sqldb']."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "-- --------------------------------------------------------\n\n";
-while ($renee_s < $num) { $tnum = $num - 1;
-$trow = GetAllRows($TableNames[$renee_s]);
-$numz = count($trow); $kazuki_p = 0;
-$sqldump .= "--\n";
-$sqldump .= "-- Table structure for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= $FullTable[$renee_s]."\n";
-while ($kazuki_p < $numz) { $tnumz = $numz - 1;
-$srow = null; $srowvalue = null;
-$trownew = $trow[$kazuki_p];
-$trowname = array_keys($trownew);
-$nums = count($trownew); $il = 0;
-while ($il < $nums) { $tnums = $nums - 1;
-$trowrname = sql_escape_string($trowname[$il],$SQLStat);
-$trowrvalue = sql_escape_string($trownew[$trowrname],$SQLStat);
-if($_GET['outtype']=="UTF-8"&&$Settings['charset']!="UTF-8") {
-$trowrvalue = utf8_encode($trowrvalue); }
-$trowrvalue = str_replace( array("\n", "\r"), array('\n', '\r'), $trowrvalue);
-/*if($kazuki_p===0) {*/
-if($il===0) { $srow = "INSERT INTO \"".$TableNames[$renee_s]."\" ("; }
-if($il<$tnums&&$il!=$tnums) { $srow .= "\"".$trowrname."\", "; }
-if($il==$tnums) { $srow .= "\"".$trowrname."\") VALUES"; } /*}*/
-if($il===0) { $srowvalue = "("; }
-if(!is_numeric($trowrvalue)) { $trowrvalue = "'".$trowrvalue."'"; }
-if($il<$tnums) { $srowvalue .= $trowrvalue.", "; }
-if($il==$tnums) { $srowvalue .= $trowrvalue;
-/*if($kazuki_p<$tnumz) { $srowvalue .= "),"; }*/
-/*if($kazuki_p==$tnumz) {*/ $srowvalue .= ");"; /*}*/ }
-++$il; }
-if($kazuki_p===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n"; }
-$sqldump .= $srow."\n"; /*}*/
-$sqldump .= $srowvalue."\n";
-if($kazuki_p==$tnumz&&$renee_s<$tnum) {
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-++$kazuki_p; }
-if($numz===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-$sqldump .= "\n";
-++$renee_s; }
-if($_GET['compress']=="none") { echo $sqldump; }
-if($_GET['compress']=="gzencode") { echo gzencode($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzcompress") { echo gzcompress($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzdeflate") { echo gzdeflate($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="bzcompress") { echo bzcompress($sqldump,$_GET['comlevel']); }
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']);
-?>
diff --git a/inc/admin/sqldumper/pgsql.php.bak b/inc/admin/sqldumper/pgsql.php.bak
deleted file mode 100644 (file)
index 8fd13f2..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: pgsql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="pgsql.php"||$File3Name=="/pgsql.php") {
-       require('index.php');
-       exit(); }
-
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($Settings['sqltype']!="pgsql") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_GET['outtype'])) { $_GET['outtype'] = "UTF-8"; }
-header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
-header("Cache-Control: private",false); 
-header("Content-Description: File Transfer");
-if(!isset($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if(!is_numeric($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if($_GET['comlevel']>9||$_GET['comlevel']<-1) {
-       $_GET['comlevel'] = -1; }
-if(!isset($_GET['compress'])) {
-       $_GET['compress'] = "none"; }
-if($_GET['compress']=="gzip") {
-       $_GET['compress'] = "gzencode"; }
-if($_GET['compress']=="bzip"||
-       $_GET['compress']=="bzip2") {
-       $_GET['compress'] = "bzcompress"; }
-if($_GET['compress']!="none"&&
-       $_GET['compress']!="gzencode"&&
-       $_GET['compress']!="gzcompress"&&
-       $_GET['compress']!="gzdeflate"&&
-       $_GET['compress']!="bzcompress") {
-       $_GET['compress'] = "none"; }
-if(!extension_loaded("zlib")) {
-if($_GET['compress']=="gzencode"&&
-       $_GET['compress']=="gzcompress"&&
-       $_GET['compress']=="gzdeflate") {
-       $_GET['compress'] = "none"; } }
-if(!extension_loaded("bz2")) {
-if($_GET['compress']=="bzcompress") {
-       $_GET['compress'] = "none"; } }
-if($_GET['compress']=="bzcompress") {
-if($_GET['comlevel']>9||$_GET['comlevel']<0) {
-       $_GET['comlevel'] = 4; } }
-$fname = null;
-if(isset($Settings['sqldb'])&&$Settings['sqldb']!="") {
-$fname = str_replace("_","", $Settings['sqldb'])."_"; }
-if($_GET['compress']=="none") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql"; }
-if($_GET['compress']=="gzencode") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzdeflate") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="bzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.bz2"; }
-header("Content-Disposition: attachment; filename=".$fname);
-header("Content-Type: application/octet-stream");
-header("Content-Transfer-Encoding: binary");
-if(!isset($AltSQLDumper)||$AltSQLDumper===null) {
-       $SQLDumper = "SQL Dumper"; }
-if(isset($AltSQLDumper)&&$AltSQLDumper!==null) {
-       $SQLDumper = $AltSQLDumper; }
-function GetAllRows($table) { $rene_j = 0; $trowout = null;
-global $SQLStat;
-$tresult = sql_query("SELECT * FROM \"".$table."\"",$SQLStat);
-while ($trow = sql_fetch_assoc($tresult)) {
-$trowout[$rene_j] = $trow;
-++$rene_j; }
-sql_free_result($tresult);
-return $trowout; }
-$TablePreFix = $Settings['sqltable'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TableChCk = array_map("add_prefix",$TableChCk);
-if(!isset($_GET['outtype'])||$_GET['outtype']=="UTF-8") {
-header("Content-Type: text/plain; charset=UTF-8"); }
-if($_GET['outtype']=="latin1") {
-header("Content-Type: text/plain; charset=ISO-8859-15"); }
-if($_GET['outtype']=="latin15") {
-header("Content-Type: text/plain; charset=ISO-8859-15"); }
-$sli = 0; $slnum = count($TableChCk);
-while ($sli < $slnum) {
-$FullTable[$sli] = "CREATE TABLE \"".$TableChCk[$sli]."\" (";
-$tabsta = sql_query("select * from information_schema.columns where table_name='".$TableChCk[$sli]."';",$SQLStat);
-$zli = 0; $zlnum = sql_num_rows($tabsta);
-$UniKeyRow = null;
-while ($zli < $zlnum) {
-$SQL['column_name'] = sql_result($tabsta,$zli,"column_name");
-$SQL['column_default'] = sql_result($tabsta,$zli,"column_default");
-$PSQL = null;
-$PSQL = explode("::", $SQL['column_default']);
-if(count($PSQL)>1) { $SQL['column_default'] = $PSQL[0]; }
-if (preg_match("/nextval(.*)\_seq/i", $SQL['column_default'])) {
-$SQL['udt_name'] = "SERIAL"; $SQL['column_default'] = null;
-} else { $SQL['column_default'] = " DEFAULT ".$SQL['column_default'];
-$SQL['udt_name'] = sql_result($tabsta,$zli,"udt_name"); }
-if($SQL['udt_name']=="text") { $SQL['column_default'] = null; }
-$SQL['character_maximum_length'] = sql_result($tabsta,$zli,"character_maximum_length");
-if($SQL['udt_name']=="varchar") {
-       $SQL['udt_name'] = $SQL['udt_name']."(".$SQL['character_maximum_length'].")"; }
-$pristats = null; $PriKeyRow = " ";
-$prista = sql_query("SELECT * FROM information_schema.key_column_usage WHERE table_name = '".$TableChCk[$sli]."' and column_name = '".$SQL['column_name']."';",$SQLStat);
-$pristats = @pg_fetch_result($prista,0,"\"constraint_name\"");
-if (preg_match("/(.*)\_pkey/i", $pristats)) {
-$PriKeyRow = " PRIMARY KEY ";
-} else {
-if (preg_match("/(.*)\_key/i", $pristats)) {
-$UniKeyRow = $UniKeyRow.",\n  UNIQUE (\"".$SQL['column_name']."\")";
-} else {
-/*Nothing*/ } }
-if($pristats==$SQL['column_name']) { $PriKeyRow = " PRIMARY KEY "; }
-$FullTable[$sli] .= "\n  \"".$SQL['column_name']."\" ".$SQL['udt_name'].$PriKeyRow."NOT NULL".$SQL['column_default'];
-if($zli+1 < $zlnum) { $FullTable[$sli] .= ","; }
-++$zli; }
-$FullTable[$sli] .= $UniKeyRow."\n);\n";
-++$sli; }
-$TableNames = $TableChCk;
-$num = count($TableNames); $renee_s = 0;
-$sqldump = "-- ".$OrgName." ".$SQLDumper."\n";
-$sqldump .= "-- version ".$VerInfo['iDB_Ver_SVN']."\n";
-$sqldump .= "-- ".$iDBHome."support/\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Host: ".$Settings['sqlhost']."\n";
-$sqldump .= "-- Generation Time: ".$usercurtime->format('F d, Y \a\t h:i A')."\n";
-$sqldump .= "-- Server version: ".sql_server_info($SQLStat)."\n";
-$sqldump .= "-- PHP Version: ".phpversion()."\n\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Database: \"".$Settings['sqldb']."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "-- --------------------------------------------------------\n\n";
-while ($renee_s < $num) { $tnum = $num - 1;
-$trow = GetAllRows($TableNames[$renee_s]);
-$numz = count($trow); $kazuki_p = 0;
-$sqldump .= "--\n";
-$sqldump .= "-- Table structure for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= $FullTable[$renee_s]."\n";
-while ($kazuki_p < $numz) { $tnumz = $numz - 1;
-$srow = null; $srowvalue = null;
-$trownew = $trow[$kazuki_p];
-$trowname = array_keys($trownew);
-$nums = count($trownew); $il = 0;
-while ($il < $nums) { $tnums = $nums - 1;
-$trowrname = sql_escape_string($trowname[$il],$SQLStat);
-$trowrvalue = sql_escape_string($trownew[$trowrname],$SQLStat);
-if($_GET['outtype']=="UTF-8"&&$Settings['charset']!="UTF-8") {
-$trowrvalue = utf8_encode($trowrvalue); }
-$trowrvalue = str_replace( array("\n", "\r"), array('\n', '\r'), $trowrvalue);
-if($kazuki_p===0) {
-if($il===0) { $srow = "INSERT INTO \"".$TableNames[$renee_s]."\" ("; }
-if($il<$tnums&&$il!=$tnums) { $srow .= "\"".$trowrname."\", "; }
-if($il==$tnums) { $srow .= "\"".$trowrname."\") VALUES"; } }
-if($il===0) { $srowvalue = "("; }
-if(!is_numeric($trowrvalue)) { $trowrvalue = "'".$trowrvalue."'"; }
-if($il<$tnums) { $srowvalue .= $trowrvalue.", "; }
-if($il==$tnums) { $srowvalue .= $trowrvalue;
-if($kazuki_p<$tnumz) { $srowvalue .= "),"; }
-if($kazuki_p==$tnumz) { $srowvalue .= ");"; } }
-++$il; }
-if($kazuki_p===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= $srow."\n"; }
-$sqldump .= $srowvalue."\n";
-if($kazuki_p==$tnumz&&$renee_s<$tnum) {
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-++$kazuki_p; }
-if($numz===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-$sqldump .= "\n";
-++$renee_s; }
-if($_GET['compress']=="none") { echo $sqldump; }
-if($_GET['compress']=="gzencode") { echo gzencode($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzcompress") { echo gzcompress($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzdeflate") { echo gzdeflate($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="bzcompress") { echo bzcompress($sqldump,$_GET['comlevel']); }
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']);
-?>
diff --git a/inc/admin/sqldumper/sqlite.php.bak b/inc/admin/sqldumper/sqlite.php.bak
deleted file mode 100644 (file)
index 7bf7b6b..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: sqlite.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="sqlite.php"||$File3Name=="/sqlite.php") {
-       require('index.php');
-       exit(); }
-
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($Settings['sqltype']!="sqlite") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_GET['outtype'])) { $_GET['outtype'] = "UTF-8"; }
-header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
-header("Cache-Control: private",false); 
-header("Content-Description: File Transfer");
-if(!isset($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if(!is_numeric($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if($_GET['comlevel']>9||$_GET['comlevel']<-1) {
-       $_GET['comlevel'] = -1; }
-if(!isset($_GET['compress'])) {
-       $_GET['compress'] = "none"; }
-if($_GET['compress']=="gzip") {
-       $_GET['compress'] = "gzencode"; }
-if($_GET['compress']=="bzip"||
-       $_GET['compress']=="bzip2") {
-       $_GET['compress'] = "bzcompress"; }
-if($_GET['compress']!="none"&&
-       $_GET['compress']!="gzencode"&&
-       $_GET['compress']!="gzcompress"&&
-       $_GET['compress']!="gzdeflate"&&
-       $_GET['compress']!="bzcompress") {
-       $_GET['compress'] = "none"; }
-if(!extension_loaded("zlib")) {
-if($_GET['compress']=="gzencode"&&
-       $_GET['compress']=="gzcompress"&&
-       $_GET['compress']=="gzdeflate") {
-       $_GET['compress'] = "none"; } }
-if(!extension_loaded("bz2")) {
-if($_GET['compress']=="bzcompress") {
-       $_GET['compress'] = "none"; } }
-if($_GET['compress']=="bzcompress") {
-if($_GET['comlevel']>9||$_GET['comlevel']<0) {
-       $_GET['comlevel'] = 4; } }
-$fname = null;
-if(isset($Settings['sqldb'])&&$Settings['sqldb']!="") {
-$fname = str_replace("_","", $Settings['sqldb'])."_"; }
-if($_GET['compress']=="none") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql"; }
-if($_GET['compress']=="gzencode") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzdeflate") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="bzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.bz2"; }
-header("Content-Disposition: attachment; filename=".$fname);
-header("Content-Type: application/octet-stream");
-header("Content-Transfer-Encoding: binary");
-if(!isset($AltSQLDumper)||$AltSQLDumper===null) {
-       $SQLDumper = "SQL Dumper"; }
-if(isset($AltSQLDumper)&&$AltSQLDumper!==null) {
-       $SQLDumper = $AltSQLDumper; }
-function GetAllRows($table) { $rene_j = 0; $trowout = null;
-global $SQLStat;
-$tresult = sql_query("SELECT * FROM \"".$table."\"",$SQLStat);
-while ($trow = sql_fetch_assoc($tresult)) {
-$trowout[$rene_j] = $trow;
-++$rene_j; }
-sql_free_result($tresult);
-return $trowout; }
-$TablePreFix = $Settings['sqltable'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TableChCk = array_map("add_prefix",$TableChCk);
-if(!isset($_GET['outtype'])||$_GET['outtype']=="UTF-8") {
-header("Content-Type: text/plain; charset=UTF-8"); }
-if($_GET['outtype']=="latin1") {
-header("Content-Type: text/plain; charset=ISO-8859-15"); }
-if($_GET['outtype']=="latin15") {
-header("Content-Type: text/plain; charset=ISO-8859-15"); }
-$sli = 0; $slnum = count($TableChCk);
-while ($sli < $slnum) {
-/*
-$FullTable[$sli] = "CREATE TABLE \"".$TableChCk[$sli]."\" (\n";
-*/
-$tabsta = sql_query("SELECT * FROM sqlite_master WHERE type=\"table\" and tbl_name=\"".$TableChCk[$sli]."\";",$SQLStat);
-$tabstats = sql_fetch_array($tabsta);
-$FullTable[$sli] = $tabstats['sql'].";\n";
-/*
-$zli = 0;
-$tabsta = sql_query("PRAGMA table_info(\"".$TableChCk[$sli]."\");",$SQLStat);
-while ($tabstats = sql_fetch_array($tabsta)) {
-var_dump($tabstats);
-if($zli>0) { $FullTable[$sli] .= ",\n"; }
-$SQLDefault = null; $PrimeKey = " ";
-if($tabstats['dflt_value']!==null) {
-$SQLDefault = " default '".$tabstats['dflt_value']."'"; }
-if($tabstats['dflt_value']===null) {
-$SQLDefault = ""; }
-if($tabstats['pk']=="1") {
-$PrimeKey = " PRIMARY KEY "; }
-$FullTable[$sli] .= "  \"".$tabstats['name']."\" ".$tabstats['type'].$PrimeKey."NOT NULL".$SQLDefault;
-++$zli; }
-$FullTable[$sli] .= "\n);\n";
-*/
-++$sli; }
-$TableNames = $TableChCk;
-$num = count($TableNames); $renee_s = 0;
-$sqldump = "-- ".$OrgName." ".$SQLDumper."\n";
-$sqldump .= "-- version ".$VerInfo['iDB_Ver_SVN']."\n";
-$sqldump .= "-- ".$iDBHome."support/\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Generation Time: ".$usercurtime->format('F d, Y \a\t h:i A')."\n";
-$sqldump .= "-- SQLite Server version: ".sql_server_info($SQLStat)."\n";
-$sqldump .= "-- PHP Version: ".phpversion()."\n\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Database: \"".$Settings['sqldb']."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "-- --------------------------------------------------------\n\n";
-while ($renee_s < $num) { $tnum = $num - 1;
-$trow = GetAllRows($TableNames[$renee_s]);
-$numz = count($trow); $kazuki_p = 0;
-$sqldump .= "--\n";
-$sqldump .= "-- Table structure for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= $FullTable[$renee_s]."\n";
-while ($kazuki_p < $numz) { $tnumz = $numz - 1;
-$srow = null; $srowvalue = null;
-$trownew = $trow[$kazuki_p];
-$trowname = array_keys($trownew);
-$nums = count($trownew); $il = 0;
-while ($il < $nums) { $tnums = $nums - 1;
-$trowrname = sql_escape_string($trowname[$il],$SQLStat);
-$trowrvalue = sql_escape_string($trownew[$trowrname],$SQLStat);
-if($_GET['outtype']=="UTF-8"&&$Settings['charset']!="UTF-8") {
-$trowrvalue = utf8_encode($trowrvalue); }
-$trowrvalue = str_replace( array("\n", "\r"), array('\n', '\r'), $trowrvalue);
-if($il===0) { $srow = "INSERT INTO \"".$TableNames[$renee_s]."\" ("; }
-if($il<$tnums&&$il!=$tnums) { $srow .= "\"".$trowrname."\", "; }
-if($il==$tnums) { $srow .= "\"".$trowrname."\") VALUES"; }
-if($il===0) { $srowvalue = "("; }
-if(!is_numeric($trowrvalue)) { $trowrvalue = "'".$trowrvalue."'"; }
-if($il<$tnums) { $srowvalue .= $trowrvalue.", "; }
-if($il==$tnums) { $srowvalue .= $trowrvalue;
-if($kazuki_p<$tnumz) { $srowvalue .= ");"; }
-if($kazuki_p==$tnumz) { $srowvalue .= ");"; } }
-++$il; }
-if($kazuki_p===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n"; }
-$sqldump .= $srow."\n";
-$sqldump .= $srowvalue."\n";
-if($kazuki_p==$tnumz&&$renee_s<$tnum) {
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-++$kazuki_p; }
-if($numz===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-$sqldump .= "\n";
-++$renee_s; }
-if($_GET['compress']=="none") { echo $sqldump; }
-if($_GET['compress']=="gzencode") { echo gzencode($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzcompress") { echo gzcompress($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzdeflate") { echo gzdeflate($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="bzcompress") { echo bzcompress($sqldump,$_GET['comlevel']); }
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']);
-?>
diff --git a/inc/admin/table.php.bak b/inc/admin/table.php.bak
deleted file mode 100644 (file)
index 1857d3d..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: table.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="table.php"||$File3Name=="/table.php") {
-       require('index.php');
-       exit(); }
-?>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Admin CP Menu</div>
-<?php } ?>
-<table id="AdminMenu" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Admin CP Menu</td>
-</tr><?php } ?>
-<tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Main Settings</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=forums",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Menu</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=categories",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Menu</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=members",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Memeber Menu</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=groups",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Group Menu</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<div>&nbsp;</div>
-<?php if($AdminMenu=="main"||$_GET['menu']=="main") { ?>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Main Settings</div>
-<?php } ?>
-<table id="AdminLinks" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Main Settings</td>
-</tr><?php } ?>
-<tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Settings</a></td>
-<?php if($GroupInfo['ViewDBInfo']=="yes") { ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=sql",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">SQL Settings</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><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;">Version Checker</a></td>
-<?php if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="pgsql"||
-       $Settings['sqltype']=="sqlite") { ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=sqldumper",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">SQL Dumper</a></td>
-<?php } ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=delsessions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Clean Sessions</a></td>
-<?php if($Settings['SQLThemes']=="off") { ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=enablesthemes",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Enable SQLThemes</a></td>
-<?php } ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=themelist",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Download Themes</a></td>
-<?php if($Settings['SQLThemes']=="on") { ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=resyncthemes",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Resync Themes</a></td>
-<?php } ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=optimize",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Optimize Tables</a></td>
-<?php } ?>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=info",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Board Info</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<div>&nbsp;</div>
-<?php } if($AdminMenu=="forums"||$_GET['menu']=="forums") { ?>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Forum Menu</div>
-<?php } ?>
-<table id="ForumMenu" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Forum Menu</td>
-</tr><?php } ?><tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Add Forums</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Forums</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deleteforum",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Delete Forums</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=retopics",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Recount Topics</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=rereplies",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Recount Replies</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fixtnames",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Fix Topic User Names</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fixrnames",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Fix Reply User Names</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=fpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Forum Permissions</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<div>&nbsp;</div>
-<?php } if($AdminMenu=="categories"||$_GET['menu']=="categories") { ?>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Category Menu</div>
-<?php } ?>
-<table id="CategoryMenu" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Category Menu</td>
-</tr><?php } ?><tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Add Categories</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editcategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Categories</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletecategory",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Delete Categories</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=cpermissions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Category Permissions</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<div>&nbsp;</div>
-<?php } if($AdminMenu=="members"||$_GET['menu']=="members") { ?>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Memeber Menu</div>
-<?php } ?>
-<table id="MemberMenu" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Memeber Menu</td>
-</tr><?php } ?><tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=validate",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Validate Menu</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editmember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Member</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Delete Member</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } if($AdminMenu=="groups"||$_GET['menu']=="groups") { ?>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Group Menu</div>
-<?php } ?>
-<table id="GroupMenu" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Group Menu</td>
-</tr><?php } ?><tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=addgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Add Groups</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=editgroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Groups</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=deletegroup",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Delete Groups</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<?php } ?>
diff --git a/inc/calendars.php.bak b/inc/calendars.php.bak
deleted file mode 100644 (file)
index 4bf84a9..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: calendars.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="calendars.php"||$File3Name=="/calendars.php") {
-       require('index.php');
-       exit(); }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",null,null);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['calendar'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['calendar']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Calendar";
-$_SESSION['ExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-$calcurtime = new DateTime();
-$calcurtime->setTimestamp($defcurtime->getTimestamp());
-$calcurtime->setTimezone($usertz);
-if(!isset($_GET['HighligtDay'])) { $_GET['HighligtDay'] = null; }
-if(!isset($_GET['calmadd'])) { $_GET['calmadd'] = 0; }
-if(!is_numeric($_GET['calmadd'])) { $_GET['calmadd'] = 0; }
-if((!isset($_GET['calmonth']) && !isset($_GET['calyear'])) && 
-isset($_GET['caldate']) && strlen($_GET['caldate'])==2) {
-$_GET['caldate'] = $_GET['caldate'].$calcurtime->format("Y"); }
-if((!isset($_GET['calmonth']) && !isset($_GET['calyear'])) && 
-isset($_GET['caldate']) && strlen($_GET['caldate'])==6) {
-preg_match_all("/([0-9]{2})([0-9]{4})/is", $_GET['caldate'], $datecheck);
-$_GET['calmonth'] = $datecheck[1][0];
-$_GET['calyear'] = $datecheck[2][0]; }
-if((isset($_GET['calmonth']) && isset($_GET['calyear'])) && 
-   (strlen($_GET['calmonth'])==2&&strlen($_GET['calyear'])==4) ) {
-$year1 = date("Y", strtotime($_GET['calyear']."-".$_GET['calmonth']."-01"));
-$year2 = date("Y", $utccurtime->getTimestamp());
-$month1 = date("m", strtotime($_GET['calyear']."-".$_GET['calmonth']."-01"));
-$month2 = date("m", $utccurtime->getTimestamp());
-$redirdate = ((($year2 - $year1) * 12) + ($month2 - $month1)) * -1;
-$_GET['calmadd'] = $redirdate; }
-$nextcalm = $_GET['calmadd'] + 1;
-$backcalm = $_GET['calmadd'] - 1;
-$calmcount = abs($_GET['calmadd']);
-$getcurmonth = $usercurtime->format("m");
-$getcuryear = $usercurtime->format("y");
-$getcurtmsp = mktime(0, 0, 0, $getcurmonth, 1, $getcuryear);
-$getnextmsp = mktime(0, 0, 0, ($getcurmonth + $nextcalm), 1, $getcuryear);
-$nexmonthnum = date("m", $getnextmsp);
-$nexyearnum = date("Y", $getnextmsp);
-$nexcaldate = $nexmonthnum.$nexyearnum;
-$getbactmsp = mktime(0, 0, 0, ($getcurmonth + $backcalm), 1, $getcuryear);
-$bacmonthnum = date("m", $getbactmsp);
-$bacyearnum = date("Y", $getbactmsp);
-$baccaldate = $bacmonthnum.$bacyearnum;
-$tmpcalmnum = 0;
-$tmpcalmadd = 0;
-$tmpcalcount = 1;
-if($_GET['calmadd']>0) {
-while($tmpcalcount <= $calmcount) {
-$calcurtime->setTimestamp($defcurtime->getTimestamp()+$tmpcalmadd);
-$tmpdaystart = $calcurtime->format("d");
-$tmpdaycount = $calcurtime->format("t");
-if($tmpdaystart>=1) { $tmpcalmnum += ($tmpdaycount - $tmpdaystart) + 1; }
-if($tmpdaystart<1) { $tmpcalmnum += $tmpdaycount; }
-$tmpcalmadd = $tmpcalmnum * $dayconv['day'];
-++$tmpcalcount; }
-$calmounthaddd = $tmpcalmadd; }
-if($_GET['calmadd']<0) {
-while($tmpcalcount <= $calmcount) {
-$calcurtime->setTimestamp($defcurtime->getTimestamp()+$tmpcalmadd);
-$tmpdaystart = $calcurtime->format("d");
-$tmpdaycount = $calcurtime->format("t");
-if($tmpdaystart>=1) { $tmpcalmnum -= $tmpdaystart + 1; }
-if($tmpdaystart<1) { $tmpcalmnum -= $tmpdaycount; }
-$tmpcalmadd = $tmpcalmnum * $dayconv['day'];
-++$tmpcalcount; }
-$calmounthaddd = $tmpcalmadd; }
-// Extra month stuff
-$MyRealMonthNum1 = $usercurtime->format("m");
-$MyRealYear = $usercurtime->format("Y");
-// Count the Days in this month
-if(!isset($calmounthaddd)) { $calmounthaddd = 0; }
-$MyTimeStamp = $utccurtime->getTimestamp() + $calmounthaddd;
-//$calcurtime->setTimestamp($defcurtime->getTimestamp()+$calmounthaddd);
-$calcurtime->setDate($_GET['calyear'], $_GET['calmonth'], 1);
-$CountDays = $calcurtime->format("t");
-$MyDay = $calcurtime->format("j");
-$MyDay2 = $calcurtime->format("jS");
-$MyDayNum = $calcurtime->format("d");
-$MyDayName = $calcurtime->format("l");
-$MyYear = $calcurtime->format("Y");
-$MyYear2 = $calcurtime->format("y");
-$MyMonth = $calcurtime->format("m");
-$MyTimeStamp1 = mktime(0,0,0,$MyMonth,1,$MyYear);
-$MyTimeStamp2 = mktime(23,59,59,$MyMonth,$CountDays,$MyYear);
-$MyMonthName = $calcurtime->format("F");
-$MyMonthNum1 = $calcurtime->format("m");
-$MyMonthNum2 = $calcurtime->format("n");
-$FirstDayThisMonth = date("w", mktime(0, 0, 0, $MyMonth, 1, $MyYear));
-$MyCurDay = $usercurtime->format("j");
-$MyCurYear = $usercurtime->format("Y");
-$MyCurMonth = $usercurtime->format("m");
-$EventsName = array();
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."events\" WHERE (\"EventMonth\">=%i AND \"EventYear\"<%i AND \"EventYearEnd\">=%i) OR (\"EventMonth\"<=%i AND \"EventMonthEnd\">=%i AND \"EventYearEnd\">=%i) OR (\"EventMonth\"<=%i AND \"EventMonthEnd\"<=%i AND \"EventYear\"<=%i AND \"EventYearEnd\">%i)",  array($MyMonth,$MyYear,$MyYear,$MyMonth,$MyMonth,$MyYear,$MyMonth,$MyMonth,$MyYear,$MyYear));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$is=0;
-while ($is < $num) {
-$EventID=sql_result($result,$is,"id");
-$EventUser=sql_result($result,$is,"UserID");
-$EventGuest=sql_result($result,$is,"GuestName");
-$EventName=sql_result($result,$is,"EventName");
-$EventText=sql_result($result,$is,"EventText");
-$EventStart=sql_result($result,$is,"TimeStamp");
-$EventEnd=sql_result($result,$is,"TimeStampEnd");
-$eventstartcurtime = new DateTime();
-$eventstartcurtime->setTimestamp($EventStart);
-$eventstartcurtime->setTimezone($usertz);
-$eventendcurtime = new DateTime();
-$eventendcurtime->setTimestamp($EventEnd);
-$eventendcurtime->setTimezone($usertz);
-//$EventMonth=sql_result($result,$is,"EventMonth");
-$EventMonth=$eventstartcurtime->format("m");
-//$EventMonthEnd=sql_result($result,$is,"EventMonthEnd");
-$EventMonthEnd=$eventendcurtime->format("m");
-//$EventDay=sql_result($result,$is,"EventDay");
-$EventDay=$eventstartcurtime->format("j");
-//$EventDayEnd=sql_result($result,$is,"EventDayEnd");
-$EventDayEnd=$eventendcurtime->format("j");
-//$EventYear=sql_result($result,$is,"EventYear");
-$EventYear=$eventstartcurtime->format("Y");
-//$EventYearEnd=sql_result($result,$is,"EventYearEnd");
-$EventYearEnd=$eventendcurtime->format("Y");
-if($EventMonthEnd!=$MyMonth) { $EventDayEnd = $CountDays; }
-if($EventMonth<$MyMonth) { $EventDay = 1; }
-$oldeventname=$EventName;
-$EventName1 = pre_substr($EventName,0,20);
-if (pre_strlen($EventName)>20) { $EventName1 = $EventName1."..."; }
-$EventName=$EventName1;
-if(!isset($EventsName[$EventDay])) { $EventsName[$EventDay] = null; }
-if ($EventsName[$EventDay] != null) {
-       $EventsName[$EventDay] .= ", <a href=\"".url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$EventID,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'])."\" style=\"font-size: 9px;\" title=\"View Event ".$oldeventname.".\">".$EventName."</a>";   }
-if ($EventsName[$EventDay] == null) {
-       $EventsName[$EventDay] = "<a href=\"".url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$EventID,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'])."\" style=\"font-size: 9px;\" title=\"View Event ".$oldeventname.".\">".$EventName."</a>"; }
-if ($EventDay<$EventDayEnd) {
-$NextDay = $EventDay+1;
-$EventDayEnd = $EventDayEnd+1;
-while ($NextDay < $EventDayEnd) {
-if(!isset($EventsName[$NextDay])) { $EventsName[$NextDay] = null; }
-if ($EventsName[$NextDay] != null) {
-       $EventsName[$NextDay] .= ", <a href=\"".url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$EventID,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'])."\" style=\"font-size: 9px;\" title=\"View Event ".$oldeventname.".\">".$EventName."</a>";    }
-if ($EventsName[$NextDay] == null) {
-       $EventsName[$NextDay] = "<a href=\"".url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$EventID,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'])."\" style=\"font-size: 9px;\" title=\"View Event ".$oldeventname.".\">".$EventName."</a>"; }
-$NextDay++; } }
-$EventsID[$EventDay] = $EventID;
-++$is; } 
-sql_free_result($result);
-$bdquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"BirthMonth\"=%i AND \"BirthYear\"<=%i", array($MyMonth, $MyYear));
-$bdresult=sql_query($bdquery,$SQLStat);
-$bdnum=sql_num_rows($bdresult);
-$bdi=0;
-while ($bdi < $bdnum) {
-$UserNamebd=sql_result($bdresult,$bdi,"Name");
-$BirthDay=sql_result($bdresult,$bdi,"BirthDay");
-$BirthMonth=sql_result($bdresult,$bdi,"BirthMonth");
-$BirthYear=sql_result($bdresult,$bdi,"BirthYear");
-$UserCurAge=$MyYear-$BirthYear;
-$oldusername=$UserNamebd;
-$UserNamebd1 = pre_substr($UserNamebd,0,20);
-if (pre_strlen($UserNamebd)>20) { $UserNamebd1 = $UserNamebd1."..."; }
-$UserNamebd=$UserNamebd1;
-if(!isset($EventsName[$BirthDay])) { $EventsName[$BirthDay] = null; }
-if ($EventsName[$BirthDay] != null) {
-       $EventsName[$BirthDay] .= ", <span title=\"".$oldusername." is ".$UserCurAge." years old\">".$UserNamebd1."</span>";     }
-if ($EventsName[$BirthDay] == null) {
-       $EventsName[$BirthDay] = "<span title=\"".$oldusername." is ".$UserCurAge." years old\">".$UserNamebd1."</span>"; }
-++$bdi; } 
-sql_free_result($bdresult);
-$MyDays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
-$DayNames = "";
-foreach ($MyDays as $x => $y) {
-    $DayNames .= '<th class="CalTableColumn2" style="width: 12%;">' . $y . '</th>'."\r\n";
-}
-$WeekDays = "";
-$i = $FirstDayThisMonth + 1;
-if ($FirstDayThisMonth != "0") {
-    $WeekDays .= '<td class="CalTableColumn3Blank" style="text-align: center;" colspan="' . $FirstDayThisMonth . '">&nbsp;</td>'."\r\n";
-}
-$Day_i = "1";
-$ii = $i;
-for ($i; $i <= ($CountDays + $FirstDayThisMonth) ;$i++) {
-if ($ii == 8) {
-$WeekDays .= "</tr><tr class=\"CalTableRow3\">"."\r\n";
-$ii = 1; }
- if ($MyCurDay == $Day_i && $MyCurMonth == $MyRealMonthNum1 && $MyCurYear == $MyRealYear) {
-$Extra = 'CalTableColumn3Current'; }
-else {
-$Extra = 'CalTableColumn3'; }
-if ($Day_i != $_GET['HighligtDay']) {
-if(!isset($EventsName[$Day_i])) { $EventsName[$Day_i] = null; }
-if($EventsName[$Day_i]!=null) { $EventsName[$Day_i] = "&nbsp;( ".$EventsName[$Day_i]." )"; }
-if ($Day_i != $MyCurDay) {
-$WeekDays .= '<td class="'.$Extra.'" style="vertical-align: top;"><div class="CalDate">' . $Day_i . '</div>' . $EventsName[$Day_i] . '</td>'."\r\n";    }      }
-if ($Day_i == $MyCurDay) {
-$WeekDays .= '<td class="'.$Extra.'" style="vertical-align: top;"><div class="CalDateCurrent">' . $Day_i  . '</div>' . $EventsName[$Day_i] . '</td>'."\r\n";    }
-$Day_i++;
-$ii++;
-}
-if ((8 - $ii) >= "1") {
-$WeekDays .= '<td class="CalTableColumn3Blank" style="text-align: center;" colspan="' . (8 - $ii) . '">&nbsp;</td>'."\r\n"; } ?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Calendar</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="CalTable1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="CalTableRow1" style="font-weight: bold;">
-<span style="float: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view&caldate=".$MyMonth.$MyYear,$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>" title="<?php echo "Viewing ".$MyMonthName." ".$MyYear; ?>"><?php echo "Viewing ".$MyMonthName." ".$MyYear; ?></a>&nbsp;</span>&nbsp;
-<span style="float: right;">&nbsp;<a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view&caldate=".$baccaldate,$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">&lt;</a><?php echo $ThemeSet['LineDivider']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view&caldate=".$nexcaldate,$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">&gt;</a>&nbsp;</span>&nbsp;</div>
-<?php } ?>
-<table class="CalTable1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="CalTableRow1">
-<th class="CalTableColumn1" colspan="7">
-<span style="float: left;"><?php echo $ThemeSet['TitleIcon']; ?><?php echo "Viewing ".$MyMonthName." ".$MyYear; ?>&nbsp;</span>&nbsp;
-<span style="float: right;">&nbsp;<a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view&caldate=".$baccaldate,$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">&lt;</a><?php echo $ThemeSet['LineDivider']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view&caldate=".$nexcaldate,$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">&gt;</a>&nbsp;</span>&nbsp;
-</th>
-</tr><?php } ?>
-<tr class="CalTableRow2">
-<?php echo $DayNames; ?>
-</tr><tr class="CalTableRow3">
-<?php echo $WeekDays; ?>
-</tr>
-<tr class="CalTableRow4">
-<td class="CalTableColumn4" colspan="7">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivCalendar">&nbsp;</div>
diff --git a/inc/categories.php.bak b/inc/categories.php.bak
deleted file mode 100644 (file)
index 9d56ba8..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: categories.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="categories.php"||$File3Name=="/categories.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!isset($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if(!is_numeric($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if($ThemeSet['ForumStyle']>2||$ThemeSet['ForumStyle']<1) {
-       $ThemeSet['ForumStyle'] = 1; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$CategoryID=sql_result($preresult,0,"id");
-$CategoryName=sql_result($preresult,0,"Name");
-$CategoryShow=sql_result($preresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($preresult,0,"CategoryType");
-$InSubCategory=sql_result($preresult,0,"InSubCategory");
-$SubShowForums=sql_result($preresult,0,"SubShowForums");
-$CategoryDescription=sql_result($preresult,0,"Description");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-$CategoryPostCountView=sql_result($preresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($preresult,0,"KarmaCountView");
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
-       $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-if(!isset($CatCheck)) { $CatCheck = null; } 
-if($CatCheck!="skip") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$CategoryID,"&","=",$prexqstr[$CategoryType],$exqstr[$CategoryType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType]; }
-$_SESSION['PreViewingTitle'] = "Viewing Category:";
-$_SESSION['ViewingTitle'] = $CategoryName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($InSubCategory!="0") {
-$iscquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($InSubCategory));
-$iscresult=sql_query($iscquery,$SQLStat);
-$iscnum=sql_num_rows($iscresult);
-if($iscnum>=1) {
-$iscCategoryID=sql_result($iscresult,0,"id");
-$iscCategoryName=sql_result($iscresult,0,"Name");
-$iscCategoryShow=sql_result($iscresult,0,"ShowCategory");
-$iscCategoryType=sql_result($iscresult,0,"CategoryType");
-$iscCategoryType = strtolower($iscCategoryType); }
-if($iscnum<1) { $InSubCategory = "0"; } 
-sql_free_result($iscresult); }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php if($InSubCategory!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$iscCategoryType],$Settings['file_ext'],"act=view&id=".$iscCategoryID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$iscCategoryType],$exqstr[$iscCategoryType]); ?>"><?php echo $iscCategoryName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-if($CategoryType=="subcategory") {
-redirect("location",$rbasedir.url_maker($exfile['subcategory'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['subcategory'],$exqstr['subcategory'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=0".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></span></div>
-<?php } ?>
-<table id="Cat<?php echo $CategoryID; ?>" class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr id="CatStart<?php echo $CategoryID; ?>" class="TableRow1">
-<td class="TableColumn1" colspan="5"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="ForumStatRow<?php echo $CategoryID; ?>" class="TableRow2">
-<th class="TableColumn2" style="width: 4%;">&nbsp;</th>
-<th class="TableColumn2" style="width: 58%;">Forum</th>
-<th class="TableColumn2" style="width: 7%;">Topics</th>
-<th class="TableColumn2" style="width: 7%;">Posts</th>
-<th class="TableColumn2" style="width: 24%;">Last Topic</th>
-</tr>
-<?php }
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<a href=\"".$sfurl."\">".$SubsForumName."</a>";
-if($apcl==1) {
-$sflist = "Subforums:";
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist.", ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$gltnum = count($gltf); $glti = 0; 
-$OldUpdateTime = 0; $UseThisFonum = null;
-if ($ForumType=="subforum") { 
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($gltf[$glti]));
-$gltforesult=sql_query($gltfoquery,$SQLStat);
-$gltfonum=sql_num_rows($gltforesult);
-if($gltfonum>0) {
-$NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
-if($NewUpdateTime>$OldUpdateTime) { 
-       $UseThisFonum = $gltf[$glti]; 
-$OldUpdateTime = $NewUpdateTime; }
-sql_free_result($gltforesult); }
-++$glti; } 
-if($UseThisFonum==0) {
-       $UseThisFonum = $gltf[0]; } }
-if ($ForumType!="subforum"&&$ForumType!="redirect") { $UseThisFonum = $gltf[0]; }
-if ($ForumType!="redirect") {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE (\"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") OR (\"OldForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") ORDER BY \"LastUpdate\" DESC LIMIT 1", array($UseThisFonum,$UseThisFonum));
-$gltresult=sql_query($gltquery,$SQLStat);
-$gltnum=sql_num_rows($gltresult);
-if($gltnum>0){
-$TopicID=sql_result($gltresult,0,"id");
-$TopicName=sql_result($gltresult,0,"TopicName");
-$NumReplys=sql_result($gltresult,0,"NumReply");
-$NumPages = null; $NumRPosts = $NumReplys + 1;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($NumRPosts>$Settings['max_posts']) {
-$NumPages = ceil($NumRPosts/$Settings['max_posts']); }
-if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
-$TopicName1 = pre_substr($TopicName,0,20);
-$oldtopicname=$TopicName;
-if (pre_strlen($TopicName)>20) {
-$TopicName1 = $TopicName1."..."; $TopicName=$TopicName1; }
-$glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
-$glrresult=sql_query($glrquery,$SQLStat);
-$glrnum=sql_num_rows($glrresult);
-if($glrnum>0){
-$ReplyID=sql_result($glrresult,0,"id");
-$UsersID=sql_result($glrresult,0,"UserID");
-$GuestsName=sql_result($glrresult,0,"GuestName");
-$TimeStamp=sql_result($glrresult,0,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TimeStamp);
-$tmpusrcurtime->setTimezone($usertz);
-$TimeStamp=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-sql_free_result($glrresult); }
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
-if($PreUsersName['Name']===null) { $UsersID = -1;
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
-$UsersName = $PreUsersName['Name'];
-$UsersHidden = $PreUsersName['Hidden'];
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-$UsersName1 = pre_substr($UsersName,0,20);
-$oldusername=$UsersName;
-if (pre_strlen($UsersName)>20) { 
-$UsersName1 = $UsersName1."..."; $UsersName=$UsersName1; } 
-$lul = null;
-if($UsersID>0&&$UsersHidden=="no") {
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\nUser: <a href=\"".$lul."\" title=\"".$oldusername."\">".$UsersName."</a>"; }
-if($UsersID<=0||$UsersHidden=="yes") {
-if($UsersID==-1) { $UserPre = "Guest:"; }
-if(($UsersID<-1&&$UsersHidden=="yes")||$UsersID==0||($UsersID>0&&$UsersHidden=="yes")) { 
-       $UserPre = "Hidden:"; }
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\n".$UserPre." <span title=\"".$oldusername."\">".$UsersName."</span>"; } }
-if($LastTopic==null) { $LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;"; }
-sql_free_result($gltresult); }
-if ($ForumType=="redirect") { $LastTopic="&nbsp;<br />Redirects: ".$NumRedirects."<br />&nbsp;"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-if($ThemeSet['ForumStyle']==1) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3\" ";
-       $ForumClass[4] = " class=\"TableColumn3\" ";
-       $ForumClass[5] = " class=\"TableColumn3\" "; }
-if($ThemeSet['ForumStyle']==2) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[4] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[5] = " class=\"TableColumn3Alt\" "; }
-?>
-<tr class="TableRow3" id="Forum<?php echo $ForumID; ?>">
-<td<?php echo $ForumClass[1]; ?>><div class="forumicon">
-<?php echo $PreForum; ?></div></td>
-<td<?php echo $ForumClass[2]; ?>><div class="forumname"><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a></div>
-<div class="forumdescription">
-<?php echo $ForumDescription; ?><br />
-<?php echo $sflist; ?></div></td>
-<td<?php echo $ForumClass[3]; ?>style="text-align: center;"><?php echo $NumTopics; ?></td>
-<td<?php echo $ForumClass[4]; ?>style="text-align: center;"><?php echo $NumPosts; ?></td>
-<td<?php echo $ForumClass[5]; ?>><?php echo $LastTopic; ?></td>
-</tr>
-<?php } ++$i; } sql_free_result($result);
-if($num>=1) { ?>
-<tr id="CatEnd<?php echo $CategoryID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="5">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivCategories">&nbsp;</div>
-<?php } } }
-sql_free_result($preresult); ?>
diff --git a/inc/endpage.php.bak b/inc/endpage.php.bak
deleted file mode 100644 (file)
index 03d2592..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: endpage.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="endpage.php"||$File3Name=="/endpage.php") {
-       require('index.php');
-       exit(); }
-if(!isset($_GET['time'])) { $_GET['time'] = true; }
-if($_GET['time']=="show"||$_GET['time']==true) {
-$MyDST = $usercurtime->format("P");
-$MyTimeNow = $usercurtime->format($_SESSION['iDBTimeFormat']);
-$MyFullTimeNow = $usercurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-if(!isset($TimeSign)) { $TimeSign = ""; }
-$endpagevar=$endpagevar."<br />The time now is <span class=\"ctimenow\" title=\"".$MyFullTimeNow."\">".$MyTimeNow."</span> ".$ThemeSet['LineDivider']." All times are UTC ".$TimeSign." ".$MyDST; }
-if(function_exists("bcsub")==False) {
-function bcsub($left_operand, $right_operand, $scale = 0) {
-$lof = floatval($left_operand);
-$rof = floatval($right_operand);
-return sprintf("%0.".$scale."f", $lof - $rof); } }
-function execution_time($starttime) {
-list($uetime, $etime) = explode(" ", microtime());
-$endtime = $uetime + $etime;
-return bcsub($endtime, $starttime, 4); }
-if($_GET['debug']=="true"||$_GET['debug']=="on") {
-       $endpagevar=$endpagevar."<br />\nNumber of Queries: ".$NumQueries." ".$ThemeSet['LineDivider']." Execution Time: ".execution_time($starttime).$ThemeSet['LineDivider']."<a href=\"http://validator.w3.org/check/referer?verbose=1\" title=\"Validate HTML\" onclick=\"window.open(this.href);return false;\">HTML</a>".$ThemeSet['LineDivider']."<a href=\"http://jigsaw.w3.org/css-validator/check/referer?profile=css3\" title=\"Validate CSS\" onclick=\"window.open(this.href);return false;\">CSS</a>"; }
-       $endpagevar=$endpagevar."</div><div class=\"DivEndPage\">&nbsp;</div>\n";
-echo $endpagevar;
-session_write_close();
-//session_write_close();
-?>
diff --git a/inc/events.php.bak b/inc/events.php.bak
deleted file mode 100644 (file)
index bfdaa6c..0000000
+++ /dev/null
@@ -1,744 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: events.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="events.php"||$File3Name=="/events.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if($_GET['act']=="view"||$_GET['act']==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."events\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$is=0;
-if($num==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($result);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">Viewing Event</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-while ($is < $num) {
-$EventID=sql_result($result,$is,"id");
-$EventIP=sql_result($result,$is,"IP");
-$EventUser=sql_result($result,$is,"UserID");
-$EventGuest=sql_result($result,$is,"GuestName");
-$EventName=sql_result($result,$is,"EventName");
-$EventText=sql_result($result,$is,"EventText");
-$EventStart=sql_result($result,$is,"TimeStamp");
-$EventEnd=sql_result($result,$is,"TimeStampEnd");
-$eventstartcurtime = new DateTime();
-$eventstartcurtime->setTimestamp($EventStart);
-$eventstartcurtime->setTimezone($usertz);
-$EventStart = $eventstartcurtime->format($_SESSION['iDBDateFormat']);
-$eventendcurtime = new DateTime();
-$eventendcurtime->setTimestamp($EventEnd);
-$eventendcurtime->setTimezone($usertz);
-$EventEnd = $eventendcurtime->format($_SESSION['iDBDateFormat']);
-$ipshow = "two";
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id'],"&","=",$prexqstr['event'],$exqstr['event']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['event'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['event']; }
-$_SESSION['PreViewingTitle'] = "Viewing Event:";
-$_SESSION['ViewingTitle'] = $EventName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:".$EventID.";";
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-if($renum<1) { $EventUser = -1;
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult); }
-$memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
-$memreresult=sql_query($memrequery,$SQLStat);
-$memrenum=sql_num_rows($memreresult);
-$rei=0;
-$User1ID=$EventUser;
-$User1Name=sql_result($reresult,$rei,"Name");
-$User1IP=sql_result($reresult,$rei,"IP");
-if($User1IP==$EventIP) { $ipshow = "one"; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$PreUserCanExecPHP=sql_result($memreresult,$rei,"CanExecPHP");
-if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
-       $PreUserCanExecPHP = "no"; }
-$PreUserCanDoHTML=sql_result($memreresult,$rei,"CanDoHTML");
-if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
-       $PreUserCanDoHTML = "no"; }
-$PreUserCanUseBBTags=sql_result($memreresult,$rei,"CanUseBBTags");
-if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
-       $PreUserCanUseBBTags = "no"; }
-sql_free_result($memreresult);
-$User1Joined=sql_result($reresult,$rei,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($User1Joined);
-$tmpusrcurtime->setTimezone($usertz);
-$User1Joined=$tmpusrcurtime->format($_SESSION['iDBDateFormat']);
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Hidden=sql_result($reresult,$rei,"HiddenMember");
-$User1Group=sql_result($gresult,0,"Name");
-$User1CanExecPHP = $PreUserCanExecPHP;
-if($PreUserCanExecPHP=="group") {
-$User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
-if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
-       $User1CanExecPHP = "no"; }
-$User1CanDoHTML = $PreUserCanDoHTML;
-if($PreUserCanDoHTML=="group") {
-$User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
-if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
-       $User1CanDoHTML = "no"; }
-$User1CanUseBBTags = $PreUserCanUseBBTags;
-if($User1CanUseBBTags=="group") {
-$User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
-if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
-       $User1CanUseBBTags = "no"; }
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-sql_free_result($gresult);
-if($User1Title=="") { $User1Title = $User1Group; }
-$User1Signature=sql_result($reresult,$rei,"Signature");
-$User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
-$User1Avatar=sql_result($reresult,$rei,"Avatar");
-$User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
-if ($User1Avatar=="http://"||$User1Avatar==null||
-       strtolower($User1Avatar)=="noavatar") {
-$User1Avatar=$ThemeSet['NoAvatar'];
-$User1AvatarSize=$ThemeSet['NoAvatarSize']; }
-$AvatarSize1=explode("x", $User1AvatarSize);
-$AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
-$User1Website=sql_result($reresult,$rei,"Website");
-if($User1Website=="http://") { 
-       $User1Website = $Settings['idburl']; }
-$User1Website = urlcheck($User1Website);
-$BoardWWWChCk = parse_url($Settings['idburl']);
-$User1WWWChCk = parse_url($User1Website);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
-       $opennew = null; }
-$User1PostCount=sql_result($reresult,$rei,"PostCount");
-$User1IP=sql_result($reresult,$rei,"IP");
-sql_free_result($reresult);
-++$is; } sql_free_result($result);
-if($User1Name=="Guest") { $User1Name=$EventGuest;
-if($User1Name==null) { $User1Name="Guest"; } }
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $User1Name = $GroupNamePrefix.$User1Name; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $User1Name = $User1Name.$GroupNameSuffix; }
-if($User1CanUseBBTags=="yes") { $EventText = bbcode_parser($EventText); }
-if($User1CanExecPHP=="no") {
-$EventText = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$EventText); }
-if($User1CanExecPHP=="yes") { $EventText = php_execute($EventText); }
-if($User1CanDoHTML=="no") {
-$EventText = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$EventText); }
-if($User1CanDoHTML=="yes") { $EventText = do_html_bbcode($EventText); }
-$EventText = text2icons($EventText,$Settings['sqltable'],$SQLStat);
-$EventText = preg_replace("/\<br\>/", "<br />", nl2br($EventText));
-$EventText = url2link($EventText);
-if($User1CanUseBBTags=="yes") { $User1Signature = bbcode_parser($User1Signature); }
-if($User1CanExecPHP=="no") {
-$User1Signature = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$User1Signature); }
-if($User1CanExecPHP=="yes") { $User1Signature = php_execute($User1Signature); }
-if($User1CanDoHTML=="no") {
-$User1Signature = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$User1Signature); }
-if($User1CanDoHTML=="yes") { $User1Signature = do_html_bbcode($User1Signature); }
-$User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
-$User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
-$User1Signature = url2link($User1Signature);
-?>
-<div class="TableInfo1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableInfoRow1">
-<span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>"><?php echo $EventName; ?></a></span></div>
-<?php } ?>
-<table class="TableInfo1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableInfoRow1">
-<td class="TableInfoColumn1" colspan="2"><span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>"><?php echo $EventName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableInfoRow2">
-<td class="TableInfoColumn2" style="vertical-align: middle; width: 160px;">
-&nbsp;<?php
-if($User1ID>0&&$User1Hidden=="no") {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$User1Name."</a>"; }
-if($User1ID<=0||$User1Hidden=="yes") {
-echo "<span>".$User1Name."</span>"; }
-?></td>
-<td class="TableInfoColumn2" style="vertical-align: middle;">
-<div style="float: left; text-align: left;">
-<span style="font-weight: bold;">Event Start: </span><?php echo $EventStart; ?><?php echo $ThemeSet['LineDividerTopic']; ?><span style="font-weight: bold;">Event End: </span><?php echo $EventEnd; ?>
-</div>
-<div style="text-align: right;">&nbsp;</div>
-</td>
-</tr>
-<tr class="TableInfoRow3">
-<td class="TableInfoColumn3" style="vertical-align: top; width: 180px;">
-<?php  // Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/  
- ?>
- <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
-       <tr class="AvatarRow" style="width: 100%; height: 100%;">
-               <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
-               <img src="<?php echo $User1Avatar; ?>" alt="<?php echo $User1Name; ?>'s Avatar" title="<?php echo $User1Name; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
-               </td>
-       </tr>
- </table><br />
-<?php echo $User1Title; ?><br />
-Group: <?php echo $User1Group; ?><br />
-Member: <?php 
-if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
-if($User1ID<=0||$User1Hidden=="yes") { echo 0; }
-?><br />
-Posts: <?php echo $User1PostCount; ?><br />
-Joined: <?php echo $User1Joined; ?><br />
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?>
-User IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$User1IP); ?>">
-<?php echo $User1IP; ?></a><br />
-<?php if($ipshow=="two") { ?>
-Event IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$EventIP); ?>">
-<?php echo $EventIP; ?></a><br />
-<?php } } ?><br />
-</td>
-<td class="TableInfoColumn3" style="vertical-align: middle;">
-<div class="eventpost"><?php echo $EventText; ?></div>
-<?php if(isset($User1Signature)&&$User1Signature!="") { ?> <br />--------------------
-<div class="signature"><?php echo $User1Signature; ?></div><?php } ?>
-</td>
-</tr>
-<tr class="TableInfoRow4">
-<td class="TableInfoColumn4" colspan="2">
-<span style="text-align: left;">&nbsp;<a href="<?php
-if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); }
-if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
-echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-?>"><?php echo $ThemeSet['Profile']; ?></a>
-<?php if(isset($ThemeSet['WWW'])&&$ThemeSet['WWW']!=null) {
-echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo $User1Website; ?>"<?php echo $opennew; ?>><?php echo $ThemeSet['WWW']; ?></a><?php } echo $ThemeSet['LineDividerTopic']; ?><a href="<?php
-if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
-echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); }
-if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
-echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-?>"><?php echo $ThemeSet['PM']; ?></a></span>
-</td>
-</tr>
-</table></div>
-<?php } if($_GET['act']=="create") { 
-if($GroupInfo['CanAddEvents']=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act=create",$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">Making a Event</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event</a></span></div>
-<?php } ?>
-<table class="Table1" id="MakeEvent">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="EventStart">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event</a></span>
-</td>
-</tr><?php } ?>
-<tr id="MakeEventRow" class="TableRow2">
-<td class="TableColumn2" colspan="2" style="width: 100%;">Making a Event</td>
-</tr>
-<tr class="TableRow3" id="MkEvent">
-<td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
-<div style="width: 100%; height: 160px; overflow: auto;">
-<table style="width: 100%; text-align: center;"><?php
-$renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
-$renee_result=sql_query($renee_query,$SQLStat);
-$renee_num=sql_num_rows($renee_result);
-$renee_s=0; $SmileRow=0; $SmileCRow=0;
-while ($renee_s < $renee_num) { ++$SmileRow;
-$FileName=sql_result($renee_result,$renee_s,"FileName");
-$SmileName=sql_result($renee_result,$renee_s,"SmileName");
-$SmileText=sql_result($renee_result,$renee_s,"SmileText");
-$SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
-$ShowSmile=sql_result($renee_result,$renee_s,"Display");
-$ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
-if($SmileRow==1) { ?><tr>
-       <?php } if($SmileRow<5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('EventText','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
-       <?php } if($SmileRow==5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('EventText','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
-       <?php $SmileCRow=0; $SmileRow=0; }
-++$renee_s; }
-if($SmileCRow<5&&$SmileCRow!=0) {
-$SmileCRowL = 5 - $SmileCRow;
-echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
-echo "</table>";
-sql_free_result($renee_result);
-?></div></td>
-<td class="TableColumn3" style="width: 85%;">
-<form style="display: inline;" method="post" id="MkEventForm" action="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act=makeevent",$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="EventName">Insert Event Name:</label></td>
-       <td style="width: 50%;"><input maxlength="30" type="text" name="EventName" class="TextBox" id="EventName" size="20" /></td>
-</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-<?php } ?></tr><?php } ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="EventStart">Insert Event Start:</label></td>
-       <td style="width: 50%;"><input maxlength="10" type="text" name="EventStart" class="TextBox" id="EventStart" size="20" value="MM/DD/YYYY" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="EventEnd">Insert Event End:</label></td>
-       <td style="width: 50%;"><input maxlength="10" type="text" name="EventEnd" class="TextBox" id="EventEnd" size="20" value="MM/DD/YYYY" /></td>
-</tr>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="EventText">Insert Event Text:</label><br />
-<textarea rows="10" name="EventText" id="EventText" cols="40" class="TextBox"></textarea><br />
-<?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
-<label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
-<input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
-<?php } ?>
-<input type="hidden" name="act" value="makeevents" style="display: none;" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="submit" class="Button" value="Make Event" name="make_event" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form></td></tr>
-<tr id="MkEventEnd" class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<?php }  if($_GET['act']=="makeevent"&&$_POST['act']=="makeevents") {
-if($GroupInfo['CanAddEvents']=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$MyUserID = $_SESSION['UserID']; if($MyUserID=="0"||$MyUserID==null) { $MyUserID = -1; }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Making";
-$_SESSION['ViewingTitle'] = "Event";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-if(!isset($_POST['EventName'])) { $_POST['EventName'] = null; }
-if(!isset($_POST['EventStart'])) { $_POST['EventStart'] = null; }
-if(!isset($_POST['EventEnd'])) { $_POST['EventEnd'] = null; }
-if(!isset($_POST['EventText'])) { $_POST['EventText'] = null; }
-if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
-$TimeIn = explode("/",$_POST['EventStart']);
-$TimeOut = explode("/",$_POST['EventEnd']);
-if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-require($SettDir['inc']."captcha.php"); }
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event</a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event</a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Event Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php if (pre_strlen($_POST['EventName'])>="30") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your Event Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-if (PhpCaptcha::Validate($_POST['signcode'])) {
-//echo 'Valid code entered';
-} else { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Invalid code entered<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } if (pre_strlen($TimeIn[0])<"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event Start Month is too small.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeIn[0])>"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event Start Month is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeIn[1])<"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event Start Day is too small.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeIn[1])>"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event Start Day is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeIn[2])<"4") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event Start Year is too small.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeIn[2])>"4") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event Start Year is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeOut[0])<"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event End Month is too small.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeOut[0])>"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event End Month is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeOut[1])<"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event End Day is too small.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeOut[1])>"2") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event End Day is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeOut[2])<"4") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event End Year is too small.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($TimeOut[2])>"4") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Event End Year is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (checkdate($TimeIn[0],$TimeIn[1],$TimeIn[2])===false) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the event start date is not valid.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (checkdate($TimeOut[0],$TimeOut[1],$TimeOut[2])===false) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the event end date is not valid.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       pre_strlen($_POST['GuestName'])>="25") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You Guest Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Settings['TestReferer']===true) {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } }
-$_POST['EventName'] = stripcslashes(htmlspecialchars($_POST['EventName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['EventName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventName']);
-$_POST['EventName'] = remove_spaces($_POST['EventName']);
-$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
-$_POST['GuestName'] = remove_spaces($_POST['GuestName']);
-$_POST['EventText'] = stripcslashes(htmlspecialchars($_POST['EventText'], ENT_QUOTES, $Settings['charset']));
-//$_POST['EventText'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventText']);
-$_POST['EventText'] = remove_bad_entities($_POST['EventText']);
-//$_POST['EventText'] = remove_spaces($_POST['EventText']);
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
-if($cookieDomain==null) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain); } }
-$_SESSION['GuestName']=$_POST['GuestName']; } }
-/*    <_<  iWordFilter  >_>      
-   by Kazuki Przyborowski - Cool Dude 2k */
-$katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-$katarzynart=sql_query($katarzynaqy,$SQLStat);
-$katarzynanm=sql_num_rows($katarzynart);
-$katarzynas=0;
-while ($katarzynas < $katarzynanm) {
-$Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-$Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-$CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-$WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-if($WholeWord=="on") { $WholeWord = "yes"; }
-if($WholeWord=="off") { $WholeWord = "no"; }
-if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-$Filter = preg_quote($Filter, "/");
-if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-$_POST['EventText'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['EventText']); }
-if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-$_POST['EventText'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['EventText']); }
-if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-$_POST['EventText'] = preg_replace("/".$Filter."/", $Replace, $_POST['EventText']); }
-if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-$_POST['EventText'] = preg_replace("/".$Filter."/i", $Replace, $_POST['EventText']); }
-++$katarzynas; } sql_free_result($katarzynart);
-$lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedEventName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
-$lonewolfrt=sql_query($lonewolfqy,$SQLStat);
-$lonewolfnm=sql_num_rows($lonewolfrt);
-$lonewolfs=0; $RMatches = null; $RGMatches = null;
-while ($lonewolfs < $lonewolfnm) {
-$RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
-$RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
-if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
-if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
-if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
-$RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
-if($RWholeWord=="on") { $RWholeWord = "yes"; }
-if($RWholeWord=="off") { $RWholeWord = "no"; }
-if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
-$RestrictedEventName=sql_result($lonewolfrt,$lonewolfs,"RestrictedEventName");
-if($RestrictedEventName=="on") { $RestrictedEventName = "yes"; }
-if($RestrictedEventName=="off") { $RestrictedEventName = "no"; }
-if($RestrictedEventName!="yes"||$RestrictedEventName!="no") { $RestrictedEventName = "no"; }
-$RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
-if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
-if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
-if($RestrictedUserName!="yes"||$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
-$RWord = preg_quote($RWord, "/");
-if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
-if($RestrictedEventName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['EventName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
-if($RestrictedEventName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['EventName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
-if($RestrictedEventName=="yes") {
-$RMatches = preg_match("/".$RWord."/", $_POST['EventName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
-if($RestrictedEventName=="yes") {
-$RMatches = preg_match("/".$RWord."/i", $_POST['EventName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-++$lonewolfs; } sql_free_result($lonewolfrt);
-if ($_POST['EventName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Event Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['EventText']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Event Text.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['EventStart']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter date for event to start in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['EventEnd']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter date for event to end in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (count($TimeIn)!="3") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter valid date for event to start in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (count($TimeOut)!="3") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter valid date for event to end in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (!is_numeric($TimeIn[0])||!is_numeric($TimeIn[1])||!is_numeric($TimeIn[2])) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter valid date for event to start in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (!is_numeric($TimeOut[0])||!is_numeric($TimeOut[1])||!is_numeric($TimeOut[2])) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter valid date for event to end in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (!isset($TimeIn[0])||!isset($TimeIn[1])||!isset($TimeIn[2])) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter valid date for event to start in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (!isset($TimeOut[0])||!isset($TimeOut[1])||!isset($TimeOut[2])) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter valid date for event to end in MM/DD/YYYY format.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $_POST['GuestName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Guest Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $RGMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Guest Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($GroupInfo['CanAddEvents']=="no") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You do not have permission to make a event here.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($RMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This User Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if ($Error!="Yes") { 
-$TimeSIn = mktime(0,0,0,$TimeIn[0],$TimeIn[1],$TimeIn[2]);
-$TimeSOut = mktime(23,59,59,$TimeOut[0],$TimeOut[1],$TimeOut[2]);
-$eventstartcurtime = new DateTime();
-$eventstartcurtime->setTimestamp($TimeSIn);
-$eventstartcurtime->setTimezone($utctz);
-$eventendcurtime = new DateTime();
-$eventendcurtime->setTimestamp($TimeSOut);
-$eventendcurtime->setTimezone($utctz);
-$EventMonth=$eventstartcurtime->format("m");
-$EventMonthEnd=$eventendcurtime->format("m");
-$EventDay=$eventstartcurtime->format("d");
-$EventDayEnd=$eventendcurtime->format("d");
-$EventYear=$eventstartcurtime->format("Y");
-$EventYearEnd=$eventendcurtime->format("Y");
-$User1ID=$MyUserID;
-$User1IP=$_SERVER['REMOTE_ADDR'];
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { $User1Name = $_SESSION['MemberName']; }
-$query = sql_pre_query("INSERT INTO ".$Settings['sqltable']."events (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
-"(%i, '%s', '%s', '%s', %i, %i, %i, %i, %i, %i, %i, %i, '%s')", array($User1ID,$User1Name,$_POST['EventName'],$_POST['EventText'],$TimeSIn,$TimeSOut,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd,$User1IP));
-sql_query($query,$SQLStat);
-$eventid = sql_get_next_id($Settings['sqltable'],"events",$SQLStat);
-redirect("refresh",$rbasedir.url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$eventid,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'],FALSE),"3");
-?><tr>
-       <td><span class="TableMessage"><br />
-       Event <?php echo $_POST['EventName']; ?> was started.<br />
-       Click <a href="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$eventid,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">here</a> to continue to event.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } ?>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } ?>
-<div class="DivEvents">&nbsp;</div>
diff --git a/inc/filename.php.bak b/inc/filename.php.bak
deleted file mode 100644 (file)
index cdae79b..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: filename.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="filename.php"||$File3Name=="/filename.php") {
-       require('index.php');
-       exit(); }
-// Check and set stuff
-if(dirname($_SERVER['SCRIPT_NAME'])!=".") {
-$basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
-if(dirname($_SERVER['SCRIPT_NAME'])==".") {
-$basedir = dirname($_SERVER['PHP_SELF'])."/"; }
-if($basedir=="\/") { $basedir="/"; }
-$basedir = str_replace("//", "/", $basedir);
-$cbasedir = $basedir;
-if($Settings['fixbasedir']!=null&&$Settings['fixbasedir']!="off") {
-               $basedir = $Settings['fixbasedir']; }
-if($Settings['fixcookiedir']!=null&&$Settings['fixcookiedir']!="") {
-               $cbasedir = $Settings['fixcookiedir']; }
-$BaseURL = $basedir;
-if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = 'off'; }
-if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
-if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
-if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
-       $rssurl = $prehost.$_SERVER["HTTP_HOST"].$BaseURL; }
-if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
-       $rssurlon = "on"; $rssurl = $Settings['idburl']; }
-if($Settings['rssurl']!=null&&$Settings['rssurl']!="") {
-       $rssurlon = "on"; $rssurl = $Settings['rssurl']; }
-require_once($SettDir['inc'].'versioninfo.php');
-//File naming stuff. <_< 
-$exfile = array(); $exfilerss = array();
-$exqstr = array(); $exqstrrss = array();
-$exfile['calendar'] = 'calendar';
-$prexqstr['calendar'] = null; $exqstr['calendar'] = null;
-$exfile['category'] = 'category';
-$prexqstr['category'] = null; $exqstr['category'] = null;
-$exfile['event'] = 'event';
-$prexqstr['event'] = null; $exqstr['event'] = null;
-$exfile['forum'] = 'forum';
-$prexqstr['forum'] = null; $exqstr['forum'] = null;
-$exfile['index'] = 'index';
-$prexqstr['index'] = null; $exqstr['index'] = null;
-$exfile['member'] = 'member';
-$prexqstr['member'] = null; $exqstr['member'] = null;
-$exfile['messenger'] = 'messenger';
-$prexqstr['messenger'] = null; $exqstr['messenger'] = null;
-$exfile['profile'] = 'profile';
-$prexqstr['profile'] = null; $exqstr['profile'] = null;
-$exfile['rss'] = 'rss';
-$prexqstr['rss'] = null; $exqstr['rss'] = null;
-$exfile['search'] = 'search';
-$prexqstr['search'] = null; $exqstr['search'] = null;
-$exfile['subforum'] = 'subforum';
-$prexqstr['subforum'] = null; $exqstr['subforum'] = null;
-$exfile['subcategory'] = 'subcategory';
-$prexqstr['subcategory'] = null; $exqstr['subcategory'] = null;
-$exfile['topic'] = 'topic';
-$prexqstr['topic'] = null; $exqstr['topic'] = null;
-$exfile['redirect'] = 'forum';
-$prexqstr['redirect'] = null; $exqstr['redirect'] = null;
-$exfile['admin'] = 'admin';
-$prexqstr['admin'] = null; $exqstr['admin'] = null;
-$exfile['modcp'] = 'modcp';
-$prexqstr['modcp'] = null; $exqstr['modcp'] = null;
-$exfilejs['javascript'] = 'javascript';
-$prexqstrjs['javascript'] = null; $exqstrjs['javascript'] = null;
-$exfilerss['forum'] = 'forum'; 
-$prexqstrrss['forum'] = null; $exqstrrss['forum'] = null;
-$exfilerss['subforum'] = 'subforum';
-$prexqstrrss['subforum'] = null; $exqstrrss['subforum'] = null;
-$exfilerss['subcategory'] = 'subcategory';
-$prexqstrrss['subcategory'] = null; $exqstrrss['subcategory'] = null;
-$exfilerss['redirect'] = 'forum';
-$prexqstrrss['redirect'] = null; $exqstrrss['redirect'] = null;
-$exfilerss['topic'] = 'topic';
-$prexqstrrss['topic'] = null; $exqstrrss['topic'] = null;
-$exfilerss['category'] = 'category';
-$prexqstrrss['category'] = null; $exqstrrss['category'] = null;
-$exfilerss['event'] = 'event';
-$prexqstrrss['event'] = null; $exqstrrss['event'] = null;
-?>
diff --git a/inc/fonts/index.php.bak b/inc/fonts/index.php.bak
deleted file mode 100644 (file)
index de16c80..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/forums.php.bak b/inc/forums.php.bak
deleted file mode 100644 (file)
index 56f95e7..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: forums.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="forums.php"||$File3Name=="/forums.php") {
-    require('index.php');
-    exit(); }
-if(!isset($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if(!is_numeric($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if($ThemeSet['ForumStyle']>2||$ThemeSet['ForumStyle']<1) {
-       $ThemeSet['ForumStyle'] = 1; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"InSubCategory\"=0".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array());
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Board index";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-while ($prei < $prenum) {
-$CategoryID=sql_result($preresult,$prei,"id");
-$CategoryName=sql_result($preresult,$prei,"Name");
-$CategoryShow=sql_result($preresult,$prei,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($preresult,$prei,"CategoryType");
-$SubShowForums=sql_result($preresult,$prei,"SubShowForums");
-$CategoryDescription=sql_result($preresult,$prei,"Description");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-$CategoryPostCountView=sql_result($preresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($preresult,0,"KarmaCountView");
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if(isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
-    $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=0".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="Cat<?php echo $CategoryID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="CatStart<?php echo $CategoryID; ?>">
-<td class="TableColumn1" colspan="5"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="ForumStatRow<?php echo $CategoryID; ?>" class="TableRow2">
-<th class="TableColumn2" style="width: 4%;">&nbsp;</th>
-<th class="TableColumn2" style="width: 58%;">Forum</th>
-<th class="TableColumn2" style="width: 7%;">Topics</th>
-<th class="TableColumn2" style="width: 7%;">Posts</th>
-<th class="TableColumn2" style="width: 24%;">Last Topic</th>
-</tr>
-<?php }
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") {
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($apcresult,$apci,"CanHaveTopics");
-$SubsForumDescription=sql_result($apcresult,$apci,"Description");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-    $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-//$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<a title=\"".$SubsForumDescription."\" href=\"".$sfurl."\">".$SubsForumName."</a>";
-if($apcl==1) {
-$sflist = "Subforums:";
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist.", ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-    $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$gltnum = count($gltf); $glti = 0;
-$OldUpdateTime = 0; $UseThisFonum = null;
-if ($ForumType=="subforum") {
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($gltf[$glti]));
-$gltforesult=sql_query($gltfoquery,$SQLStat);
-$gltfonum=sql_num_rows($gltforesult);
-if($gltfonum>0) {
-$NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
-if($NewUpdateTime>$OldUpdateTime) {
-    $UseThisFonum = $gltf[$glti];
-$OldUpdateTime = $NewUpdateTime; } }
-sql_free_result($gltforesult);
-++$glti; } 
-if($UseThisFonum==0) {
-       $UseThisFonum = $gltf[0]; } }
-if ($ForumType!="subforum"&&$ForumType!="redirect") { $UseThisFonum = $gltf[0]; }
-if ($ForumType!="redirect") {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE (\"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") OR (\"OldForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") ORDER BY \"LastUpdate\" DESC LIMIT 1", array($UseThisFonum,$UseThisFonum));
-$gltresult=sql_query($gltquery,$SQLStat);
-$gltnum=sql_num_rows($gltresult);
-if($gltnum>0){
-$TopicID=sql_result($gltresult,0,"id");
-$TopicName=sql_result($gltresult,0,"TopicName");
-$NumReplys=sql_result($gltresult,0,"NumReply");
-$NumPages = null; $NumRPosts = $NumReplys + 1;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($NumRPosts>$Settings['max_posts']) {
-$NumPages = ceil($NumRPosts/$Settings['max_posts']); }
-if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
-$TopicName1 = pre_substr($TopicName,0,20);
-$oldtopicname=$TopicName;
-if (pre_strlen($TopicName)>20) {
-$TopicName1 = $TopicName1."..."; $TopicName=$TopicName1; }
-$glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
-$glrresult=sql_query($glrquery,$SQLStat);
-$glrnum=sql_num_rows($glrresult);
-if($glrnum>0){
-$ReplyID=sql_result($glrresult,0,"id");
-$UsersID=sql_result($glrresult,0,"UserID");
-$GuestsName=sql_result($glrresult,0,"GuestName");
-$TimeStamp=sql_result($glrresult,0,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TimeStamp);
-$tmpusrcurtime->setTimezone($usertz);
-$TimeStamp=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-sql_free_result($glrresult); }
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
-if($PreUsersName['Name']===null) { $UsersID = -1;
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
-$UsersName = $PreUsersName['Name'];
-$UsersHidden = $PreUsersName['Hidden'];
-$UsersName1 = pre_substr($UsersName,0,20);
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-$oldusername=$UsersName;
-if (pre_strlen($UsersName)>20) {
-$UsersName1 = $UsersName1."..."; $UsersName=$UsersName1; }
-$lul = null;
-if($UsersID>0&&$UsersHidden=="no") {
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\nUser: <a href=\"".$lul."\" title=\"".$oldusername."\">".$UsersName."</a>"; }
-if($UsersID<=0||$UsersHidden=="yes") {
-if($UsersID==-1) { $UserPre = "Guest:"; }
-if(($UsersID<-1&&$UsersHidden=="yes")||$UsersID==0||($UsersID>0&&$UsersHidden=="yes")) {
-    $UserPre = "Hidden:"; }
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\n".$UserPre." <span title=\"".$oldusername."\">".$UsersName."</span>"; } }
-if($LastTopic==null) { $LastTopic="&nbsp;<br />&nbsp;"; }
-sql_free_result($gltresult); }
-if ($ForumType=="redirect") { $LastTopic="&nbsp;<br />Redirects: ".$NumRedirects."<br />&nbsp;"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-    $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-if($ThemeSet['ForumStyle']==1) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3\" ";
-       $ForumClass[4] = " class=\"TableColumn3\" ";
-       $ForumClass[5] = " class=\"TableColumn3\" "; }
-if($ThemeSet['ForumStyle']==2) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[4] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[5] = " class=\"TableColumn3Alt\" "; }
-?>
-<tr class="TableRow3" id="Forum<?php echo $ForumID; ?>">
-<td<?php echo $ForumClass[1]; ?>><div class="forumicon">
-<?php echo $PreForum; ?></div></td>
-<td<?php echo $ForumClass[2]; ?>><div class="forumname"><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a></div>
-<div class="forumdescription">
-<?php echo $ForumDescription; ?><br />
-<?php echo $sflist; ?></div></td>
-<td<?php echo $ForumClass[3]; ?>style="text-align: center;"><?php echo $NumTopics; ?></td>
-<td<?php echo $ForumClass[4]; ?>style="text-align: center;"><?php echo $NumPosts; ?></td>
-<td<?php echo $ForumClass[5]; ?>><?php echo $LastTopic; ?></td>
-</tr>
-<?php } ++$i; } sql_free_result($result);
-if($num>=1) {
-?>
-<tr id="CatEnd<?php echo $CategoryID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="5">&nbsp;</td>
-</tr>
-</table></div>
-<?php if($prei < $prenum - 1) { ?>
-<div class="DivForums">&nbsp;</div>
-<?php } if($prei == $prenum - 1) { ?>
-<div class="DivStsts">&nbsp;</div>
-<?php } } } ++$prei; }
-sql_free_result($preresult); ?>
diff --git a/inc/function.php.bak b/inc/function.php.bak
deleted file mode 100644 (file)
index 928f942..0000000
+++ /dev/null
@@ -1,676 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: function.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="function.php"||$File3Name=="/function.php") {
-       require('index.php');
-       exit(); }
-require_once($SettDir['misc'].'functions.php');
-require_once($SettDir['misc'].'ibbcode.php');
-require_once($SettDir['misc'].'iuntar.php');
-/* In php 6 and up the function get_magic_quotes_gpc dose not exist. 
-   here we make a fake version that always sends false out. :P */
-if(!function_exists('get_magic_quotes_gpc')) {
-function get_magic_quotes_gpc() { return false; } }
-/**
- * Undo the damage of magic_quotes_gpc if in effect
- * @return bool
- * @link http://www.charles-reace.com/blog/2010/07/13/undoing-magic-quotes/
- */
-function fix_magic_quotes()
-{
-   if (get_magic_quotes_gpc()) {
-      $func = create_function(
-         '&$val, $key',
-         'if(!is_numeric($val)) {$val = stripslashes($val);}'
-      );
-      array_walk_recursive($_GET, $func);
-      array_walk_recursive($_POST, $func);
-      array_walk_recursive($_COOKIE, $func);
-   }
-   return true;
-}
-fix_magic_quotes();
-/* Change Some PHP Settings Fix the & to &amp;
-if($Settings['use_iniset']==true&&$Settings['qstr']!="/") {
-ini_set("arg_separator.output",htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']));
-ini_set("arg_separator.input",$Settings['qstr']);
-ini_set("arg_separator",htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset'])); }
-//$basepath = pathinfo($_SERVER['REQUEST_URI']);
-if(dirname($_SERVER['REQUEST_URI'])!="."||
-       dirname($_SERVER['REQUEST_URI'])!=null) {
-$basedir = dirname($_SERVER['REQUEST_URI'])."/"; }*/
-// Get the base dir name
-/*if(dirname($_SERVER['SCRIPT_NAME'])!="."||
-       dirname($_SERVER['SCRIPT_NAME'])!=null) {
-$basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
-if($basedir==null||$basedir==".") {
-if(dirname($_SERVER['SCRIPT_NAME'])=="."||
-       dirname($_SERVER['SCRIPT_NAME'])==null) {
-$basedir = dirname($_SERVER['PHP_SELF'])."/"; } }
-if($basedir=="\/") { $basedir="/"; }
-$basedir = str_replace("//", "/", $basedir);*/
-if($Settings['qstr']!="/") {
-$iDBURLCHK = $Settings['idburl']; }
-if($Settings['qstr']=="/") {
-$iDBURLCHK = preg_replace("/\/$/","",$Settings['idburl']); }
-$basecheck = parse_url($iDBURLCHK);
-$basedir = $basecheck['path'];
-$cbasedir = $basedir;
-$rbasedir = $basedir;
-if($Settings['fixbasedir']!=null&&$Settings['fixbasedir']!="off") {
-               $basedir = $Settings['fixbasedir']; }
-if($Settings['fixcookiedir']!=null&&$Settings['fixcookiedir']!="") {
-               $cbasedir = $Settings['fixcookiedir']; }
-if($Settings['fixredirectdir']!=null) {
-               $rbasedir = $Settings['fixredirectdir']; }
-$BaseURL = $basedir;
-// Get our Host Name and Referer URL's Host Name
-if(!isset($_SERVER['HTTP_REFERER'])) { $_SERVER['HTTP_REFERER'] = null; }
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-if(!isset($REFERERurl['host'])) { $REFERERurl['host'] = null; }
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $basecheck['host'];
-$REFERERurl = null;
-// Function made by Howard Yeend
-// http://php.net/manual/en/function.trigger-error.php#92016
-// http://www.puremango.co.uk/
-function output_error($message, $level=E_USER_ERROR) {
-    $caller = next(debug_backtrace());
-    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); }
-       $Names['D'] = "Dagmara";
-define("_dagmara_", $Names['D']);
-// http://us.php.net/manual/en/function.uniqid.php#94959
-/**
-  * Generates an UUID
-  * 
-  * @author     Andrew Moore
-  * @url        http://us.php.net/manual/en/function.uniqid.php#94959
-  */
-function uuid($uuidver = "v4", $rndty = "rand", $namespace = null, $name = null) {
-if($uuidver!="v3"&&$uuidver!="v4"&&$uuidver!="v5") { $uuidver = "v4"; }
-if($uuidver=="v4") {
-    return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
-      $rndty(0, 0xffff), $rndty(0, 0xffff),
-      $rndty(0, 0xffff),
-      $rndty(0, 0x0fff) | 0x4000,
-      $rndty(0, 0x3fff) | 0x8000,
-      $rndty(0, 0xffff), $rndty(0, 0xffff), $rndty(0, 0xffff) ); }
-if($uuidver=="v3"||$uuidver=="v5") {
-       if($namespace===null) {
-       $namespace = uuid("v4",$rndty); }
-    $nhex = str_replace(array('-','{','}'), '', $namespace);
-    $nstr = '';
-    for($i = 0; $i < strlen($nhex); $i+=2) {
-      if(isset($nhex[$i+1])) {
-         $nstr .= chr(hexdec($nhex[$i].$nhex[$i+1])); }
-      if(!isset($nhex[$i+1])) {
-         $nstr .= chr(hexdec($nhex[$i])); }
-    }
-       if($name===null) { $name = salt_hmac(); }
-    // Calculate hash value
-       if($uuidver=="v3") {
-       $uuidverid = 0x3000;
-       if (function_exists('hash')) {
-       $hash = hash("md5", $nstr . $name); }
-       if (!function_exists('hash')) {
-       $hash = md5($nstr . $name); } }
-       if($uuidver=="v5") {
-       $uuidverid = 0x5000;
-       if (function_exists('hash')) {
-       $hash = hash("sha1", $nstr . $name); }
-       if (!function_exists('hash')) {
-       $hash = sha1($nstr . $name); } }
-    return sprintf('%08s-%04s-%04x-%04x-%12s',
-      substr($hash, 0, 8),
-      substr($hash, 8, 4),
-      (hexdec(substr($hash, 12, 4)) & 0x0fff) | $uuidverid,
-      (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
-      substr($hash, 20, 12) ); } }
-function rand_uuid($rndty = "rand", $namespace = null, $name = null) {
-$rand_array = array(1 => "v3", 2 => "v4", 3 => "v5");
-if($name===null) { $name = salt_hmac(); }
-$my_uuid = $rand_array[$rndty(1,3)];
-if($my_uuid=="v4") { return uuid("v4",$rndty); }
-if($my_uuid=="v3"||$my_uuid=="v5") {
-return uuid($my_uuid,$rndty,$name); } }
-// unserialize sessions variables
-// By: jason@joeymail.net
-// URL: http://us2.php.net/manual/en/function.session-decode.php#101687
-function unserialize_session($data)
-{
-    if(  strlen( $data) == 0)
-    {
-        return array();
-    }
-    // match all the session keys and offsets
-    preg_match_all('/(^|;|\})([a-zA-Z0-9_]+)\|/i', $data, $matchesarray, PREG_OFFSET_CAPTURE);
-    $returnArray = array();
-    $lastOffset = null;
-    $currentKey = '';
-    foreach ( $matchesarray[2] as $value )
-    {
-        $offset = $value[1];
-        if(!is_null( $lastOffset))
-        {
-            $valueText = substr($data, $lastOffset, $offset - $lastOffset );
-            $returnArray[$currentKey] = unserialize($valueText);
-        }
-        $currentKey = $value[0];
-        $lastOffset = $offset + strlen( $currentKey )+1;
-    }
-    $valueText = substr($data, $lastOffset );
-    $returnArray[$currentKey] = unserialize($valueText);
-    return $returnArray;
-}
-// Make the Query String if we are not useing &=
-function qstring($qstr=";",$qsep="=")
-{ $_GET = array(); $_GET = null;
-if (!isset($_SERVER['QUERY_STRING'])) {
-$_SERVER['QUERY_STRING'] = getenv('QUERY_STRING'); }
-ini_set("arg_separator.input", $qstr);
-$_SERVER['QUERY_STRING'] = urldecode($_SERVER['QUERY_STRING']);
-$preqs = explode($qstr,$_SERVER["QUERY_STRING"]);
-$qsnum = count($preqs); $qsi = 0;
-while ($qsi < $qsnum) {
-$preqst = explode($qsep,$preqs[$qsi],2);
-$fix1 = array(" ",'$'); $fix2  = array("_","_");
-$preqst[0] = str_replace($fix1, $fix2, $preqst[0]);
-$preqst[0] = killbadvars($preqst[0]);
-if($preqst[0]!=null) {
-$_GET[$preqst[0]] = $preqst[1]; }
-++$qsi; } return true; }
-if($Settings['qstr']!="&"&&
-       $Settings['qstr']!="/") {
-qstring($Settings['qstr'],$Settings['qsep']); 
-if(!isset($_GET['page'])) { $_GET['page'] = null; }
-if(!isset($_GET['act'])) { $_GET['act'] = null; }
-if(!isset($_POST['act'])) { $_POST['act'] = null; }
-if(!isset($_GET['id'])) { $_GET['id'] = null; } 
-if(!isset($_GET['debug'])) { $_GET['debug'] = "false"; }
-if(!isset($_GET['post'])) { $_GET['post'] = null; }
-if(!isset($_POST['License'])) { $_POST['License'] = null; } }
-if($_SERVER['PATH_INFO']==null) {
-       if(getenv('PATH_INFO')!=null&&getenv('PATH_INFO')!="1") {
-$_SERVER['PATH_INFO'] = getenv('PATH_INFO'); }
-if(getenv('PATH_INFO')==null) {
-$myscript = $_SERVER["SCRIPT_NAME"];
-$myphpath = $_SERVER["PHP_SELF"];
-$mypathinfo = str_replace($myscript, "", $myphpath);
-@putenv("PATH_INFO=".$mypathinfo); } }
-// Change raw post data to POST array
-// Not sure why I made but alwell. :P 
-function parse_post_data()
-{ $_POST = array(); $_POST = null;
-$postdata = file_get_contents("php://input");
-if (!isset($postdata)) { $postdata = null; }
-$postdata = urldecode($postdata);
-$preqs = explode("&",$postdata);
-$qsnum = count($preqs); $qsi = 0;
-while ($qsi < $qsnum) {
-$preqst = explode("=",$preqs[$qsi],2);
-$fix1 = array(" ",'$'); $fix2  = array("_","_");
-$preqst[0] = str_replace($fix1, $fix2, $preqst[0]);
-$preqst[0] = killbadvars($preqst[0]);
-if($preqst[0]!=null) {
-$_POST[$preqst[0]] = $preqst[1]; }
-++$qsi; } return true; }
-// Change Path info to Get Vars :
-function mrstring() {
-$urlvar = explode('/',$_SERVER['PATH_INFO']);
-$num=count($urlvar); $i=1;
-while ($i < $num) {
-//$urlvar[$i] = urldecode($urlvar[$i]);
-if(!isset($_GET[$urlvar[$i]])) { $_GET[$urlvar[$i]] = null; }
-if(!isset($urlvar[$i])) { $urlvar[$i] = null; }
-if($_GET[$urlvar[$i]]==null&&$urlvar[$i]!=null) {
-$fix1 = array(" ",'$'); $fix2  = array("_","_");
-$urlvar[$i] = str_replace($fix1, $fix2, $urlvar[$i]);
-$urlvar[$i] = killbadvars($urlvar[$i]);
-       $_GET[$urlvar[$i]] = $urlvar[$i+1]; }
-++$i; ++$i; } return true; }
-// Redirect to another file with ether timed or nontimed redirect
-function redirect($type,$file,$time=0,$url=null,$dbsr=true) {
-if($type!="location"&&$type!="refresh") { $type=="location"; }
-if($url!=null) { $file = $url.$file; }
-if($dbsr===true) { $file = str_replace("//", "/", $file); }
-if($type=="refresh") { header("Refresh: ".$time."; URL=".$file); }
-if($type=="location") { session_write_close(); 
-header("Location: ".$file); } return true; }
-function redirects($type,$url,$time=0) {
-if($type!="location"&&$type!="refresh") { $type=="location"; }
-if($type=="refresh") { header("Refresh: ".$time."; URL=".$url); }
-if($type=="location") { idb_log_maker(302,"-"); }
-if($type=="location") { header("Location: ".$url); } return true; }
-// Make xhtml tags
-function html_tag_make($name="br",$emptytag=true,$attbvar=null,$attbval=null,$extratest=null) {
-       $var_num = count($attbvar); $value_num = count($attbval);
-       if($var_num!=$value_num) { 
-               output_error("Erorr Number of Var and Values dont match!",E_USER_ERROR);
-       return false; } $i = 0;
-       while ($i < $var_num) {
-       if($i==0) { $mytag = "<".$name." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
-       if($i>=1) { $mytag = $mytag." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
-       if($i==$var_num-1) { 
-       if($emptytag===false) { $mytag = $mytag.">"; }
-       if($emptytag===true) { $mytag = $mytag." />"; } }       ++$i; }
-       if($attbvar==null&&$attbval==null) { $mytag = "<".$name;
-       if($emptytag===true) { $mytag = $mytag." />"; }
-       if($emptytag===false) { $mytag = $mytag.">"; } }
-       if($emptytag===false&&$extratest!=null) { 
-       $mytag = $mytag.$extratest; $mytag = $mytag."</".$name.">"; } 
-       return $mytag; }
-// Start a xml document
-function xml_tag_make($type,$attbs,$retval=false) {
-       $renee1 = explode("&",$attbs);
-       $reneenum=count($renee1);
-       $reneei=0; $attblist = null;
-       while ($reneei < $reneenum) {
-       $renee2 = explode("=",$renee1[$reneei]);
-       if($renee2[0]!=null||$renee2[1]!=null) {
-       $attblist = $attblist.' '.$renee2[0].'="'.$renee2[1].'"'; }
-       ++$reneei; }
-       if($retval!==false&&$retval!==true) { $retval=false; }
-       if($retval===false) {
-       echo '<?'.$type.$attblist.'?>'."\n"; }
-       if($retval===true) {
-       return '<?'.$type.$attblist.'?>'."\n"; } }
-// Start a xml document (old version)
-function xml_doc_start($ver,$encode,$retval=false) {
-       if($retval===false) {
-       echo xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); }
-       if($retval===true) {
-       return xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); } }
-$icharset = $Settings['charset'];
-$debug_on = false;
-if(isset($_GET['debug'])) {
-if($_GET['debug']=="true"||
-       $_GET['debug']=="on") {
-$debug_on = true; } }
-$BoardURL = $Settings['idburl'];
-// Change URLs to Links
-function pre_url2link($matches) {
-global $BoardURL; $opennew = true;
-$burlCHCK = parse_url($BoardURL);
-$urlCHCK = parse_url($matches[0]);
-if($urlCHCK['host']==$burlCHCK['host']) {
-       $opennew = false; }
-$outurl = $urlCHCK['scheme']."://";
-if(isset($urlCHCK['user'])) {
-$outurl = $outurl.$urlCHCK['user'];
-if(isset($urlCHCK['pass'])) {
-$outurl = $outurl.":".$urlCHCK['pass']; }
-$outurl = $outurl."@"; }
-$outurl = $outurl.$urlCHCK['host'];
-if(isset($urlCHCK['path'])) {
-$outurl = $outurl.$urlCHCK['path']; }
-if(!isset($urlCHCK['path'])) {
-$outurl = $outurl."/"; }
-if(isset($urlCHCK['query'])) {
-$urlCHCK['query'] = str_replace(" ", "+", $urlCHCK['query']);
-$outurl = $outurl."?".$urlCHCK['query']; }
-if(isset($urlCHCK['fragment'])) {
-$urlCHCK['fragment'] = str_replace(" ", "+", $urlCHCK['fragment']);
-$outurl = $outurl."#".$urlCHCK['fragment']; }
-if($opennew===true) {
-$outlink = "<a onclick=\"window.open(this.href); return false;\" href=\"".$outurl."\">".$outurl."</a>"; }
-if($opennew===false) {
-$outlink = "<a href=\"".$outurl."\">".$outurl."</a>"; }
-return $outlink; }
-function url2link($string) {
-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); }
-function urlcheck($string) {
-global $BoardURL;
-$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); 
-if(isset($urlcheck[0][0])) { $url = $urlcheck[0][0]; }
-if(!isset($urlcheck[0][0])) { $url = $BoardURL; }
-return $url; }
-//Check to make sure theme exists
-$BoardTheme = $Settings['DefaultTheme'];
-$ThemeDir = $SettDir['themes'];
-function chack_themes($theme) {
-global $BoardTheme,$ThemeDir;
-if(!isset($theme)) { $theme = null; }
-if(preg_match("/([a-zA-Z]+)\:/isU",$theme)) {
-       $theme = $BoardTheme; }
-if(!preg_match("/^[a-z0-9]+$/isU",$theme)) {
-       $theme = $BoardTheme; }
-require('settings.php');
-$ckskindir = dirname(realpath("settings.php"))."/".$ThemeDir;
-if ($handle = opendir($ckskindir)) { $dirnum = null;
-   while (false !== ($ckfile = readdir($handle))) {
-          if ($dirnum==null) { $dirnum = 0; }
-          if (is_dir($ckskindir.$ckfile)&&file_exists($ckskindir.$ckfile."/info.php")) {
-                  if ($ckfile != "." && $ckfile != "..") {
-          //include($ckskindir.$ckfile."/info.php");
-       $cktheme[$dirnum] =  $ckfile;
-          ++$dirnum; } } }
-   closedir($handle); asort($cktheme); }
-$theme=preg_replace("/(.*?)\.\/(.*?)/", $BoardTheme, $theme);
-if(!in_array($theme,$cktheme)||strlen($theme)>26) {
-       $theme = $BoardTheme; } return $theme; }
-// Make a url with query string
-function url_maker($file="index",$ext=".php",$qvarstr=null,$qstr=";",$qsep="=",$prexqstr=null,$exqstr=null,$fixhtml=true) {
-global $sidurls, $icharset, $debug_on;
-$fileurl = null; if(!isset($ext)) { $ext = null; }
-if($ext==null) { $ext = ".php"; } 
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $ext = null; }
-$file = $file.$ext;
-if($sidurls=="on"&&$qstr!="/") { 
-       if(defined('SID')) {
-if($qvarstr==null) { $qvarstr = SID; }
-if($qvarstr!=null) { $qvarstr = SID."&".$qvarstr; } } }
-if($debug_on===true) {
-if($qvarstr==null) { $qvarstr = "debug=on"; }
-if($qvarstr!=null) { $qvarstr = $qvarstr."&debug=on"; } }
-if($qvarstr==null) { $fileurl = $file; }
-if($fixhtml===true) {
-$qstr = htmlentities($qstr, ENT_QUOTES, $icharset);
-$qsep = htmlentities($qsep, ENT_QUOTES, $icharset); }
-if($prexqstr!=null) { 
-$rene1 = explode("&",$prexqstr);
-$renenum=count($rene1);
-$renei=0;
-$reneqstr = "index.php?";
-if($qstr!="/") { $fileurl = $file."?"; }
-if($qstr=="/") { $fileurl = $file."/"; }
-while ($renei < $renenum) {
-       $rene2 = explode("=",$rene1[$renei]);
-       if(!isset($rene2[0])) { $rene2[0] = null; }
-       $rene2[1] = urlencode($rene2[1]);
-       if(!isset($rene2[0])) { $rene2[0] = null; }
-       $rene2[1] = urlencode($rene2[1]);
-       if($qstr!="/") {
-       $fileurl = $fileurl.$rene2[0].$qsep.$rene2[1]; }
-       if($qstr=="/") {
-       $fileurl = $fileurl.$rene2[0]."/".$rene2[1]."/"; }
-       $reneis = $renei + 1;
-       if($qstr!="/") {
-       if($reneis < $renenum) { $fileurl = $fileurl.$qstr; } }
-       ++$renei; } }
-if($qvarstr!=null&&$qstr!="/") { $fileurl = $fileurl.$qstr; }
-if($qvarstr!=null) { 
-if($prexqstr==null) {
-if($qstr!="/") { $fileurl = $file."?"; }
-if($qstr=="/") { $fileurl = $file."/"; } }
-$cind1 = explode("&",$qvarstr);
-$cindnum=count($cind1);
-$cindi=0;
-$cindqstr = "index.php?";
-while ($cindi < $cindnum) {
-       $cind2 = explode("=",$cind1[$cindi]);
-       if(!isset($cind2[0])) { $cind2[0] = null; }
-       $cind2[0] = urlencode($cind2[0]);
-       if(!isset($cind2[1])) { $cind2[1] = null; }
-       $cind2[1] = urlencode($cind2[1]);
-       if($qstr!="/") {
-       $fileurl = $fileurl.$cind2[0].$qsep.$cind2[1]; }
-       if($qstr=="/") {
-       $fileurl = $fileurl.$cind2[0]."/".$cind2[1]."/"; }
-       $cindis = $cindi + 1;
-       if($qstr!="/") {
-       if($cindis < $cindnum) { $fileurl = $fileurl.$qstr; } }
-       ++$cindi; } }
-if($exqstr!=null&&$qstr!="/") { $fileurl = $fileurl.$qstr; }
-if($exqstr!=null) { 
-if($qvarstr==null&&$prexqstr==null) {
-if($qstr!="/") { $fileurl = $file."?"; }
-if($qstr=="/") { $fileurl = $file."/"; } }
-$sand1 = explode("&",$exqstr);
-$sanum=count($sand1);
-$sandi=0;
-$sandqstr = "index.php?";
-while ($sandi < $sanum) {
-       $sand2 = explode("=",$sand1[$sandi]);
-       if(!isset($sand2[0])) { $sand2[0] = null; }
-       $sand2[0] = urlencode($sand2[0]);
-       if(!isset($sand2[1])) { $sand2[1] = null; }
-       $sand2[1] = urlencode($sand2[1]);
-       if($qstr!="/") {
-       $fileurl = $fileurl.$sand2[0].$qsep.$sand2[1]; }
-       if($qstr=="/") {
-       $fileurl = $fileurl.$sand2[0]."/".$sand2[1]."/"; }
-       $sandis = $sandi + 1;
-       if($qstr!="/") {
-       if($sandis < $sanum) { $fileurl = $fileurl.$qstr; } }
-       ++$sandi; } }
-return $fileurl; }
-$thisdir = dirname(realpath("Preindex.php"))."/";
-// Get the Query String
-function GetQueryStr($qstr=";",$qsep="=",$fixhtml=true)
-{ $pregqstr = preg_quote($qstr,"/");
-$pregqsep = preg_quote($qsep,"/");
-$oqstr = $qstr; $oqsep = $qsep;
-if($fixhtml===true||$fixhtml==null) {
-$qstr = htmlentities($qstr, ENT_QUOTES, $icharset);
-$qsep = htmlentities($qsep, ENT_QUOTES, $icharset); }
-$OldBoardQuery = preg_replace("/".$pregqstr."/isxS", $qstr, $_SERVER['QUERY_STRING']);
-$BoardQuery = "?".$OldBoardQuery;
-return $BoardQuery; }
-function log_fix_quotes($logtxt) {
-       $logtxt = str_replace("\"", "\\\"", $logtxt);
-       $logtxt = str_replace("'", "", $logtxt);
-       return $logtxt; }
-function get_server_values($matches) {
-       $return_text = "-";
-       if(isset($_SERVER[$matches[1]])) { $return_text = $_SERVER[$matches[1]]; }
-       if(!isset($_SERVER[$matches[1]])) { $return_text = "-"; }
-       return $return_text; }
-function get_cookie_values($matches) {
-       $return_text = null;
-       if(isset($_COOKIE[$matches[1]])) { $return_text = $_COOKIE[$matches[1]]; }
-       if(!isset($_COOKIE[$matches[1]])) { $return_text = null; }
-       return $return_text; }
-function get_env_values($matches) {
-       $return_text = getenv($matches[1]);
-       if(!isset($return_text)) { $return_text = "-"; }
-       return $return_text; }
-function get_setting_values($matches) {
-       global $Settings;
-       $return_text = null;
-       $matches[1] = str_replace("sqlpass", "sqluser", $matches[1]);
-       if(isset($Settings[$matches[1]])) { $return_text = $Settings[$matches[1]]; }
-       if(!isset($Settings[$matches[1]])) { $return_text = null; }
-       return $return_text; }
-function log_fix_get_server_values($matches) {
-       return log_fix_quotes(get_server_values($matches)); }
-function log_fix_get_cookie_values($matches) {
-       return log_fix_quotes(get_cookie_values($matches)); }
-function log_fix_get_env_values($matches) {
-       return log_fix_quotes(get_env_values($matches)); }
-function log_fix_get_setting_values($matches) {
-       return log_fix_quotes(get_setting_values($matches)); }
-function get_time($matches) {
-       return date(convert_strftime($matches[1])); }
-function convert_strftime($strftime) {
-$strftime = str_replace("%%", "{percent\}p", $strftime);
-$strftime = str_replace("%a", "D", $strftime);
-$strftime = str_replace("%A", "l", $strftime);
-$strftime = str_replace("%d", "d", $strftime);
-$strftime = str_replace("%e", "j", $strftime);
-$strftime = str_replace("%j", "z", $strftime);
-$strftime = str_replace("%u", "w", $strftime);
-$strftime = str_replace("%w", "w", $strftime);
-$strftime = str_replace("%U", "W", $strftime);
-$strftime = str_replace("%V", "W", $strftime);
-$strftime = str_replace("%W", "W", $strftime);
-$strftime = str_replace("%b", "M", $strftime);
-$strftime = str_replace("%B", "F", $strftime);
-$strftime = str_replace("%h", "M", $strftime);
-$strftime = str_replace("%m", "m", $strftime);
-$strftime = str_replace("%g", "y", $strftime);
-$strftime = str_replace("%G", "Y", $strftime);
-$strftime = str_replace("%y", "y", $strftime);
-$strftime = str_replace("%Y", "Y", $strftime);
-$strftime = str_replace("%H", "H", $strftime);
-$strftime = str_replace("%I", "h", $strftime);
-$strftime = str_replace("%l", "g", $strftime);
-$strftime = str_replace("%M", "i", $strftime);
-$strftime = str_replace("%p", "A", $strftime);
-$strftime = str_replace("%P", "a", $strftime);
-$strftime = str_replace("%r", "h:i:s A", $strftime);
-$strftime = str_replace("%R", "H:i", $strftime);
-$strftime = str_replace("%S", "s", $strftime);
-$strftime = str_replace("%T", "H:i:s", $strftime);
-$strftime = str_replace("%X", "H:i:s", $strftime);
-$strftime = str_replace("%z", "O", $strftime);
-$strftime = str_replace("%Z", "O", $strftime);
-$strftime = str_replace("%c", "D M j H:i:s Y", $strftime);
-$strftime = str_replace("%D", "m/d/y", $strftime);
-$strftime = str_replace("%F", "Y-m-d", $strftime);
-$strftime = str_replace("%x", "m/d/y", $strftime);
-$strftime = str_replace("%n", "\n", $strftime);
-$strftime = str_replace("%t", "\t", $strftime);
-$strftime = preg_replace("/\{percent\}p/s", "%", $strftime);
-return $strftime; }
-function apache_log_maker($logtxt,$logfile=null,$status=200,$contentsize="-",$headersize=0) {
-global $Settings;
-if(isset($Settings['DefaultTimeZone'])) {
-$servtz = new DateTimeZone($Settings['DefaultTimeZone']); }
-if(!isset($Settings['DefaultTimeZone'])) {
-$servtz = new DateTimeZone(date_default_timezone_get()); }
-$servcurtime = new DateTime();
-$servcurtime->setTimezone($servtz);
-if(!isset($_SERVER['HTTP_REFERER'])) { $LOG_URL_REFERER = "-"; }
-if(isset($_SERVER['HTTP_REFERER'])) { $LOG_URL_REFERER = $_SERVER['HTTP_REFERER']; }
-if($LOG_URL_REFERER==""||$LOG_URL_REFERER==null) { $LOG_URL_REFERER = "-"; }
-if(trim($LOG_URL_REFERER, "\x00..\x1F") == "") { $LOG_URL_REFERER = "-"; }
-$LOG_URL_REFERER = log_fix_quotes($LOG_URL_REFERER);
-if(!isset($_SERVER['PHP_AUTH_USER'])) { $LOG_AUTH_USER = "-"; }
-if(isset($_SERVER['PHP_AUTH_USER'])) { $LOG_AUTH_USER = $_SERVER['PHP_AUTH_USER']; }
-if($LOG_AUTH_USER==""||$LOG_AUTH_USER==null) { $LOG_AUTH_USER = "-"; }
-if(trim($LOG_AUTH_USER, "\x00..\x1F") == "") { $LOG_AUTH_USER = "-"; }
-$LOG_AUTH_USER = log_fix_quotes($LOG_AUTH_USER);
-if(!isset($_SERVER["HTTP_USER_AGENT"])) { $LOG_USER_AGENT = "-"; }
-if(isset($_SERVER["HTTP_USER_AGENT"])) { $LOG_USER_AGENT = $_SERVER["HTTP_USER_AGENT"]; }
-if($LOG_USER_AGENT==""||$LOG_USER_AGENT==null) { $LOG_USER_AGENT = "-"; }
-if(trim($LOG_USER_AGENT, "\x00..\x1F") == "") { $LOG_USER_AGENT = "-"; }
-$LOG_USER_AGENT = log_fix_quotes($LOG_USER_AGENT);
-$LogMemName = "-";
-if(!isset($_SESSION['MemberName'])) {
-       $_SESSION['MemberName'] = null; }
-if($_SESSION['MemberName']===null) {
-       $LogMemName = "-"; }
-if(isset($_SESSION['MemberName'])&&$_SESSION['MemberName']!==null) {
-       $LogMemName = $_SESSION['MemberName']; }
-if(trim($LogMemName, "\x00..\x1F") == "") { $LogMemName = "-"; }
-$LogMemName = log_fix_quotes($LogMemName);
-$LogMemID = "-";
-if(!isset($_SESSION['UserID'])) {
-       $_SESSION['UserID'] = 0; }
-if($_SESSION['UserID']===null||$_SESSION['UserID']===0) {
-       $LogMemID = "-"; }
-if(isset($_SESSION['UserID'])&&$_SESSION['UserID']!==null&&$_SESSION['UserID']!==0) {
-       $LogMemID = $_SESSION['UserID']; }
-if(trim($LogMemID, "\x00..\x1F") == "") { $LogMemID = "-"; }
-$LogMemID = log_fix_quotes($LogMemID);
-$LogGroupName = "-";
-if(!isset($_SESSION['UserGroup'])) {
-       $LogGroupName = "-"; }
-if(isset($_SESSION['UserGroup'])&&$_SESSION['UserGroup']===null) {
-       $LogGroupName = "-"; }
-if(isset($_SESSION['UserGroup'])&&$_SESSION['UserGroup']!==null) {
-       $LogGroupName = $_SESSION['UserGroup']; }
-if(trim($LogGroupName, "\x00..\x1F") == "") { $LogGroupName = "-"; }
-$LogGroupName = log_fix_quotes($LogGroupName);
-$LogGroupID = "-";
-if(!isset($_SESSION['UserGroupID'])) {
-       $LogGroupID = "-"; }
-if(isset($_SESSION['UserGroupID'])&&$_SESSION['UserGroupID']===null) {
-       $LogGroupID = "-"; }
-if(isset($_SESSION['UserGroupID'])&&$_SESSION['UserGroupID']!==null) {
-       $LogGroupID = $_SESSION['UserGroupID']; }
-if(trim($LogGroupID, "\x00..\x1F") == "") { $LogGroupID = "-"; }
-$LogGroupID = log_fix_quotes($LogGroupID);
-$LOG_QUERY_STRING = "";
-if($_SERVER["QUERY_STRING"]!=="") {
-$LOG_QUERY_STRING = "?".$_SERVER["QUERY_STRING"]; }
-if(trim($LOG_QUERY_STRING, "\x00..\x1F") == "") { $LOG_QUERY_STRING = ""; }
-$LOG_QUERY_STRING = log_fix_quotes($LOG_QUERY_STRING);
-$oldcontentsize = $contentsize;
-if($oldcontentsize=="-") { $oldcontentsize = 0; }
-if($contentsize===0) { $contentsize = "-"; }
-if($contentsize=="-"&&$headersize!==0) { $fullsitesize = $headersize; }
-if($contentsize!="-"&&$headersize!==0) { $fullsitesize = $contentsize + $headersize; }
-if($status=="302") { $contentsize = "-"; }
-$HTTP_REQUEST_LINE = $_SERVER["REQUEST_METHOD"]." ".$_SERVER["REQUEST_URI"]." ".$_SERVER["SERVER_PROTOCOL"];
-$HTTP_REQUEST_LINE = log_fix_quotes($HTTP_REQUEST_LINE);
-$logtxt = preg_replace("/%%/s", "{percent}p", $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)a/s", $_SERVER['REMOTE_ADDR'], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)A/s", $_SERVER["SERVER_ADDR"], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)B/s", $oldcontentsize, $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)b/s", $contentsize, $logtxt);
-$logtxt = preg_replace_callback("/%([\<\>]*?)\{([^\}]*)\}C/s", "get_cookie_values", $logtxt);
-$logtxt = preg_replace_callback("/%([\<\>]*?)\{([^\}]*)\}e/s", "get_env_values", $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)f/s", log_fix_quotes($_SERVER["SCRIPT_FILENAME"]), $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)h/s", $_SERVER['REMOTE_ADDR'], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)H/s", $_SERVER["SERVER_PROTOCOL"], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)\{Referer\}i/s", $LOG_URL_REFERER, $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)\{User-Agent\}i/s", $LOG_USER_AGENT, $logtxt);
-$logtxt = preg_replace_callback("/%([\<\>]*?)\{([^\}]*)\}i/s", "get_server_values", $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)l/s", "-", $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)m/s", $_SERVER["REQUEST_METHOD"], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)p/s", $_SERVER["SERVER_PORT"], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)q/s", $LOG_QUERY_STRING, $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)r/s", $HTTP_REQUEST_LINE, $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)s/s", $status, $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)t/s", "[".$servcurtime->format("d/M/Y:H:i:s O")."]", $logtxt);
-$logtxt = preg_replace_callback("/%([\<\>]*?)\{([^\}]*)\}t/s", "get_time", $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)u/s", $LOG_AUTH_USER, $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)U/s", log_fix_quotes($_SERVER["PHP_SELF"]), $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)v/s", $_SERVER["SERVER_NAME"], $logtxt);
-$logtxt = preg_replace("/%([\<\>]*?)V/s", $_SERVER["SERVER_NAME"], $logtxt);
-// Not what it should be but PHP dose not have variable to get Apache ServerName config value. :( 
-$logtxt = preg_replace("/%([\<\>]*?)O/s", $fullsitesize, $logtxt);
-$logtxt = preg_replace_callback("/%([\<\>]*?)\{([^\}]*)\}s/s", "get_setting_values", $logtxt);
-$logtxt = preg_replace("/\%\{UserName\}m/s", $LogMemName, $logtxt);
-$logtxt = preg_replace("/\%\{MemberName\}m/s", $LogMemName, $logtxt);
-$logtxt = preg_replace("/\%\{UserID\}m/s", $LogMemID, $logtxt);
-$logtxt = preg_replace("/\%\{MemberID\}m/s", $LogMemID, $logtxt);
-$logtxt = preg_replace("/\%\{UserGroup\}m/s", $LogGroupName, $logtxt);
-$logtxt = preg_replace("/\%\{MemberGroup\}m/s", $LogGroupName, $logtxt);
-$logtxt = preg_replace("/\%\{UserGroupID\}m/s", $LogGroupID, $logtxt);
-$logtxt = preg_replace("/\%\{MemberGroupID\}m/s", $LogGroupID, $logtxt);
-$logtxt = preg_replace("/\{percent\}p/s", "%", $logtxt);
-if(isset($logfile)&&$logfile!==null) {
-       $fp = fopen($logfile, "a+");
-       if (flock($fp, LOCK_EX)) {
-               $logtxtnew = $logtxt."\r\n";
-               fwrite($fp, $logtxtnew, strlen($logtxtnew)); 
-               flock($fp, LOCK_UN); }
-       fclose($fp); 
-       @chmod($logfile, 0666); }
-return $logtxt; }
-function idb_log_maker($status=200,$contentsize="-") {
-global $Settings,$SettDir;
-if(isset($Settings['DefaultTimeZone'])) {
-$servtz = new DateTimeZone($Settings['DefaultTimeZone']); }
-if(!isset($Settings['DefaultTimeZone'])) {
-$servtz = new DateTimeZone(date_default_timezone_get()); }
-$servcurtime = new DateTime();
-$servcurtime->setTimezone($servtz);
-if(!isset($Settings['log_http_request'])) {
-       $Settings['log_http_request'] = "off"; }
-if(!isset($Settings['log_config_format'])) {
-       $Settings['log_config_format'] = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""; }
-if(isset($Settings['log_http_request'])&&$Settings['log_http_request']=="on"&&
-       $Settings['log_http_request']!==null&&$Settings['log_http_request']!="off") {
-return apache_log_maker($Settings['log_config_format'], $SettDir['logs'].$Settings['sqltable'].$servcurtime->format("Ym").".log", $status, $contentsize, strlen(implode("\r\n",headers_list())."\r\n\r\n")); }
-if(isset($Settings['log_http_request'])&&$Settings['log_http_request']!="on"&&
-       $Settings['log_http_request']!==null&&$Settings['log_http_request']!="off") {
-$Settings['log_http_request'] = preg_replace_callback("/".preg_quote("%{", "/")."([^\}]*)".preg_quote("}t", "/")."/s", "get_time", $Settings['log_http_request']);
-$Settings['log_http_request'] = preg_replace_callback("/".preg_quote("%{", "/")."([^\}]*)".preg_quote("}s", "/")."/s", "get_setting_values", $Settings['log_http_request']);
-return apache_log_maker($Settings['log_config_format'], $SettDir['logs'].$Settings['log_http_request'], $status, $contentsize, strlen(implode("\r\n",headers_list())."\r\n\r\n")); } }
-?>
diff --git a/inc/groupsetup.php.bak b/inc/groupsetup.php.bak
deleted file mode 100644 (file)
index 5b2bca7..0000000
+++ /dev/null
@@ -1,520 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: groupsetup.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="groupsetup.php"||$File3Name=="/groupsetup.php") {
-       require('index.php');
-       exit(); }
-//Set members temp location
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Board index";
-$_SESSION['ExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-/*$ggidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
-$ggidresult=sql_query($ggidquery,$SQLStat);
-$Settings['GuestGroupID']=sql_result($ggidresult,0,"id");*/
-// Check to make sure MemberInfo is right
-$MyPostCountChk = null; $MyKarmaCount = null;
-if(!isset($_SESSION['UserID'])) { $_SESSION['UserID'] = 0; }
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) { $BanError = null;
-$kgbquerychkusr = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' AND \"UserPassword\"='%s' AND \"id\"=%i LIMIT 1", array($_SESSION['MemberName'],$_SESSION['UserPass'],$_SESSION['UserID'])); 
-$resultchkusr=sql_query($kgbquerychkusr,$SQLStat);
-$numchkusr=sql_num_rows($resultchkusr);
-if($numchkusr==1) {
-$ChkUsrID=sql_result($resultchkusr,0,"id");
-$ChkUsrName=sql_result($resultchkusr,0,"Name");
-$ChkUsrGroup=sql_result($resultchkusr,0,"GroupID");
-$ChkUsrGroupID=$ChkUsrGroup;
-$ChkUsrLevel=sql_result($resultchkusr,0,"LevelID");
-$ChkUsrLevelID=$ChkUsrLevel;
-$ChkUsrPass=sql_result($resultchkusr,0,"UserPassword");
-$ChkUsrTimeZone=sql_result($resultchkusr,0,"TimeZone");
-$ChkUsrDateFormat=sql_result($resultchkusr,0,"DateFormat");
-$ChkUsrTimeFormat=sql_result($resultchkusr,0,"TimeFormat");
-$ChkUsrTheme=sql_result($resultchkusr,0,"UseTheme");
-$ChkUsrLastPostTime=sql_result($resultchkusr,0,"LastPostTime");
-$MyPostCountChk=sql_result($resultchkusr,0,"PostCount");
-$MyKarmaCount=sql_result($resultchkusr,0,"Karma");
-$MyKarmaUpdate=sql_result($resultchkusr,0,"KarmaUpdate");
-$MyRepliesPerPage=sql_result($resultchkusr,0,"RepliesPerPage");
-$Settings['max_posts'] = $MyRepliesPerPage;
-$MyTopicsPerPage=sql_result($resultchkusr,0,"TopicsPerPage");
-$Settings['max_topics'] = $MyTopicsPerPage;
-$MyMessagesPerPage=sql_result($resultchkusr,0,"MessagesPerPage");
-$Settings['max_memlist'] = $MyMessagesPerPage;
-$Settings['max_pmlist'] = $MyMessagesPerPage;
-$svrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($ChkUsrGroup));
-$svrgresultkgb=sql_query($svrquery,$SQLStat);
-$ChkUsrGroup=sql_result($svrgresultkgb,0,"Name"); 
-$ChkUsrBanTime=sql_result($resultchkusr,0,"BanTime");
-$ChkUsrGMTime = $utccurtime->getTimestamp();
-if($ChkUsrBanTime!=0&&$ChkUsrBanTime!=null) {
-if($ChkUsrBanTime>=$ChkUsrGMTime) { $BanError = "yes"; }
-if($ChkUsrBanTime<0) { $BanError = "yes"; } }
-if($BanError!="yes") {
-$_SESSION['Theme']=$ChkUsrTheme;
-$_SESSION['MemberName']=$ChkUsrName;
-$_SESSION['UserID']=$ChkUsrID;
-$_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
-$_SESSION['UserTimeZone']=$ChkUsrTimeZone;
-$usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-$usercurtime->setTimestamp($defcurtime->getTimestamp());
-$usercurtime->setTimezone($usertz);
-$_SESSION['iDBDateFormat']=$ChkUsrDateFormat;
-$_SESSION['iDBTimeFormat']=$ChkUsrTimeFormat;
-$_SESSION['UserGroup']=$ChkUsrGroup;
-$_SESSION['UserGroupID']=$ChkUsrGroupID;
-$_SESSION['UserPass']=$ChkUsrPass;
-$_SESSION['LastPostTime'] = $ChkUsrLastPostTime; } }
-if($numchkusr<=0||$numchkusr>1||$BanError=="yes") { session_unset();
-if($cookieDomain==null) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain); } }
-unset($_COOKIE[session_name()]);
-$_SESSION = array(); session_unset(); session_destroy();
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false)); sql_free_result($resultchkusr); sql_free_result($svrgresultkgb);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($resultchkusr); sql_free_result($svrgresultkgb); }
-if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
-$_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
-$_SESSION['MemberName'] = null;
-$_SESSION['UserGroup'] = $Settings['GuestGroup']; 
-$gidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
-$gidresult=sql_query($gidquery,$SQLStat);
-$_SESSION['UserGroupID']=sql_result($gidresult,0,"id"); 
-sql_free_result($gidresult); }
-if($_SESSION['MemberName']==null) { $_SESSION['UserID'] = "0";
-$_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
-$_SESSION['UserGroup'] = $Settings['GuestGroup']; 
-$gidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
-$gidresult=sql_query($gidquery,$SQLStat);
-$_SESSION['UserGroupID']=sql_result($gidresult,0,"id"); 
-sql_free_result($gidresult); }
-if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
- $levnum = 0; }
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
-$levquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($ChkUsrLevelID));
-$levresult=sql_query($levquery,$SQLStat);
-$levnum=sql_num_rows($levresult);
-if($levnum<=0) { $GruError = true; sql_free_result($levresult);
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
-ob_clean(); echo "Sorry could not find level data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($levnum>=1) {
-$LevelInfo['ID']=sql_result($levresult,0,"id");
-if(!is_numeric($LevelInfo['ID'])) { $GruError = true; }
-$LevelInfo['Name']=sql_result($levresult,0,"Name");
-$LevelInfo['PromoteTo']=sql_result($levresult,0,"PromoteTo");
-$LevelInfo['PromotePosts']=sql_result($levresult,0,"PromotePosts");
-if(!is_numeric($LevelInfo['PromotePosts'])) { 
-       $LevelInfo['PromotePosts'] = 0; $LevelInfo['PromoteTo'] = 0; }
-$LevelInfo['PromoteKarma']=sql_result($levresult,0,"PromoteKarma");
-if(!is_numeric($LevelInfo['PromoteKarma'])) { 
-       $LevelInfo['PromoteKarma'] = 0; $LevelInfo['PromoteTo'] = 0; } }
-// Member Group Setup
-if(!isset($_SESSION['UserGroup'])) { $_SESSION['UserGroup'] = null; }
-if($_SESSION['UserGroup']==null) { 
-$_SESSION['UserGroup']=$Settings['GuestGroup']; } $GruError = null;
-$gruquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($_SESSION['UserGroup']));
-$gruresult=sql_query($gruquery,$SQLStat);
-$grunum=sql_num_rows($gruresult);
-if($grunum<=0) { $GruError = true; sql_free_result($gruresult);
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
-ob_clean(); echo "Sorry could not find group data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserID']!=0) {
-$memprequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID'])); }
-if($_SESSION['UserID']==0) {
-$memprequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array(-1)); }
-$mempreresult=sql_query($memprequery,$SQLStat);
-$memprenum=sql_num_rows($mempreresult);
-if($grunum>=1) {
-$GroupInfo['ID']=sql_result($gruresult,0,"id");
-if(!is_numeric($GroupInfo['ID'])) { $GruError = true; }
-$GroupInfo['Name']=sql_result($gruresult,0,"Name");
-$GroupInfo['PermissionID']=sql_result($mempreresult,0,"PermissionID");
-if(!is_numeric($GroupInfo['PermissionID'])||$GroupInfo['PermissionID']=="0") {
-$GroupInfo['PermissionID']=sql_result($gruresult,0,"PermissionID");
-if(!is_numeric($GroupInfo['PermissionID'])) { $GruError = true; } }
-$GroupInfo['NamePrefix']=sql_result($gruresult,0,"NamePrefix");
-$GroupInfo['NameSuffix']=sql_result($gruresult,0,"NameSuffix");
-$GroupInfo['CanViewBoard']=sql_result($mempreresult,0,"CanViewBoard");
-if($GroupInfo['CanViewBoard']!="yes"&&$GroupInfo['CanViewBoard']!="no"&&$GroupInfo['CanViewBoard']!="group") {
-               $GruError = true; }
-if($GroupInfo['CanViewBoard']=="group") {
-$GroupInfo['CanViewBoard']=sql_result($gruresult,0,"CanViewBoard");
-if($GroupInfo['CanViewBoard']!="yes"&&$GroupInfo['CanViewBoard']!="no") {
-               $GruError = true; } }
-$GroupInfo['CanViewOffLine']=sql_result($mempreresult,0,"CanViewOffLine");
-if($GroupInfo['CanViewOffLine']!="yes"&&$GroupInfo['CanViewOffLine']!="no"&&$GroupInfo['CanViewOffLine']!="group") {
-               $GruError = true; }
-if($GroupInfo['CanViewOffLine']=="group") {
-$GroupInfo['CanViewOffLine']=sql_result($gruresult,0,"CanViewOffLine");
-if($GroupInfo['CanViewOffLine']!="yes"&&$GroupInfo['CanViewOffLine']!="no") {
-               $GruError = true; } }
-$GroupInfo['FloodControl']=sql_result($mempreresult,0,"FloodControl");
-if(!is_numeric($GroupInfo['FloodControl'])) { $GroupInfo['FloodControl'] = 30; }
-if($GroupInfo['FloodControl']==-1) {
-$GroupInfo['FloodControl']=sql_result($gruresult,0,"FloodControl");
-if(!is_numeric($GroupInfo['FloodControl'])) { $GroupInfo['FloodControl'] = 30; } }
-$GroupInfo['SearchFlood']=sql_result($mempreresult,0,"SearchFlood");
-if(!is_numeric($GroupInfo['SearchFlood'])) { $GroupInfo['SearchFlood'] = 30; }
-if($GroupInfo['SearchFlood']==-1) {
-$GroupInfo['SearchFlood']=sql_result($gruresult,0,"SearchFlood");
-if(!is_numeric($GroupInfo['SearchFlood'])) { $GroupInfo['SearchFlood'] = 30; } }
-$GroupInfo['CanEditProfile']=sql_result($mempreresult,0,"CanEditProfile");
-if($GroupInfo['CanEditProfile']!="yes"&&$GroupInfo['CanEditProfile']!="no"&&$GroupInfo['CanEditProfile']!="group") {
-               $GruError = true; }
-if($GroupInfo['CanEditProfile']=="group") {
-$GroupInfo['CanEditProfile']=sql_result($gruresult,0,"CanEditProfile");
-if($GroupInfo['CanEditProfile']!="yes"&&$GroupInfo['CanEditProfile']!="no") {
-               $GruError = true; } }
-$GroupInfo['CanAddEvents']=sql_result($mempreresult,0,"CanAddEvents");
-if($GroupInfo['CanAddEvents']!="yes"&&$GroupInfo['CanAddEvents']!="no"&&$GroupInfo['CanAddEvents']!="group") {
-               $GruError = true; }
-if($GroupInfo['CanAddEvents']=="group") {
-$GroupInfo['CanAddEvents']=sql_result($gruresult,0,"CanAddEvents");
-if($GroupInfo['CanAddEvents']!="yes"&&$GroupInfo['CanAddEvents']!="no") {
-               $GruError = true; } }
-$GroupInfo['CanPM']=sql_result($mempreresult,0,"CanPM");
-if($GroupInfo['CanPM']!="yes"&&$GroupInfo['CanPM']!="no"&&$GroupInfo['CanPM']!="group") {
-               $GruError = true; }
-if($GroupInfo['CanPM']=="group") {
-$GroupInfo['CanPM']=sql_result($gruresult,0,"CanPM");
-if($GroupInfo['CanPM']!="yes"&&$GroupInfo['CanPM']!="no") {
-               $GruError = true; } }
-$GroupInfo['CanSearch']=sql_result($mempreresult,0,"CanSearch");
-if($GroupInfo['CanSearch']!="yes"&&$GroupInfo['CanSearch']!="no"&&$GroupInfo['CanSearch']!="group") {
-               $GruError = true; }
-if($GroupInfo['CanSearch']=="group") {
-$GroupInfo['CanSearch']=sql_result($gruresult,0,"CanSearch");
-if($GroupInfo['CanSearch']!="yes"&&$GroupInfo['CanSearch']!="no") {
-               $GruError = true; } }
-$GroupInfo['CanExecPHP']=sql_result($mempreresult,0,"CanExecPHP");
-if($GroupInfo['CanExecPHP']!="yes"&&$GroupInfo['CanExecPHP']!="no"&&$GroupInfo['CanExecPHP']!="group") {
-       $GroupInfo['CanExecPHP'] = "no"; }
-if($GroupInfo['CanExecPHP']=="group") {
-$GroupInfo['CanExecPHP']=sql_result($gruresult,0,"CanExecPHP");
-if($GroupInfo['CanExecPHP']!="yes"&&$GroupInfo['CanExecPHP']!="no") {
-       $GroupInfo['CanExecPHP'] = "no"; } }
-$GroupInfo['CanDoHTML']=sql_result($mempreresult,0,"CanDoHTML");
-if($GroupInfo['CanDoHTML']!="yes"&&$GroupInfo['CanDoHTML']!="no"&&$GroupInfo['CanDoHTML']!="group") {
-       $GroupInfo['CanDoHTML'] = "no"; }
-if($GroupInfo['CanDoHTML']=="group") {
-$GroupInfo['CanDoHTML']=sql_result($gruresult,0,"CanDoHTML");
-if($GroupInfo['CanDoHTML']!="yes"&&$GroupInfo['CanDoHTML']!="no") {
-       $GroupInfo['CanDoHTML'] = "no"; } }
-$GroupInfo['CanUseBBTags']=sql_result($mempreresult,0,"CanUseBBTags");
-if($GroupInfo['CanUseBBTags']!="yes"&&$GroupInfo['CanUseBBTags']!="no"&&$GroupInfo['CanUseBBTags']!="group") {
-       $GroupInfo['CanUseBBTags'] = "no"; }
-if($GroupInfo['CanUseBBTags']=="group") {
-$GroupInfo['CanUseBBTags']=sql_result($gruresult,0,"CanUseBBTags");
-if($GroupInfo['CanUseBBTags']!="yes"&&$GroupInfo['CanUseBBTags']!="no") {
-       $GroupInfo['CanUseBBTags'] = "no"; } }
-$GroupInfo['PromoteTo']=sql_result($gruresult,0,"PromoteTo");
-$GroupInfo['PromotePosts']=sql_result($gruresult,0,"PromotePosts");
-if(!is_numeric($GroupInfo['PromotePosts'])) { 
-       $GroupInfo['PromotePosts'] = 0; $GroupInfo['PromoteTo'] = 0; }
-$GroupInfo['PromoteKarma']=sql_result($gruresult,0,"PromoteKarma");
-if(!is_numeric($GroupInfo['PromoteKarma'])) { 
-       $GroupInfo['PromoteKarma'] = 0; $GroupInfo['PromoteTo'] = 0; }
-if(!isset($Settings['KarmaBoostDays'])) {
-       $Settings['KarmaBoostDays'] = null; }
-$Settings['OldKarmaBoostDays'] = $Settings['KarmaBoostDays'];
-if(!isset($Settings['KBoostPercent'])) {
-       $Settings['KBoostPercent'] = "6|10"; }
-//Update karma and group upgrade on post count or karma count.
-if($_SESSION['UserID']!=0) { $BoostTotal = null;
-$KarmaExp = explode("&",$Settings['KarmaBoostDays']);
-$KarmaNow = $usercurtime->format("md");
-$kupdate = false;
-if(in_array($KarmaNow,$KarmaExp)) {
-$KarmaNum = count($KarmaExp); 
-$Karmai = 0;
-while ($Karmai < $KarmaNum) {
-if($KarmaExp[$Karmai]==$KarmaNow) { 
-$Settings['KarmaBoostDays'] = $KarmaExp[$Karmai]; 
-$kupdate = true; break 1; }
-++$Karmai; } }
-if($kupdate===false) {
-$Settings['KarmaBoostDays'] = $KarmaExp[0]; }
-$NewKarmaUpdate = $usercurtime->format("Ymd");
-$ThisYearUpdate = $usercurtime->format("Y");
-if($MyKarmaUpdate<$NewKarmaUpdate&&$MyPostCountChk>0) { 
-       $KarmaBoostDay = $Settings['KarmaBoostDays'];
-       $KBoostPercent = explode("|",$Settings['KBoostPercent']);
-       if(count($KBoostPercent)<1) { 
-       $KBoostPercent[0] = rand(1,4); }
-       if(!is_numeric($KBoostPercent[0])) {
-       $KBoostPercent[0] = 6; }
-       if(count($KBoostPercent)==1) { 
-       $KBoostPercent[1] = $KBoostPercent[0] + rand(3,6); }
-       if(!is_numeric($KBoostPercent[1])) {
-       $KBoostPercent[0] = 10; }
-       $KBoostPercent = rand($KBoostPercent[0],$KBoostPercent[1]);
-       if($ThisYearUpdate.$KarmaBoostDay==$NewKarmaUpdate&&
-       is_numeric($KarmaBoostDay)) {
-       $KBoostPercent = $KBoostPercent / 100;
-       $BoostTotal = $MyKarmaCount * $KBoostPercent;
-       $BoostTotal = round($BoostTotal,0); }
-       if($BoostTotal!=null) {
-       $MyKarmaCount = $MyKarmaCount + $BoostTotal; }
-       if($BoostTotal==null) {
-       $MyKarmaCount = $MyKarmaCount + 1; }
-       $querykarmaup = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Karma\"=%i,\"KarmaUpdate\"=%i WHERE \"id\"=%i", array($MyKarmaCount,$NewKarmaUpdate,$_SESSION['UserID']));
-       sql_query($querykarmaup,$SQLStat); }
-       $Settings['KarmaBoostDays'] = $Settings['OldKarmaBoostDays'];
-if($LevelInfo['PromoteTo']!=0&&$MyPostCountChk>=$LevelInfo['PromotePosts']) {
-       $sql_level_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($LevelInfo['PromoteTo'])),$SQLStat);
-       $level_check = sql_num_rows($sql_level_check);
-       sql_free_result($sql_level_check);
-       if($level_check > 0) {
-       $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LevelID\"=%i WHERE \"id\"=%i", array($LevelInfo['PromoteTo'],$_SESSION['UserID']));
-       sql_query($queryupgrade,$SQLStat); } }
-if($LevelInfo['PromotePosts']==0&&$LevelInfo['PromoteTo']!=0&&$MyKarmaCount>=$LevelInfo['PromoteKarma']) {
-       $sql_level_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($LevelInfo['PromoteTo'])),$SQLStat);
-       $level_check = sql_num_rows($sql_level_check);
-       sql_free_result($sql_level_check);
-       if($level_check > 0) {
-       $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LevelID\"=%i WHERE \"id\"=%i", array($LevelInfo['PromoteTo'],$_SESSION['UserID']));
-       sql_query($queryupgrade,$SQLStat); } }
-if($GroupInfo['PromoteTo']!=0&&$MyPostCountChk>=$GroupInfo['PromotePosts']) {
-       $sql_group_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($GroupInfo['PromoteTo'])),$SQLStat);
-       $group_check = sql_num_rows($sql_group_check);
-       sql_free_result($sql_group_check);
-       if($group_check > 0) {
-       $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"=%i WHERE \"id\"=%i", array($GroupInfo['PromoteTo'],$_SESSION['UserID']));
-       sql_query($queryupgrade,$SQLStat); } }
-if($GroupInfo['PromotePosts']==0&&$GroupInfo['PromoteTo']!=0&&$MyKarmaCount>=$GroupInfo['PromoteKarma']) {
-       $sql_group_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($GroupInfo['PromoteTo'])),$SQLStat);
-       $group_check = sql_num_rows($sql_group_check);
-       sql_free_result($sql_group_check);
-       if($group_check > 0) {
-       $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"=%i WHERE \"id\"=%i", array($GroupInfo['PromoteTo'],$_SESSION['UserID']));
-       sql_query($queryupgrade,$SQLStat); } } }
-$GroupInfo['HasModCP']=sql_result($mempreresult,0,"HasModCP");
-if($GroupInfo['HasModCP']!="yes"&&$GroupInfo['HasModCP']!="no"&&$GroupInfo['HasModCP']!="group") {
-       $GroupInfo['HasModCP'] = "no"; }
-if($GroupInfo['HasModCP']=="group") {
-$GroupInfo['HasModCP']=sql_result($gruresult,0,"HasModCP");
-if($GroupInfo['HasModCP']!="yes"&&$GroupInfo['HasModCP']!="no") {
-       $GroupInfo['HasModCP'] = "no"; } }
-$GroupInfo['HasAdminCP']=sql_result($mempreresult,0,"HasAdminCP");
-if($GroupInfo['HasAdminCP']!="yes"&&$GroupInfo['HasAdminCP']!="no"&&$GroupInfo['HasAdminCP']!="group") {
-       $GroupInfo['HasAdminCP'] = "no"; }
-if($GroupInfo['HasAdminCP']=="group") {
-$GroupInfo['HasAdminCP']=sql_result($gruresult,0,"HasAdminCP");
-if($GroupInfo['HasAdminCP']!="yes"&&$GroupInfo['HasAdminCP']!="no") {
-       $GroupInfo['HasAdminCP'] = "no"; } }
-$GroupInfo['CanViewIPAddress']=sql_result($mempreresult,0,"CanViewIPAddress");
-if($GroupInfo['CanViewIPAddress']!="yes"&&$GroupInfo['CanViewIPAddress']!="no"&&$GroupInfo['CanViewIPAddress']!="group") {
-       $GroupInfo['CanViewIPAddress'] = "no"; }
-if($GroupInfo['CanViewIPAddress']=="group") {
-$GroupInfo['CanViewIPAddress']=sql_result($gruresult,0,"CanViewIPAddress");
-if($GroupInfo['CanViewIPAddress']!="yes"&&$GroupInfo['CanViewIPAddress']!="no") {
-       $GroupInfo['CanViewIPAddress'] = "no"; } }
-$GroupInfo['CanViewUserAgent']=sql_result($mempreresult,0,"CanViewUserAgent");
-if($GroupInfo['CanViewUserAgent']!="yes"&&$GroupInfo['CanViewUserAgent']!="no"&&$GroupInfo['CanViewUserAgent']!="group") {
-       $GroupInfo['CanViewUserAgent'] = "no"; }
-if($GroupInfo['CanViewUserAgent']=="group") {
-$GroupInfo['CanViewUserAgent']=sql_result($gruresult,0,"CanViewUserAgent");
-if($GroupInfo['CanViewUserAgent']!="yes"&&$GroupInfo['CanViewUserAgent']!="no") {
-       $GroupInfo['CanViewUserAgent'] = "no"; } }
-$GroupInfo['ViewDBInfo']=sql_result($mempreresult,0,"ViewDBInfo");
-if($GroupInfo['ViewDBInfo']!="yes"&&$GroupInfo['ViewDBInfo']!="no"&&$GroupInfo['ViewDBInfo']!="group") {
-       $GroupInfo['ViewDBInfo'] = "no"; }
-if($GroupInfo['ViewDBInfo']=="group") {
-$GroupInfo['ViewDBInfo']=sql_result($gruresult,0,"ViewDBInfo"); 
-if($GroupInfo['ViewDBInfo']!="yes"&&$GroupInfo['ViewDBInfo']!="no") {
-       $GroupInfo['ViewDBInfo'] = "no"; } }
-if($GruError==true) {
-header("Content-Type: text/plain; charset=".$Settings['charset']); 
-sql_free_result($gruresult); sql_free_result($levresult); sql_free_result($mempreresult); $urlstatus = 503;
-ob_clean(); echo "Sorry could not load all group data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-sql_free_result($gruresult);
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
- sql_free_result($levresult); }
-if($GroupInfo['CanViewBoard']=="no") { 
-header("Content-Type: text/plain; charset=".$Settings['charset']); 
-ob_clean(); echo "Sorry you can not view the board."; $urlstatus = 503;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-// Member Group Permissions Setup
-$perquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i ORDER BY \"ForumID\" ASC", array($GroupInfo['PermissionID']));
-$peresult=sql_query($perquery,$SQLStat);
-$pernum=sql_num_rows($peresult);
-$peri=0; $PerError = null;
-if($pernum<0) { $PerError = true; sql_free_result($peresult);
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
-ob_clean(); echo "Sorry could not find permission data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ForumIgnoreList1 = null; $ForumIgnoreList2 = null;
-$ForumIgnoreList3 = null; $ForumIgnoreList4 = null;
-$ForumIgnoreList5 = null; $ForumIgnoreList6 = null;
-$ModForumIgnoreList1 = null; $ModForumIgnoreList2 = null;
-$ModForumIgnoreList3 = null; $ModForumIgnoreList4 = null;
-if($pernum>=1) { while ($peri < $pernum) {
-$PerForumID=sql_result($peresult,$peri,"ForumID");
-if(!is_numeric($PerForumID)) { $PerError = true; }
-$PermissionInfo['ID'][$PerForumID]=sql_result($peresult,$peri,"id");
-if(!is_numeric($PermissionInfo['ID'][$PerForumID])) { $PerError = true; }
-$PermissionInfo['PermissionID'][$PerForumID]=sql_result($peresult,$peri,"PermissionID");
-if(!is_numeric($PermissionInfo['PermissionID'][$PerForumID])) { $PerError = true; }
-$PermissionInfo['Name'][$PerForumID]=sql_result($peresult,$peri,"Name");
-$PermissionInfo['ForumID'][$PerForumID]=sql_result($peresult,$peri,"ForumID");
-if(!is_numeric($PermissionInfo['ForumID'][$PerForumID])) { $PerError = true; }
-$PermissionInfo['CanViewForum'][$PerForumID]=sql_result($peresult,$peri,"CanViewForum");
-if($PermissionInfo['CanViewForum'][$PerForumID]!="yes"&&$PermissionInfo['CanViewForum'][$PerForumID]!="no") {
-               $PerError = true; }
-if($PermissionInfo['CanViewForum'][$PerForumID]=="no") {
-if(strlen($ForumIgnoreList1)>1) { $ForumIgnoreList1 .= " AND \"id\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList1)<1) { $ForumIgnoreList1 = " \"id\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList2)>1) { $ForumIgnoreList2 .= " AND \"id\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList2)<1) { $ForumIgnoreList2 = " AND \"id\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList3)>1) { $ForumIgnoreList3 .= " AND \"ForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList3)<1) { $ForumIgnoreList3 = " WHERE \"ForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList4)>1) { $ForumIgnoreList4 .= " AND \"ForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList4)<1) { $ForumIgnoreList4 = " AND \"ForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList5)>1) { $ForumIgnoreList5 .= " AND \"OldForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList5)<1) { $ForumIgnoreList5 = " WHERE \"OldForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList6)>1) { $ForumIgnoreList6 .= " AND \"OldForumID\"<>".$PerForumID; }
-if(strlen($ForumIgnoreList6)<1) { $ForumIgnoreList6 = " AND \"OldForumID\"<>".$PerForumID; } }
-$PermissionInfo['CanMakePolls'][$PerForumID]=sql_result($peresult,$peri,"CanMakePolls");
-if($PermissionInfo['CanMakePolls'][$PerForumID]!="yes"&&$PermissionInfo['CanMakePolls'][$PerForumID]!="no") {
-               $PerError = true; }
-$PermissionInfo['CanMakeTopics'][$PerForumID]=sql_result($peresult,$peri,"CanMakeTopics");
-if($PermissionInfo['CanMakeTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeTopics'][$PerForumID]!="no") {
-               $PerError = true; }
-$PermissionInfo['CanMakeReplys'][$PerForumID]=sql_result($peresult,$peri,"CanMakeReplys");
-if($PermissionInfo['CanMakeReplys'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeReplys'][$PerForumID]!="no") {
-               $PerError = true; }
-$PermissionInfo['CanMakeReplysClose'][$PerForumID]=sql_result($peresult,$peri,"CanMakeReplysCT");
-if($PermissionInfo['CanMakeReplysClose'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeReplysClose'][$PerForumID]!="no") {
-               $PerError = true; }
-$PermissionInfo['CanEditTopics'][$PerForumID]=sql_result($peresult,$peri,"CanEditTopics");
-if($PermissionInfo['CanEditTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanEditTopics'][$PerForumID]!="no") {
-       $PermissionInfo['CanEditTopics'][$PerForumID] = "no"; }
-$PermissionInfo['CanEditTopicsClose'][$PerForumID]=sql_result($peresult,$peri,"CanEditTopicsCT");
-if($PermissionInfo['CanEditTopicsClose'][$PerForumID]!="yes"&&$PermissionInfo['CanEditTopicsClose'][$PerForumID]!="no") {
-       $PermissionInfo['CanEditTopicsClose'][$PerForumID] = "no"; }
-$PermissionInfo['CanEditReplys'][$PerForumID]=sql_result($peresult,$peri,"CanEditReplys");
-if($PermissionInfo['CanEditReplys'][$PerForumID]!="yes"&&$PermissionInfo['CanEditReplys'][$PerForumID]!="no") {
-       $PermissionInfo['CanEditReplys'][$PerForumID] = "no"; }
-$PermissionInfo['CanEditReplysClose'][$PerForumID]=sql_result($peresult,$peri,"CanEditReplysCT");
-if($PermissionInfo['CanEditReplysClose'][$PerForumID]!="yes"&&$PermissionInfo['CanEditReplysClose'][$PerForumID]!="no") {
-       $PermissionInfo['CanEditReplysClose'][$PerForumID] = "no"; }
-$PermissionInfo['CanDeleteTopics'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteTopics");
-if($PermissionInfo['CanDeleteTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteTopics'][$PerForumID]!="no") {
-       $PermissionInfo['CanDeleteTopics'][$PerForumID] = "no"; }
-$PermissionInfo['CanDeleteTopicsClose'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteTopicsCT");
-if($PermissionInfo['CanDeleteTopicsClose'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteTopicsClose'][$PerForumID]!="no") {
-       $PermissionInfo['CanDeleteTopicsClose'][$PerForumID] = "no"; }
-$PermissionInfo['CanDeleteReplys'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteReplys");
-if($PermissionInfo['CanDeleteReplys'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteReplys'][$PerForumID]!="no") {
-       $PermissionInfo['CanDeleteReplys'][$PerForumID] = "no"; }
-$PermissionInfo['CanDeleteReplysClose'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteReplysCT");
-if($PermissionInfo['CanDeleteReplysClose'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteReplysClose'][$PerForumID]!="no") {
-       $PermissionInfo['CanDeleteReplysClose'][$PerForumID] = "no"; }
-$PermissionInfo['CanCloseTopics'][$PerForumID]=sql_result($peresult,$peri,"CanCloseTopics");
-if($PermissionInfo['CanCloseTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanCloseTopics'][$PerForumID]!="no") {
-       $PermissionInfo['CanCloseTopics'][$PerForumID] = "no"; }
-$PermissionInfo['CanPinTopics'][$PerForumID]=sql_result($peresult,$peri,"CanPinTopics");
-if($PermissionInfo['CanPinTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanPinTopics'][$PerForumID]!="no") {
-       $PermissionInfo['CanPinTopics'][$PerForumID] = "no"; }
-$PermissionInfo['CanDoHTML'][$PerForumID]=sql_result($peresult,$peri,"CanDoHTML");
-if($PermissionInfo['CanDoHTML'][$PerForumID]!="yes"&&$PermissionInfo['CanDoHTML'][$PerForumID]!="no") {
-       $PermissionInfo['CanDoHTML'][$PerForumID] = "no"; }
-$PermissionInfo['CanUseBBTags'][$PerForumID]=sql_result($peresult,$peri,"CanUseBBTags");
-if($PermissionInfo['CanUseBBTags'][$PerForumID]!="yes"&&$PermissionInfo['CanUseBBTags'][$PerForumID]!="no") {
-       $PermissionInfo['CanUseBBTags'][$PerForumID] = "no"; }
-$PermissionInfo['CanModForum'][$PerForumID]=sql_result($peresult,$peri,"CanModForum");
-if($PermissionInfo['CanModForum'][$PerForumID]!="yes"&&$PermissionInfo['CanModForum'][$PerForumID]!="no") {
-       $PermissionInfo['CanModForum'][$PerForumID] = "no"; }
-if($PermissionInfo['CanModForum'][$PerForumID]=="no") {
-if(strlen($ModForumIgnoreList1)>1) { $ModForumIgnoreList1 .= " AND \"id\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList1)<1) { $ModForumIgnoreList1 = " \"id\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList2)>1) { $ModForumIgnoreList2 .= " AND \"id\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList2)<1) { $ModForumIgnoreList2 = " AND \"id\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList3)>1) { $ModForumIgnoreList3 .= " AND \"ForumID\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList3)<1) { $ModForumIgnoreList3 = " WHERE \"ForumID\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList4)>1) { $ModForumIgnoreList4 .= " AND \"ForumID\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList4)<1) { $ModForumIgnoreList4 = " AND \"ForumID\"<>".$PerForumID; } }
-if($PerError===true) { $peri = $pernum; }
-++$peri; } if($PerError===true) {
-header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($peresult); $urlstatus = 503;
-ob_clean(); echo "Sorry could not load all permission data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-sql_free_result($peresult);
-$per2query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"PermissionID\"=%i ORDER BY \"CategoryID\" ASC", array($GroupInfo['PermissionID']));
-$per2esult=sql_query($per2query,$SQLStat);
-$per2num=sql_num_rows($per2esult);
-$per2i=0; $Per2Error = null;
-if($per2num<=0) { $Per2Error = true; sql_free_result($per2esult);
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
-ob_clean(); echo "Sorry could not find permission data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$CatIgnoreList1 = null; $CatIgnoreList2 = null;
-$CatIgnoreList3 = null; $CatIgnoreList4 = null;
-$CatIgnoreList5 = null; $CatIgnoreList6 = null;
-if($per2num>=1) { while ($per2i < $per2num) {
-$PerCatID=sql_result($per2esult,$per2i,"CategoryID");
-if(!is_numeric($PerCatID)) { $Per2Error = true; }
-$CatPermissionInfo['ID'][$PerCatID]=sql_result($per2esult,$per2i,"id");
-if(!is_numeric($CatPermissionInfo['ID'][$PerCatID])) { $Per2Error = true; }
-$CatPermissionInfo['PermissionID'][$PerCatID]=sql_result($per2esult,$per2i,"PermissionID");
-if(!is_numeric($CatPermissionInfo['PermissionID'][$PerCatID])) { $Per2Error = true; }
-$CatPermissionInfo['Name'][$PerCatID]=sql_result($per2esult,$per2i,"Name");
-$CatPermissionInfo['CategoryID'][$PerCatID]=sql_result($per2esult,$per2i,"CategoryID");
-if(!is_numeric($CatPermissionInfo['CategoryID'][$PerCatID])) { $Per2Error = true; }
-$CatPermissionInfo['CanViewCategory'][$PerCatID]=sql_result($per2esult,$per2i,"CanViewCategory");
-if($CatPermissionInfo['CanViewCategory'][$PerCatID]!="yes"&&$CatPermissionInfo['CanViewCategory'][$PerCatID]!="no") { $Per2Error = true; }
-if($CatPermissionInfo['CanViewCategory'][$PerCatID]=="no") {
-if(strlen($CatIgnoreList1)>1) { $CatIgnoreList1 .= " AND \"id\"<>".$PerCatID; }
-if(strlen($CatIgnoreList1)<1) { $CatIgnoreList1 = " \"id\"<>".$PerCatID; }
-if(strlen($CatIgnoreList2)>1) { $CatIgnoreList2 .= " AND \"id\"<>".$PerCatID; }
-if(strlen($CatIgnoreList2)<1) { $CatIgnoreList2 = " AND \"id\"<>".$PerCatID; }
-if(strlen($CatIgnoreList3)>1) { $CatIgnoreList3 .= " AND \"CategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList3)<1) { $CatIgnoreList3 = " WHERE \"CategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList4)>1) { $CatIgnoreList4 .= " AND \"CategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList4)<1) { $CatIgnoreList4 = " AND \"CategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList5)>1) { $CatIgnoreList5 .= " AND \"OldCategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList5)<1) { $CatIgnoreList5 = " WHERE \"OldCategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList6)>1) { $CatIgnoreList6 .= " AND \"OldCategoryID\"<>".$PerCatID; }
-if(strlen($CatIgnoreList6)<1) { $CatIgnoreList6 = " AND \"OldCategoryID\"<>".$PerCatID; } }
-if($Per2Error===true) { $per2i = $per2num; }
-++$per2i; } if($Per2Error===true) {
-header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($per2esult); $urlstatus = 503;
-ob_clean(); echo "Sorry could not load all permission data in database.\nContact the board admin about error."; 
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-sql_free_result($per2esult);
-?>
\ No newline at end of file
diff --git a/inc/html5.php.bak b/inc/html5.php.bak
deleted file mode 100644 (file)
index 70f4703..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: html5.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="html5.php"||$File3Name=="/html5.php") {
-       require('index.php');
-       exit(); }
-$XHTML5 = false;
-// Check to see if we serv the file as html or xhtml
-// if we do xhtml we also check to see if user's browser 
-// can dispay if or else fallback to html
-if($Settings['output_type']=="html") {
-       $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
-header("Content-Type: text/html; charset=".$Settings['charset']); }
-if($Settings['output_type']=="xhtml") {
-if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
-       $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
-       header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']); }
-else { if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
-       $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
-   header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
-} else { $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
-       header("Content-Type: text/html; charset=".$Settings['charset']); } } }
-if($Settings['output_type']!="xhtml") {
-       if($Settings['output_type']!="html") {
-               $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
-header("Content-Type: text/html; charset=".$Settings['charset']); } }
-if($checklowview===true&&$_GET['act']=="lowview") { 
-   $ThemeSet['CSSType'] = "lowview"; 
-   $ThemeSet['ThemeName'] = $OrgName." Low Theme";
-   $ThemeSet['ThemeMaker'] =$iDB_Author;
-   $ThemeSet['ThemeVersion'] = $VER1[0].".".$VER1[1].".".$VER1[2];
-   $ThemeSet['ThemeVersionType'] = $VER2[0];
-   $ThemeSet['ThemeSubVersion'] = $VER2[2]." ".$SubVerN;
-   $ThemeSet['MakerURL'] = $iDBHome."support/?act=lowview";
-   $ThemeSet['CopyRight'] = $ThemeSet['ThemeName']." was made by <a href=\"".$ThemeSet['MakerURL']."\" title=\"".$ThemeSet['ThemeMaker']."\">".$ThemeSet['ThemeMaker']."</a>";
-   $ThemeInfo['ThemeName'] = $ThemeSet['ThemeName'];
-   $ThemeInfo['ThemeMaker'] = $ThemeSet['ThemeMaker'];
-   $ThemeInfo['ThemeVersion'] = $ThemeSet['ThemeVersion'];
-   $ThemeInfo['ThemeVersionType'] = $ThemeSet['ThemeVersionType'];
-   $ThemeInfo['ThemeSubVersion'] = $ThemeSet['ThemeSubVersion'];
-   $ThemeInfo['MakerURL'] = $ThemeSet['MakerURL'];
-   $ThemeInfo['CopyRight'] = $ThemeSet['CopyRight']; }
-if($ThemeSet['CSSType']!="import"&&
-   $ThemeSet['CSSType']!="link"&&
-   $ThemeSet['CSSType']!="lowview"&&
-   $ThemeSet['CSSType']!="xml"&&
-   $ThemeSet['CSSType']!="sql") { 
-   $ThemeSet['CSSType'] = "import"; }
-header("Content-Style-Type: text/css");
-header("Content-Script-Type: text/javascript");
-if($Settings['showverinfo']!="on") {
-$iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">"; }
-if($Settings['showverinfo']=="on") {
-$iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$VerInfo['iDB_Ver_Show']."\" onclick=\"window.open(this.href);return false;\">"; }
-$GM2kURL = "<a href=\"".$GM2kHome."\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
-$csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
-$BSDL = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"".$RName." is dual-licensed under the Revised BSD License\">BSDL</a>";
-$GPL = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"".$RName." is dual-licensed under the Gnu General Public License\">GPL</a>";
-$DualLicense = $BSDL." &amp; ".$GPL;
-$extext = null;
-if($checklowview!==true) { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">Low-Version</a>"; }
-if($checklowview===true&&$_GET['act']!="lowview") { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">Low-Version</a>"; }
-if($checklowview===true&&$_GET['act']=="lowview") {  $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">High-Version</a>"; }
-$endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1.$RName."</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <br />\n".$ThemeSet['CopyRight']." | ".$extext; 
-header("Content-Language: en");
-header("Vary: Accept-Encoding");
-// Check if we are on a secure HTTP connection
-if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
-if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
-// Get the board's url
-if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
-       $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
-if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
-       $BoardURL = $Settings['idburl']; 
-       if($Settings['qstr']!="/") {
-       $AltBoardURL = $BoardURL; } 
-       if($Settings['qstr']=="/") { 
-       $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
-// Get the html level
-/*if($Settings['html_level']!="Strict") {
-       if($Settings['html_level']!="Transitional") {
-               $Settings['html_level'] = "Transitional"; } }*/
-// HTML Document Starts
-ob_start("idb_suboutput_handler");
-if($XHTML5===false) { ?>
-<!DOCTYPE html>
-<?php // HTML meta tags and other html, head tags ?>
-<html lang="en">
-<?php } if($XHTML5===true) { ?>
-<!DOCTYPE html [
-<!ENTITY nbsp "&#160;">
-<!ENTITY copy "&#169;">
-<!ENTITY reg "&#174;">
-<!ENTITY Aacute "&#193;">
-<!ENTITY aacute "&#225;">
-<!ENTITY Agrave "&#224;">
-<!ENTITY agrave "&#192;">
-<!ENTITY Acirc "&#194;">
-<!ENTITY acirc "&#226;">
-<!ENTITY Auml "&#196;">
-<!ENTITY auml "&#228;">
-<!ENTITY Atilde "&#195;">
-<!ENTITY atilde "&#227;">
-<!ENTITY Aring "&#197;">
-<!ENTITY aring "&#229;">
-<!ENTITY Aelig "&#198;">
-<!ENTITY aelig "&#230;">
-<!ENTITY Ccedil "&#199;">
-<!ENTITY ccedil "&#231;">
-<!ENTITY Eth "&#208;">
-<!ENTITY eth "&#240;">
-<!ENTITY Eacute "&#201;">
-<!ENTITY eacute "&#233;">
-<!ENTITY Egrave "&#200;">
-<!ENTITY egrave "&#232;">
-<!ENTITY Ecirc "&#202;">
-<!ENTITY ecirc "&#234;">
-<!ENTITY Euml "&#203;">
-<!ENTITY euml "&#235;">
-<!ENTITY Iacute "&#205;">
-<!ENTITY iacute "&#237;">
-<!ENTITY Igrave "&#204;">
-<!ENTITY igrave "&#236;">
-<!ENTITY Icirc "&#206;">
-<!ENTITY icirc "&#238;">
-<!ENTITY Iuml "&#207;">
-<!ENTITY iuml "&#239;">
-<!ENTITY Ntilde "&#209;">
-<!ENTITY ntilde "&#241;">
-<!ENTITY Oacute "&#211;">
-<!ENTITY oacute "&#243;">
-<!ENTITY Ograve "&#210;">
-<!ENTITY ograve "&#242;">
-<!ENTITY Ocirc "&#212;">
-<!ENTITY ocirc "&#244;">
-<!ENTITY Ouml "&#214;">
-<!ENTITY ouml "&#246;">
-<!ENTITY Otilde "&#213;">
-<!ENTITY otilde "&#245;">
-<!ENTITY Oslash "&#216;">
-<!ENTITY oslash "&#248;">
-<!ENTITY szlig "&#223;">
-<!ENTITY Thorn "&#222;">
-<!ENTITY thorn "&#254;">
-<!ENTITY Uacute "&#218;">
-<!ENTITY uacute "&#250;">
-<!ENTITY Ugrave "&#217;">
-<!ENTITY ugrave "&#249;">
-<!ENTITY Ucirc "&#219;">
-<!ENTITY ucirc "&#251;">
-<!ENTITY Uuml "&#220;">
-<!ENTITY uuml "&#252;">
-<!ENTITY Yacute "&#221;">
-<!ENTITY yacute "&#253;">
-<!ENTITY yuml "&#255;">
-]>
-<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
-<?php } ?>
-<head>
-<?php $iWrappers['HTMLSTART'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($XHTML5===false) { ?>
-<meta charset="<?php echo $Settings['charset']; ?>">
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>">
-<?php 
-if(!isset($_SERVER['HTTP_USER_AGENT'])) {
-       $_SERVER['HTTP_USER_AGENT'] = ""; }
-if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
-       !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge">
-<?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
-<?php } } if($XHTML5===true) { ?>
-<meta charset="<?php echo $Settings['charset']; ?>" />
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
-<?php 
-if(!isset($_SERVER['HTTP_USER_AGENT'])) {
-       $_SERVER['HTTP_USER_AGENT'] = ""; }
-if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
-       !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
-<?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
-<?php } } $iWrappers['HTTPEQUIV'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-<base href="<?php echo $BoardURL; ?>" />
-<?php if($Settings['showverinfo']=="on") { ?>
-<meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
-<?php } if($Settings['showverinfo']!="on") { ?>
-<meta name="Generator" content="<?php echo $iDB; ?>" />
-<?php } ?>
-<meta name="Author" content="<?php echo $SettInfo['Author']; ?>" />
-<meta name="Keywords" content="<?php echo $SettInfo['Keywords']; ?>" />
-<meta name="Description" content="<?php echo $SettInfo['Description']; ?>" />
-<meta name="ROBOTS" content="Index, FOLLOW" />
-<meta name="GOOGLEBOT" content="Index, FOLLOW" />
-<?php if($Settings['showverinfo']=="on") { ?>
-<!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
-<?php } if($Settings['showverinfo']!="on") { ?>
-<!-- generator="<?php echo $iDB; ?>" -->
-<?php } $iWrappers['METATAGS'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-<script type="text/javascript" src="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>"></script>
-<?php echo "\n"; $iWrappers['JAVASCRIPT'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-<link rel="Start" href="<?php echo $AltBoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" title="<?php echo $Settings['board_name'].$idbpowertitle; ?>" />
-<link rel="Copyright" href="<?php echo $AltBoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" title="Copyright Notice" />
-<?php echo "\n"; $iWrappers['LINKTAGS'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler");
-if($ThemeSet['CSSType']=="import") { ?>
-<style type="text/css">
-/* Import the theme css file */
-<?php echo "\n@import url(\"".$ThemeSet['CSS']."\");\n"; ?>
-</style>
-<?php } if($ThemeSet['CSSType']=="sql") { ?>
-<style type="text/css">
-<?php echo $ThemeSet['CSS']; ?>
-</style>
-<?php } if($ThemeSet['CSSType']=="link") { ?>
-<link rel="prefetch alternate stylesheet" href="<?php echo $ThemeSet['CSS']; ?>" />
-<link rel="stylesheet" type="text/css" href="<?php echo $ThemeSet['CSS']; ?>" />
-<?php } if($ThemeSet['CSSType']=="lowview") { ?>
-<style type="text/css">
-/* (Low View / Lo-Fi ) version start */
-body {
-background-color: #FFFFFF;
-color: #000000;
-font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
-font-size: 16px;
-margin: 20px;
-padding: 0px;
-}
-.copyright {
-text-align: center;
-font-family: Sans-Serif;
-font-size: 12px;
-line-height: 11px;
-color: #000000;
-}
-.EditReply {
-color: #000000;
-font-size: 9px;
-}
-</style>
-<?php } $iWrappers['CSSTHEME'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($ThemeSet['FavIcon']!=null) { ?>
-<link rel="icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
-<link rel="shortcut icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
-<?php } $iWrappers['FAVICON'] = ob_get_clean(); ?>
\ No newline at end of file
diff --git a/inc/index.php.bak b/inc/index.php.bak
deleted file mode 100644 (file)
index 0c7c8e2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../index.php');
-?>
\ No newline at end of file
diff --git a/inc/iwrapper.php.bak b/inc/iwrapper.php.bak
deleted file mode 100644 (file)
index eee7a21..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: iwrapper.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="iwrapper.php"||$File3Name=="/iwrapper.php") {
-       require('index.php');
-       exit(); }
-
-if(!isset($ThemeSet['WrapperString'])||$ThemeSet['WrapperString']===null) {
-$ThemeSet['WrapperString'] = "<% HTMLSTART %>\n<% HTTPEQUIV %>\n<% METATAGS %>\n<% JAVASCRIPT %>\n<% LINKTAGS %>\n<% CSSTHEME %>\n<% FAVICON %>\n<% EXTRALINKS %>\n<% TITLETAG %>\n<% BODYTAG %>\n<% NAVBAR %>\n<% CONTENT %>\n<% COPYRIGHT %>\n<% HTMLEND %>"; }
-$iWrappers['WrapperString'] = $ThemeSet['WrapperString'];
-if(!isset($iWrappers['HTMLSTART'])) { $iWrappers['HTMLSTART'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% HTMLSTART %\>/is", trim($iWrappers['HTMLSTART']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['HTTPEQUIV'])) { $iWrappers['HTTPEQUIV'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% HTTPEQUIV %\>/is", trim($iWrappers['HTTPEQUIV']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['METATAGS'])) { $iWrappers['METATAGS'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% METATAGS %\>/is", trim($iWrappers['METATAGS']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['JAVASCRIPT'])) { $iWrappers['JAVASCRIPT'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% JAVASCRIPT %\>/is", trim($iWrappers['JAVASCRIPT']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['LINKTAGS'])) { $iWrappers['LINKTAGS'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% LINKTAGS %\>/is", trim($iWrappers['LINKTAGS']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['CSSTHEME'])) { $iWrappers['CSSTHEME'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% CSSTHEME %\>/is", trim($iWrappers['CSSTHEME']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['FAVICON'])) { $iWrappers['FAVICON'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% FAVICON %\>/is", trim($iWrappers['FAVICON']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['EXTRALINKS'])) { $iWrappers['EXTRALINKS'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% EXTRALINKS %\>/is", trim($iWrappers['EXTRALINKS']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['TITLETAG'])) { $iWrappers['TITLETAG'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% TITLETAG %\>/is", trim($iWrappers['TITLETAG']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['BODYTAG'])) { $iWrappers['BODYTAG'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% BODYTAG %\>/is", trim($iWrappers['BODYTAG']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['NAVBAR'])) { $iWrappers['NAVBAR'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% NAVBAR %\>/is", trim($iWrappers['NAVBAR']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['CONTENT'])) { $iWrappers['CONTENT'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% CONTENT %\>/is", trim($iWrappers['CONTENT']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['COPYRIGHT'])) { $iWrappers['COPYRIGHT'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% COPYRIGHT %\>/is", trim($iWrappers['COPYRIGHT']), $iWrappers['WrapperString']);
-if(!isset($iWrappers['HTMLEND'])) { $iWrappers['HTMLEND'] = null; }
-$iWrappers['WrapperString'] = preg_replace("/\<% HTMLEND %\>/is", trim($iWrappers['HTMLEND']), $iWrappers['WrapperString']);
-echo $iWrappers['WrapperString'];
-$iWrappers = array(null);
-?>
diff --git a/inc/javascript.php.bak b/inc/javascript.php.bak
deleted file mode 100644 (file)
index 32254f4..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: javascript.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header("Content-Language: en");
-header("Vary: Accept");
-?>
-function getid(id) {
-var itm;
-itm = document.getElementById(id);
-return itm; }
-
-function toggletag(id) {
-var itm;
-itm = document.getElementById(id);
-if (itm.style.display == "none") {
-itm.style.display = ""; }
-else {
-itm.style.display = "none"; } }
-
-function bgchange(id,color) {
-var itm;
-itm = document.getElementById(id);
-itm.style.backgroundColor = ''+color+''; }
-
-function innerchange(tag,text1,text2) {
-var usrname;
-usrname = document.getElementsByTagName(tag);
-for (var i = 0; i < usrname.length; i++) {
-if(usrname[i].innerHTML==text1) {
-usrname[i].innerHTML = text2; } } }
-
-function addsmiley(id,code) {
-var itm;
-itm = document.getElementById(id);
-var pretext = itm.value;
-itm.value = pretext + code; }
-
-<?php gzip_page($Settings['use_gzip']); ?>
diff --git a/inc/lowcategories.php.bak b/inc/lowcategories.php.bak
deleted file mode 100644 (file)
index 8ba1fce..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: lowcategories.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="lowcategories.php"||$File3Name=="/lowcategories.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$CategoryID=sql_result($preresult,0,"id");
-$CategoryName=sql_result($preresult,0,"Name");
-$CategoryShow=sql_result($preresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($preresult,0,"CategoryType");
-$InSubCategory=sql_result($preresult,0,"InSubCategory");
-$SubShowForums=sql_result($preresult,0,"SubShowForums");
-$CategoryDescription=sql_result($preresult,0,"Description");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-$CategoryPostCountView=sql_result($preresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($preresult,0,"KarmaCountView");
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
-       $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-if(!isset($CatCheck)) { $CatCheck = null; } 
-if($CatCheck!="skip") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview&id=".$CategoryID,"&","=",$prexqstr[$CategoryType],$exqstr[$CategoryType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType]; }
-$_SESSION['PreViewingTitle'] = "Viewing Category:";
-$_SESSION['ViewingTitle'] = $CategoryName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($InSubCategory!="0") {
-$iscquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($InSubCategory));
-$iscresult=sql_query($iscquery,$SQLStat);
-$iscnum=sql_num_rows($iscresult);
-if($iscnum>=1) {
-$iscCategoryID=sql_result($iscresult,0,"id");
-$iscCategoryName=sql_result($iscresult,0,"Name");
-$iscCategoryShow=sql_result($iscresult,0,"ShowCategory");
-$iscCategoryType=sql_result($iscresult,0,"CategoryType");
-$iscCategoryType = strtolower($iscCategoryType); }
-if($iscnum<1) { $InSubCategory = "0"; } 
-sql_free_result($iscresult); }
-?>
-<div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php if($InSubCategory!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$iscCategoryType],$Settings['file_ext'],"act=view&id=".$iscCategoryID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$iscCategoryType],$exqstr[$iscCategoryType]); ?>"><?php echo $iscCategoryName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></div>
-<div>&nbsp;</div>
-<div style="padding: 10px; border: 1px solid gray;">
-<ul style="list-style-type: none;">
-<?php
-if($CategoryType=="subcategory") {
-redirect("location",$rbasedir.url_maker($exfile['subcategory'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['subcategory'],$exqstr['subcategory'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=0".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<li style="font-weight: bold;"><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></li><li>
-<?php }
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-$shownum = null;
-if ($SubsForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($SubsForumType!="redirect") { $shownum = "(".$NumsPosts." posts)"; }
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=lowview&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<li><ul style=\"list-style-type: none;\"><li><a href=\"".$sfurl."\">".$SubsForumName."</a><span style=\"color: gray; font-size: 10px;\">".$shownum."</span></li></ul></li>";
-if($apcl==1) {
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist." ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$shownum = null;
-if ($ForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($ForumType!="redirect") { $shownum = "(".$NumPosts." posts)"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-?>
-<ul style="list-style-type: none;"><li>
-<a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a> <span style="color: gray; font-size: 10px;"><?php echo $shownum; ?></span></li>
-<?php echo $sflist; ?></ul>
-<?php } ++$i; } sql_free_result($result);
-if($num>=1) { ?>
-</li></ul></div>
-<div>&nbsp;</div>
-<?php } } }
-sql_free_result($preresult); ?>
diff --git a/inc/lowforums.php.bak b/inc/lowforums.php.bak
deleted file mode 100644 (file)
index 929ec7b..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: lowforums.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="lowforums.php"||$File3Name=="/lowforums.php") {
-       require('index.php');
-       exit(); }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"InSubCategory\"=0".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array());
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Board index";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-?>
-<div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a></div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a></div>
-<div>&nbsp;</div>
-<div style="padding: 10px; border: 1px solid gray;">
-<ul style="list-style-type: none;">
-<?php
-while ($prei < $prenum) {
-$CategoryID=sql_result($preresult,$prei,"id");
-$CategoryName=sql_result($preresult,$prei,"Name");
-$CategoryShow=sql_result($preresult,$prei,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($preresult,$prei,"CategoryType");
-$SubShowForums=sql_result($preresult,$prei,"SubShowForums");
-$CategoryDescription=sql_result($preresult,$prei,"Description");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-$CategoryPostCountView=sql_result($preresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($preresult,0,"KarmaCountView");
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if(isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=0".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<li style="font-weight: bold;"><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></li><li>
-<?php }
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-$shownum = null;
-if ($SubsForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($SubsForumType!="redirect") { $shownum = "(".$NumsPosts." posts)"; }
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=lowview&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<li><ul style=\"list-style-type: none;\"><li><a href=\"".$sfurl."\">".$SubsForumName."</a> <span style=\"color: gray; font-size: 10px;\">".$shownum."</span></li></ul></li>";
-if($apcl==1) {
-$sflist = null;
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist." ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$gltnum = count($gltf); $glti = 0; 
-$OldUpdateTime = 0; $UseThisFonum = null;
-if ($ForumType=="subforum") { 
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($gltf[$glti]));
-$gltforesult=sql_query($gltfoquery,$SQLStat);
-$gltfonum=sql_num_rows($gltforesult);
-if($gltfonum>0) {
-$NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
-if($NewUpdateTime>$OldUpdateTime) { 
-       $UseThisFonum = $gltf[$glti]; 
-$OldUpdateTime = $NewUpdateTime; } }
-sql_free_result($gltforesult);
-++$glti; } }
-$shownum = null;
-if ($ForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($ForumType!="redirect") { $shownum = "(".$NumPosts." posts)"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-?>
-<ul style="list-style-type: none;"><li>
-<a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a> <span style="color: gray; font-size: 10px;"><?php echo $shownum; ?></span></li>
-<?php echo $sflist; ?></ul>
-<?php } ++$i; } sql_free_result($result);
-if($num>=1) {
-?>
-<?php } } 
-?></li><?php
-++$prei; }
-sql_free_result($preresult); ?>
-</ul></div>
-<div>&nbsp;</div>
diff --git a/inc/lowreplies.php.bak b/inc/lowreplies.php.bak
deleted file mode 100644 (file)
index cbbe46e..0000000
+++ /dev/null
@@ -1,472 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: lowreplies.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="replies.php"||$File3Name=="/replies.php") {
-       require('index.php');
-       exit(); }
-$pstring = null; $pagenum = null;
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!is_numeric($_GET['post'])) { $_GET['post'] = null; }
-if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
-if(!isset($_GET['st'])) { $_GET['st'] = 0; }
-if(!is_numeric($_GET['st'])) { $_GET['st'] = 0; }
-if(!isset($_GET['modact'])) { $_GET['modact'] = null; }
-if($_GET['modact']=="pin"||$_GET['modact']=="unpin"||$_GET['modact']=="open"||
-       $_GET['modact']=="close"||$_GET['modact']=="edit"||$_GET['modact']=="delete")
-               { $_GET['act'] = $_GET['modact']; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i".$ForumIgnoreList4." LIMIT 1", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$TopicName=sql_result($preresult,0,"TopicName");
-$TopicID=sql_result($preresult,0,"id");
-$TopicForumID=sql_result($preresult,0,"ForumID");
-$TopicCatID=sql_result($preresult,0,"CategoryID");
-$TopicClosed=sql_result($preresult,0,"Closed");
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_GET['post'])||$_GET['post']!==null) {
-$NumberReplies=sql_result($preresult,0,"NumReply"); }
-if(isset($_GET['post'])&&$_GET['post']!==null) {
-$NumberReplies=1; }
-$ViewTimes=sql_result($preresult,0,"NumViews");
-sql_free_result($preresult);
-$forumcheckx = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."  LIMIT 1", array($TopicForumID));
-$fmckresult=sql_query($forumcheckx,$SQLStat);
-$fmcknum=sql_num_rows($fmckresult);
-if($fmcknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ForumID=sql_result($fmckresult,0,"id");
-$ForumName=sql_result($fmckresult,0,"Name");
-$ForumType=sql_result($fmckresult,0,"ForumType");
-$ForumShow=sql_result($fmckresult,0,"ShowForum");
-$InSubForum=sql_result($fmckresult,0,"InSubForum");
-if($InSubForum!=0) {
-$subforumcheckx = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."  LIMIT 1", array($InSubForum));
-$subfmckresult=sql_query($subforumcheckx,$SQLStat);
-$subfmcknum=sql_num_rows($subfmckresult);
-$SubForumName=sql_result($subfmckresult,0,"Name");
-$SubForumType=sql_result($subfmckresult,0,"ForumType");
-$InSubCategory=sql_result($catresult,0,"InSubCategory");
-$SubForumShow=sql_result($subfmckresult,0,"ShowForum");
-sql_free_result($subfmckresult); }
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CanHaveTopics=sql_result($fmckresult,0,"CanHaveTopics");
-$ForumPostCountView=sql_result($fmckresult,0,"PostCountView");
-$ForumKarmaCountView=sql_result($fmckresult,0,"KarmaCountView");
-sql_free_result($fmckresult);
-$catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2."  LIMIT 1", array($TopicCatID));
-$catresult=sql_query($catcheck,$SQLStat);
-$CategoryID=sql_result($catresult,0,"id");
-$CategoryName=sql_result($catresult,0,"Name");
-$CategoryShow=sql_result($catresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($catresult,0,"CategoryType");
-$CategoryPostCountView=sql_result($catresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
-sql_free_result($catresult);
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($ForumCheck!="skip") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id']."&page=".$_GET['page'],"&","=",$prexqstr['topic'],$exqstr['topic']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['topic'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['topic']; }
-$_SESSION['PreViewingTitle'] = "Viewing Topic:";
-$_SESSION['ViewingTitle'] = $TopicName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:".$TopicID."; currentmessageid:0; currenteventid:0; currentmemberid:0;"; 
-?>
-<div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$TopicCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php echo $ThemeSet['NavLinkDivider']; if($InSubForum!=0 && $subfmcknum>0) { ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$InSubForum."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $SubForumName; ?></a><?php echo $ThemeSet['NavLinkDivider']; } ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$TopicForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></div>
-<div>&nbsp;</div>
-<?php }
-if(!isset($CatPermissionInfo['CanViewCategory'][$TopicCatID])) {
-       $CatPermissionInfo['CanViewCategory'][$TopicCatID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$TopicCatID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($PermissionInfo['CanViewForum'][$TopicForumID])) {
-       $PermissionInfo['CanViewForum'][$TopicForumID] = "no"; }
-if($PermissionInfo['CanViewForum'][$TopicForumID]=="no"||
-       $PermissionInfo['CanViewForum'][$TopicForumID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_GET['act']!="view") { 
-$CanMakeReply = "no"; $CanMakeTopic = "no";
-if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") { 
-       $CanMakeTopic = "yes"; }
-if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-       $CanMakeReply = "yes"; }
-if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
-       &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-               $CanMakeReply = "yes"; } } 
-if($_GET['act']=="lowview") {
-if($NumberReplies==null) { 
-       $NumberReplies = 0; }
-$num=$NumberReplies+1;
-//Start Reply Page Code
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$nums = $_GET['page'] * $Settings['max_posts']; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$nums = $_GET['st']; }
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_posts'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_posts']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_posts']) { 
-       $pnum = $pnum - $Settings['max_posts']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_posts']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-$snumber = $_GET['page'] - 1;
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$PageLimit = $Settings['max_posts'] * $snumber; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$PageLimit = $_GET['st']; }
-if($PageLimit<0) { $PageLimit = 0; }
-//End Reply Page Code
-$i=0;
-if(!isset($_GET['post'])||$_GET['post']!==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$PageLimit,$Settings['max_posts'])); }
-if(isset($_GET['post'])&&$_GET['post']!==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i AND \"id\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$_GET['post'],$PageLimit,$Settings['max_posts'])); }
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-if($num==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($num!=0) { 
-if($ViewTimes==0||$ViewTimes==null) { $NewViewTimes = 1; }
-if($ViewTimes!=0&&$ViewTimes!=null) { $NewViewTimes = $ViewTimes + 1; }
-$viewsup = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumViews\"='%s' WHERE \"id\"=%i", array($NewViewTimes,$_GET['id']));
-sql_query($viewsup,$SQLStat); }
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($num==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-//List Page Number Code end
-$CanMakeReply = "no"; $CanMakeTopic = "no";
-if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") { 
-       $CanMakeTopic = "yes"; }
-if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-       $CanMakeReply = "yes"; }
-if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
-       &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-               $CanMakeReply = "yes"; }
-?>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
-<?php echo $pstring; ?></div>
-<div>&nbsp;</div>
-<div style="padding: 10px; border: 1px solid gray;">
-<?php while ($i < $num) {
-$MyPostID=sql_result($result,$i,"id");
-$MyTopicID=sql_result($result,$i,"TopicID");
-$MyPostIP=sql_result($result,$i,"IP");
-$MyForumID=sql_result($result,$i,"ForumID");
-$MyCategoryID=sql_result($result,$i,"CategoryID");
-$MyUserID=sql_result($result,$i,"UserID");
-$MyGuestName=sql_result($result,$i,"GuestName");
-$MyTimeStamp=sql_result($result,$i,"TimeStamp");
-$MyEditTime=sql_result($result,$i,"LastUpdate");
-$MyEditUserID=sql_result($result,$i,"EditUser");
-$MyEditUserName=sql_result($result,$i,"EditUserName");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($MyTimeStamp);
-$tmpusrcurtime->setTimezone($usertz);
-$MyTimeStamp=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MyPost=sql_result($result,$i,"Post");
-$MyDescription=sql_result($result,$i,"Description");
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-if($renum<1) { $MyUserID = -1;
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult); }
-$memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$memreresult=sql_query($memrequery,$SQLStat);
-$memrenum=sql_num_rows($memreresult);
-$rei=0; $ipshow = "two";
-$User1ID=$MyUserID; $GuestsName = $MyGuestName;
-$User1Name=sql_result($reresult,$rei,"Name");
-$User1IP=sql_result($reresult,$rei,"IP");
-if($User1IP==$MyPostIP) { $ipshow = "one"; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$PreUserCanExecPHP=sql_result($memreresult,$rei,"CanExecPHP");
-if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
-       $PreUserCanExecPHP = "no"; }
-$PreUserCanDoHTML=sql_result($memreresult,$rei,"CanDoHTML");
-if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
-       $PreUserCanDoHTML = "no"; }
-$PreUserCanUseBBTags=sql_result($memreresult,$rei,"CanUseBBTags");
-if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
-       $PreUserCanUseBBTags = "no"; }
-sql_free_result($memreresult);
-$User1Joined=sql_result($reresult,$rei,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($User1Joined);
-$tmpusrcurtime->setTimezone($usertz);
-$User1Joined=$tmpusrcurtime->format($_SESSION['iDBDateFormat']);
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-$User1CanExecPHP = $PreUserCanExecPHP;
-if($PreUserCanExecPHP=="group") {
-$User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
-if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
-       $User1CanExecPHP = "no"; }
-$User1CanDoHTML = $PreUserCanDoHTML;
-if($PreUserCanDoHTML=="group") {
-$User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
-if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
-       $User1CanDoHTML = "no"; }
-$User1CanUseBBTags = $PreUserCanUseBBTags;
-if($User1CanUseBBTags=="group") {
-$User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
-if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
-       $User1CanUseBBTags = "no"; }
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-$User1PermissionID=sql_result($gresult,0,"PermissionID");
-sql_free_result($gresult);
-$per1query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i LIMIT 1", array($User1PermissionID));
-$per1esult=sql_query($per1query,$SQLStat);
-$per1num=sql_num_rows($per1esult);
-$User1CanDoHTML1=sql_result($per1esult,0,"CanDoHTML");
-if($User1CanDoHTML1!="yes"&&$User1CanDoHTML1!="no") {
-       $User1CanDoHTML1 = "no"; }
-$User1CanUseBBTags1=sql_result($per1esult,0,"CanUseBBTags");
-if($User1CanUseBBTags1!="yes"&&$User1CanUseBBTags1!="no") {
-       $User1CanUseBBTags1 = "no"; }
-sql_free_result($per1esult);
-$User1Signature=sql_result($reresult,$rei,"Signature");
-$User1Avatar=sql_result($reresult,$rei,"Avatar");
-$User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
-if ($User1Avatar=="http://"||$User1Avatar==null||
-       strtolower($User1Avatar)=="noavatar") {
-$User1Avatar=$ThemeSet['NoAvatar'];
-$User1AvatarSize=$ThemeSet['NoAvatarSize']; }
-$AvatarSize1=explode("x", $User1AvatarSize);
-$AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
-$User1Website=sql_result($reresult,$rei,"Website");
-$BoardWWWChCk = parse_url($Settings['idburl']);
-if($User1Website=="http://") { 
-       $User1Website = $Settings['idburl']; }
-$User1WWWChCk = parse_url($User1Website);
-$User1Website = urlcheck($User1Website);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
-       $opennew = null; }
-$User1PostCount=sql_result($reresult,$rei,"PostCount");
-$User1Karma=sql_result($reresult,$rei,"Karma");
-$User1IP=sql_result($reresult,$rei,"IP");
-sql_free_result($reresult);
-if($User1Name=="Guest") { $User1Name=$GuestsName;
-if($User1Name==null) { $User1Name="Guest"; } }
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $User1Name = $GroupNamePrefix.$User1Name; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $User1Name = $User1Name.$GroupNameSuffix; }
-$MySubPost = null;
-if($MyEditTime!=$MyTimeStamp&&$MyEditUserID!=0) {
-if($MyEditUserID!=$MyUserID) {
-$euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
-$euresult = sql_query($euquery,$SQLStat);
-$eunum = sql_num_rows($euresult);
-if($eunum<1) { $MyEditUserID = -1;
-$euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
-$euresult = sql_query($euquery,$SQLStat);
-$eunum = sql_num_rows($euresult); }
-       $EditUserID = $MyEditUserID;
-       $EditUserGroupID = sql_result($euresult,0,"GroupID");
-       $EditUserHidden=sql_result($euresult,0,"HiddenMember");
-       $EditUserName = sql_result($euresult,0,"Name");
-       sql_free_result($euresult);
-       $eugquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($EditUserGroupID));
-       $eugresult=sql_query($eugquery,$SQLStat);
-       $EditUserGroup=sql_result($eugresult,0,"Name");
-       $EditUserNamePrefix=sql_result($eugresult,0,"NamePrefix");
-       $EditUserNameSuffix=sql_result($eugresult,0,"NameSuffix");
-       sql_free_result($eugresult);    }
-       if($MyEditUserID==$MyUserID) {
-       $EditUserID = $User1ID;
-       $EditUserGroupID = $User1GroupID;
-       //$EditUserHidden=$User1Hidden;
-       $EditUserName = $User1Name;
-       $EditUserGroup=$User1Group;
-       $EditUserNamePrefix=null;
-       $EditUserNameSuffix=null; }
-       if($EditUserName=="Guest") { $EditUserName=$MyEditUserName;
-       if($EditUserName==null) { $EditUserName="Guest"; } }
-       if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-               $EditUserName = $EditUserNamePrefix.$EditUserName; }
-       if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-               $EditUserName = $EditUserName.$EditUserNameSuffix; }
-       $tmpusrcurtime = new DateTime();
-       $tmpusrcurtime->setTimestamp($MyEditTime);
-       $tmpusrcurtime->setTimezone($usertz);
-       $MyEditTime = $tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-       $MySubPost = "<div class=\"EditReply\"><br />This post has been edited by <b>".$EditUserName."</b> on ".$MyEditTime."</div>"; }
-if($MyEditTime!=$MyTimeStamp&&$MyEditUserID!=0&&$MyEditUserID!=$MyUserID) {
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0; $ipshow = "two";
-$User1ID=$MyUserID; $GuestsName = $MyGuestName;
-$User1Name=sql_result($reresult,$rei,"Name");
-$User1IP=sql_result($reresult,$rei,"IP");
-if($User1IP==$MyPostIP) { $ipshow = "one"; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$User1Joined=sql_result($reresult,$rei,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($User1Joined);
-$tmpusrcurtime->setTimezone($usertz);
-$User1Joined=$tmpusrcurtime->format($_SESSION['iDBDateFormat']);
-$User1Hidden=sql_result($reresult,$rei,"HiddenMember");
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-sql_free_result($gresult); }
-if($User1CanUseBBTags1=="yes") { $MyPost = bbcode_parser($MyPost); }
-if($User1CanExecPHP=="no") {
-$MyPost = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$MyPost); }
-if($User1CanExecPHP=="yes") { $MyPost = php_execute($MyPost); }
-if($User1CanDoHTML1=="no") {
-$MyPost = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$MyPost); }
-if($User1CanDoHTML1=="yes") { $MyPost = do_html_bbcode($MyPost); }
-$MyPost = text2icons($MyPost,$Settings['sqltable'],$SQLStat);
-$MyPost = preg_replace("/\<br\>/", "<br />", nl2br($MyPost));
-$MyPost = url2link($MyPost);
-if($MySubPost!=null) { $MyPost = $MyPost."\n".$MySubPost; }
-if($User1CanUseBBTags=="yes") { $User1Signature = bbcode_parser($User1Signature); }
-if($User1CanExecPHP=="no") {
-$User1Signature = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$User1Signature); }
-if($User1CanExecPHP=="yes") { $User1Signature = php_execute($User1Signature); }
-if($User1CanDoHTML1=="no") {
-$User1Signature = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$User1Signature); }
-if($User1CanDoHTML=="yes") { $User1Signature = do_html_bbcode($User1Signature); }
-$User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
-$User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
-$User1Signature = url2link($User1Signature);
-$CanEditReply = false; $CanDeleteReply = false;
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanEditReplys'][$MyForumID]=="yes"&&
-       $_SESSION['UserID']==$MyUserID) { $CanEditReply = true; }
-if($PermissionInfo['CanDeleteReplys'][$MyForumID]=="yes"&&
-       $_SESSION['UserID']==$MyUserID) { $CanDeleteReply = true; }
-if($PermissionInfo['CanModForum'][$MyForumID]=="yes") { 
-       $CanEditReply = true; $CanDeleteReply = true; } }
-if($_SESSION['UserID']==0) { 
-       $CanEditReply = false; $CanDeleteReply = false; }
-$ReplyNum = $i + $PageLimit + 1;
-?>
-<div style="border:1px solid #E6E3E4; padding:1px; margin-bottom: 15px;" id="reply<?php echo $ReplyNum; ?>">
-<div style="border: 1px solid #E6E3E4; padding:1px; margin-bottom: 15px; background-color: #E6E3E4; padding: 6px;" id="post<?php echo $MyPostID; ?>">
-<div style="font-weight: bold; font-size: 0.8em; width: auto; float: left;"><?php echo $User1Name; ?></div>
-<div style="width:auto; font-size: 0.8em; color: gray; text-align:right;"><?php echo $MyTimeStamp; ?></div>
-</div>
-<div style="padding: 6px; font-size: 0.8em;"><?php echo $MyPost; ?></div></div>
-<?php ++$i; } sql_free_result($result); 
-?></div><div>&nbsp;</div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
-<?php echo $pstring; ?></div>
-<div>&nbsp;</div><?php } } ?>
diff --git a/inc/lowsubcategories.php.bak b/inc/lowsubcategories.php.bak
deleted file mode 100644 (file)
index 1498028..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: lowsubcategories.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="lowsubcategories.php"||$File3Name=="/lowsubcategories.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-$checkquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($_GET['id']));
-$checkresult=sql_query($checkquery,$SQLStat);
-$checknum=sql_num_rows($checkresult);
-if($checknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($checkresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($checknum>=1) {
-$CategoryID=sql_result($checkresult,0,"id");
-$CategoryName=sql_result($checkresult,0,"Name");
-$CategoryShow=sql_result($checkresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($checkresult,0,"CategoryType");
-$InSubCategory=sql_result($checkresult,0,"InSubCategory");
-$SubShowForums=sql_result($checkresult,0,"SubShowForums");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-$SCategoryName = $CategoryName;
-if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
-       $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview&id=".$CategoryID,"&","=",$prexqstr[$CategoryType],$exqstr[$CategoryType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType]; }
-$_SESSION['PreViewingTitle'] = "Viewing SubCategory:";
-$_SESSION['ViewingTitle'] = $CategoryName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($InSubCategory!="0") {
-$iscquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($InSubCategory));
-$iscresult=sql_query($iscquery,$SQLStat);
-$iscnum=sql_num_rows($iscresult);
-if($iscnum>=1) {
-$iscCategoryID=sql_result($iscresult,0,"id");
-$iscCategoryName=sql_result($iscresult,0,"Name");
-$iscCategoryShow=sql_result($iscresult,0,"ShowCategory");
-$iscCategoryType=sql_result($iscresult,0,"CategoryType");
-$iscCategoryType = strtolower($iscCategoryType); }
-if($iscnum<1) { $InSubCategory = "0"; } 
-sql_free_result($iscresult); }
-?>
-<div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php if($InSubCategory!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$iscCategoryType],$Settings['file_ext'],"act=view&id=".$iscCategoryID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$iscCategoryType],$exqstr[$iscCategoryType]); ?>"><?php echo $iscCategoryName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></div>
-<div>&nbsp;</div>
-<?php
-if($CategoryType=="category") {
-redirect("location",$rbasedir.url_maker($exfile['category'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['category'],$exqstr['category'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($checkresult);
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"InSubCategory\"=%i".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-while ($prei < $prenum) {
-$CategoryID=sql_result($preresult,$prei,"id");
-$CategoryName=sql_result($preresult,$prei,"Name");
-$CategoryShow=sql_result($preresult,$prei,"ShowCategory");
-$CategoryType=sql_result($preresult,$prei,"CategoryType");
-$SSubShowForums=sql_result($preresult,$prei,"SubShowForums");
-$CategoryDescription=sql_result($preresult,$prei,"Description");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-if(isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=0".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<div style="padding: 10px; border: 1px solid gray;">
-<ul style="list-style-type: none;">
-<li style="font-weight: bold;"><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></li><li>
-<?php }
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-$shownum = null;
-if ($SubsForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($SubsForumType!="redirect") { $shownum = "(".$NumsPosts." posts)"; }
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<li><ul style=\"list-style-type: none;\"><li><a href=\"".$sfurl."\">".$SubsForumName."</a> <span style=\"color: gray; font-size: 10px;\">".$shownum."</span></li></ul></li>";
-if($apcl==1) {
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist." ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$gltnum = count($gltf); $glti = 0; 
-$OldUpdateTime = 0; $UseThisFonum = null;
-if ($ForumType=="subforum") { 
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"CategoryID\"=%i AND \"ForumID\"=%i".$ExtraIgnores." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($CategoryID,$gltf[$glti]));
-$gltforesult=sql_query($gltfoquery,$SQLStat);
-$gltfonum=sql_num_rows($gltforesult);
-if($gltfonum>0) {
-$NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
-if($NewUpdateTime>$OldUpdateTime) { 
-       $UseThisFonum = $gltf[$glti]; 
-$OldUpdateTime = $NewUpdateTime; } }
-sql_free_result($gltforesult);
-++$glti; } }
-$shownum = null;
-if ($ForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($ForumType!="redirect") { $shownum = "(".$NumPosts." posts)"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-?>
-<ul style="list-style-type: none;"><li>
-<a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a> <span style="color: gray; font-size: 10px;"><?php echo $shownum; ?></span></li>
-<?php echo $sflist; ?></ul>
-<?php } ++$i; } sql_free_result($result); } ?>
-</li></ul>
-<ul style="list-style-type: none;">
-<?php ++$prei; } } ?>
-<?php
-sql_free_result($preresult);
-$CatCheck = "skip";
-if($SubShowForums!="yes") { 
-       $CategoryName = $SCategoryName; }
-if($SubShowForums!="no") {
-require($SettDir['inc'].'lowcategories.php'); } }
-?>
diff --git a/inc/lowsubforums.php.bak b/inc/lowsubforums.php.bak
deleted file mode 100644 (file)
index 09e495b..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: lowsubforums.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="lowsubforums.php"||$File3Name=="/lowsubforums.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-$checkquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['id']));
-$checkresult=sql_query($checkquery,$SQLStat);
-$checknum=sql_num_rows($checkresult);
-if($checknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($checkresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($checknum>=1) {
-$ForumID=sql_result($checkresult,0,"id");
-$ForumName=sql_result($checkresult,0,"Name");
-$ForumType=sql_result($checkresult,0,"ForumType");
-$ForumShow=sql_result($checkresult,0,"ShowForum");
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$InSubForum=sql_result($checkresult,0,"InSubForum");
-$CategoryID=sql_result($checkresult,0,"CategoryID");
-$RedirectURL=sql_result($checkresult,0,"RedirectURL");
-$RedirectTimes=sql_result($checkresult,0,"Redirects");
-$CanHaveTopics=sql_result($checkresult,0,"CanHaveTopics");
-$NumberViews=sql_result($checkresult,0,"NumViews");
-$SForumName = $ForumName;
-$ForumType = strtolower($ForumType); $CanHaveTopics = strtolower($CanHaveTopics);
-if($CanHaveTopics!="yes"&&$ForumType!="redirect") {
-if($NumberViews==0||$NumberViews==null) { $NewNumberViews = 1; }
-if($NumberViews!=0&&$NumberViews!=null) { $NewNumberViews = $NumberViews + 1; }
-$viewup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumViews\"='%s' WHERE \"id\"=%i", array($NewNumberViews,$_GET['id']));
-sql_query($viewup,$SQLStat); }
-if($ForumType=="redirect") {
-if($RedirectTimes==0||$RedirectTimes==null) { $NewRedirTime = 1; }
-if($RedirectTimes!=0&&$RedirectTimes!=null) { $NewRedirTime = $RedirectTimes + 1; }
-$redirup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"Redirects\"='%s' WHERE \"id\"=%i", array($NewRedirTime,$_GET['id']));
-sql_query($redirup,$SQLStat);
-if($RedirectURL!="http://"&&$RedirectURL!="") {
-redirect("location",$RedirectURL,0,null,false); ob_clean();
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($RedirectURL=="http://"||$RedirectURL=="") {
-redirect("location",url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($ForumType=="forum") {
-redirect("location",$rbasedir.url_maker($exfile['forum'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($checkresult);
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"id\"=%i".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-$CategoryID=sql_result($preresult,0,"id");
-$CategoryName=sql_result($preresult,0,"Name");
-$CategoryShow=sql_result($preresult,0,"ShowCategory");
-$CategoryType=sql_result($preresult,0,"CategoryType");
-$InSubCategory=sql_result($preresult,0,"InSubCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryDescription=sql_result($preresult,0,"Description");
-if($InSubForum!="0") {
-$isfquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($InSubForum));
-$isfresult=sql_query($isfquery,$SQLStat);
-$isfnum=sql_num_rows($isfresult);
-if($isfnum>=1) {
-$isfForumID=sql_result($isfresult,0,"id");
-$isfForumCatID=sql_result($isfresult,0,"CategoryID");
-$isfForumName=sql_result($isfresult,0,"Name");
-$isfForumType=sql_result($isfresult,0,"ForumType");
-$isfForumType = strtolower($isfForumType);
-$isfRedirectURL=sql_result($isfresult,0,"RedirectURL"); }
-if($isfnum<1) { $InSubForum = "0"; } 
-sql_free_result($isfresult); }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview&id=".$ForumID."&page=".$_GET['page'],"&","=",$prexqstr[$ForumType],$exqstr[$ForumType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType]; }
-$_SESSION['PreViewingTitle'] = "Viewing SubForum:";
-$_SESSION['ViewingTitle'] = $ForumName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; 
-?>
-<div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php if($InSubForum!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$isfForumType],$Settings['file_ext'],"act=view&id=".$isfForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$isfForumType],$exqstr[$isfForumType]); ?>"><?php echo $isfForumName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
-<div>&nbsp;</div>
-<?php
-if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
-       $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($PermissionInfo['CanViewForum'][$_GET['id']])) {
-       $PermissionInfo['CanViewForum'][$_GET['id']] = "no"; }
-if($PermissionInfo['CanViewForum'][$_GET['id']]=="no"||
-       $PermissionInfo['CanViewForum'][$_GET['id']]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes"&&
-       $PermissionInfo['CanViewForum'][$_GET['id']]=="yes") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID,$_GET['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<div style="padding: 10px; border: 1px solid gray;">
-<ul style="list-style-type: none;">
-<li style="font-weight: bold;"><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></li><li>
-<?php
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-$shownum = null;
-if ($SubsForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($SubsForumType!="redirect") { $shownum = "(".$NumsPosts." posts)"; }
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=lowview&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<li><ul style=\"list-style-type: none;\"><li><a href=\"".$sfurl."\">".$SubsForumName."</a> <span style=\"color: gray; font-size: 10px;\">".$shownum."</span></li></ul></li>";
-if($apcl==1) {
-$sflist = "Subforums:";
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist." ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-$shownum = null;
-if ($ForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
-if ($ForumType!="redirect") { $shownum = "(".$NumPosts." posts)"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-?>
-<ul style="list-style-type: none;"><li>
-<a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a> <span style="color: gray; font-size: 10px;"><?php echo $shownum; ?></span></li>
-<?php echo $sflist; ?></ul>
-<?php ++$i; } sql_free_result($result);
-?>
-</li></ul></div>
-<div>&nbsp;</div>
-<?php } } sql_free_result($preresult);
-$ForumCheck = "skip";
-if($CanHaveTopics!="yes") { 
-       $ForumName = $SForumName; }
-if($CanHaveTopics!="no") {
-require($SettDir['inc'].'lowtopics.php'); } }
-?>
diff --git a/inc/lowtopics.php.bak b/inc/lowtopics.php.bak
deleted file mode 100644 (file)
index cdfecc2..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: lowtopics.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="lowtopics.php"||$File3Name=="/lowtopics.php") {
-       require('index.php');
-       exit(); }
-$pstring = null; $pagenum = null;
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
-if(!isset($_GET['st'])) { $_GET['st'] = 0; }
-if(!is_numeric($_GET['st'])) { $_GET['st'] = 0; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$ForumID=sql_result($preresult,0,"id");
-$ForumCatID=sql_result($preresult,0,"CategoryID");
-$ForumName=sql_result($preresult,0,"Name");
-$ForumType=sql_result($preresult,0,"ForumType");
-$ForumShow=sql_result($preresult,0,"ShowForum");
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$InSubForum=sql_result($preresult,0,"InSubForum");
-$RedirectURL=sql_result($preresult,0,"RedirectURL");
-$RedirectTimes=sql_result($preresult,0,"Redirects");
-$NumberViews=sql_result($preresult,0,"NumViews");
-$NumberPosts=sql_result($preresult,0,"NumPosts");
-$NumberTopics=sql_result($preresult,0,"NumTopics");
-$PostCountAdd=sql_result($preresult,0,"PostCountAdd");
-$CanHaveTopics=sql_result($preresult,0,"CanHaveTopics");
-$HotTopicPosts=sql_result($preresult,0,"HotTopicPosts");
-if($HotTopicPosts!=0&&is_numeric($HotTopicPosts)) {
-       $Settings['hot_topic_num'] = $HotTopicPosts; }
-if(!is_numeric($Settings['hot_topic_num'])) {
-       $Settings['hot_topic_num'] = 15; }
-$ForumPostCountView=sql_result($preresult,0,"PostCountView");
-$ForumKarmaCountView=sql_result($preresult,0,"KarmaCountView");
-sql_free_result($preresult);
-$ForumType = strtolower($ForumType); $CanHaveTopics = strtolower($CanHaveTopics);
-$catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2."  LIMIT 1", array($ForumCatID));
-$catresult=sql_query($catcheck,$SQLStat);
-$CategoryID=sql_result($catresult,0,"id");
-$CategoryName=sql_result($catresult,0,"Name");
-$CategoryShow=sql_result($catresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($catresult,0,"CategoryType");
-$InSubCategory=sql_result($catresult,0,"InSubCategory");
-$CategoryPostCountView=sql_result($catresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
-sql_free_result($catresult);
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($InSubForum!="0") {
-$isfquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($InSubForum));
-$isfresult=sql_query($isfquery,$SQLStat);
-$isfnum=sql_num_rows($isfresult);
-if($isfnum>=1) {
-$isfForumID=sql_result($isfresult,0,"id");
-$isfForumCatID=sql_result($isfresult,0,"CategoryID");
-$isfForumName=sql_result($isfresult,0,"Name");
-$isfForumType=sql_result($isfresult,0,"ForumType");
-$isfForumType = strtolower($isfForumType);
-$isfRedirectURL=sql_result($isfresult,0,"RedirectURL"); }
-if($isfnum<1) { $InSubForum = "0"; }
-sql_free_result($isfresult); }
-if($ForumCheck!="skip") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview&id=".$ForumID."&page=".$_GET['page'],"&","=",$prexqstr[$ForumType],$exqstr[$ForumType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType]; }
-$_SESSION['PreViewingTitle'] = "Viewing Forum:";
-$_SESSION['ViewingTitle'] = $ForumName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; 
-?>
-<div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$ForumCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php if($InSubForum!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$isfForumType],$Settings['file_ext'],"act=view&id=".$isfForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$isfForumType],$exqstr[$isfForumType]); ?>"><?php echo $isfForumName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
-<div>&nbsp;</div>
-<?php }
-if(!isset($CatPermissionInfo['CanViewCategory'][$ForumCatID])) {
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($PermissionInfo['CanViewForum'][$ForumID])) {
-       $PermissionInfo['CanViewForum'][$ForumID] = "no"; }
-if($PermissionInfo['CanViewForum'][$ForumID]=="no"||
-       $PermissionInfo['CanViewForum'][$ForumID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="yes"&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-if($ForumType!="redirect") {
-if($NumberViews==0||$NumberViews==null) { $NewNumberViews = 1; }
-if($NumberViews!=0&&$NumberViews!=null) { $NewNumberViews = $NumberViews + 1; }
-$viewup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumViews\"=%i WHERE \"id\"=%i", array($NewNumberViews,$_GET['id']));
-sql_query($viewup,$SQLStat); }
-if($ForumType=="redirect") {
-if($RedirectTimes==0||$RedirectTimes==null) { $NewRedirTime = 1; }
-if($RedirectTimes!=0&&$RedirectTimes!=null) { $NewRedirTime = $RedirectTimes + 1; }
-$redirup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"Redirects\"=%i WHERE \"id\"=%i", array($NewRedirTime,$_GET['id']));
-sql_query($redirup,$SQLStat);
-if($RedirectURL!="http://"&&$RedirectURL!="") {
-redirect("location",$RedirectURL,0,null,false); ob_clean();
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($RedirectURL=="http://"||$RedirectURL=="") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($ForumCheck!="skip") {
-if($ForumType=="subforum") {
-redirect("location",$rbasedir.url_maker($exfile['subforum'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['subforum'],$exqstr['subforum'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($_GET['act']=="lowview") {
-if($NumberTopics==null) { 
-       $NumberTopics = 0; }
-$num=$NumberTopics;
-//Start Topic Page Code
-if(!isset($Settings['max_topics'])) { $Settings['max_topics'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$nums = $_GET['page'] * $Settings['max_topics']; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$nums = $_GET['st']; }
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_topics'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_topics']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_topics']) { 
-       $pnum = $pnum - $Settings['max_topics']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_topics']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-$snumber = $_GET['page'] - 1;
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$PageLimit = $Settings['max_topics'] * $snumber; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$PageLimit = $_GET['st']; }
-if($PageLimit<0) { $PageLimit = 0; }
-//End Topic Page Code
-$i=0;
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$_GET['id']]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"Pinned\" DESC, \"LastUpdate\" DESC ".$SQLimit, array($_GET['id'],$PageLimit,$Settings['max_topics']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($NumberTopics==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-?>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
-<?php echo $pstring; ?></div>
-<div>&nbsp;</div>
-<div style="padding: 10px; border: 1px solid gray;">
-<?php if($num<=0) { ?>
-<ul style="list-style-type: none;">
-<li>&nbsp;</li>
-<?php } if($num>0) { ?>
-<ul style="list-style-type: decimal;">
-<?php }
-while ($i < $num) {
-$TopicID=sql_result($result,$i,"id");
-$TForumID=sql_result($result,$i,"ForumID");
-$OldForumID=sql_result($result,$i,"OldForumID");
-$UsersID=sql_result($result,$i,"UserID");
-$GuestsName=sql_result($result,$i,"GuestName");
-$TheTime=sql_result($result,$i,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TheTime);
-$tmpusrcurtime->setTimezone($usertz);
-$TheTime=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$NumReply=sql_result($result,$i,"NumReply");
-$NumberPosts=$NumReply + 1;
-$prepagelist = null;
-if(!isset($Settings['max_posts'])) { 
-       $Settings['max_posts'] = 10; }
-$TopicName=sql_result($result,$i,"TopicName");
-$TopicDescription=sql_result($result,$i,"Description");
-$PinnedTopic=sql_result($result,$i,"Pinned");
-$TopicStat=sql_result($result,$i,"Closed");
-$PreTopic = null;
-if ($PinnedTopic>2) { $PinnedTopic = 1; } 
-if ($PinnedTopic<0) { $PinnedTopic = 0; }
-if(!is_numeric($PinnedTopic)) { $PinnedTopic = 0; }
-if ($TopicStat>3) { $TopicStat = 1; } 
-if ($TopicStat<0) { $TopicStat = 0; }
-if(!is_numeric($TopicStat)) { $TopicStat = 1; }
-if ($PinnedTopic>0&&$PinnedTopic<3) { $PreTopic="<span style=\"font-weight: bold;\">Pinned: </span>"; }
-if ($PinnedTopic==0) { $PreTopic=null; }
-if ($OldForumID==$ForumID&&$TForumID!=$ForumID) { $PreTopic="<span>Moved: </span>"; }
-?>
-<li><?php echo $PreTopic; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a> <span style="color: gray; font-size: 10px;">(<?php echo $NumReply; ?> replies)</span></li>
-<?php ++$i; } ?>
-</ul></div><div>&nbsp;</div>
-<div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
-<?php echo $pstring; ?></div>
-<div>&nbsp;</div>
-<?php sql_free_result($result); } } } ?>
diff --git a/inc/members.php.bak b/inc/members.php.bak
deleted file mode 100644 (file)
index 2569464..0000000
+++ /dev/null
@@ -1,1779 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: members.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="members.php"||$File3Name=="/members.php") {
-       require('index.php');
-       exit(); }
-$pagenum = null;
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
-if($_GET['act']=="list"||$_GET['act']=="getactive") {
-$orderlist = null;
-$orderlist = "order by \"ID\" asc";
-if(!isset($_GET['list'])) { $_GET['list'] = "members"; }
-if(!isset($_GET['orderby'])) { $_GET['orderby'] = null; }
-if(!isset($_GET['sorttype'])) { $_GET['sorttype'] = null; }
-if(!isset($_GET['ordertype'])) { $_GET['ordertype'] = null; }
-if(!isset($_GET['orderby'])) { $_GET['orderby'] = null; }
-if(!isset($_GET['sortby'])) { $_GET['sortby'] = null; }
-if(!isset($_GET['gid'])) { $_GET['gid'] = null; }
-if(!isset($_GET['groupid'])) { $_GET['groupid'] = null; }
-if($_GET['orderby']==null) { 
-       if($_GET['sortby']!=null) { 
-               $_GET['orderby'] = $_GET['sortby']; } }
-if($_GET['orderby']==null) { $_GET['orderby'] = "joined"; }
-if($_GET['orderby']!=null) {
-if($_GET['orderby']=="id") { $orderlist = "order by \"ID\""; }
-if($_GET['orderby']=="name") { $orderlist = "order by \"Name\""; }
-if($_GET['orderby']=="joined") { $orderlist = "order by \"Joined\""; }
-if($_GET['orderby']=="active") { $orderlist = "order by \"LastActive\""; }
-if($_GET['orderby']=="post") { $orderlist = "order by \"PostCount\""; }
-if($_GET['orderby']=="posts") { $orderlist = "order by \"PostCount\""; }
-if($_GET['orderby']=="karma") { $orderlist = "order by \"Karma\""; }
-if($_GET['orderby']=="offset") { $orderlist = "order by \"TimeZone\""; } }
-if($_GET['ordertype']==null) { 
-       if($_GET['sorttype']!=null) { 
-               $_GET['ordertype'] = $_GET['sorttype']; } }
-if($_GET['ordertype']==null) { $_GET['ordertype'] = "asc"; }
-if($_GET['ordertype']!=null) {
-if($_GET['ordertype']=="ascending") { $orderlist .= " asc"; }
-if($_GET['ordertype']=="descending") { $orderlist .= " desc"; }
-if($_GET['ordertype']=="asc") { $orderlist .= " asc"; }
-if($_GET['ordertype']=="desc") { $orderlist .= " desc"; } }
-if(!is_numeric($_GET['gid'])) { $_GET['gid'] = null; }
-if($_GET['gid']!=null&&$_GET['groupid']==null) { $_GET['groupid'] = $_GET['gid']; }
-if(!is_numeric($_GET['groupid'])) { $_GET['groupid'] = null; }
-$ggquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s'", array($Settings['GuestGroup']));
-$ggresult=sql_query($ggquery,$SQLStat);
-$GGroup=sql_result($ggresult,0,"id");
-sql_free_result($ggresult);
-//Get SQL LIMIT Number
-$nums = $_GET['page'] * $Settings['max_memlist'];
-$PageLimit = $nums - $Settings['max_memlist'];
-if($PageLimit<0) { $PageLimit = 0; }
-$i=0;
-if($_GET['act']=="list") {
-if($_GET['groupid']==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"<>%i AND \"id\">=0 AND \"HiddenMember\"='no' ".$orderlist." ".$SQLimit, array($GGroup,$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"<>%i AND \"id\">=0 AND \"HiddenMember\"='no'", array($GGroup)); }
-if($_GET['groupid']!=null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"=%i AND \"GroupID\"<>%i AND \"id\">=0 ".$orderlist." ".$SQLimit, array($_GET['groupid'],$GGroup,$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"=%i AND \"GroupID\"<>%i AND \"id\">=0", array($_GET['groupid'],$GGroup)); } }
-if($_GET['act']=="getactive") {
-$active_month = $usercurtime->format("m");
-$active_day = $usercurtime->format("d");
-$active_year = $usercurtime->format("Y");
-$active_start = mktime(0,0,0,$active_month,$active_day,$active_year);
-$active_end = mktime(23,59,59,$active_month,$active_day,$active_year);
-if($_GET['groupid']==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"<>%i AND \"id\">=0 AND \"HiddenMember\"='no' AND (\"LastActive\">=%i AND \"LastActive\"<=%i) ".$orderlist." ".$SQLimit, array($GGroup,$active_start,$active_end,$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"<>%i AND \"id\">=0 AND \"HiddenMember\"='no' AND (\"LastActive\">=%i AND \"LastActive\"<=%i)", array($GGroup,$active_start,$active_end)); }
-if($_GET['groupid']!=null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"=%i AND \"GroupID\"<>%i AND \"id\">=0 AND (\"LastActive\">=%i AND \"LastActive\"<=%i) ".$orderlist." ".$SQLimit, array($_GET['groupid'],$GGroup,$active_start,$active_end,$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"=%i AND \"GroupID\"<>%i AND \"id\">=0 AND (\"LastActive\">=%i AND \"LastActive\"<=%i)", array($_GET['groupid'],$GGroup,$active_start,$active_end)); } }
-$result=sql_query($query,$SQLStat);
-$rnresult=sql_query($rnquery,$SQLStat);
-$NumberMembers = sql_result($rnresult,0);
-sql_free_result($rnresult);
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$_GET['page'],"&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Member List";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($NumberMembers==null) { 
-       $NumberMembers = 0; }
-$num = $NumberMembers;
-//Start MemberList Page Code
-if(!isset($Settings['max_memlist'])) { $Settings['max_memlist'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-$nums = $_GET['page'] * $Settings['max_memlist'];
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_memlist'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_memlist']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_memlist']) { 
-       $pnum = $pnum - $Settings['max_memlist']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_memlist']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-$nums = $_GET['page'] * $Settings['max_memlist'];
-//End MemberList Page Code
-$num=sql_num_rows($result);
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($NumberMembers==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Member list</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-echo $pstring;
-//List Page Number Code end
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Member List</a>
-</span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1" colspan="8"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Member List</a>
-</span></td>
-</tr><?php } ?>
-<tr id="Member" class="TableRow2">
-<th class="TableColumn2" style="width: 28%;">Name</th>
-<th class="TableColumn2" style="width: 10%;">Group</th>
-<th class="TableColumn2" style="width: 5%;">Posts</th>
-<th class="TableColumn2" style="width: 5%;">Karma</th>
-<th class="TableColumn2" style="width: 20%;">Joined</th>
-<th class="TableColumn2" style="width: 20%;">Last Active</th>
-<th class="TableColumn2" style="width: 7%;">Website</th>
-<th class="TableColumn2" style="width: 5%;">Message</th>
-</tr>
-<?php
-while ($i < $num) {
-$MemList['ID']=sql_result($result,$i,"id");
-$MemList['Name']=sql_result($result,$i,"Name");
-$MemList['Email']=sql_result($result,$i,"Email");
-$MemList['GroupID']=sql_result($result,$i,"GroupID");
-$MemList['HiddenMember']=sql_result($result,$i,"HiddenMember");
-$MemList['WarnLevel']=sql_result($result,$i,"WarnLevel");
-$MemList['Interests']=sql_result($result,$i,"Interests");
-$MemList['Title']=sql_result($result,$i,"Title");
-$MemList['Joined']=sql_result($result,$i,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($MemList['Joined']);
-$tmpusrcurtime->setTimezone($usertz);
-$MemList['Joined']=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MemList['LastActive']=sql_result($result,$i,"LastActive");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($MemList['LastActive']);
-$tmpusrcurtime->setTimezone($usertz);
-$MemList['LastActive']=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MemList['Website']=sql_result($result,$i,"Website");
-if($MemList['Website']=="http://") { 
-       $MemList['Website'] = $Settings['idburl']; }
-$MemList['Website'] = urlcheck($MemList['Website']);
-$BoardWWWChCk = parse_url($Settings['idburl']);
-$MemsWWWChCk = parse_url($MemList['Website']);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$MemsWWWChCk['host']) {
-       $opennew = null; }
-$MemList['Gender']=sql_result($result,$i,"Gender");
-$MemList['PostCount']=sql_result($result,$i,"PostCount");
-$MemList['Karma']=sql_result($result,$i,"Karma");
-$MemList['TimeZone']=sql_result($result,$i,"TimeZone");
-$MemList['IP']=sql_result($result,$i,"IP");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($MemList['GroupID']));
-$gresult=sql_query($gquery,$SQLStat);
-$MemList['Group']=sql_result($gresult,0,"Name");
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-sql_free_result($gresult);
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $MemList['Name'] = $GroupNamePrefix.$MemList['Name']; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $MemList['Name'] = $MemList['Name'].$GroupNameSuffix; }
-$membertitle = " ".$ThemeSet['TitleDivider']." Member List";
-if($MemList['Group']!=$Settings['GuestGroup']) {
-?>
-<tr class="TableRow3" id="Member<?php echo $MemList['ID']; ?>">
-<td class="TableColumn3" style="text-align: center;">&nbsp;<a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $MemList['Name']; ?></a> <?php if($GroupInfo['CanViewIPAddress']=="yes") { ?> ( <a title="<?php echo $MemList['IP']; ?>" onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$MemList['IP']); ?>"><?php echo $MemList['IP']; ?></a> )<?php } ?></td>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&gid=".$MemList['GroupID']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $MemList['Group']; ?></a></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $MemList['PostCount']; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $MemList['Karma']; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $MemList['Joined']; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $MemList['LastActive']; ?></td>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo $MemList['Website']; ?>"<?php echo $opennew; ?>>Website</a></td>
-<?php if($MemList['ID']>0&&$MemList['HiddenMember']=="no") { ?>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>"<?php echo $opennew; ?>>PM</a></td>
-<?php } if($MemList['ID']<=0||$MemList['HiddenMember']=="yes") { ?>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"<?php echo $opennew; ?>>PM</a></td>
-<?php } ?>
-</tr>
-<?php }
-++$i; } sql_free_result($result);
-?>
-<tr id="MemEnd" class="TableRow4">
-<td class="TableColumn4" colspan="8">&nbsp;</td>
-</tr>
-</table></div>
-<?php 
-if($pagenum>1) {
-?>
-<div class="DivMembers">&nbsp;</div>
-<?php }
-echo $pstring;
-//List Page Number Code end
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } }
-if($_GET['act']=="online") {
-if($_GET['list']!="all"&&$_GET['list']!="members"&&$_GET['list']!="guests") {
-       $_GET['list'] = "members"; }
-//Get SQL LIMIT Number
-$nums = $_GET['page'] * $Settings['max_memlist'];
-$PageLimit = $nums - $Settings['max_memlist'];
-if($PageLimit<0) { $PageLimit = 0; }
-$i=0;
-$uolcuttime = $utccurtime->getTimestamp();
-$uoltime = $uolcuttime - ini_get("session.gc_maxlifetime");
-if($_GET['list']=="members") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"serialized_data\" NOT LIKE '%s' ORDER BY \"expires\" DESC ".$SQLimit, array($uoltime,"%UserGroup|s:".strlen($Settings['GuestGroup']).":\"".$Settings['GuestGroup']."\";%",$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"serialized_data\" NOT LIKE '%s'", array($uoltime,"%UserGroup|s:".strlen($Settings['GuestGroup']).":\"".$Settings['GuestGroup']."\";%")); }
-if($_GET['list']=="guests") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"serialized_data\" LIKE '%s' ORDER BY \"expires\" DESC ".$SQLimit, array($uoltime,"%UserGroup|s:".strlen($Settings['GuestGroup']).":\"".$Settings['GuestGroup']."\";%",$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"serialized_data\" LIKE '%s'", array($uoltime,"%UserGroup|s:".strlen($Settings['GuestGroup']).":\"".$Settings['GuestGroup']."\";%")); }
-if($_GET['list']=="all") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i ORDER BY \"expires\" DESC ".$SQLimit, array($uoltime,$PageLimit,$Settings['max_memlist'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i", array($uoltime)); }
-$result=sql_query($query,$SQLStat);
-$rnresult=sql_query($rnquery,$SQLStat);
-$NumberMembers = sql_result($rnresult,0);
-sql_free_result($rnresult);
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=online&list=".$_GET['list']."&page=".$_GET['page'],"&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Online Member List";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($NumberMembers==null) { 
-       $NumberMembers = 0; }
-$num = $NumberMembers;
-//Start MemberList Page Code
-if(!isset($Settings['max_memlist'])) { $Settings['max_memlist'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-$nums = $_GET['page'] * $Settings['max_memlist'];
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_memlist'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_memlist']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_memlist']) { 
-       $pnum = $pnum - $Settings['max_memlist']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_memlist']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-$nums = $_GET['page'] * $Settings['max_memlist'];
-//End MemberList Page Code
-$num=sql_num_rows($result);
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($NumberMembers==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=all&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Online Member List</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-echo $pstring;
-//List Page Number Code end
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Online Member List</a>
-</span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1" colspan="8"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Online Member List</a>
-</span></td>
-</tr><?php } ?>
-<tr id="Member" class="TableRow2">
-<th class="TableColumn2" style="width: 28%;">Member Name</th>
-<th class="TableColumn2" style="width: 10%;">Group Name</th>
-<th class="TableColumn2" style="width: 26%;">Location</th>
-<th class="TableColumn2" style="width: 24%;">Time</th>
-<th class="TableColumn2" style="width: 7%;">Website</th>
-<th class="TableColumn2" style="width: 5%;">Message</th>
-</tr>
-<?php
-while ($i < $num) {
-$AmIHiddenUser = "no";
-$get_session_id=sql_result($result,$i,"session_id");
-$session_data=sql_result($result,$i,"session_data");
-$serialized_data=sql_result($result,$i,"serialized_data");
-$session_user_agent=sql_result($result,$i,"user_agent"); 
-$session_ip_address=sql_result($result,$i,"ip_address"); 
-$session_expires=sql_result($result,$i,"expires"); 
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($session_expires);
-$tmpusrcurtime->setTimezone($usertz);
-$session_expires = $tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-if(isset($UserSessInfo)) { $UserSessInfo = null; }
-//$UserSessInfo = unserialize_session($session_data);
-$UserSessInfo = unserialize($serialized_data);
-if(!isset($UserSessInfo['ShowActHidden'])) { $UserSessInfo['ShowActHidden'] = "no"; }
-if(!isset($UserSessInfo['UserGroup'])) { 
-       $UserSessInfo['UserGroup'] = $Settings['GuestGroup']; }
-if(!isset($session_ip_address)) { 
-       $session_ip_address = "127.0.0.1"; }
-$ViewSessMem['Website'] = $Settings['idburl'];
-$opennew = null;
-if($UserSessInfo['UserGroup']!=$Settings['GuestGroup']) {
-$sess_query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
-$sess_result=sql_query($sess_query,$SQLStat);
-$sess_num=sql_num_rows($sess_result);
-$sess_i=0;
-$ViewSessMem['ID']=sql_result($sess_result,$sess_i,"id");
-$ViewSessMem['Name']=sql_result($sess_result,$sess_i,"Name");
-$ViewSessMem['GroupID']=sql_result($sess_result,$sess_i,"GroupID");
-$ViewSessMem['HiddenMember']=sql_result($sess_result,$sess_i,"HiddenMember");
-$ViewSessMem['WarnLevel']=sql_result($sess_result,$sess_i,"WarnLevel");
-$ViewSessMem['Joined']=sql_result($sess_result,$sess_i,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($ViewSessMem['Joined']);
-$tmpusrcurtime->setTimezone($usertz);
-$ViewSessMem['Joined']=$tmpusrcurtime->format("M j Y, ".$_SESSION['iDBTimeFormat']);
-$ViewSessMem['LastActive']=sql_result($sess_result,$sess_i,"LastActive");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($ViewSessMem['LastActive']);
-$tmpusrcurtime->setTimezone($usertz);
-$ViewSessMem['LastActive']=$tmpusrcurtime->format("M j Y, ".$_SESSION['iDBTimeFormat']);
-$ViewSessMem['Website']=sql_result($sess_result,$sess_i,"Website");
-if($ViewSessMem['Website']=="http://") { 
-       $ViewSessMem['Website'] = $Settings['idburl']; }
-$ViewSessMem['Website'] = urlcheck($ViewSessMem['Website']);
-$BoardWWWChCk = parse_url($Settings['idburl']);
-$MemsWWWChCk = parse_url($ViewSessMem['Website']);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$MemsWWWChCk['host']) {
-       $opennew = null; }
-$ViewSessMem['Gender']=sql_result($sess_result,$sess_i,"Gender");
-$ViewSessMem['PostCount']=sql_result($sess_result,$sess_i,"PostCount");
-$ViewSessMem['Karma']=sql_result($sess_result,$sess_i,"Karma");
-$ViewSessMem['TimeZone']=sql_result($sess_result,$sess_i,"TimeZone");
-$ViewSessMem['IP']=sql_result($sess_result,$sess_i,"IP");
-$gsess_query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($ViewSessMem['GroupID']));
-$gsess_result=sql_query($gsess_query,$SQLStat);
-$ViewSessMem['Group']=sql_result($gsess_result,0,"Name");
-$PreAmIHiddenUser = GetUserName($UserSessInfo['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden']; }
-if(!isset($AmIHiddenUser)) { $AmIHiddenUser = "no"; }
-if($AmIHiddenUser===null) { $AmIHiddenUser = "no"; }
-if(!isset($UserSessInfo['ViewingPage'])) {
-       $UserSessInfo['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
-if(!isset($UserSessInfo['ViewingFile'])) {
-       if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-       $UserSessInfo['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-       if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-       $UserSessInfo['ViewingFile'] = $exfile['index']; } }
-if(!isset($UserSessInfo['PreViewingTitle'])) {
-       $UserSessInfo['PreViewingTitle'] = "Viewing"; }
-if(!isset($UserSessInfo['ViewingTitle'])) {
-       $UserSessInfo['ViewingTitle'] = "Board index"; }
-$PreExpPage = explode("?",$UserSessInfo['ViewingPage']);
-$PreFileName = $UserSessInfo['ViewingFile'];
-$qstr = htmlentities("&", ENT_QUOTES, $Settings['charset']);
-$qsep = htmlentities("=", ENT_QUOTES, $Settings['charset']);
-$PreExpPage = preg_replace("/^\?/","",$UserSessInfo['ViewingPage']);
-$PreExpPage = str_replace($qstr, "&", $PreExpPage);
-$PreExpPage = str_replace($qsep, "=", $PreExpPage);
-parse_str($PreExpPage,$ChkID);
-if($PreFileName==$exfile['topic'].$Settings['file_ext']) {
-if(isset($ChkID["id"])) { $ChkID = $ChkID["id"]; 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($ChkID));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum>=1) {
-$TopicForumID=sql_result($preresult,0,"ForumID");
-$TopicCatID=sql_result($preresult,0,"CategoryID"); }
-if($prenum<1) {
-$TopicForumID=0;
-$TopicCatID=0; }
-if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$TopicCatID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; }
-if($PermissionInfo['CanViewForum'][$TopicForumID]=="no"||
-       $PermissionInfo['CanViewForum'][$TopicForumID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; } } }
-if($PreFileName==$exfile['forum'].$Settings['file_ext']) {
-if(isset($ChkID["id"])) { $ChkID = $ChkID["id"]; 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($ChkID));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$ForumCatID=sql_result($preresult,0,"CategoryID");
-sql_free_result($preresult);
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; }
-if($PermissionInfo['CanViewForum'][$ChkID]=="no"||
-       $PermissionInfo['CanViewForum'][$ChkID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; } } }
-if($PreFileName==$exfile['subforum'].$Settings['file_ext']) {
-if(isset($ChkID["id"])) { $ChkID = $ChkID["id"]; 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i LIMIT 1", array($ChkID));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$ForumCatID=sql_result($preresult,0,"CategoryID");
-sql_free_result($preresult);
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; }
-if($PermissionInfo['CanViewForum'][$ChkID]=="no"||
-       $PermissionInfo['CanViewForum'][$ChkID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; } } }
-if($PreFileName==$exfile['category'].$Settings['file_ext']) {
-if(isset($ChkID["id"])) { $ChkID = $ChkID["id"]; 
-if($CatPermissionInfo['CanViewCategory'][$ChkID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ChkID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; } } }
-if($PreFileName==$exfile['subcategory'].$Settings['file_ext']) {
-if(isset($ChkID["id"])) { $ChkID = $ChkID["id"]; 
-if($CatPermissionInfo['CanViewCategory'][$ChkID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ChkID]!="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-       $UserSessInfo['PreViewingTitle'] = "Viewing";
-       $UserSessInfo['ViewingTitle'] = "Board index"; } } }
-if($GroupInfo['HasAdminCP']!="yes"&&$UserSessInfo['ShowActHidden']=="yes") {
-       $PreFileName = $exfile['index'].$Settings['file_ext'];
-       $PreExpPage = "act=view";
-       $UserSessInfo['ViewingPage'] = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-if($_GET['list']=="all"||$_GET['list']=="members") {
-if($UserSessInfo['UserGroup']!=$Settings['GuestGroup']) {
-if($AmIHiddenUser=="no"&&$UserSessInfo['UserID']>0) { 
-?>
-<tr id="Member<?php echo $i; ?>" class="TableRow3">
-<td class="TableColumn3" style="text-align: center;"><a<?php if($GroupInfo['HasAdminCP']=="yes") { ?> title="<?php echo htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset']); ?>"<?php } ?> href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $UserSessInfo['MemberName']; ?></a>
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?> ( <a title="<?php echo $session_ip_address; ?>" onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$session_ip_address); ?>"><?php echo $session_ip_address; ?></a> )<?php } ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $UserSessInfo['UserGroup']; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php if($get_session_id!=session_id()) { ?><a href="<?php echo url_maker($PreFileName,"no+ext",$PreExpPage,$Settings['qstr'],$Settings['qsep'],null,null); ?>"><?php echo $UserSessInfo['PreViewingTitle']; ?> <?php echo $UserSessInfo['ViewingTitle']; ?></a><?php } if($get_session_id==session_id()) { ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$_GET['page'],"&","=",$prexqstr['member'],$exqstr['member']); ?>">Viewing Online Member List</a><?php } ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $session_expires; ?></td>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo $MemList['Website']; ?>"<?php echo $opennew; ?>>Website</a></td>
-<?php if($UserSessInfo['UserID']>0&&$AmIHiddenUser=="no") { ?>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>"<?php echo $opennew; ?>>PM</a></td>
-<?php } if($UserSessInfo['UserID']<=0||$AmIHiddenUser=="yes") { ?>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">PM</a></td>
-<?php } ?>
-</tr>
-<?php } } }
-if($UserSessInfo['UserGroup']==$Settings['GuestGroup']) {
-if(!isset($UserSessInfo['GuestName'])) { 
-       $UserSessInfo['GuestName'] = "Guest"; }
-if(!isset($UserSessInfo['UserID'])) { 
-       $UserSessInfo['UserID'] = "0"; }
-if($_GET['list']=="all"||$_GET['list']=="guests") {
-if(user_agent_check($session_user_agent)) {
-       $UserSessInfo['GuestName'] = user_agent_check($session_user_agent); }
-?>
-<tr id="Member<?php echo $i; ?>" class="TableRow3">
-<td class="TableColumn3" style="text-align: center;"><span<?php if($GroupInfo['HasAdminCP']=="yes") { ?> title="<?php echo htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset']); ?>"<?php } ?>><?php echo $UserSessInfo['GuestName']; ?></span>
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?> ( <a title="<?php echo $session_ip_address; ?>" onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$session_ip_address); ?>"><?php echo $session_ip_address; ?></a> )<?php } ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $UserSessInfo['UserGroup']; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php if($get_session_id!=session_id()) { ?><a href="<?php echo url_maker($PreFileName,"no+ext",$PreExpPage,$Settings['qstr'],$Settings['qsep'],null,null); ?>"><?php echo $UserSessInfo['PreViewingTitle']; ?> <?php echo $UserSessInfo['ViewingTitle']; ?></a><?php } if($get_session_id==session_id()) { ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=".$_GET['list']."&page=".$_GET['page'],"&","=",$prexqstr['member'],$exqstr['member']); ?>">Viewing Online Member List</a><?php } ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $session_expires; ?></td>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo $MemList['Website']; ?>"<?php echo $opennew; ?>>Website</a></td>
-<?php if($UserSessInfo['UserID']>0&&$AmIHiddenUser=="no") { ?>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>"<?php echo $opennew; ?>>PM</a></td>
-<?php } if($UserSessInfo['UserID']<=0||$AmIHiddenUser=="yes") { ?>
-<td class="TableColumn3" style="text-align: center;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">PM</a></td>
-<?php } ?>
-</tr>
-<?php } }
-++$i; }
-?>
-<tr id="MemEnd" class="TableRow4">
-<td class="TableColumn4" colspan="8">&nbsp;</td>
-</tr>
-</table></div>
-<?php 
-if($pagenum>1) {
-?>
-<div class="DivMembers">&nbsp;</div>
-<?php }
-echo $pstring;
-//List Page Number Code end
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } }
-if($_GET['act']=="view") { 
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num==0||$_GET['id']<=0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ViewMem['ID']=sql_result($result,$i,"id");
-$ViewMem['Name']=sql_result($result,$i,"Name");
-$ViewMem['Signature']=sql_result($result,$i,"Signature");
-$ViewMem['Avatar']=sql_result($result,$i,"Avatar");
-$ViewMem['AvatarSize']=sql_result($result,$i,"AvatarSize");
-$ViewMem['Email']=sql_result($result,$i,"Email");
-$ViewMem['GroupID']=sql_result($result,$i,"GroupID");
-$ViewMem['LevelID']=sql_result($result,$i,"LevelID");
-$ViewMem['HiddenMember']=sql_result($result,$i,"HiddenMember");
-$ViewMem['WarnLevel']=sql_result($result,$i,"WarnLevel");
-$ViewMem['Interests']=sql_result($result,$i,"Interests");
-$ViewMem['Title']=sql_result($result,$i,"Title");
-$ViewMem['Joined']=sql_result($result,$i,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($ViewMem['Joined']);
-$tmpusrcurtime->setTimezone($usertz);
-$ViewMem['Joined']=$tmpusrcurtime->format("M j Y, ".$_SESSION['iDBTimeFormat']);
-$ViewMem['LastActive']=sql_result($result,$i,"LastActive");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($ViewMem['LastActive']);
-$tmpusrcurtime->setTimezone($usertz);
-$ViewMem['LastActive']=$tmpusrcurtime->format("M j Y, ".$_SESSION['iDBTimeFormat']);
-$ViewMem['Website']=sql_result($result,$i,"Website");
-if($ViewMem['Website']=="http://") { 
-       $ViewMem['Website'] = $Settings['idburl']; }
-$ViewMem['Website'] = urlcheck($ViewMem['Website']);
-$BoardWWWChCk = parse_url($Settings['idburl']);
-$MemsWWWChCk = parse_url($ViewMem['Website']);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$MemsWWWChCk['host']) {
-       $opennew = null; }
-$ViewMem['Gender']=sql_result($result,$i,"Gender");
-$ViewMem['PostCount']=sql_result($result,$i,"PostCount");
-$ViewMem['Karma']=sql_result($result,$i,"Karma");
-$ViewMem['TimeZone']=sql_result($result,$i,"TimeZone");
-$viewmemcurtime = new DateTime();
-$viewmemcurtime->setTimezone($ViewMem['TimeZone']);
-$ViewMem['IP']=sql_result($result,$i,"IP");
-$lquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($ViewMem['LevelID']));
-$lresult=sql_query($lquery,$SQLStat);
-$ViewMem['Level']=sql_result($lresult,0,"Name");
-sql_free_result($lresult);
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($ViewMem['GroupID']));
-$gresult=sql_query($gquery,$SQLStat);
-$ViewMem['Group']=sql_result($gresult,0,"Name");
-/*
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-*/
-sql_free_result($gresult);
-if($ViewMem['Title']=="") { $ViewMem['Title'] = $ViewMem['Group']; }
-/*
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $ViewMem['Name'] = $GroupNamePrefix.$ViewMem['Name']; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $ViewMem['Name'] = $ViewMem['Name'].$GroupNameSuffix; }
-*/
-if($ViewMem['HiddenMember']=="yes") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$membertitle = " ".$ThemeSet['TitleDivider']." ".$ViewMem['Name'];     
-if ($ViewMem['Avatar']=="http://"||$ViewMem['Avatar']==null||
-       strtolower($ViewMem['Avatar'])=="noavatar") {
-$ViewMem['Avatar']=$ThemeSet['NoAvatar'];
-$ViewMem['AvatarSize']=$ThemeSet['NoAvatarSize']; }
-$AvatarSize1=explode("x", $ViewMem['AvatarSize']);
-$AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
-$ViewMem['Signature'] = text2icons($ViewMem['Signature'],$Settings['sqltable'],$SQLStat);
-$ViewMem['Signature'] = url2link($ViewMem['Signature']);
-if($_GET['view']==null) { $_GET['view'] = "profile"; }
-if($_GET['view']!="profile"&&$_GET['view']!="avatar"&&
-       $_GET['view']!="website"&&$_GET['view']!="homepage") { $_GET['view'] = "profile"; }
-if($_GET['view']=="avatar") { 
-       session_write_close(); $urlstatus = 302;
-       header("Location: ".$ViewMem['Avatar']);
-       gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
-if($_GET['view']=="website"||$_GET['view']=="homepage") { 
-       if ($ViewMem['Website']!="http://"&&$ViewMem['Website']!=null) {
-       session_write_close(); $urlstatus = 302;
-       header("Location: ".$ViewMem['Website']); 
-       gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
-       if ($ViewMem['Website']=="http://"||$ViewMem['Website']==null||
-       strtolower($ViewMem['Avatar'])=="noavatar") {
-       session_write_close(); $urlstatus = 302;
-       header("Location: ".$BoardURL."index.php?act=view"); 
-       gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); } }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id'],"&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Viewing Profile:";
-$_SESSION['ViewingTitle'] = $ViewMem['Name'];
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:".$ViewMem['ID'].";";
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Viewing profile</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Viewing profile<?php echo $ThemeSet['NavLinkDivider']; ?><?php echo $ViewMem['Name']; ?></a>
-</span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Viewing profile<?php echo $ThemeSet['NavLinkDivider']; ?><?php echo $ViewMem['Name']; ?></a>
-</span></td>
-</tr><?php } ?>
-<tr id="Member" class="TableRow2">
-<th class="TableColumn2" style="width: 50%;">Avatar</th>
-<th class="TableColumn2" style="width: 50%;">User Info</th>
-</tr>
-<tr class="TableRow3" id="MemberProfile">
-<td class="TableColumn3">
-<?php  // Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/  
- ?>
- <table class="AvatarTable" style="width: 100%; height: 100px; text-align: center;">
-       <tr class="AvatarRow" style="width: 100px; height: 100px;">
-               <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
-               <img src="<?php echo $ViewMem['Avatar']; ?>" alt="<?php echo $ViewMem['Name']; ?>'s Avatar" title="<?php echo $ViewMem['Name']; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
-               </td>
-       </tr>
- </table>
-<div style="text-align: center;">
-Name: <?php echo $ViewMem['Name']; ?><br />
-Title: <?php echo $ViewMem['Title']; ?>
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?>
-<br />User IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$ViewMem['IP']); ?>">
-<?php echo $ViewMem['IP']; echo "</a>"; } ?></div>
-</td>
-<td class="TableColumn3">
-&nbsp;User Name: <?php echo $ViewMem['Name']; ?><br />
-&nbsp;User Title: <?php echo $ViewMem['Title']; ?><br />
-&nbsp;User Group: <?php echo $ViewMem['Group']; ?><br />
-&nbsp;User Level: <?php echo $ViewMem['Level']; ?><br />
-&nbsp;User Joined: <?php echo $ViewMem['Joined']; ?><br />
-&nbsp;Last Active: <?php echo $ViewMem['LastActive']; ?><br />
-&nbsp;User Time: <?php echo $viewmemcurtime->format("M j Y, ".$_SESSION['iDBTimeFormat']); ?><br />
-&nbsp;User Website: <a href="<?php echo $ViewMem['Website']; ?>"<?php echo $opennew; ?>>Website</a><br />
-&nbsp;Post Count: <?php echo $ViewMem['PostCount']; ?><br />
-&nbsp;Karma: <?php echo $ViewMem['Karma']; ?><br />
-&nbsp;Interests: <?php echo $ViewMem['Interests']; ?><br />
-&nbsp;Topics: <?php if($Settings['enable_search']=="on"&&$GroupInfo['CanSearch']=="yes") { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=%&type=wildcard&memid=".$ViewMem['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Find Topics</a>
-<?php } ?>
-</td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<?php sql_free_result($result); } 
-if($_GET['act']=="logout") {
-session_unset();
-if($cookieDomain==null) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain); } }
-unset($_COOKIE[session_name()]);
-$_SESSION = array();
-//session_unset();
-//session_destroy();
-$temp_user_ip = $_SERVER['REMOTE_ADDR'];
-$exptime = $utccurtime->getTimestamp() - ini_get("session.gc_maxlifetime");
-sql_query(sql_pre_query("DELETE FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" < %i OR ip_address='%s'", array($exptime,$temp_user_ip)),$SQLStat);
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_GET['act']=="login") {
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) { 
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=login","&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Act: ";
-$_SESSION['ViewingTitle'] = "Logging in";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-$membertitle = " ".$ThemeSet['TitleDivider']." Login";
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Login</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a>
-</span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a>
-</span></td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Inert your login info: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<form style="display: inline;" method="post" action="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login_now",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" for="username">Enter UserName: </label></td>
-       <td style="width: 70%;"><input maxlength="256" class="TextBox" id="username" type="text" name="username" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" for="userpass">Enter Password: </label></td>
-       <td style="width: 70%;"><input maxlength="30" class="TextBox" id="userpass" type="password" name="userpass" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" title="Store userinfo as a cookie so you dont need to login again." for="storecookie">Store as cookie?</label></td>
-       <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
-<option value="true">Yes</option>
-<option value="false">No</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" title="Use your Email address for username." for="loginemail">Login by Email?</label></td>
-       <td style="width: 70%;"><select id="loginemail" name="loginemail" class="TextBox">
-<option value="false">No</option>
-<option value="true">Yes</option>
-</select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="loginmember" style="display: none;" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<input class="Button" type="submit" value="Log in" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } } if($_POST['act']=="loginmember"&&$_GET['act']=="login_now") {
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) { 
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=login","&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Act: ";
-$_SESSION['ViewingTitle'] = "Logging in";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-$membertitle = " ".$ThemeSet['TitleDivider']." Login";
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Login</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">&nbsp;<a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a></span>
-</div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1">
-<span style="text-align: left;">&nbsp;<a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Login Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php
-if (pre_strlen($_POST['userpass'])>"60") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your password is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($_POST['username'])>"30") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your user name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Settings['TestReferer']=="on") {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } $BanError = null;
-if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false),"4"); }
-if($Error!="Yes"){
-$YourName = stripcslashes(htmlspecialchars($_POST['username'], ENT_QUOTES, $Settings['charset']));
-//$YourName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $YourName);
-$YourName = remove_spaces($YourName);
-$passtype="ODFH";
-if(!isset($_POST['loginemail'])) { $_POST['loginemail'] = "false"; }
-if($_POST['loginemail']!="true") {
-$querylog = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' LIMIT 1", array($YourName)); }
-if($_POST['loginemail']=="true") {
-$querylog = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Email\"='%s' LIMIT 1", array($YourName)); }
-$resultlog=sql_query($querylog,$SQLStat);
-$numlog=sql_num_rows($resultlog);
-if($numlog>=1) {
-$i=0;
-$YourName=sql_result($resultlog,$i,"Name");
-$YourPassTry=sql_result($resultlog,$i,"UserPassword");
-$HashType=sql_result($resultlog,$i,"HashType");
-$HashType=str_replace("IntDBH", "iDBH", $HashType);
-$JoinedPass=sql_result($resultlog,$i,"Joined");
-$HashSalt=sql_result($resultlog,$i,"Salt");
-$UpdateHash = false; $YourPassword = null;
-//Used if you forget your password will change on next login.
-if($HashType=="NoHash") { $YourPassword = $_POST['userpass']; }
-if($HashType=="NoHASH") { $YourPassword = $_POST['userpass']; }
-if($HashType=="PlainText") { $YourPassword = $_POST['userpass']; }
-//Used to not allow guest user number -1 to login.
-if($HashType=="NoPass") { $YourPassword = null; $UpdateHash = false; }
-if($HashType=="NoPassword") { $YourPassword = null; $UpdateHash = false; }
-if($HashType=="GuestPass") { $YourPassword = null; $UpdateHash = false; }
-if($HashType=="GuestPassword") { $YourPassword = null; $UpdateHash = false; }
-//iDB hashing system
-if($HashType=="ODFH") { $YourPassword = PassHash2x($_POST['userpass']); }
-if($HashType=="IPB2") { $YourPassword = hash2xkey($_POST['userpass'],$HashSalt); }
-if($HashType=="DF4H") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
-if($HashType=="iDBH2") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"md2"); }
-if($HashType=="iDBH4") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"md4"); }
-if($HashType=="iDBH5") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"md5"); }
-if($HashType=="iDBH") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
-if($HashType=="iDBH1") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
-if($HashType=="iDBH224") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha224"); }
-if($HashType=="iDBH256") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha256"); }
-if($HashType=="iDBH384") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha384"); }
-if($HashType=="iDBH512") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha512"); }
-if($HashType=="iDBHRMD128") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"ripemd128"); }
-if($HashType=="iDBHRMD160") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"ripemd160"); }
-if($HashType=="iDBHRMD256") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"ripemd256"); }
-if($HashType=="iDBHRMD320") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"ripemd320"); }
-if($HashType=="NoPass") { $YourPassword = "iDB"; $YourPassTry = "IntDB"; }
-if($HashType=="NoPassword") { $YourPassword = "iDB"; $YourPassTry = "IntDB"; }
-if($HashType=="GuestPass") { $YourPassword = "iDB"; $YourPassTry = "IntDB"; }
-if($HashType=="GuestPassword") { $YourPassword = "iDB"; $YourPassTry = "IntDB"; }
-if($YourPassword!=$YourPassTry) { $passright = false; } 
-if($YourPassword==$YourPassTry) { $passright = true;
-$YourIDM=sql_result($resultlog,$i,"id");
-$YourNameM=sql_result($resultlog,$i,"Name");
-$YourPassM=sql_result($resultlog,$i,"UserPassword");
-$PostCount=sql_result($resultlog,$i,"PostCount");
-$YourGroupM=sql_result($resultlog,$i,"GroupID");
-$YourGroupIDM=$YourGroupM;
-$YourLastPostTime=sql_result($resultlog,$i,"LastPostTime");
-$YourBanTime=sql_result($resultlog,$i,"BanTime");
-$CGMTime = $utccurtime->getTimestamp();
-if($YourBanTime!=0&&$YourBanTime!=null) {
-if($YourBanTime>=$CGMTime) { $BanError = "yes"; }
-if($YourBanTime<0) { $BanError = "yes"; } }
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($YourGroupM));
-$gresult=sql_query($gquery,$SQLStat);
-$YourGroupM=sql_result($gresult,0,"Name");
-sql_free_result($gresult);
-$YourTimeZoneM=sql_result($resultlog,$i,"TimeZone");
-$JoinedDate=sql_result($resultlog,$i,"Joined");
-$UseTheme=sql_result($resultlog,$i,"UseTheme");
-$NewHashSalt = salt_hmac();
-if($Settings['use_hashtype']=="md2") { $iDBHash = "iDBH2";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"md2"); }
-if($Settings['use_hashtype']=="md4") { $iDBHash = "iDBH4";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"md4"); }
-if($Settings['use_hashtype']=="md5") { $iDBHash = "iDBH5";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"md5"); }
-if($Settings['use_hashtype']=="sha1") { $iDBHash = "iDBH";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha1"); }
-if($Settings['use_hashtype']=="sha224") { $iDBHash = "iDBH224";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha224"); }
-if($Settings['use_hashtype']=="sha256") { $iDBHash = "iDBH256";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha256"); }
-if($Settings['use_hashtype']=="sha384") { $iDBHash = "iDBH384";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha384"); }
-if($Settings['use_hashtype']=="sha512") { $iDBHash = "iDBH512";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha512"); }
-if($Settings['use_hashtype']=="ripemd128") { $iDBHash = "iDBHRMD128";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"ripemd128"); }
-if($Settings['use_hashtype']=="ripemd160") { $iDBHash = "iDBHRMD160";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"ripemd160"); }
-if($Settings['use_hashtype']=="ripemd256") { $iDBHash = "iDBHRMD256";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"ripemd256"); }
-if($Settings['use_hashtype']=="ripemd320") { $iDBHash = "iDBHRMD320";
-$NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"ripemd320"); }
-$NewDay=$utccurtime->getTimestamp();
-$NewIP=$_SERVER['REMOTE_ADDR'];
-if($BanError!="yes") {
-$queryup = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UserPassword\"='%s',\"HashType\"='%s',\"LastActive\"=%i,\"IP\"='%s',\"Salt\"='%s' WHERE \"id\"=%i", array($NewPassword,$iDBHash,$NewDay,$NewIP,$NewHashSalt,$YourIDM));
-sql_query($queryup,$SQLStat);
-sql_free_result($resultlog);
-//session_regenerate_id();
-$_SESSION['Theme']=$UseTheme;
-$_SESSION['MemberName']=$YourNameM;
-$_SESSION['UserID']=$YourIDM;
-$_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
-$_SESSION['UserTimeZone']=$YourTimeZoneM;
-$usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-$usercurtime->setTimestamp($defcurtime->getTimestamp());
-$usercurtime->setTimezone($usertz);
-$_SESSION['UserGroup']=$YourGroupM;
-$_SESSION['UserGroupID']=$YourGroupIDM;
-$_SESSION['UserPass']=$NewPassword;
-$_SESSION['LastPostTime'] = $YourLastPostTime;
-$_SESSION['DBName']=$Settings['sqldb'];
-if($_POST['storecookie']=="true") {
-if($cookieDomain==null) {
-setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir);
-setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
-setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain);
-setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } } }
-} } if($numlog<=0) {
-//echo "Password was not right or user not found!! <_< ";
-} ?>
-<?php if($passright===true&&$BanError!="yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"3"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
-       Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to continue to board.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if($passright===false||$BanError=="yes"||$numlog<=0) { ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Password was not right or user not found or user is banned!! &lt;_&lt;<br />
-       Click <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$exqstr['member'],$prexqstr['member']); ?>">here</a> to try again.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } } ?>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } } if($_GET['act']=="signup") { 
-$membertitle = " ".$ThemeSet['TitleDivider']." Signing up"; 
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) { 
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=signup","&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Act: ";
-$_SESSION['ViewingTitle'] = "Signing up";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-// http://www.tutorialspoint.com/php/php_function_timezone_identifiers_list.htm
-$timezone_identifiers = DateTimeZone::listIdentifiers();
-//$timezone_identifiers = timezone_identifiers_list();
-$zonelist['africa'] = array();
-$zonelist['america'] = array();
-$zonelist['antarctica'] = array();
-$zonelist['asia'] = array();
-$zonelist['atlantic'] = array();
-$zonelist['australia'] = array();
-$zonelist['europe'] = array();
-$zonelist['indian'] = array();
-$zonelist['pacific'] = array();
-$zonelist['etcetera'] = array();
-for ($i=0; $i < count($timezone_identifiers); $i++) {
-    $zonelookup = explode("/", $timezone_identifiers[$i]);
-    if(count($zonelookup)==1) { array_push($zonelist['etcetera'], array($timezone_identifiers[$i], $timezone_identifiers[$i])); }
-    if(count($zonelookup)>1) { 
-        if($zonelookup[0]=="Africa") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['africa'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['africa'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="America") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['america'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['america'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Antarctica") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['antarctica'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['antarctica'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Asia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['asia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['asia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Atlantic") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['atlantic'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['atlantic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Australia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['australia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['australia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Europe") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['europe'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['europe'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Indian") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['indian'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['indian'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Pacific") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['pacific'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['pacific'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-    }
-}
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Signup</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Register</a>
-</span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Register</a>
-</span></td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Inert your user info: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<form style="display: inline;" method="post" action="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=makemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" for="Name">Insert a UserName:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 70%;"><input maxlength="24" type="text" class="TextBox" name="Name" size="20" id="Name" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 70%;"><input maxlength="24" type="text" class="TextBox" name="Name" size="20" id="Name" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-       <?php } ?>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
-       <td style="width: 70%;"><input maxlength="30" type="password" class="TextBox" name="Password" size="20" id="Password" /></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
-       <td style="width: 70%;"><input maxlength="30" type="password" class="TextBox" name="RePassword" size="20" id="RePassword" /></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
-       <td style="width: 70%;"><input type="text" class="TextBox" name="Email" size="20" id="Email" /></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
-       <td style="width: 70%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
-<optgroup label="Africa">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['africa']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['africa'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['africa'][$i][1]."\">".str_replace("_", " ", $zonelist['africa'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="America">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['america']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['america'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['america'][$i][1]."\">".str_replace("_", " ", $zonelist['america'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Antarctica">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['antarctica']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['antarctica'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['antarctica'][$i][1]."\">".str_replace("_", " ", $zonelist['antarctica'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Asia">
-<?php
-for ($i=0; $i < count($zonelist['asia']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['asia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['asia'][$i][1]."\">".str_replace("_", " ", $zonelist['asia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Atlantic">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['atlantic']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['atlantic'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['atlantic'][$i][1]."\">".str_replace("_", " ", $zonelist['atlantic'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Australia">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['australia']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['australia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['australia'][$i][1]."\">".str_replace("_", " ", $zonelist['australia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Europe">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['europe']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['europe'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['europe'][$i][1]."\">".str_replace("_", " ", $zonelist['europe'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Indian">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['indian']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['indian'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['indian'][$i][1]."\">".str_replace("_", " ", $zonelist['indian'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Pacific">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['pacific']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['pacific'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['pacific'][$i][1]."\">".str_replace("_", " ", $zonelist['pacific'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Etcetera">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['etcetera']); $i++) {
-    if($Settings['DefaultTimeZone']==$zonelist['etcetera'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['etcetera'][$i][1]."\">".str_replace("_", " ", $zonelist['etcetera'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-</select></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
-       <td style="width: 70%;"><select id="YourGender" name="YourGender" class="TextBox">
-<option value="Male">Male</option>
-<option value="Female">Female</option>
-<option value="Unknow">Unknown</option>
-</select></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="Website">Insert your Website:</label></td>
-       <td style="width: 70%;"><input type="text" class="TextBox" name="Website" size="20" value="http://" id="Website" /></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="Avatar">Insert a URL for Avatar:</label></td>
-       <td style="width: 70%;"><input type="text" class="TextBox" name="Avatar" size="20" value="http://" id="Avatar" /></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" title="Store userinfo as a cookie so you dont need to login again." for="storecookie">Store as cookie?</label></td>
-       <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
-<option value="true">Yes</option>
-<option value="false">No</option>
-</select></td>
-</tr>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="TOSBox">TOS - Please read fully and check 'I agree' box ONLY if you agree to terms</label><br />
-<textarea rows="10" cols="58" id="TOSBox" name="TOSBox" class="TextBox" readonly="readonly" accesskey="T"><?php 
-       echo file_get_contents("TOS");  ?></textarea><br />
-<input type="checkbox" class="TextBox" name="TOS" value="Agree" id="TOS" /><label class="TextBoxLabel" for="TOS">I Agree</label>
-<?php if($Settings['use_captcha']!="on") { ?><br />
-<?php } if($Settings['use_captcha']=="on") { ?>
-</td></tr>
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
-<input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br /><?php } ?>
-<input type="hidden" style="display: none;" name="act" value="makemembers" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if(isset($_GET['referrerid'])&&is_numeric($_GET['referrerid'])) { ?>
-<input type="hidden" style="display: none;" name="referrerid" value="<?php echo $_GET['referrerid']; ?>" />
-<?php } ?>
-<input type="submit" class="Button" value="Sign UP" />
-</td></tr>
-</table>
-</form>
-</td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } } if($_GET['act']=="makemember") {
-       if($_POST['act']=="makemembers") {
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) { 
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=signup","&","=",$prexqstr['member'],$exqstr['member']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['member']; }
-$_SESSION['PreViewingTitle'] = "Act: ";
-$_SESSION['ViewingTitle'] = "Signing up";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-$membertitle = " ".$ThemeSet['TitleDivider']." Signing up";
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-if(!isset($_POST['username'])) { $_POST['username'] = null; }
-if(!isset($_POST['TOS'])) { $_POST['TOS'] = null; }
-if($Settings['use_captcha']=="on") {
-require($SettDir['inc']."captcha.php"); }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Signup</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-&nbsp;<a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Register</a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-&nbsp;<a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Register</a></span></td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Signup Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php if (pre_strlen($_POST['Password'])>"60") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your password is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($_POST['username'])>"30") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your user name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your passwords did not match.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($Settings['use_captcha']=="on") {
-if (PhpCaptcha::Validate($_POST['signcode'])) {
-//echo 'Valid code entered';
-} else { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Invalid code entered<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } if ($Settings['TestReferer']=="on") {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } }
-$Name = stripcslashes(htmlspecialchars($_POST['Name'], ENT_QUOTES, $Settings['charset']));
-//$Name = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Name);
-$Name = remove_spaces($Name);
-$lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedUserName\"='yes'", array(null));
-$lonewolfrt=sql_query($lonewolfqy,$SQLStat);
-$lonewolfnm=sql_num_rows($lonewolfrt);
-$lonewolfs=0; $RMatches = null;
-while ($lonewolfs < $lonewolfnm) {
-$RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
-$RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
-if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
-if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
-if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
-$RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
-if($RWholeWord=="on") { $RWholeWord = "yes"; }
-if($RWholeWord=="off") { $RWholeWord = "no"; }
-if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
-$RWord = preg_quote($RWord, "/");
-if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/", $Name);
-       if($RMatches==true) { break 1; } }
-if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/i", $Name);
-       if($RMatches==true) { break 1; } }
-if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
-$RMatches = preg_match("/".$RWord."/", $Name);
-       if($RMatches==true) { break 1; } }
-if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
-$RMatches = preg_match("/".$RWord."/i", $Name);
-       if($RMatches==true) { break 1; } }
-++$lonewolfs; } sql_free_result($lonewolfrt);
-$sql_email_check = sql_query(sql_pre_query("SELECT \"Email\" FROM \"".$Settings['sqltable']."members\" WHERE \"Email\"='%s'", array($_POST['Email'])),$SQLStat);
-$sql_username_check = sql_query(sql_pre_query("SELECT \"Name\" FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s'", array($Name)),$SQLStat);
-$email_check = sql_num_rows($sql_email_check); 
-$username_check = sql_num_rows($sql_username_check);
-sql_free_result($sql_email_check); sql_free_result($sql_username_check);
-if ($_POST['TOS']!="Agree") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to  agree to the tos.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['Name']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['Name']=="ShowMe") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['Password']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a password.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['Email']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a email.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($email_check > 0) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Email address is already used.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($username_check > 0) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />User Name is already used.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($RMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This User Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],FALSE),"4"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Click <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$exqstr['member'],$prexqstr['member']); ?>">here</a> to try again.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if ($Error!="Yes") {
-$_POST['UserIP'] = $_SERVER['REMOTE_ADDR'];
-$_POST['Group'] = $Settings['MemberGroup'];
-$_POST['Joined'] = $utccurtime->getTimestamp(); $_POST['LastActive'] = $utccurtime->getTimestamp();
-$_POST['Signature'] = ""; $_POST['Interests'] = "";
-$_POST['Title'] = ""; $_POST['PostCount'] = "0";
-if(!isset($Settings['AdminValidate'])) { $Settings['AdminValidate'] = "off"; }
-if($Settings['AdminValidate']=="on"||$Settings['AdminValidate']!="off")
-{ $ValidateStats="no"; $yourgroup=$Settings['ValidateGroup']; }
-if($Settings['AdminValidate']=="off"||$Settings['AdminValidate']!="on")
-{ $ValidateStats="yes"; $yourgroup=$Settings['MemberGroup']; }
-$HideMe = "no"; $HashSalt = salt_hmac();
-if($Settings['use_hashtype']=="md2") { $iDBHash = "iDBH2";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"md2"); }
-if($Settings['use_hashtype']=="md4") { $iDBHash = "iDBH4";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"md4"); }
-if($Settings['use_hashtype']=="md5") { $iDBHash = "iDBH5";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"md5"); }
-if($Settings['use_hashtype']=="sha1") { $iDBHash = "iDBH";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha1"); }
-if($Settings['use_hashtype']=="sha224") { $iDBHash = "iDBH224";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha224"); }
-if($Settings['use_hashtype']=="sha256") { $iDBHash = "iDBH256";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha256"); }
-if($Settings['use_hashtype']=="sha384") { $iDBHash = "iDBH384";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha384"); }
-if($Settings['use_hashtype']=="sha512") { $iDBHash = "iDBH512";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha512"); }
-if($Settings['use_hashtype']=="ripemd128") { $iDBHash = "iDBHRMD128";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"ripemd128"); }
-if($Settings['use_hashtype']=="ripemd160") { $iDBHash = "iDBHRMD160";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"ripemd160"); }
-if($Settings['use_hashtype']=="ripemd256") { $iDBHash = "iDBHRMD256";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"ripemd256"); }
-if($Settings['use_hashtype']=="ripemd320") { $iDBHash = "iDBHRMD320";
-$NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"ripemd320"); }
-$_GET['YourPost'] = $_POST['Signature'];
-//require( './'.$SettDir['misc'].'HTMLTags.php');
-$_GET['YourPost'] = htmlspecialchars($_GET['YourPost'], ENT_QUOTES, $Settings['charset']);
-//$_GET['YourPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_GET['YourPost']);
-$NewSignature = $_GET['YourPost'];
-$_GET['YourPost'] = preg_replace("/\t+/"," ",$_GET['YourPost']);
-$_GET['YourPost'] = preg_replace("/\s\s+/"," ",$_GET['YourPost']);
-$_GET['YourPost'] = remove_bad_entities($_GET['YourPost']);
-$Avatar = stripcslashes(htmlspecialchars($_POST['Avatar'], ENT_QUOTES, $Settings['charset']));
-//$Avatar = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Avatar);
-$Avatar = remove_spaces($Avatar);
-$Website = stripcslashes(htmlspecialchars($_POST['Website'], ENT_QUOTES, $Settings['charset']));
-//$Website = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Website);
-$Website = remove_spaces($Website);
-$gquerys = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($yourgroup));
-$gresults=sql_query($gquerys,$SQLStat);
-$yourgroup=sql_result($gresults,0,"id");
-$PreUserPer['CanViewBoard']=sql_result($gresults,0,"CanViewBoard");
-$PreUserPer['CanViewOffLine']=sql_result($gresults,0,"CanViewOffLine");
-$PreUserPer['CanEditProfile']=sql_result($gresults,0,"CanEditProfile");
-$PreUserPer['CanAddEvents']=sql_result($gresults,0,"CanAddEvents");
-$PreUserPer['CanPM']=sql_result($gresults,0,"CanPM");
-$PreUserPer['CanSearch']=sql_result($gresults,0,"CanSearch");
-$PreUserPer['CanExecPHP']=sql_result($gresults,0,"CanExecPHP");
-$PreUserPer['CanDoHTML']=sql_result($gresults,0,"CanDoHTML");
-$PreUserPer['CanUseBBTags']=sql_result($gresults,0,"CanUseBBTags");
-$PreUserPer['CanModForum']=sql_result($gresults,0,"CanModForum");
-$PreUserPer['FloodControl']=sql_result($gresults,0,"FloodControl");
-$PreUserPer['SearchFlood']=sql_result($gresults,0,"SearchFlood");
-$PreUserPer['HasModCP']=sql_result($gresults,0,"HasModCP");
-$PreUserPer['HasAdminCP']=sql_result($gresults,0,"HasAdminCP");
-$PreUserPer['ViewDBInfo']=sql_result($gresults,0,"ViewDBInfo");
-sql_free_result($gresults);
-$_POST['Interests'] = remove_spaces($_POST['Interests']);
-$_POST['Title'] = remove_spaces($_POST['Title']);
-$_POST['Email'] = remove_spaces($_POST['Email']);
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."members\" (\"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"LevelID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n". 
-"('%s', '%s', '%s', '%s', '%s', '1', '%s', '%s', %i, '%s', '%s', %i, %i, '0', '0', '0', '0', '0', '%s', '%s', '%s', '%s', '%s', '%s', %i, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '%s', '%s')", array($Name,$NewPassword,$iDBHash,$_POST['Email'],$yourgroup,$ValidateStats,$HideMe,"0",$_POST['Interests'],$_POST['Title'],$_POST['Joined'],$_POST['LastActive'],$NewSignature,'Your Notes',$Avatar,"100x100",$Website,$_POST['YourGender'],$_POST['PostCount'],$_POST['YourOffSet'],$Settings['idb_date_format'],$Settings['idb_time_format'],$Settings['DefaultTheme'],$_POST['UserIP'],$HashSalt));
-sql_query($query,$SQLStat);
-$yourid = sql_get_next_id($Settings['sqltable'],"members",$SQLStat);
-$idquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' AND \"UserPassword\"='%s' AND \"Email\"='%s' AND \"IP\"='%s' AND \"Salt\"='%s' LIMIT 1", array($Name,$NewPassword,$_POST['Email'],$_POST['UserIP'],$HashSalt));
-$idresult=sql_query($idquery,$SQLStat);
-$idnum=sql_num_rows($idresult);
-$idcheck = $yourid;
-if($idnum>=1) {
-$idncheck = sql_result($idresult,0,"id"); 
-$idncheck = intval($idncheck); }
-sql_free_result($idresult);
-if($yourid!=$idncheck) { $yourid = $idncheck; }
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n". 
-"(%i, %i, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %i, %i, '%s', '%s', '%s')", array($yourid, 0, "group", "group", "group", "group", "group", "group", "group", "group", "group", "group", "group", "group", -1, -1, "group", "group", "group"));
-//"(%i, %i, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %i, %i, '%s', '%s', '%s')", array($yourid, 0, $PreUserPer['CanViewBoard'], $PreUserPer['CanViewOffLine'], $PreUserPer['CanEditProfile'], $PreUserPer['CanAddEvents'], $PreUserPer['CanPM'], $PreUserPer['CanSearch'], $PreUserPer['CanExecPHP'], $PreUserPer['CanDoHTML'], $PreUserPer['CanUseBBTags'], $PreUserPer['CanModForum'], $PreUserPer['FloodControl'], $PreUserPer['SearchFlood'], $PreUserPer['HasModCP'], $PreUserPer['HasAdminCP'], $PreUserPer['ViewDBInfo']));
-sql_query($query,$SQLStat);
-if(isset($_POST['referrerid'])&&is_numeric($_POST['referrerid'])) {
-       $rfidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_POST['referrerid']));
-       $rfidresult=sql_query($rfidquery,$SQLStat);
-       $rfidnum=sql_num_rows($rfidresult);
-       if($rfidnum>=1) {
-               $rfidKarma=sql_result($rfidresult,0,"Karma");
-               sql_free_result($rfidresult);
-               if(!is_numeric($rfidKarma)) { $rfidKarma = 0; }
-               $rfidKarma = $rfidKarma + 1;
-               $querykup = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Karma\"=%i WHERE \"id\"=%i", array($rfidKarma,$_POST['referrerid']));
-               sql_query($querykup,$SQLStat); } }
-$querylogr = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' AND \"UserPassword\"='%s' LIMIT 1", array($Name,$NewPassword));
-$resultlogr=sql_query($querylogr,$SQLStat);
-$numlogr=sql_num_rows($resultlogr);
-if($numlogr>=1) {
-$ir=0;
-$YourIDMr=sql_result($resultlogr,$ir,"id");
-$YourNameMr=sql_result($resultlogr,$ir,"Name");
-$YourGroupMr=sql_result($resultlogr,$ir,"GroupID");
-$YourGroupIDMr=$YourGroupMr;
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($YourGroupMr));
-$gresult=sql_query($gquery,$SQLStat);
-$YourGroupMr=sql_result($gresult,0,"Name");
-sql_free_result($gresult);
-$YourTimeZoneMr=sql_result($resultlogr,$ir,"TimeZone"); }
-sql_free_result($resultlogr);
-session_regenerate_id(true);
-$_SESSION['Loggedin']=true;
-$_SESSION['MemberName']=$YourNameMr;
-$_SESSION['UserID']=$YourIDMr;
-$_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
-$_SESSION['UserTimeZone']=$YourTimeZoneMr;
-$usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-$usercurtime->setTimestamp($defcurtime->getTimestamp());
-$usercurtime->setTimezone($usertz);
-$_SESSION['UserGroup']=$YourGroupMr;
-$_SESSION['UserGroupID']=$YourGroupIDMr;
-$_SESSION['UserPass']=$NewPassword;
-$_SESSION['DBName']=$Settings['sqldb'];
-if($_POST['storecookie']=="true") {
-if($cookieDomain==null) {
-setcookie("MemberName", $YourNameMr, time() + (7 * 86400), $cbasedir);
-setcookie("UserID", $YourIDMr, time() + (7 * 86400), $cbasedir);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("MemberName", $YourNameMr, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
-setcookie("UserID", $YourIDMr, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("MemberName", $YourNameMr, time() + (7 * 86400), $cbasedir, $cookieDomain);
-setcookie("UserID", $YourIDMr, time() + (7 * 86400), $cbasedir, $cookieDomain);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } }
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],FALSE),"3");
-?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
-       Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to continue to board.<?php echo "\n"; 
-       if($Settings['AdminValidate']=="on"||$Settings['AdminValidate']!="off") {
-       echo "<br />The admin has to validate your account befoure you can post.\n";
-       echo "<br />The admin has been notified of your registration.\n"; } ?>
-       <br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } ?>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } } }
-if($pagenum<=1) { ?>
-<div class="DivMembers">&nbsp;</div>
-<?php } ?>
\ No newline at end of file
diff --git a/inc/messages.php.bak b/inc/messages.php.bak
deleted file mode 100644 (file)
index 0edc00d..0000000
+++ /dev/null
@@ -1,1103 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: messages.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="messages.php"||$File3Name=="/messages.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!is_numeric($_GET['post'])) { $_GET['post'] = null; }
-if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
-// Check if we can read/send PM
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['CanPM']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Messages";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($_GET['act']=="view"||$_GET['act']=="viewsent"||$_GET['act']=="read") {
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Mailbox</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-       <div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Messenger</div>
-<?php } ?>
-<table id="ProfileLinks" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Messenger</td>
-</tr><?php } ?>
-<tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">View MailBox</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">View SentBox</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Send Message</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php
-if($_GET['act']=="view") {
-//Get SQL LIMIT Number
-$nums = $_GET['page'] * $Settings['max_pmlist'];
-$PageLimit = $nums - $Settings['max_pmlist'];
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE \"ReciverID\"=%i ORDER BY \"DateSend\" DESC ".$SQLimit, array($_SESSION['UserID'],$PageLimit,$Settings['max_pmlist']));
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."messenger\" WHERE \"ReciverID\"=%i", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$rnresult=sql_query($rnquery,$SQLStat);
-$NumberMessage = sql_result($rnresult,0);
-sql_free_result($rnresult);
-if($NumberMessage==null) { 
-       $NumberMessage = 0; }
-$num = $NumberMessage;
-$num=sql_num_rows($result);
-//Start MessengerList Page Code
-if(!isset($Settings['max_pmlist'])) { $Settings['max_pmlist'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-$nums = $_GET['page'] * $Settings['max_pmlist'];
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_pmlist'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_pmlist']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_pmlist']) { 
-       $pnum = $pnum - $Settings['max_pmlist']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_pmlist']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-//End MessengerList Page Code
-$num=sql_num_rows($result);
-$i=0;
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($num==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\">a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-//echo $pstring;
-//List Page Number Code end
-echo $pstring; 
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">MailBox&nbsp;(<?php echo $PMNumber; ?>)</a>
-</span>&nbsp;</div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1" colspan="4"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">MailBox&nbsp;(<?php echo $PMNumber; ?>)</a>
-</span>&nbsp;</td>
-</tr><?php } ?>
-<tr id="Messenger" class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 4%;">State</th>
-<th class="TableMenuColumn2" style="width: 46%;">Message Name</th>
-<th class="TableMenuColumn2" style="width: 25%;">Sender</th>
-<th class="TableMenuColumn2" style="width: 25%;">Time</th>
-</tr>
-<?php
-while ($i < $num) {
-$PMID=sql_result($result,$i,"id");
-$PMDiscussionID=sql_result($result,$i,"DiscussionID");
-$SenderID=sql_result($result,$i,"SenderID");
-$SenderIP=sql_result($result,$i,"IP");
-$PreSenderName = GetUserName($SenderID,$Settings['sqltable'],$SQLStat);
-if($PreSenderName['Name']===null) { $SenderID = -1;
-$PreSenderName = GetUserName($SenderID,$Settings['sqltable'],$SQLStat); }
-$SenderName = $PreSenderName['Name'];
-$SenderHidden = $PreSenderName['Hidden'];
-$ReciverID=sql_result($result,$i,"ReciverID");
-$PreReciverName = GetUserName($ReciverID,$Settings['sqltable'],$SQLStat);
-if($PreReciverName['Name']===null) { $ReciverID = -1;
-$PreReciverName = GetUserName($ReciverID,$Settings['sqltable'],$SQLStat); }
-$ReciverName = $PreReciverName['Name'];
-$ReciverHidden = $PreReciverName['Hidden'];
-$PMGuest=sql_result($result,$i,"GuestName");
-$MessageName=sql_result($result,$i,"MessageTitle");
-$MessageDesc=sql_result($result,$i,"Description");
-$DateSend=sql_result($result,$i,"DateSend");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($DateSend);
-$tmpusrcurtime->setTimezone($usertz);
-$DateSend=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MessageStat=sql_result($result,$i,"Read");
-if($SenderName=="Guest") { $SenderName=$PMGuest;
-if($SenderName==null) { $SenderName="Guest"; } }
-$PreMessage = $ThemeSet['MessageUnread'];
-if ($MessageStat==0) {
-       $PreMessage=$ThemeSet['MessageUnread']; }
-if ($MessageStat==1) {
-       $PreMessage=$ThemeSet['MessageRead']; }
-?>
-<tr class="TableMenuRow3" id="Message<?php echo $PMID; ?>">
-<td class="TableMenuColumn3"><div class="messagestate">
-<?php echo $PreMessage; ?></div></td>
-<td class="TableMenuColumn3"><div class="messagename">
-<?php if($PMDiscussionID<=0) { ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=read&id=".$PMID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']).$qstrhtml."&#35;message".$PMID; ?>"><?php echo $MessageName; ?></a><?php } if($PMDiscussionID>0) { ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=read&id=".$PMDiscussionID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']).$qstrhtml."&#35;message".$PMID; ?>"><?php echo $MessageName; ?></a><?php } ?></div>
-<div class="messagedesc"><?php echo $MessageDesc; ?></div></td>
-<td class="TableMenuColumn3" style="text-align: center;"><?php
-if($SenderID>0&&$SenderHidden=="no") {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$SenderID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$SenderName."</a>"; }
-if($SenderID<=0||$SenderHidden=="yes") {
-echo "<span>".$SenderName."</span>"; }
-?></td>
-<td class="TableMenuColumn3" style="text-align: center;"><?php echo $DateSend; ?></td>
-</tr>
-<?php ++$i; } sql_free_result($result); ?>
-<tr id="MessengerEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4" colspan="4">&nbsp;</td>
-</tr>
-<?php } 
-if($_GET['act']=="viewsent") {
-//Get SQL LIMIT Number
-$nums = $_GET['page'] * $Settings['max_pmlist'];
-$PageLimit = $nums - $Settings['max_pmlist'];
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE \"SenderID\"=%i ORDER BY \"DateSend\" DESC ".$SQLimit, array($_SESSION['UserID'],$PageLimit,$Settings['max_pmlist']));
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."messenger\" WHERE \"SenderID\"=%i", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$rnresult=sql_query($rnquery,$SQLStat);
-$NumberMessage = sql_result($rnresult,0);
-sql_free_result($rnresult);
-if($NumberMessage==null) { 
-       $NumberMessage = 0; }
-$num = $NumberMessage;
-$num=sql_num_rows($result);
-//Start MessengerList Page Code
-if(!isset($Settings['max_pmlist'])) { $Settings['max_pmlist'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-$nums = $_GET['page'] * $Settings['max_pmlist'];
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_pmlist'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_pmlist']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_pmlist']) { 
-       $pnum = $pnum - $Settings['max_pmlist']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_pmlist']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-//End MessengerList Page Code
-$num=sql_num_rows($result);
-$i=0;
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($num==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\">a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-//echo $pstring;
-//List Page Number Code end
-echo $pstring; 
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } ?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">MailBox&nbsp;(<?php echo $PMNumber; ?>)</a>
-</span>&nbsp;</div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1" colspan="4"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=viewsent&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">MailBox&nbsp;(<?php echo $PMNumber; ?>)</a>
-</span>&nbsp;</td>
-</tr><?php } ?>
-<tr id="Messenger" class="TableMenuRow2">
-<th class="TableMenuColumn2" style="width: 4%;">State</th>
-<th class="TableMenuColumn2" style="width: 46%;">Message Name</th>
-<th class="TableMenuColumn2" style="width: 25%;">Sent To</th>
-<th class="TableMenuColumn2" style="width: 25%;">Time</th>
-</tr>
-<?php
-while ($i < $num) {
-$PMID=sql_result($result,$i,"id");
-$PMDiscussionID=sql_result($result,$i,"DiscussionID");
-$SenderID=sql_result($result,$i,"SenderID");
-$SenderIP=sql_result($result,$i,"IP");
-$PreSenderName = GetUserName($SenderID,$Settings['sqltable'],$SQLStat);
-if($PreSenderName['Name']===null) { $SenderID = -1;
-$PreSenderName = GetUserName($SenderID,$Settings['sqltable'],$SQLStat); }
-$SenderName = $PreSenderName['Name'];
-$SenderHidden = $PreSenderName['Hidden'];
-$ReciverID=sql_result($result,$i,"ReciverID");
-$PreReciverName = GetUserName($ReciverID,$Settings['sqltable'],$SQLStat);
-if($PreReciverName['Name']===null) { $ReciverID = -1;
-$PreReciverName = GetUserName($ReciverID,$Settings['sqltable'],$SQLStat); }
-$ReciverName = $PreReciverName['Name'];
-$ReciverHidden = $PreReciverName['Hidden'];
-$PMGuest=sql_result($result,$i,"GuestName");
-$MessageName=sql_result($result,$i,"MessageTitle");
-$MessageDesc=sql_result($result,$i,"Description");
-$DateSend=sql_result($result,$i,"DateSend");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($DateSend);
-$tmpusrcurtime->setTimezone($usertz);
-$DateSend=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MessageStat=sql_result($result,$i,"Read");
-if($SenderName=="Guest") { $SenderName=$PMGuest;
-if($SenderName==null) { $SenderName="Guest"; } }
-$PreMessage = $ThemeSet['MessageUnread'];
-if ($MessageStat==0) {
-       $PreMessage=$ThemeSet['MessageUnread']; }
-if ($MessageStat==1) {
-       $PreMessage=$ThemeSet['MessageRead']; }
-?>
-<tr class="TableMenuRow3" id="Message<?php echo $PMID; ?>">
-<td class="TableMenuColumn3"><div class="messagestate">
-<?php echo $PreMessage; ?></div></td>
-<td class="TableMenuColumn3"><div class="messagename">
-<?php if($PMDiscussionID<=0) { ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=read&id=".$PMID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']).$qstrhtml."&#35;message".$PMID; ?>"><?php echo $MessageName; ?></a><?php } if($PMDiscussionID>0) { ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=read&id=".$PMDiscussionID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']).$qstrhtml."&#35;message".$PMID; ?>"><?php echo $MessageName; ?></a><?php } ?></div>
-<div class="messagedesc"><?php echo $MessageDesc; ?></div></td>
-<td class="TableMenuColumn3" style="text-align: center;"><?php
-if($ReciverID>0&&$ReciverHidden=="no") {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$ReciverID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$ReciverName."</a>"; }
-if($ReciverID<=0||$ReciverHidden=="yes") {
-echo "<span>".$ReciverName."</span>"; }
-?></td>
-<td class="TableMenuColumn3" style="text-align: center;"><?php echo $DateSend; ?></td>
-</tr>
-<?php ++$i; } ?>
-<tr id="MessengerEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4" colspan="4">&nbsp;</td>
-</tr>
-<?php sql_free_result($result); }
-if($_GET['act']=="read") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE (\"id\"=%i OR \"DiscussionID\"=%i) AND (\"SenderID\"=%i OR \"ReciverID\"=%i)", array($_GET['id'], $_GET['id'], $_SESSION['UserID'], $_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$is=0;
-if($num==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-while ($is < $num) {
-$PMID=sql_result($result,$is,"id");
-$SenderID=sql_result($result,$is,"SenderID");
-$SenderIP=sql_result($result,$is,"IP");
-$PreSenderName = GetUserName($SenderID,$Settings['sqltable'],$SQLStat);
-if($PreSenderName['Name']===null) { $SenderID = -1;
-$PreSenderName = GetUserName($SenderID,$Settings['sqltable'],$SQLStat); }
-$SenderName = $PreSenderName['Name'];
-$SenderHidden = $PreSenderName['Hidden'];
-$ReciverID=sql_result($result,$is,"ReciverID");
-$PreReciverName = GetUserName($ReciverID,$Settings['sqltable'],$SQLStat);
-if($PreReciverName['Name']===null) { $ReciverID = -1;
-$PreReciverName = GetUserName($ReciverID,$Settings['sqltable'],$SQLStat); }
-$ReciverName = $PreReciverName['Name'];
-$ReciverHidden = $PreReciverName['Hidden'];
-$PMGuest=sql_result($result,$is,"GuestName");
-$MessageName=sql_result($result,$is,"MessageTitle");
-$DateSend=sql_result($result,$is,"DateSend");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($DateSend);
-$tmpusrcurtime->setTimezone($usertz);
-$DateSend=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MessageText=sql_result($result,$is,"MessageText");
-$MessageDesc=sql_result($result,$is,"Description");
-$ipshow = "two";
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i", array($SenderID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0;
-$memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($SenderID));
-$memreresult=sql_query($memrequery,$SQLStat);
-$memrenum=sql_num_rows($memreresult);
-if($_SESSION['UserID']!=$ReciverID&&
-       $_SESSION['UserID']!=$SenderID) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-while ($rei < $renum) {
-$User1ID=$SenderID;
-$User1Name=sql_result($reresult,$rei,"Name");
-$SenderName = $User1Name;
-$User1IP=sql_result($reresult,$rei,"IP");
-if($User1IP==$SenderIP) { $ipshow = "one"; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$PreUserCanExecPHP=sql_result($memreresult,$rei,"CanExecPHP");
-if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
-       $PreUserCanExecPHP = "no"; }
-$PreUserCanDoHTML=sql_result($memreresult,$rei,"CanDoHTML");
-if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
-       $PreUserCanDoHTML = "no"; }
-$PreUserCanUseBBTags=sql_result($memreresult,$rei,"CanUseBBTags");
-if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
-       $PreUserCanUseBBTags = "no"; }
-sql_free_result($memreresult);
-$User1Joined=sql_result($reresult,$rei,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($User1Joined);
-$tmpusrcurtime->setTimezone($usertz);
-$User1Joined=$tmpusrcurtime->format($_SESSION['iDBDateFormat']);
-$User1LevelID=sql_result($reresult,$rei,"LevelID");
-$lquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($User1LevelID));
-$lresult=sql_query($lquery,$SQLStat);
-$User1Level=sql_result($lresult,0,"Name");
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$User1Hidden=sql_result($reresult,$rei,"HiddenMember");
-$SenderHidden = $User1Hidden;
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-$User1CanExecPHP = $PreUserCanExecPHP;
-if($PreUserCanExecPHP=="group") {
-$User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
-if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
-       $User1CanExecPHP = "no"; }
-$User1CanDoHTML = $PreUserCanDoHTML;
-if($PreUserCanDoHTML=="group") {
-$User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
-if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
-       $User1CanDoHTML = "no"; }
-$User1CanUseBBTags = $PreUserCanUseBBTags;
-if($User1CanUseBBTags=="group") {
-$User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
-if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
-       $User1CanUseBBTags = "no"; }
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-sql_free_result($gresult); sql_free_result($lresult);
-if($User1Title=="") { $User1Title = $User1Group; }
-$User1Signature=sql_result($reresult,$rei,"Signature");
-$User1Avatar=sql_result($reresult,$rei,"Avatar");
-$User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
-if ($User1Avatar=="http://"||$User1Avatar==null||
-       strtolower($User1Avatar)=="noavatar") {
-$User1Avatar=$ThemeSet['NoAvatar'];
-$User1AvatarSize=$ThemeSet['NoAvatarSize']; }
-$AvatarSize1=explode("x", $User1AvatarSize);
-$AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
-$User1Website=sql_result($reresult,$rei,"Website");
-if($User1Website=="http://") { 
-       $User1Website = $Settings['idburl']; }
-$User1Website = urlcheck($User1Website);
-$BoardWWWChCk = parse_url($Settings['idburl']);
-$User1WWWChCk = parse_url($User1Website);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
-       $opennew = null; }
-$User1PostCount=sql_result($reresult,$rei,"PostCount");
-$User1Karma=sql_result($reresult,$rei,"Karma");
-$User1IP=sql_result($reresult,$rei,"IP");
-++$rei; } sql_free_result($reresult);
-if($_SESSION['UserID']==$ReciverID) {
-$queryup = sql_pre_query("UPDATE \"".$Settings['sqltable']."messenger\" SET \"Read\"=%i WHERE \"id\"=%i", array(1,$_GET['id']));
-sql_query($queryup,$SQLStat); }
-if($User1Name=="Guest") { $User1Name=$PMGuest;
-if($User1Name==null) { $User1Name="Guest"; } }
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $User1Name = $GroupNamePrefix.$User1Name; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $User1Name = $User1Name.$GroupNameSuffix; }
-if($User1CanUseBBTags=="yes") { $MessageText = bbcode_parser($MessageText); }
-if($User1CanExecPHP=="no") {
-$MessageText = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$MessageText); }
-if($User1CanExecPHP=="yes") { $MessageText = php_execute($MessageText); }
-if($User1CanDoHTML=="no") {
-$MessageText = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$MessageText); }
-if($User1CanDoHTML=="yes") { $MessageText = do_html_bbcode($MessageText); }
-$MessageText = text2icons($MessageText,$Settings['sqltable'],$SQLStat);
-$MessageText = preg_replace("/\<br\>/", "<br />", nl2br($MessageText));
-$MessageText = url2link($MessageText);
-if($User1CanUseBBTags=="yes") { $User1Signature = bbcode_parser($User1Signature); }
-if($User1CanExecPHP=="no") {
-$User1Signature = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$User1Signature); }
-if($User1CanExecPHP=="yes") { $User1Signature = php_execute($User1Signature); }
-if($User1CanDoHTML=="no") {
-$User1Signature = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$User1Signature); }
-if($User1CanDoHTML=="yes") { $User1Signature = do_html_bbcode($User1Signature); }
-$User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
-$User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
-$User1Signature = url2link($User1Signature);
-?>
-<div class="TableInfoMini1Border" id="message<?php echo $PMID; ?>">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableInfoMiniRow1">
-<span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>"><?php echo $MessageName; ?></a> ( <?php echo $MessageDesc; ?> )</span>
-</div>
-<?php } ?>
-<table class="TableInfoMini1" style="width: 100%;" id="pmessage<?php echo $is+1; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableInfoMiniRow1">
-<td class="TableInfoMiniColumn1" colspan="2"><span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>"><?php echo $MessageName; ?></a> ( <?php echo $MessageDesc; ?> )</span>
-</td>
-</tr><?php } ?>
-<tr class="TableInfoMiniRow2">
-<td class="TableInfoMiniColumn2" style="vertical-align: middle; width: 160px;">
-&nbsp;<?php
-if($User1ID>0&&$User1Hidden=="no") {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$User1Name."</a>"; }
-if($User1ID<=0||$User1Hidden=="yes") {
-echo "<span>".$User1Name."</span>"; }
-?></td>
-<td class="TableInfoMiniColumn2" style="vertical-align: middle;">
-<div style="float: left; text-align: left;">
-<span style="font-weight: bold;">Time Sent: </span><?php echo $DateSend; ?>
-</div>
-<div style="text-align: right;">
-<?php if(isset($ThemeSet['Report'])&&$ThemeSet['Report']!=null) { ?>
-<a href="#Act/Report"><?php echo $ThemeSet['Report']; ?></a>
-<?php } if($GroupInfo['CanPM']=="yes"&&isset($ThemeSet['QuoteReply'])&&$ThemeSet['QuoteReply']!=null) {
-if($_SESSION['UserID']!=$User1ID) { $SendToID = $User1ID; }
-if($_SESSION['UserID']==$User1ID) { $SendToID = $ReciverID; }
-echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$SendToID."&post=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>"><?php echo $ThemeSet['QuoteReply']; ?></a>
-<?php } ?>&nbsp;</div>
-</td>
-</tr>
-<tr class="TableInfoMiniRow3">
-<td class="TableInfoMiniColumn3" style="vertical-align: top; width: 180px;">
-<?php  // Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/  
- ?>
- <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
-       <tr class="AvatarRow" style="width: 100%; height: 100%;">
-               <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
-               <img src="<?php echo $User1Avatar; ?>" alt="<?php echo $User1Name; ?>'s Avatar" title="<?php echo $User1Name; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
-               </td>
-       </tr>
- </table><br />
-<?php echo $User1Title; ?><br />
-Group: <?php echo $User1Group; ?><br />
-Level: <?php echo $User1Level; ?><br />
-Member: <?php 
-if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
-if($User1ID<=0||$User1Hidden=="yes") { echo 0; }
-?><br />
-Posts: <?php echo $User1PostCount; ?><br />
-Karma: <?php echo $User1Karma; ?><br />
-Joined: <?php echo $User1Joined; ?><br />
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?>
-User IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$User1IP); ?>">
-<?php echo $User1IP; ?></a><br />
-<?php if($ipshow=="two") { ?>
-Message IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$SenderIP); ?>">
-<?php echo $SenderIP; ?></a><br />
-<?php } } ?><br />
-</td>
-<td class="TableInfoMiniColumn3" style="vertical-align: middle;">
-<div class="pmpost"><?php echo $MessageText; ?></div>
-<?php if(isset($User1Signature)&&$User1Signature!="") { ?> <br />--------------------
-<div class="signature"><?php echo $User1Signature; ?></div><?php } ?>
-</td>
-</tr>
-<tr class="TableInfoMiniRow4">
-<td class="TableInfoMiniColumn4" colspan="2">
-<span style="text-align: left;">&nbsp;<a href="<?php
-if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); }
-if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
-echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-?>"><?php echo $ThemeSet['Profile']; ?></a>
-<?php if(isset($ThemeSet['WWW'])&&$ThemeSet['WWW']!=null) {
-echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo $User1Website; ?>"<?php echo $opennew; ?>><?php echo $ThemeSet['WWW']; ?></a><?php } echo $ThemeSet['LineDividerTopic']; ?><a href="<?php
-if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
-echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); }
-if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
-echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-?>"><?php echo $ThemeSet['PM']; ?></a></span>
-</td></tr>
-</table></div>
-<div class="DivReplies">&nbsp;</div>
-<?php ++$is; } ?>
-</td></tr>
-</table>
-<?php sql_free_result($result); }
-if($_GET['act']!="read") { ?>
-</table></div>
-</td></tr>
-</table>
-<?php } }
-if($_GET['act']=="create") { 
-$SendMessageTo = null;
-if($_GET['id']!=null&&$_GET['id']!=-1) {
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i", array($_GET['id']));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0;
-while ($rei < $renum) {
-$SendMessageTo = sql_result($reresult,$rei,"Name");
-$SendMessageTo = htmlspecialchars($SendMessageTo, ENT_QUOTES, $Settings['charset']);
-$SendToGroupID = sql_result($reresult,$rei,"GroupID");
-++$rei; } sql_free_result($reresult); }
-if(!isset($renum)) { $renum = 0; }
-if($renum==0) { $SendMessageTo = null; }
-$QuoteReply = null; $QuoteDescription = null; $QuoteTitle = null;
-if($_GET['post']!=null and is_numeric($_GET['post'])) {
-if(isset($SendMessageTo)) {
-$QuoteUserName = $SendMessageTo; }
-if(!isset($SendMessageTo)) {
-$QuoteUserName = "Unknown"; }
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE \"id\"=%i AND (\"SenderID\"=%i OR \"ReciverID\"=%i)", array($_GET['post'], $_SESSION['UserID'], $_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-if($num>0) {
-$QuoteTitle=sql_result($result,0,"MessageTitle");
-$MessageText=sql_result($result,0,"MessageText");
-$QuoteReply = preg_replace("/\<br\>/", "<br />", nl2br($MessageText));
-$QuoteDescription=sql_result($result,0,"Description");
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$QuoteReply = remove_bad_entities($QuoteReply);
-$QuoteDescription = str_replace("Re: ","",$QuoteDescription);
-$QuoteDescription = "Re: ".$QuoteDescription;
-$QuoteTitle = str_replace("Re: ","",$QuoteTitle);
-$QuoteTitle = "Re: ".$QuoteTitle;
-$QuoteReply = null; } }
-if($num==0) { $_GET['post'] = null; }
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Seanding a Message</a></span></div>
-<?php } ?>
-<table class="Table1" id="MakeMessage">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="MessageStart">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Seanding a Message</a></span>
-</td>
-</tr><?php } ?>
-<tr id="MakeMessageRow" class="TableRow2">
-<td class="TableColumn2" colspan="2" style="width: 100%;">Making a Message</td>
-</tr>
-<tr class="TableRow3" id="MkMessage">
-<td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
-<div style="width: 100%; height: 160px; overflow: auto;">
-<table style="width: 100%; text-align: center;"><?php
-$renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
-$renee_result=sql_query($renee_query,$SQLStat);
-$renee_num=sql_num_rows($renee_result);
-$renee_s=0; $SmileRow=0; $SmileCRow=0;
-while ($renee_s < $renee_num) { ++$SmileRow;
-$FileName=sql_result($renee_result,$renee_s,"FileName");
-$SmileName=sql_result($renee_result,$renee_s,"SmileName");
-$SmileText=sql_result($renee_result,$renee_s,"SmileText");
-$SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
-$ShowSmile=sql_result($renee_result,$renee_s,"Display");
-$ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
-if($SmileRow==1) { ?><tr>
-       <?php } if($SmileRow<5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
-       <?php } if($SmileRow==5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
-       <?php $SmileCRow=0; $SmileRow=0; }
-++$renee_s; }
-if($SmileCRow<5&&$SmileCRow!=0) {
-$SmileCRowL = 5 - $SmileCRow;
-echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
-echo "</table>";
-sql_free_result($renee_result);
-?></div></td>
-<td class="TableColumn3" style="width: 85%;">
-<form style="display: inline;" method="post" id="MkReplyForm" action="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=sendmessage",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="SendMessageTo">Insert UserName:</label></td>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="SendMessageTo" class="TextBox" id="SendMessageTo" size="20" value="<?php echo $SendMessageTo; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MessageName">Insert Message Name:</label></td>
-       <td style="width: 50%;"><input maxlength="30" type="text" name="MessageName" class="TextBox" id="MessageName" size="20" value="<?php echo $QuoteTitle; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="MessageDesc">Insert Message Description:</label></td>
-       <td style="width: 50%;"><input maxlength="45" type="text" name="MessageDesc" class="TextBox" id="MessageDesc" size="20" value="<?php echo $QuoteDescription; ?>" /></td>
-</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-<?php } ?></tr><?php } ?>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="Message">Insert Your Message:</label><br />
-<textarea rows="10" name="Message" id="Message" cols="40" class="TextBox"><?php echo $QuoteReply; ?></textarea><br />
-<?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
-<label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
-<input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
-<?php } ?>
-<input type="hidden" name="act" value="sendmessages" style="display: none;" />
-<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="submit" class="Button" value="Send Message" name="send_message" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if($_GET['post']!=null and is_numeric($_GET['post'])) { ?>
-<input type="hidden" style="display: none;" name="post" value="<?php echo $_GET['post']; ?>" />
-<?php } if($_GET['post']==null or !is_numeric($_GET['post'])) { ?>
-<input type="hidden" style="display: none;" name="post" value="0" />
-<?php } ?>
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form></td></tr>
-<tr id="MkReplyEnd" class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<?php } if($_GET['act']=="sendmessage"&&$_POST['act']=="sendmessages") {
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-if(!isset($_POST['SendMessageTo'])) { $_POST['SendMessageTo'] = null; }
-if(!isset($_POST['MessageName'])) { $_POST['MessageName'] = null; }
-if(!isset($_POST['MessageDesc'])) { $_POST['MessageDesc'] = null; }
-if(!isset($_POST['Message'])) { $_POST['Message'] = null; }
-if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-require($SettDir['inc']."captcha.php"); }
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=sendmessage",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Making a Message</a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=sendmessage",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Making a Message</a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php if (pre_strlen($_POST['SendMessageTo'])>="25") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Send to user name too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-if (PhpCaptcha::Validate($_POST['signcode'])) {
-//echo 'Valid code entered';
-} else { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Invalid code entered<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } if ($_POST['SendMessageTo']==null) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a user name to send message to.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($_POST['MessageName'])>="30") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Message Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if (pre_strlen($_POST['MessageDesc'])>="45") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Message Description is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       pre_strlen($_POST['GuestName'])>="25") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You Guest Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Settings['TestReferer']=="on") {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } }
-if(is_numeric($_POST['post'])) { $_POST['post'] = intval($_POST['post'], 10); }
-if(!isset($_POST['post']) or !is_numeric($_POST['post']) or $_POST['post']==null) { $_POST['post'] = 0; }
-if($_POST['post']>0) {
-$querychckm = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE \"id\"=%i AND (\"SenderID\"=%i OR \"ReciverID\"=%i)", array($_POST['post'], $_SESSION['UserID'], $_SESSION['UserID']));
-$resultchckm=sql_query($querychckm,$SQLStat);
-$numchckm=sql_num_rows($resultchckm);
-if($numchckm==0) { $_POST['post'] = 0; } }
-sql_free_result($resultchckm);
-$_POST['MessageName'] = stripcslashes(htmlspecialchars($_POST['MessageName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['MessageName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['MessageName']);
-$_POST['MessageName'] = remove_spaces($_POST['MessageName']);
-$_POST['MessageDesc'] = stripcslashes(htmlspecialchars($_POST['MessageDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['MessageDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['MessageDesc']);
-$_POST['MessageDesc'] = remove_spaces($_POST['MessageDesc']);
-$_POST['SendMessageTo'] = stripcslashes(htmlspecialchars($_POST['SendMessageTo'], ENT_QUOTES, $Settings['charset']));
-//$_POST['SendMessageTo'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['SendMessageTo']);
-$_POST['SendMessageTo'] = remove_spaces($_POST['SendMessageTo']);
-$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
-$_POST['GuestName'] = remove_spaces($_POST['GuestName']);
-$_POST['Message'] = stripcslashes(htmlspecialchars($_POST['Message'], ENT_QUOTES, $Settings['charset']));
-//$_POST['Message'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Message']);
-//$_POST['Message'] = remove_spaces($_POST['Message']);
-$_POST['Message'] = remove_bad_entities($_POST['Message']);
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
-if($cookieDomain==null) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain); } }
-$_SESSION['GuestName']=$_POST['GuestName']; } }
-/*    <_<  iWordFilter  >_>      
-   by Kazuki Przyborowski - Cool Dude 2k */
-$katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-$katarzynart=sql_query($katarzynaqy,$SQLStat);
-$katarzynanm=sql_num_rows($katarzynart);
-$katarzynas=0;
-while ($katarzynas < $katarzynanm) {
-$Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-$Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-$CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-$WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-if($WholeWord=="on") { $WholeWord = "yes"; }
-if($WholeWord=="off") { $WholeWord = "no"; }
-if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-$Filter = preg_quote($Filter, "/");
-if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-$_POST['Message'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Message']);
-$_POST['MessageDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['MessageDesc']); }
-if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-$_POST['Message'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Message']);
-$_POST['MessageDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['MessageDesc']); }
-if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-$_POST['Message'] = preg_replace("/".$Filter."/", $Replace, $_POST['Message']);
-$_POST['MessageDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['MessageDesc']); }
-if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-$_POST['Message'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Message']);
-$_POST['MessageDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['MessageDesc']); }
-++$katarzynas; } sql_free_result($katarzynart);
-$lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedMessageName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
-$lonewolfrt=sql_query($lonewolfqy,$SQLStat);
-$lonewolfnm=sql_num_rows($lonewolfrt);
-$lonewolfs=0; $RMatches = null; $RGMatches = null;
-while ($lonewolfs < $lonewolfnm) {
-$RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
-$RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
-if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
-if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
-if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
-$RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
-if($RWholeWord=="on") { $RWholeWord = "yes"; }
-if($RWholeWord=="off") { $RWholeWord = "no"; }
-if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
-$RestrictedMessageName=sql_result($lonewolfrt,$lonewolfs,"RestrictedMessageName");
-if($RestrictedMessageName=="on") { $RestrictedMessageName = "yes"; }
-if($RestrictedMessageName=="off") { $RestrictedMessageName = "no"; }
-if($RestrictedMessageName!="yes"||$RestrictedMessageName!="no") { $RestrictedMessageName = "no"; }
-$RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
-if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
-if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
-if($RestrictedUserName!="yes"||$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
-$RWord = preg_quote($RWord, "/");
-if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
-if($RestrictedMessageName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['MessageName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
-if($RestrictedMessageName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['MessageName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
-if($RestrictedMessageName=="yes") {
-$RMatches = preg_match("/".$RWord."/", $_POST['MessageName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
-if($RestrictedMessageName=="yes") {
-$RMatches = preg_match("/".$RWord."/i", $_POST['MessageName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-++$lonewolfs; } sql_free_result($lonewolfrt);
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s'", array($_POST['SendMessageTo']));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0;
-while ($rei < $renum) {
-$SendMessageToID = sql_result($reresult,$rei,"id");
-$SendToGroupID = sql_result($reresult,$rei,"GroupID");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i", array($SendToGroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$SendUserCanPM=sql_result($gresult,0,"CanPM");
-$SendUserCanPM = strtolower($SendUserCanPM);
-if($SendUserCanPM!="yes"&&$SendUserCanPM!="no") {
-       $SendUserCanPM = "no"; }
-sql_free_result($gresult);
-++$rei; } sql_free_result($reresult);
-if($renum==0) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Cound not find users name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['MessageName']==null) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Message Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['MessageDesc']==null) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Message Description.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($SendUserCanPM=="no") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />User Name enter can not get messages.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['Message']==null) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Message.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $_POST['GuestName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Guest Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $RGMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Guest Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($RMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Message Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if ($Error!="Yes") { $LastActive = $utccurtime->getTimestamp();
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { $User1Name = $_SESSION['MemberName']; }
-$User1IP=$_SERVER['REMOTE_ADDR'];
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."messenger\" (\"DiscussionID\", \"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES 
-(%i, %i, %i, '%s', '%s', '%s', '%s', %i, %i, '%s')", array($_POST['post'],$_SESSION['UserID'],$SendMessageToID,$_SESSION['MemberName'],$_POST['MessageName'],$_POST['Message'],$_POST['MessageDesc'],$LastActive,0,$User1IP));
-sql_query($query,$SQLStat);
-$messageid = sql_get_next_id($Settings['sqltable'],"messenger",$SQLStat);
-$msglinkback = "Click <a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">here</a> to go back to mailbox.";
-if($_POST['post']>0) { $msglinkback = "Click <a href=\"".url_maker($exfile['messenger'],$Settings['file_ext'],"act=read&id=".$_POST['post'],$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger'])."\">here</a> to go back to message."; }
-?><tr>
-       <td><span class="TableMessage"><br />
-       Message sent to user <?php echo $_POST['SendMessageTo']; ?>.<br />
-       <?php echo $msglinkback; ?><br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } ?>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } ?>
-<div class="DivMessages">&nbsp;</div>
diff --git a/inc/misc/compression.php.bak b/inc/misc/compression.php.bak
deleted file mode 100644 (file)
index 0ed9d02..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    GZip and Zlib by Jean-loup Gailly (compression) and Mark Adler (decompression) http://www.zlib.net/
-       BZip2 and libbzip2 by Julian Seward http://www.bzip.org/
-
-    $FileInfo: compression.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="compression.php"||$File3Name=="/compression.php") {
-       require('index.php');
-       exit(); }
-//Check if zlib is loaded
-if(extension_loaded("zlib")) {
-function gunzip($infile, $outfile) {
-  $string = null;
-  $zp = gzopen($infile, "r");
-  while(!gzeof($zp))
-       $string .= gzread($zp, 4096);
-  gzclose($zp);
-  $fp = fopen($outfile, "w");
-  fwrite($fp, $string, strlen($string));
-  fclose($fp);
-}
-
-function gunzip2($infile, $outfile) {
- $string = implode("", gzfile($infile));
- $fp = fopen($outfile, "w");
- fwrite($fp, $string, strlen($string));
- fclose($fp);
-}
-function gzip($infile, $outfile, $param = 5) {
- $fp = fopen($infile, "r");
- $data = fread ($fp, filesize($infile));
- fclose($fp);
- $zp = gzopen($outfile, "w".$param);
- gzwrite($zp, $data);
- gzclose($zp);
-} }
-//Check if bz2 is loaded
-if(extension_loaded("bz2")) {
-function bzip($infile, $outfile) {
- $fp = fopen($infile, "r");
- $data = fread($fp, filesize($infile));
- fclose($fp);
- $zp = bzopen($outfile, "w");
- bzwrite($zp, $data);
- bzclose($zp);
-}
-
-function bunzip($infile, $outfile) {
-  $string = null;
-  $zp = bzopen($infile, "r");
-  while(!feof($zp))
-       $string .= bzread($zp, 4096);
-  bzclose($zp);
-  $fp = fopen($outfile, "w");
-  fwrite($fp, $string, strlen($string));
-  fclose($fp);
-} }
-//Check if zip is loaded
-if(extension_loaded("zip")) {
-/* Nothing for now... :P */ }
-//Check if rar is loaded
-if(extension_loaded("rar")) {
-/* Nothing for now... :P */ }
-
-?>
diff --git a/inc/misc/functions.php.bak b/inc/misc/functions.php.bak
deleted file mode 100644 (file)
index f8d7933..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: functions.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="functions.php"||$File3Name=="/functions.php") {
-       require('index.php');
-       exit(); }
-// Check the file names
-function CheckFile($FileName) {
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name==$FileName||$File3Name=="/".$FileName) {
-       require('index.php');
-       exit(); }
-return null; }
-function CheckFiles($FileName) {
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name==$FileName||$File3Name=="/".$FileName) {
-       return true; } }
-CheckFile("functions.php");
-require($SettDir['misc']."compression.php");
-if($Settings['sqltype']=="mysql") {
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("mysql.default_host",$Settings['sqlhost']);
-@ini_set("mysql.default_user",$Settings['sqluser']);
-@ini_set("mysql.default_password",$Settings['sqlpass']); }
-require($SettDir['sql']."mysql.php"); }
-if($Settings['sqltype']=="mysqli") {
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("mysqli.default_host",$Settings['sqlhost']);
-@ini_set("mysqli.default_user",$Settings['sqluser']);
-@ini_set("mysqli.default_pw",$Settings['sqlpass']); }
-require($SettDir['sql']."mysqli.php"); }
-if($Settings['sqltype']=="pgsql") {
-require($SettDir['sql']."pgsql.php"); }
-if($Settings['sqltype']=="sqlite") {
-require($SettDir['sql']."sqlite.php"); }
-if($Settings['sqltype']=="cubrid") {
-require($SettDir['sql']."cubrid.php"); }
-require($SettDir['misc']."useragents.php");
-/* 
-if ($_GET['act']=="DeleteSession") { session_destroy(); }
-if ($_GET['act']=="ResetSession") { session_unset(); }
-if ($_GET['act']=="NewSessionID") { session_regenerate_id(); }
-if ($_GET['act']=="PHPInfo") { phpinfo(); exit(); }
-if ($_GET['act']=="phpinfo") { phpinfo(); exit(); }
-if ($_GET['act']=="PHPCredits") { phpcredits(); exit(); }
-if ($_GET['act']=="phpcredits") { phpcredits(); exit(); } 
-*/
-function header_protocol($header) {
-if(isset($_SERVER['SERVER_PROTOCOL'])&&strstr($_SERVER['SERVER_PROTOCOL'],"/1.0")) {
-       return "HTTP/1.0 ".$header; }
-else {
-       return "HTTP/1.1 ".$header; } }
-// Change the title and gzip page
-function change_title($new_title,$use_gzip="off",$gzip_type="gzip") {
-global $Settings,$urlstatus;
-if(!isset($urlstatus)||!is_numeric($urlstatus)) { $urlstatus = 200; }
-if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } }
-$output = trim(ob_get_clean());
-$output = preg_replace("/<title>(.*?)<\/title>/i", "<title>".$new_title."</title>", $output);
-/* Change Some PHP Settings Fix the &PHPSESSID to &amp;PHPSESSID */
-$SessName = session_name();
-$output = preg_replace("/&PHPSESSID/", "&amp;PHPSESSID", $output);
-$qstrcode = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']);
-$output = str_replace($Settings['qstr'].$SessName, $qstrcode.$SessName, $output);
-if($use_gzip!="on") {
-       if($Settings['send_pagesize']=="on") {
-       @header("Content-Length: ".decoct(strlen($output))); 
-       @header("Content-MD5: ".base64_encode(md5($output))); }
-       idb_log_maker($urlstatus,strlen($output));
-       echo $output; }
-if($use_gzip=="on") {
-       if($gzip_type=="gzip") {
-       $goutput = gzencode($output); }
-       if($gzip_type=="deflate") {
-       $goutput = gzcompress($output); }
-       if($Settings['send_pagesize']=="on") {
-       @header("Content-Length: ".decoct(strlen($goutput))); 
-       @header("Content-MD5: ".base64_encode(md5($goutput))); }
-       idb_log_maker($urlstatus,strlen($goutput));
-       echo $goutput; } }
-// Fix amp => (&) to &amp; and gzip page
-function fix_amp($use_gzip="off",$gzip_type="gzip") {
-global $Settings,$urlstatus;
-if(!isset($urlstatus)||!is_numeric($urlstatus)) { $urlstatus = 200; }
-if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } }
-$output = trim(ob_get_clean());
-/* Change Some PHP Settings Fix the &PHPSESSID to &amp;PHPSESSID */
-$SessName = session_name();
-$output = preg_replace("/&PHPSESSID/", "&amp;PHPSESSID", $output);
-$qstrcode = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']);
-$output = str_replace($Settings['qstr'].$SessName, $qstrcode.$SessName, $output);
-if($use_gzip!="on") {
-       if($Settings['send_pagesize']=="on") {
-       @header("Content-Length: ".decoct(strlen($output))); 
-       @header("Content-MD5: ".base64_encode(md5($output))); }
-       idb_log_maker($urlstatus,strlen($output));
-       echo $output; }
-if($use_gzip=="on") {
-       if($gzip_type=="gzip") {
-       $goutput = gzencode($output); }
-       if($gzip_type=="deflate") {
-       $goutput = gzcompress($output); }
-       if($Settings['send_pagesize']=="on") {
-       @header("Content-Length: ".decoct(strlen($goutput))); 
-       @header("Content-MD5: ".base64_encode(md5($goutput))); }
-       idb_log_maker($urlstatus,strlen($goutput));
-       echo $goutput; } }
-// GZip page for faster download
-function gzip_page($use_gzip="off",$gzip_type="gzip") {
-global $Settings,$urlstatus;
-if(!isset($urlstatus)||!is_numeric($urlstatus)) { $urlstatus = 200; }
-$output = trim(ob_get_clean());
-if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } }
-if($use_gzip!="on") {
-       if($Settings['send_pagesize']=="on") {
-       @header("Content-Length: ".decoct(strlen($output))); 
-       @header("Content-MD5: ".base64_encode(md5($output))); }
-       idb_log_maker($urlstatus,strlen($output));
-       echo $output; }
-if($use_gzip=="on") {
-       if($gzip_type=="gzip") {
-       $goutput = gzencode($output); }
-       if($gzip_type=="deflate") {
-       $goutput = gzcompress($output); }
-       if($Settings['send_pagesize']=="on") {
-       @header("Content-Length: ".decoct(strlen($goutput))); 
-       @header("Content-MD5: ".base64_encode(md5($goutput))); }
-       idb_log_maker($urlstatus,strlen($goutput));
-       echo $goutput; } }
-$foo="bar"; $$foo="foo";
-// Kill bad vars for some functions
-function killbadvars($varname) {
-$badphp1 = array('$'); $badphp2 = array(null);
-$varname = str_replace($badphp1, $badphp2, $varname);
-$varname = preg_replace("/(_SERVER|_ENV|_COOKIE|_SESSION)/i", null, $varname);
-$varname = preg_replace("/(_GET|_POST|_FILES|_REQUEST|GLOBALS)/i", null, $varname);
-$varname = preg_replace("/(HTTP_SERVER_VARS|HTTP_ENV_VARS)/i", null, $varname);
-$varname = preg_replace("/(HTTP_COOKIE_VARS|HTTP_SESSION_VARS)/i", null, $varname);
-$varname = preg_replace("/(HTTP_GET_VARS|HTTP_POST_VARS|HTTP_POST_FILES)/i", null, $varname);
-       return $varname; }
-// Trying to fix this bug. ^_^
-// http://xforce.iss.net/xforce/xfdb/49697
-if(!isset($Settings['DefaultTheme'])) {
-       $Settings['DefaultTheme'] = "iDB"; }
-// Change the text to icons(smileys)
-function text2icons($Text,$sqlt,$link=null) {
-global $SQLStat;
-if(!isset($link)) { $link = $SQLStat; }
-$reneequery=sql_pre_query("SELECT * FROM \"".$sqlt."smileys\"", array(null));
-$reneeresult=sql_query($reneequery,$link);
-$reneenum=sql_num_rows($reneeresult);
-$renees=0;
-while ($renees < $reneenum) {
-$FileName=sql_result($reneeresult,$renees,"FileName");
-$SmileName=sql_result($reneeresult,$renees,"SmileName");
-$SmileText=sql_result($reneeresult,$renees,"SmileText");
-$SmileDirectory=sql_result($reneeresult,$renees,"Directory");
-$ShowSmile=sql_result($reneeresult,$renees,"Display");
-$ReplaceType=sql_result($reneeresult,$renees,"ReplaceCI");
-if($ReplaceType=="on") { $ReplaceType = "yes"; }
-if($ReplaceType=="off") { $ReplaceType = "no"; }
-if($ReplaceType!="yes"||$ReplaceType!="no") { $ReplaceType = "no"; }
-$Smile1 = $SmileText;
-$Smile2 = '<img src="'.$SmileDirectory.''.$FileName.'" style="vertical-align: middle; border: 0px;" title="'.$SmileName.'" alt="'.$SmileName.'" />';
-if($ReplaceType=="no") {
-$Text = str_replace($Smile1, $Smile2, $Text); }
-if($ReplaceType=="yes") {
-       $Smile1 = preg_quote($SmileText,"/");
-$Text = preg_replace("/".$Smile1."/i",$Smile2,$Text); }
-++$renees; } return $Text; }
-// Removes the bad stuff
-function remove_bad_entities($Text) {
-//HTML Entities Dec Version
-$Text = preg_replace("/&#8238;/isU","",$Text);
-$Text = preg_replace("/&#8194;/isU","",$Text);
-$Text = preg_replace("/&#8195;/isU","",$Text);
-$Text = preg_replace("/&#8201;/isU","",$Text);
-$Text = preg_replace("/&#8204;/isU","",$Text);
-$Text = preg_replace("/&#8205;/isU","",$Text);
-$Text = preg_replace("/&#8206;/isU","",$Text);
-$Text = preg_replace("/&#8207;/isU","",$Text);
-//HTML Entities Hex Version
-$Text = preg_replace("/&#x202e;/isU","",$Text);
-$Text = preg_replace("/&#x2002;/isU","",$Text);
-$Text = preg_replace("/&#x2003;/isU","",$Text);
-$Text = preg_replace("/&#x2009;/isU","",$Text);
-$Text = preg_replace("/&#x200c;/isU","",$Text);
-$Text = preg_replace("/&#x200d;/isU","",$Text);
-$Text = preg_replace("/&#x200e;/isU","",$Text);
-$Text = preg_replace("/&#x200f;/isU","",$Text);
-//HTML Entities Name Version
-$Text = preg_replace("/&ensp;/isU","",$Text);
-$Text = preg_replace("/&emsp;/isU","",$Text);
-$Text = preg_replace("/&thinsp;/isU","",$Text);
-$Text = preg_replace("/&zwnj;/isU","",$Text);
-$Text = preg_replace("/&zwj;/isU","",$Text);
-$Text = preg_replace("/&lrm;/isU","",$Text);
-$Text = preg_replace("/&rlm;/isU","",$Text);
-return $Text; }
-// Remove the bad stuff
-function remove_spaces($Text) {
-$Text = preg_replace("/(^\t+|\t+$)/","",$Text);
-$Text = preg_replace("/(^\n+|\n+$)/","",$Text);
-$Text = preg_replace("/(^\r+|\r+$)/","",$Text);
-$Text = preg_replace("/(\r|\n|\t)+/"," ",$Text);
-$Text = preg_replace("/\s\s+/"," ",$Text);
-$Text = preg_replace("/(^\s+|\s+$)/","",$Text);
-$Text = trim($Text, "\x00..\x1F");
-$Text = remove_bad_entities($Text);
-return $Text; }
-// Fix some chars
-function fixbamps($text) {
-$fixamps1 = array("&amp;copy;","&amp;reg;","&amp;trade;","&amp;quot;","&amp;amp;","&amp;lt;","&amp;gt;","&amp;(a|e|i|o|u|y)acute;","&amp;(a|e|i|o|u)grave;","&amp;(a|e|i|o|u)circ;","&amp;(a|e|i|o|u|y)uml;","&amp;(a|o|n)tilde;","&amp;aring;","&amp;aelig;","&amp;ccedil;","&amp;eth;","&amp;oslash;","&amp;szlig;","&amp;thorn;");
-$fixamps2 = array("&copy;","&reg;","&trade;","&quot;","&amp;","&lt;","&gt;","&\\1acute;","&\\1grave;","&\\1circ;","&\\1uml;","&\\1tilde;","&aring;","&aelig;","&ccedil;","&eth;","&oslash;","&szlig;","&thorn;");
-$ampnum = count($fixamps1); $ampi=0;
-while ($ampi < $ampnum) {
-$text = preg_replace("/".$fixamps1[$ampi]."/i", $fixamps2[$ampi], $text);
-++$ampi; }
-$text = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $text);
-return $text; }
-$utshour = $dayconv['hour'];
-$utsminute = $dayconv['minute'];
-// Change Time Stamp to a readable time
-function GMTimeChange($format,$timestamp,$offset,$minoffset=null,$dst=null) {
-global $utshour,$utsminute;
-$dstake = null;
-if(!is_numeric($minoffset)) { $minoffset = "00"; }
-$ts_array = explode(":",$offset);
-if(count($ts_array)!=2) {
-       if(!isset($ts_array[0])) { $ts_array[0] = "0"; }
-       if(!isset($ts_array[1])) { $ts_array[1] = "00"; }
-       $offset = $ts_array[0].":".$ts_array[1]; }
-if(!is_numeric($ts_array[0])) { $ts_array[0] = "0"; }
-if(!is_numeric($ts_array[1])) { $ts_array[1] = "00"; }
-if($ts_array[1]<0) { $ts_array[1] = "00"; $offset = $ts_array[0].":".$ts_array[1]; }
-$tsa = array("offset" => $offset, "hour" => $ts_array[0], "minute" => $ts_array[1]);
-//$tsa['minute'] = $tsa['minute'] + $minoffset;
-if($dst!="on"&&$dst!="off") { $dst = "off"; }
-if($dst=="on") { if($dstake!="done") { 
-       $dstake = "done"; $tsa['hour'] = $tsa['hour']+1; } }
-$utimestamp = $tsa['hour'] * $utshour;
-$utimestamp = $utimestamp + $tsa['minute'] * $utsminute;
-$utimestamp = $utimestamp + $minoffset * $utsminute;
-$timestamp = $timestamp + $utimestamp;
-return date($format,$timestamp); }
-// Change Time Stamp to a readable time
-function TimeChange($format,$timestamp,$offset,$minoffset=null,$dst=null) {
-return GMTimeChange($format,$timestamp,$offset,$minoffset,$dst); }
-// Make a GMT Time Stamp
-function GMTimeStamp() {
-$GMTHour = gmdate("H");
-$GMTMinute = gmdate("i");
-$GMTSecond = gmdate("s");
-$GMTMonth = gmdate("n");
-$GMTDay = gmdate("d");
-$GMTYear = gmdate("Y");
-return mktime($GMTHour,$GMTMinute,$GMTSecond,$GMTMonth,$GMTDay,$GMTYear); }
-// Make a GMT Time Stamp alt version
-function GMTimeStampS() { return time() - date('Z', time()); }
-// Get GMT Time
-function GMTimeGet($format,$offset,$minoffset=null,$dst=null,$taddon=null) {
-       if(!is_numeric($taddon)) { $taddon = null; }
-       if($taddon!==null) {
-       return GMTimeChange($format,GMTimeStamp()+$taddon,$offset,$minoffset,$dst); }
-       if($taddon===null) {
-       return GMTimeChange($format,GMTimeStamp(),$offset,$minoffset,$dst); } }
-// Get GMT Time alt version
-function GMTimeGetS($format,$offset,$minoffset=null,$dst=null) {
-global $utshour,$utsminute;
-$dstake = null;
-if(!is_numeric($offset)) { $offset = "0"; }
-if(!is_numeric($minoffset)) { $minoffset = "00"; }
-$ts_array = explode(":",$offset);
-if(count($ts_array)!=2) {
-       if(!isset($ts_array[0])) { $ts_array[0] = "0"; }
-       if(!isset($ts_array[1])) { $ts_array[1] = "00"; }
-       $offset = $ts_array[0].":".$ts_array[1]; }
-if(!is_numeric($ts_array[0])) { $ts_array[0] = "0"; }
-if(!is_numeric($ts_array[1])) { $ts_array[1] = "00"; }
-if($ts_array[1]<0) { $ts_array[1] = "00"; $offset = $ts_array[0].":".$ts_array[1]; }
-$tsa = array("offset" => $offset, "hour" => $ts_array[0], "minute" => $ts_array[1]);
-//$tsa['minute'] = $tsa['minute'] + $minoffset;
-if($dst!="on"&&$dst!="off") { $dst = "off"; }
-if($dst=="on") { if($dstake!="done") { 
-       $dstake = "done"; $tsa['hour'] = $tsa['hour']+1; } }
-$utimestamp = $tsa['hour'] * $utshour;
-$utimestamp = $utimestamp + $tsa['minute'] * $utsminute;
-$utimestamp = $utimestamp + $minoffset * $utsminute;
-$timestamp = $timestamp + $utimestamp;
-return date($format,mktime()+$timestamp); }
-// Get Server offset
-function GetSeverZone() {
-$TestHour1 = date("H");
-@putenv("OTZ=".getenv("TZ"));
-@putenv("TZ=GMT");
-$TestHour2 = date("H");
-@putenv("TZ=".getenv("OTZ"));
-$TestHour3 = $TestHour1-$TestHour2;
-return $TestHour3; }
-// Get Server offset alt version
-function SeverOffSet() {
-$TestHour1 = date("H");
-$TestHour2 = gmdate("H");
-$TestHour3 = $TestHour1-$TestHour2;
-return $TestHour3; }
-// Get Server offset new version
-function SeverOffSetNew() {
-return gmdate("g",mktime(0,date("Z"))); }
-function gmtime() { return time() - (int) date('Z'); }
-// Acts like highlight_file();
-function file_get_source($filename,$return = FALSE) {
-$phpsrc = file_get_contents($filename);
-$phpsrcs = highlight_string($phpsrc,$return);
-return $phpsrcs; }
-// Also acts like highlight_file(); but valid xhtml
-function valid_get_source($filename) {
-$phpsrcs = file_get_source($filename,TRUE);
-// Change font tag to span tag for valid xhtml
-$phpsrcs = preg_replace("/\<font color=\"(.*?)\"\>/i", "<span style=\"color: \\1;\">", $phpsrcs);
-$phpsrcs = preg_replace("/\<\/font>/i", "</span>", $phpsrcs);
-return $phpsrcs; }
-// Check to see if the user is hidden/shy/timid. >_> | ^_^ | <_<
-function GetUserName($idu,$sqlt,$link=null) { $UsersName = null;
-global $SQLStat;
-if(!isset($link)) { $link = $SQLStat; }
-$gunquery = sql_pre_query("SELECT * FROM \"".$sqlt."members\" WHERE \"id\"=%i LIMIT 1", array($idu));
-$gunresult=sql_query($gunquery,$link);
-$gunnum=sql_num_rows($gunresult);
-// I'm now hidden from you. ^_^ | <_< I cant find you.
-$UsersHidden = "yes";
-if($gunnum>0){
-$UsersName=sql_result($gunresult,0,"Name");
-// Am i still hidden. o_O <_< I can see you.
-$UsersHidden=sql_result($gunresult,0,"HiddenMember"); }
-sql_free_result($gunresult);
-$UsersInfo['Name'] = $UsersName;
-$UsersInfo['Hidden'] = $UsersHidden;
-return $UsersInfo; }
-if(!function_exists('hash_hmac')) {
-function hash_hmac($algo, $data, $key, $raw_output = false) {
-  $blocksize = 64;
-  if (strlen($key)>$blocksize) {
-  if (function_exists('hash')) {
-  $key=pack('H*',hash($hash, $key)); }
-  if (!function_exists('hash')) {
-  $key=pack('H*',$hash($key)); } }
-  $key=str_pad($key, $blocksize, chr(0x00));
-  $ipad=str_repeat(chr(0x36),$blocksize);
-  $opad=str_repeat(chr(0x5c),$blocksize);
-  return hash($algo, ($key^$opad).pack('H*',hash($algo, ($key^$ipad).$data))); } }
-if(!function_exists('hash')) {
-function hash($algo, $data, $raw_output = false) {
-if($algo!="md5"&&$algo!="sha1") { $algo = "md5"; }
-return $algo($data); } }
-if(!function_exists('hash_algos')) {
-function hash_algos() {
-return array(0 => "md5", 1 => "sha1"); } }
-// hmac hash function
-function hmac($data,$key,$hash='sha1',$blocksize=64) {
-  if (!function_exists('hash_hmac')) {
-  if (strlen($key)>$blocksize) {
-  if (function_exists('hash')) {
-  $key=pack('H*',hash($hash, $key)); }
-  if (!function_exists('hash')) {
-  $key=pack('H*',$hash($key)); } }
-  $key=str_pad($key, $blocksize, chr(0x00));
-  $ipad=str_repeat(chr(0x36),$blocksize);
-  $opad=str_repeat(chr(0x5c),$blocksize);
-  if (function_exists('hash')) {
-  return hash($hash, ($key^$opad).pack('H*',hash($hash, ($key^$ipad).$data))); }
-  if (!function_exists('hash')) {
-  return $hash(($key^$opad).pack('H*',$hash(($key^$ipad).$data))); } }
-  if (function_exists('hash_hmac')) { 
-  return hash_hmac($hash,$data,$key); } }
-// b64hmac hash function
-function b64e_hmac($data,$key,$extdata,$hash='sha1',$blocksize=64) {
-       $extdata2 = hexdec($extdata); $key = $key.$extdata2;
-  return base64_encode(hmac($data,$key,$hash,$blocksize).$extdata); }
-// b64hmac rot13 hash function
-function b64e_rot13_hmac($data,$key,$extdata,$hash='sha1',$blocksize=64) {
-       $data = str_rot13($data);
-       $extdata2 = hexdec($extdata); $key = $key.$extdata2;
-  return base64_encode(hmac($data,$key,$hash,$blocksize).$extdata); }
-// salt hmac hash function
-function salt_hmac($size1=6,$size2=12) {
-$hprand = rand($size1,$size2); $i = 0; $hpass = "";
-while ($i < $hprand) {
-$hspsrand = rand(1,2);
-if($hspsrand!=1&&$hspsrand!=2) { $hspsrand=1; }
-if($hspsrand==1) { $hpass .= chr(rand(48,57)); }
-/* if($hspsrand==2) { $hpass .= chr(rand(65,70)); } */
-if($hspsrand==2) { $hpass .= chr(rand(97,102)); }
-++$i; } return $hpass; }
-/* is_empty by M at http://us2.php.net/manual/en/function.empty.php#74093 */
-function is_empty($var) {
-    if (((is_null($var) || rtrim($var) == "") &&
-               $var !== false) || (is_array($var) && empty($var))) {
-        return true; } else { return false; } }
-// PHP 5 hash algorithms to functions :o 
-if(function_exists('hash')&&function_exists('hash_algos')) {
-if(in_array("md2",hash_algos())&&!function_exists("md2")) { 
-function md2($data) { return hash("md2",$data); } } 
-if(in_array("md4",hash_algos())&&!function_exists("md4")) { 
-function md4($data) { return hash("md4",$data); } }
-if(in_array("md5",hash_algos())&&!function_exists("md5")) { 
-function md5($data) { return hash("md5",$data); } }
-if(in_array("sha1",hash_algos())&&!function_exists("sha1")) { 
-function sha1($data) { return hash("sha1",$data); } }
-if(in_array("sha224",hash_algos())&&!function_exists("sha224")) { 
-function sha224($data) { return hash("sha224",$data); } }
-if(in_array("sha256",hash_algos())&&!function_exists("sha256")) { 
-function sha256($data) { return hash("sha256",$data); } }
-if(in_array("sha384",hash_algos())&&!function_exists("sha384")) { 
-function sha384($data) { return hash("sha384",$data); } }
-if(in_array("sha512",hash_algos())&&!function_exists("sha512")) { 
-function sha512($data) { return hash("sha512",$data); } }
-if(in_array("ripemd128",hash_algos())&&!function_exists("ripemd128")) { 
-function ripemd128($data) { return hash("ripemd128",$data); } }
-if(in_array("ripemd160",hash_algos())&&!function_exists("ripemd160")) { 
-function ripemd160($data) { return hash("ripemd160",$data); } }
-if(in_array("ripemd256",hash_algos())&&!function_exists("ripemd256")) { 
-function ripemd256($data) { return hash("ripemd256",$data); } }
-if(in_array("ripemd512",hash_algos())&&!function_exists("ripemd512")) { 
-function ripemd320($data) { return hash("ripemd320",$data); } } }
-// Try and convert IPB 2.0.0 style passwords to iDB style passwords
-function hash2xkey($data,$key,$hash1='md5',$hash2='md5') {
-  return $hash1($hash2($key).$hash2($data)); }
-// Hash two times with md5 and sha1 for DF2k
-function PassHash2x($Text) {
-$Text = md5($Text);
-$Text = sha1($Text);
-return $Text; }
-// Hash two times with hmac-md5 and hmac-sha1
-function PassHash2x2($data,$key,$extdata,$blocksize=64) {
-$extdata2 = hexdec($extdata); $key = $key.$extdata2;
-$Text = hmac($data,$key,"md5").$extdata; 
-$Text = hmac($Text,$key,"sha1").$extdata;
-return base64_encode($Text); }
-function cp($infile,$outfile,$mode="w") { 
-   $contents = file_get_contents($infile);
-   $cpfp = fopen($outfile,$mode);
-   fwrite($cpfp, $contents);
-   fclose($cpfp);
-   return true; }
-/* str_ireplace for PHP below ver. 5 updated // 
-//       by Kazuki Przyborowski - Cool Dude 2k      //
-//      and upaded by Kazuki Przyborowski again     */
-if(!function_exists('str_ireplace')) {
-function str_ireplace($search,$replace,$subject) {
-if(!is_array($search)&&is_array($replace)) {
-       $search = array($search); }
-if(is_array($search)&&!is_array($replace)) {
-       $replace = array($replace); }
-if(is_array($search)&&is_array($replace)) {
-       $sc=count($search); $rc=count($replace); $sn=0;
-       if($sc!=$rc) { return false; }
-while ($sc > $sn) {
-       $search[$sn] = preg_quote($search[$sn], "/");
-       $subject = preg_replace("/".$search[$sn]."/i", $replace[$sn], $subject);
-       ++$sn; } }
-if(!is_array($search)&&!is_array($replace)) {
-$search = preg_quote($search, "/");
-$subject = preg_replace("/".$search."/i", $replace, $subject); }
-return $subject; } }
-/*   Adds httponly to PHP below Ver. 5.2.0   // 
-//       by Kazuki Przyborowski - Cool Dude 2k      */
-function http_set_cookie($name,$value=null,$expire=null,$path=null,$domain=null,$secure=false,$httponly=false) {
-       $mkcookie = null; $expireGMT = null;
-       if(!isset($name)) { 
-       output_error("Error: You need to enter a name for cookie.",E_USER_ERROR); 
-       return false; }
-       if(!isset($expire)) { 
-       output_error("Error: You need to enter a time for cookie to expire.",E_USER_ERROR); 
-       return false; }
-       $expireGMT = gmdate("D, d-M-Y H:i:s \G\M\T", $expire);
-       if(!isset($value)) { $value = null; }
-       if(!isset($httponly)||$httponly==false) {
-       setcookie($name, $value, $expire, $path, $domain, $secure); return true; }
-       if(version_compare(PHP_VERSION,"5.2.0",">=")&&$httponly==true) {
-       setcookie($name, $value, $expire, $path, $domain, $secure, $httponly); return true; }
-       if(version_compare(PHP_VERSION,"5.2.0","<")&&$httponly==true) {
-       $mkcookie = "Set-Cookie: ".rawurlencode($name)."=".rawurlencode($value);
-       $mkcookie = $mkcookie."; expires=".$expireGMT;
-       if(isset($path)&&$path!=null) { $mkcookie = $mkcookie."; path=".$path; }
-       if(isset($domain)&&$domain!=null) { $mkcookie = $mkcookie."; domain=".$domain; }
-       if(isset($secure)&&$secure===true) { $mkcookie = $mkcookie."; secure"; }
-       if(isset($httponly)&&$httponly===true) { $mkcookie = $mkcookie."; HttpOnly"; }
-header($mkcookie, false); return true; } }
-$foobar="fubar"; $$foobar="foobar";
-// Debug info
-function dump_included_files($type="var_dump") {
-       if(!isset($type)) { $type = "var_dump"; }
-       if($type=="print_r") { return print_r(get_included_files()); }
-       if($type=="var_dump") { return var_dump(get_included_files()); }
-       if($type=="var_export") { return var_export(get_included_files()); } }
-function count_included_files() {      return count(get_included_files()); }
-function dump_extensions($type="var_dump") {
-       if(!isset($type)) { $type = "var_dump"; }
-       if($type=="print_r") { return print_r(get_loaded_extensions()); }
-       if($type=="var_dump") { return var_dump(get_loaded_extensions()); }
-       if($type=="var_export") { return var_export(get_loaded_extensions()); } }
-function count_extensions() {  return count(get_loaded_extensions()); }
-?>
\ No newline at end of file
diff --git a/inc/misc/ibbcode.php.bak b/inc/misc/ibbcode.php.bak
deleted file mode 100644 (file)
index e75bd92..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-       iBBCode / iBBTags by Kazuki Przyborowski - http://idb.berlios.net/
-
-    $FileInfo: ibbcode.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="ibbcode.php"||$File3Name=="/ibbcode.php") {
-       require('index.php');
-       exit(); }
-
-/*
-This File has all the Functions for BBTags
-Thanks for the Help of czambran at: 
-http://www.phpfreaks.com/forums/index.php?action=profile;u=15535
-*/ 
-$BoardCharSet = $Settings['charset'];
-function html_decode($matches) {
-       global $BoardCharSet;
-       $matches[1] = str_replace(array("\r", "\r\n", "\n"), " ", $matches[1]);
-       return html_entity_decode($matches[1], ENT_QUOTES, $BoardCharSet); }
-function do_html_bbcode($text) {
-       return preg_replace_callback("/\[DoHTML\](.*?)\[\/DoHTML\]/is","html_decode",$text); }
-function idb_exec_php_handler($buffer) { return $buffer; }
-function exec_php($matches) {
-       global $BoardCharSet;
-       ob_start("idb_exec_php_handler");
-       $matches[1] = html_entity_decode($matches[1], ENT_QUOTES, $BoardCharSet);
-       @eval("?> ".$matches[1]);
-       return ob_get_clean(); }
-function php_execute($text) {
-       return preg_replace_callback("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","exec_php",$text); }
-function bbcode_rot13($matches) { 
-       return str_rot13($matches[1]); }
-function bbcode_base64encode($matches) { 
-       return base64_encode($matches[1]); }
-function bbcode_base64decode($matches) { 
-       return base64_decode($matches[1]); }
-function bbcode_urlencode($matches) { 
-       return urlencode($matches[1]); }
-function bbcode_urldecode($matches) { 
-       return urldecode($matches[1]); }
-function bbcode_date_time($matches) { 
-       return $usercurtime->format($matches[1]); }
-function bbcode_random($matches) { 
-       if(!isset($matches[2])) {
-       return rand(0,$matches[1]); }
-       if(isset($matches[2])) {
-       return rand($matches[1],$matches[2]); } }
-// Pre URL and IMG tags
-if(!function_exists("urlcheck2")) {
-function urlcheck2($matches) {
-global $BoardURL;
-$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", $matches[1], $urlcheck); 
-if(isset($urlcheck[0][0])) { 
-$matches[0] = preg_replace("/\[URL\](.*?)\[\/URL\]/is", " \\1", $matches[0]);
-$matches[0] = preg_replace("/\[URL\=(.*?)\](.*?)\[\/URL\]/is", "<a href=\"\\1\">\\2</a>", $matches[0]);
-$matches[0] = preg_replace("/\[IMG](.*?)\[\/IMG\]/is", "<img src=\"\\1\" alt=\"user posted image\" title=\"user posted image\" />", $matches[0]); 
-$matches[0] = preg_replace("/\[IMG\=(.*?)]([A-Za-z0-9\.\/%\?\!\$\(\)\*\-_\:;,\+\@~\s]+)\[\/IMG\]/is", "<img src=\"\\1\" alt=\"\\2\" title=\"\\2\" />", $matches[0]); }
-return $matches[0]; } }
-function bbcode_parser($text) {
-global $Settings;
-$usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-$usercurtime = new DateTime();
-$usercurtime->setTimezone($usertz);
-$text = preg_replace("/\[EmbedVideo\=&quot;([A-Za-z0-9\.\-_]+)&quot;\]([A-Za-z0-9\.\-_]+)\[\/EmbedVideo\]/is", "[\\1]\\2[/\\1]", $text);
-$text = preg_replace("/\[EmbedVideo\=([A-Za-z0-9\.\-_]+)\]([A-Za-z0-9\.\-_]+)\[\/EmbedVideo\]/is", "[\\1]\\2[/\\1]", $text);
-$text = preg_replace("/\[EmbedMusic\=&quot;([A-Za-z0-9\.\-_]+)&quot;\]([A-Za-z0-9\.\-_]+)\[\/EmbedMusic\]/is", "[\\1]\\2[/\\1]", $text);
-$text = preg_replace("/\[EmbedMusic\=([A-Za-z0-9\.\-_]+)\]([A-Za-z0-9\.\-_]+)\[\/EmbedMusic\]/is", "[\\1]\\2[/\\1]", $text);
-$text = preg_replace("/\[Kiwi6\]([A-Za-z0-9\.\-_]+)\[\/Kiwi6\]/is", "\n<object type=\"application/x-shockwave-flash\" height=\"24\" width=\"290\" data=\"http://kiwi6.com/swf/player.swf\">\n<param name=\"movie\" value=\"http://kiwi6.com/swf/player.swf\" />\n<param name=\"FlashVars\" value=\"playerID=audioplayer&amp;soundFile=http%3A%2F%2Fk003.kiwi6.com%2Fuploads%2Fhotlink%2F\\1\" />\n<param name=\"quality\" value=\"high\" />\n<param name=\"menu\" value=\"false\" />\n<param name=\"allowscriptaccess\" value=\"always\" />\n<param name=\"wmode\" value=\"transparent\" />\n</object>\n", $text);
-$text = preg_replace("/\[YouTube\]([A-Za-z0-9\.\-_]+)\[\/YouTube\]/is", "\n<object type=\"application/x-shockwave-flash\" width=\"480\" height=\"385\" data=\"http://www.youtube.com/v/\\1?fs=1&amp;hl=en_US\">\n<param name=\"\\1\" value=\"http://www.youtube.com/v/\\1?fs=1&amp;hl=en_US\" />\n</object>\n", $text);
-$text = preg_replace("/\[DailyMotion\]([A-Za-z0-9\.\-_]+)\[\/DailyMotion\]/is", "\n<object type=\"application/x-shockwave-flash\" width=\"480\" height=\"385\" data=\"http://www.dailymotion.com/swf/video/\\1\">\n<param name=\"\\1\" value=\"http://www.dailymotion.com/swf/video/\\1\" />\n<param name=\"allowFullScreen\" value=\"true\" />\n<param name=\"allowScriptAccess\" value=\"always\" />\n<param name=\"wmode\" value=\"transparent\" />\n</object>\n", $text);
-$text = preg_replace("/\[Vimeo\]([A-Za-z0-9\.\-_]+)\[\/Vimeo\]/is", "\n<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"225\" data=\"http://vimeo.com/moogaloop.swf?clip_id=\\1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0\">\n<param name=\"\\1\" value=\"http://vimeo.com/moogaloop.swf?clip_id=\\1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0\" />\n<param name=\"allowfullscreen\" value=\"true\" />\n<param name=\"allowscriptaccess\" value=\"always\" />\n</object>\n", $text);
-$text = preg_replace("/\[TinyPic\]([A-Za-z0-9\.\-_]+)\,([A-Za-z0-9\.\-_]+)\[\/TinyPic\]/is", "<img src=\"http://\\1.tinypic.com/\\2\" alt=\"\\2\" title=\"\\2\" />", $text);
-$text = preg_replace("/\[BR\]/is", "<br />", $text);
-$text = preg_replace("/\[HR\]/is", "<hr />", $text);
-$text = preg_replace("/\[SUP\](.*?)\[\/SUP\]/is", "<sup>\\1</sup>", $text);
-$text = preg_replace("/\[SUB\](.*?)\[\/SUB\]/is", "<sub>\\1</sub>", $text);
-$text = preg_replace("/\[BoardName\]/is", $Settings['board_name'], $text);
-$text = preg_replace("/\[BoardURL\]/is", $Settings['idburl'], $text);
-$text = preg_replace("/\[WebSiteURL\]/is", $Settings['weburl'], $text);
-$text = preg_replace("/\{BoardName\}/is", $Settings['board_name'], $text);
-$text = preg_replace("/\{BoardURL\}/is", $Settings['idburl'], $text);
-$text = preg_replace("/\{WebSiteURL\}/is", $Settings['weburl'], $text);
-$text = preg_replace("/\[DATE\]/is", $usercurtime->format('M j Y'), $text);
-//$text = preg_replace("/\[DATE\=(.*?)\]/is", $usercurtime->format("${1}"), $text);
-$text = preg_replace("/\[TIME\]/is", $usercurtime->format('g:i a'), $text);
-//$text = preg_replace("/\[TIME\=(.*?)\]/is", $usercurtime->format("${1}"), $text);
-$text = preg_replace_callback("/\[DATE\=&quot;(.*?)&quot;\]/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\[TIME\=&quot;(.*?)&quot;\]/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\[DATE\=(.*?)\]/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\[TIME\=(.*?)\]/is", "bbcode_date_time", $text);
-$text = preg_replace("/\{DATE\}/is", $usercurtime->format('g:i a'), $text);
-//$text = preg_replace("/\{DATE\=(.*?)\}/is", $usercurtime->format("${1}"), $text);
-$text = preg_replace("/\{TIME\}/is", $usercurtime->format('M j Y'), $text);
-//$text = preg_replace("/\{TIME\=(.*?)\}/is", $usercurtime->format("${1}"), $text);
-$text = preg_replace_callback("/\{DATE\=&quot;(.*?)\"\}/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\{TIME\=&quot;(.*?)\"\}/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\[RAND\=&quot;([\-]?[0-9]+)&quot;\]/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\[RAND\=&quot;([\-]?[0-9]+)&quot;,&quot;([\-]?[0-9]+)&quot;\]/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\[RAND\=&quot;([\-]?[0-9]+),([\-]?[0-9]+)&quot;\]/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\{RAND\=&quot;([\-]?[0-9]+)\"\}/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\{RAND\=&quot;([\-]?[0-9]+),([\-]?[0-9]+)\"\}/is", "bbcode_random", $text);
-$text = preg_replace("/\[Entity\=&quot;([A-Za-z0-9\#]+)&quot;\]/is", "&\\1;", $text);
-$text = preg_replace("/\{Entity\=&quot;([A-Za-z0-9\#]+)\"\}/is", "&\\1;", $text);
-$text = preg_replace_callback("/\{DATE\=(.*?)\}/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\{TIME\=(.*?)\}/is", "bbcode_date_time", $text);
-$text = preg_replace_callback("/\[RAND\=([\-]?[0-9]+)\]/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\[RAND\=([\-]?[0-9]+),([\-]?[0-9]+)\]/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\{RAND\=([\-]?[0-9]+)\}/is", "bbcode_random", $text);
-$text = preg_replace_callback("/\{RAND\=([\-]?[0-9]+),([\-]?[0-9]+)\}/is", "bbcode_random", $text);
-$text = preg_replace("/\[Entity\=([A-Za-z0-9\#]+)\]/is", "&\\1;", $text);
-$text = preg_replace("/\{Entity\=([A-Za-z0-9\#]+)\}/is", "&\\1;", $text);
-$text = preg_replace("/\[B\](.*?)\[\/B\]/is", "<span style=\"font-weight: bold;\">\\1</span>", $text);
-$text = preg_replace("/\[BOLD\](.*?)\[\/BOLD\]/is", "<span style=\"font-weight: bold;\">\\1</span>", $text);
-$text = preg_replace("/\[I\](.*?)\[\/I\]/is", "<span style=\"font-style: italic;\">\\1</span>", $text);
-$text = preg_replace("/\[ITALIC\](.*?)\[\/ITALIC\]/is", "<span style=\"font-style: italic;\">\\1</span>", $text);
-$text = preg_replace("/\[OBLIQUE\](.*?)\[\/OBLIQUE\]/is", "<span style=\"font-style: oblique;\">\\1</span>", $text);
-$text = preg_replace("/\[S\](.*?)\[\/S\]/is", "<span style=\"font-style: strike;\">\\1</span>", $text);
-$text = preg_replace("/\[STRIKE\](.*?)\[\/STRIKE\]/is", "<span style=\"font-style: strike;\">\\1</span>", $text);
-$text = preg_replace("/\[U\](.*?)\[\/U\]/is", "<span style=\"text-decoration: underline;\">\\1</span>", $text);
-$text = preg_replace("/\[O\](.*?)\[\/O\]/is", "<span style=\"text-decoration: overline;\">\\1</span>", $text);
-$text = preg_replace("/\[CENTER\](.*?)\[\/CENTER\]/is", "<span style=\"text-align: center;\">\\1</span>", $text);
-$text = preg_replace("/\[LTR\](.*?)\[\/LTR\]/is", "<span style=\"direction: rtl;\">\\1</span>", $text);
-$text = preg_replace("/\[FONT\=&quot;([A-Za-z0-9\,\s]+)&quot;\](.*?)\[\/FONT\]/is", "<span style=\"font-family: \\1px;\">\\2</span>", $text);
-$text = preg_replace("/\[DIV\=&quot;([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)&quot;\](.*?)\[\/DIV\]/is", "<div style=\"\\1\">\\2</div>", $text);
-$text = preg_replace("/\[SPAN\=&quot;([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)&quot;\](.*?)\[\/SPAN\]/is", "<span style=\"\\1\">\\2</span>", $text);
-$text = preg_replace("/\[SIZE\=&quot;([0-9]+)&quot;\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1px;\">\\2</span>", $text);
-$text = preg_replace("/\[SIZE\=&quot;([0-9]+)\%&quot;\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1%;\">\\2</span>", $text);
-$text = preg_replace("/\[SIZE\=&quot;([0-9]+)(em|pt|px)&quot;\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1\\2;\">\\3</span>", $text);
-$text = preg_replace("/\[COLOR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/COLOR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[COLOUR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOUR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOUR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOUR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOUR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOUR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOUR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOUR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[ALIGN=\"(left|center|right|justify)&quot;\](.*?)\[\/ALIGN\]/is", "<div style=\"text-align: \\1;\">\\2</div>", $text);
-$text = preg_replace("/\[VALIGN=\"(.*?)&quot;\](.*?)\[\/VALIGN\]/is", "<div style=\"vertical-align: \\1;\">\\2</div>", $text);
-$text = preg_replace("/\[FLOAT=\"(left|right)&quot;\](.*?)\[\/FLOAT\]/is", "<div style=\"float: \\1;\">\\2</div>", $text);
-$text = preg_replace("/\[FONT\=([A-Za-z0-9\,\s]+)\](.*?)\[\/FONT\]/is", "<span style=\"font-family: \\1px;\">\\2</span>", $text);
-$text = preg_replace("/\[DIV\=([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)\](.*?)\[\/DIV\]/is", "<div style=\"\\1\">\\2</div>", $text);
-$text = preg_replace("/\[SPAN\=([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)\](.*?)\[\/SPAN\]/is", "<span style=\"\\1\">\\2</span>", $text);
-$text = preg_replace("/\[COMMENT\](.*?)\[COMMENT\]/is", "<!--\\1-->", $text);
-$text = preg_replace("/\[SIZE\=([0-9]+)\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1px;\">\\2</span>", $text);
-$text = preg_replace("/\[SIZE\=([0-9]+)\%\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1%;\">\\2</span>", $text);
-$text = preg_replace("/\[SIZE\=([0-9]+)(em|pt|px)\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1\\2;\">\\3</span>", $text);
-$text = preg_replace("/\[COLOR\=([A-Za-z0-9]+)\](.*?)\[\/COLOR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOR\=\#([A-Za-z0-9]+)\](.*?)\[\/COLOR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/COLOR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOR\=([A-Za-z0-9]+)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOR\=\#([A-Za-z0-9]+)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[COLOUR\=([A-Za-z0-9]+)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOUR\=\#([A-Za-z0-9]+)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[COLOUR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOUR\=([A-Za-z0-9]+)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOUR\=\#([A-Za-z0-9]+)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
-$text = preg_replace("/\[BGCOLOUR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
-$text = preg_replace("/\[ALIGN=(left|center|right|justify)\](.*?)\[\/ALIGN\]/is", "<div style=\"text-align: \\1;\">\\2</div>", $text);
-$text = preg_replace("/\[VALIGN=(.*?)\](.*?)\[\/VALIGN\]/is", "<div style=\"vertical-align: \\1;\">\\2</div>", $text);
-$text = preg_replace("/\[FLOAT=(left|right)\](.*?)\[\/FLOAT\]/is", "<div style=\"float: \\1;\">\\2</div>", $text);
-// Sub URL and IMG tags
-$text = preg_replace_callback("/\[URL](.*?)\[\/URL\]/is", "urlcheck2", $text);
-$text = preg_replace("/\[URL\=&quot;(.*?)&quot;\](.*?)\[\/URL\]/is", "[URL=\\1]\\2[/URL]", $text);
-$text = preg_replace_callback("/\[URL\=(.*?)\](.*?)\[\/URL\]/is", "urlcheck2", $text);
-$text = preg_replace_callback("/\[IMG](.*?)\[\/IMG\]/is", "urlcheck2", $text);
-$text = preg_replace("/\[IMG\=&quot;(.*?)&quot;\](.*?)\[\/IMG\]/is", "[IMG=\\1]\\2[/IMG]", $text);
-$text = preg_replace_callback("/\[IMG\=(.*?)](.*?)\[\/IMG\]/is", "urlcheck2", $text);
-$text = preg_replace_callback("/\[URLENCODE\](.*?)\[\/URLENCODE\]/is","bbcode_urlencode",$text);
-$text = preg_replace_callback("/\[URLDECODE\](.*?)\[\/URLDECODE\]/is","bbcode_urldecode",$text);
-$text = preg_replace_callback("/\[BASE64\](.*?)\[\/BASE64\]/is","bbcode_base64encode",$text);
-$text = preg_replace_callback("/\[BASE64\=ENCODE\](.*?)\[\/BASE64\]/is","bbcode_base64encode",$text);
-$text = preg_replace_callback("/\[BASE64\=DECODE\](.*?)\[\/BASE64\]/is","bbcode_base64decode",$text);
-$text = preg_replace_callback("/\[ROT13\](.*?)\[\/ROT13\]/is","bbcode_rot13",$text);
-$text = preg_replace("/\[JavaScript\](.*?)\[\/JavaScript\]/is","[DoHTML]\n&lt;script type=&quot;text/javascript&quot;&gt;\n\\1\n&lt;/script&gt;\n[/DoHTML]",$text);
-return $text; }
-function ibbcode_parser($text) { return bbcode_parser($text); }
-?>
\ No newline at end of file
diff --git a/inc/misc/index.php.bak b/inc/misc/index.php.bak
deleted file mode 100644 (file)
index de16c80..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/misc/iuntar.php.bak b/inc/misc/iuntar.php.bak
deleted file mode 100644 (file)
index 6918b9b..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iUnTar ver. 4.7 by Kazuki Przyborowski & Josep Sanz Campderros
-
-    $FileInfo: iuntar.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="iuntar.php"||$File3Name=="/iuntar.php") {
-       require('index.php');
-       exit(); }
-
-// PHP iUnTAR Version 4.7
-// license: Revised BSD license
-// Kazuki Przyborowski (http://ja.gamemaker2k.org/)
-// Josep Sanz Campderros (http://saltos.net/)
-function untar($tarfile,$outdir="./",$chmod=null,$extract=true,$lsonly=false,$findfile=null) {
-$TarSize = filesize($tarfile);
-$TarSizeEnd = $TarSize - 1024;
-if($extract!==true&&$extract!==false) {
-       $extract = false; }
-if($lsonly!==true&&$lsonly!==false) {
-       $lsonly = false; }
-if($extract===true) { 
-       $lsonly = false; }
-if($extract===true) {
-if($outdir!=""&&!file_exists($outdir)) {
-       mkdir($outdir,0777); } }
-$thandle = fopen($tarfile, "rb");
-$i = 0;
-if($extract===false) {
-       $FileArray = null; $i = 0; }
-$outdir = preg_replace('{/$}', '', $outdir)."/";
-if(isset($findfile)) {
-$qfindfile = preg_quote($findfile,"/"); }
-if(!isset($findfile)) {
-$qfindfile = null; }
-while (ftell($thandle)<$TarSizeEnd) {
-       $FileName = null;
-       $FileMode = null;
-       $OwnerID = null;
-       $GroupID = null;
-       $FileSize = null;
-       $LastEdit = null;
-       $Checksum = null;
-       $FileType = null;
-       $LinkedFile = null;
-       $FileContent = null;
-       $FileName = $outdir.trim(fread($thandle,100));
-       fseek($thandle,56,SEEK_CUR);
-       $FileType = trim(fread($thandle,1));
-       fseek($thandle,-57,SEEK_CUR);
-       if($findfile!==null&&$FileType!="L"&&!preg_match("/".$qfindfile."/",$FileName)) {
-               fseek($thandle,8,SEEK_CUR);
-               fseek($thandle,8,SEEK_CUR);
-               fseek($thandle,8,SEEK_CUR);
-               $FileSize = octdec(trim(fread($thandle,12)));
-               fseek($thandle,12,SEEK_CUR);
-               fseek($thandle,8,SEEK_CUR);
-               $FileType = trim(fread($thandle,1));
-               fseek($thandle,100,SEEK_CUR);
-               fseek($thandle,255,SEEK_CUR); 
-               if($FileType=="0"||$FileType=="7") {
-                       fseek($thandle,$FileSize,SEEK_CUR); } }
-       if($findfile===null||$FileType=="L"||preg_match("/".$qfindfile."/",$FileName)) {
-       $FileMode = trim(fread($thandle,8));
-       if($chmod===null) {
-               $FileCHMOD = octdec("0".substr($FileMode,-3)); }
-       if($chmod!==null) {
-               $FileCHMOD = $chmod; }
-               $OwnerID = trim(fread($thandle,8));
-               $GroupID = trim(fread($thandle,8));
-               $FileSize = octdec(trim(fread($thandle,12)));
-               $LastEdit = octdec(trim(fread($thandle,12)));
-               $Checksum = octdec(trim(fread($thandle,8)));
-               $FileType = trim(fread($thandle,1));
-               $LinkedFile = trim(fread($thandle,100));
-               fseek($thandle,255,SEEK_CUR); 
-                       // LongLink support added by Josep Sanz Campderros
-                       if($FileType=="L"&&$FileSize>0) {
-                               $FileName = $outdir.trim(fread($thandle,$FileSize));
-                               fseek($thandle,512-$FileSize,SEEK_CUR);
-                               fseek($thandle,100,SEEK_CUR);
-                               $FileMode = trim(fread($thandle,8));
-                               if($chmod===null) {
-                                       $FileCHMOD = octdec("0".substr($FileMode,-3)); }
-                               if($chmod!==null) {
-                                       $FileCHMOD = $chmod; }
-                               $OwnerID = trim(fread($thandle,8));
-                               $GroupID = trim(fread($thandle,8));
-                               $FileSize = octdec(trim(fread($thandle,12)));
-                               $LastEdit = trim(fread($thandle,12));
-                               $Checksum = trim(fread($thandle,8));
-                               $FileType = trim(fread($thandle,1));
-                               $LinkedFile = trim(fread($thandle,100));
-                               fseek($thandle,255,SEEK_CUR); } }
-               if($findfile===null||preg_match("/".$qfindfile."/",$FileName)) {
-               if($FileType=="0"||$FileType=="7") {
-                       if($lsonly===true) {
-                       fseek($thandle,$FileSize,SEEK_CUR); }
-                       if($lsonly===false) {
-                       // Empty files support added by Josep Sanz Campderros
-                       if($FileSize===0) {
-                       $FileContent = ""; }
-                       if($FileSize>0) {
-                       $FileContent = fread($thandle,$FileSize); } } }
-               if($FileType=="1") {
-                       $FileContent = null; }
-               if($FileType=="2") {
-                       $FileContent = null; }
-               if($FileType=="5") {
-                       $FileContent = null; }
-               if($FileType=="0"||$FileType=="7") {
-                       if($extract===true) {
-                               $subhandle = fopen($FileName, "wb+");
-                               fwrite($subhandle,$FileContent,$FileSize);
-                               fclose($subhandle);
-                               chmod($FileName,$FileCHMOD); } }
-               if($FileType=="1") {
-                       if($extract===true) {
-                               link($FileName,$LinkedFile); } }
-               if($FileType=="2") {
-                       if($extract===true) {
-                               symlink($LinkedFile,$FileName); } }
-               if($FileType=="5") {
-                       if($extract===true) {
-                               mkdir($FileName,$FileCHMOD); } }
-               if($FileType=="0"||$FileType=="1"||$FileType=="2"||$FileType=="5"||$FileType=="7") {
-                       if($extract===false) { 
-                               $FileArray[$i]['FileName'] = $FileName;
-                               $FileArray[$i]['FileMode'] = $FileMode;
-                               $FileArray[$i]['OwnerID'] = $OwnerID;
-                               $FileArray[$i]['GroupID'] = $GroupID;
-                               $FileArray[$i]['FileSize'] = $FileSize;
-                               $FileArray[$i]['LastEdit'] = $LastEdit;
-                               $FileArray[$i]['Checksum'] = $Checksum;
-                               $FileArray[$i]['FileType'] = $FileType;
-                               $FileArray[$i]['LinkedFile'] = $LinkedFile;
-                               if($lsonly===false) {
-                               $FileArray[$i]['FileContent'] = $FileContent; } } } }
-               //touch($FileName,$LastEdit);
-               if($extract===false&&$findfile===null&&isset($FileArray[$i]['FileName'])) { ++$i; }
-               if($extract===false) {
-               if($findfile!==null&&preg_match("/".$qfindfile."/",$FileName)&&isset($FileArray[$i]['FileName'])) { ++$i; } }
-               if($extract===true) {
-               if($findfile!==null&&preg_match("/".$qfindfile."/",$FileName)) { ++$i; } }
-               if(($FileType=="0"||$FileType=="7")&$FileSize>0) {
-                       $CheckSize = 512;
-                       while ($CheckSize<$FileSize) {
-                               if($CheckSize<$FileSize) {
-                                       $CheckSize = $CheckSize + 512; } }
-                                       $SeekSize = $CheckSize - $FileSize;
-                                       fseek($thandle,$SeekSize,SEEK_CUR); } }
-               fclose($thandle);
-               if($extract===true) {
-                       return true; }
-               if($extract===false) {
-                       return $FileArray; } }
-function iuntar($tarfile,$outdir="./",$chmod=null,$extract=true,$lsonly=false,$findfile=null) {
-       return untar($tarfile,$outdir,$chmod,$extract,$lsonly,$findfile); }
-?>
\ No newline at end of file
diff --git a/inc/misc/killglobals.php.bak b/inc/misc/killglobals.php.bak
deleted file mode 100644 (file)
index ee49bcb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-       Kill Register Globals (Register Globals are very lame we dont need them anyways. :P)
-
-    $FileInfo: killglobals.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="killqlobals.php"||$File3Name=="/killqlobals.php") {
-       require('index.php');
-       exit(); }
-function unregister_globals() {
-   $REQUEST = $_REQUEST;
-   $GET = $_GET;
-   $POST = $_POST;
-   $COOKIE = $_COOKIE;
-   if(isset($_SESSION)) {
-   $SESSION = $_SESSION; }
-   $FILES = $_FILES;
-   $ENV = $_ENV;
-   $SERVER = $_SERVER;
-   foreach($GLOBALS as $key => $value) {
-   if($key!='GLOBALS') {
-   unset($GLOBALS[$key]); } }
-   $_REQUEST = $REQUEST;
-   $_GET = $GET;
-   $_POST = $POST;
-   $_COOKIE = $COOKIE;
-   if(isset($SESSION)) {
-   $_SESSION = $SESSION; }
-   $_FILES = $FILES;
-   $_ENV = $ENV;
-   $_SERVER = $SERVER; }
-unregister_globals();
-?>
\ No newline at end of file
diff --git a/inc/misc/setcheck.php.bak b/inc/misc/setcheck.php.bak
deleted file mode 100644 (file)
index ceea8c0..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: setcheck.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="setcheck.php"||$File3Name=="/setcheck.php") {
-       require('index.php');
-       exit(); }
-if(!isset($Settings['showverinfo'])) { $Settings['showverinfo'] = "on"; }
-if(!isset($_GET['debug'])) { $_GET['debug'] = false; }
-if(!isset($GZipEncode)) { $GZipEncode = array("Type" => "none"); }
-if(!is_array($GZipEncode)) { $GZipEncode = array("Type" => "none"); }
-if(!isset($preact)) { $preact = null; }
-if(!isset($Settings['hash_type'])) { $Settings['hash_type'] = null; }
-if(!isset($Error)) { $Error = null; }
-if(!isset($passright)) { $passright = null; }
-$SQLimit = null;
-if(!isset($Settings['sqltype'])) {
-       $Settings['sqltype'] = "mysql"; }
-$Settings['sqltype'] = strtolower($Settings['sqltype']);
-if($Settings['sqltype']!="mysql"&&
-       $Settings['sqltype']!="mysqli"&&
-       $Settings['sqltype']!="pgsql"&&
-       $Settings['sqltype']!="sqlite"&&
-       $Settings['sqltype']!="cubrid") {
-       $Settings['sqltype'] = "mysql"; }
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="sqlite"||
-       $Settings['sqltype']=="cubrid") {
-       $SQLimit = "LIMIT %i,%i"; }
-if($Settings['sqltype']=="pgsql") {
-       $SQLimit = "OFFSET %i LIMIT %i"; }
-if(!isset($Settings['enable_pathinfo'])) {
-  $Settings['enable_pathinfo'] = "off";  }
-if($Settings['enable_pathinfo']!="on"&&
-       $Settings['enable_pathinfo']!="off") {
-  $Settings['enable_pathinfo'] = "off";  }
-$Settings['sessionid_in_urls'] = "off";
-if(!isset($Settings['sessionid_in_urls'])) {
-  $Settings['sessionid_in_urls'] = "off";  }
-if($Settings['sessionid_in_urls']!="on"&&
-       $Settings['sessionid_in_urls']!="off") {
-  $Settings['sessionid_in_urls'] = "off";  }
-if(!isset($Settings['use_captcha'])) {
-       $Settings['use_captcha'] = "on"; }
-if(isset($Settings['use_captcha'])) {
-       if($Settings['use_captcha']!="on"&&
-               $Settings['use_captcha']!="off") {
-       $Settings['use_captcha'] = "on"; } }
-if(!isset($Settings['captcha_guest'])) {
-       $Settings['captcha_guest'] = "on"; }
-if(isset($Settings['captcha_guest'])) {
-       if($Settings['captcha_guest']!="on"&&
-               $Settings['captcha_guest']!="off") {
-       $Settings['captcha_guest'] = "on"; } }
-if(!isset($Settings['captcha_clean'])) {
-       $Settings['captcha_clean'] = "off"; }
-if(isset($Settings['captcha_clean'])) {
-       if($Settings['captcha_clean']!="on"&&
-               $Settings['captcha_clean']!="off") {
-       $Settings['captcha_clean'] = "on"; } }
-$sidurls = $Settings['sessionid_in_urls'];
-if(!isset($Settings['board_offline'])) {
-  $Settings['board_offline'] = "off";  }
-if($Settings['board_offline']!="on"&&
-       $Settings['board_offline']!="off") {
-  $Settings['board_offline'] = "off";  }
-$oldusername = null; $oldtopicname = null; $ext = null;
-if($Settings['DefaultTheme']==null) {
-       $Settings['DefaultTheme'] = "iDB"; }
-if($Settings['DefaultTimeZone']==null) {
-       $Settings['DefaultTimeZone'] = date_default_timezone_get(); }
-if(!isset($Settings['use_captcha'])) {
-       $Settings['use_captcha'] = "off"; }
-if($Settings['use_captcha']!="on"&&
-       $Settings['use_captcha']!="off") { 
-       $Settings['use_captcha'] = "off"; }
-if(!isset($Settings['captcha_clean'])) {
-       $Settings['captcha_clean'] = "off"; }
-if($Settings['captcha_clean']!="on"&&
-       $Settings['captcha_clean']!="off") { 
-       $Settings['captcha_clean'] = "off"; }
-if($Settings['enable_rss']!="on"&&
-       $Settings['enable_rss']!="on") { 
-       $Settings['enable_rss'] = "off"; }
-if($Settings['enable_rss']=="on") { 
-    $Settings['enable_rss'] = "on"; }
-if (file_exists("themes/iDB/settings.php")) {
-       $FallBack['DefaultTheme'] = "iDB"; }
-if (!file_exists("themes/iDB/settings.php")) {
-       $FallBack['DefaultTheme'] = "Gray"; }
-if($Settings['DefaultTheme']!=null) {
-if (file_exists("themes/".$Settings['DefaultTheme']."/settings.php")) {
-/* The file Skin Exists */ }
-else { $Settings['DefaultTheme']=$FallBack['DefaultTheme'];
-/* The file Skin Dose Not Exists */ } }
-if($Settings['TestReferer']!="on"&&
-       $Settings['TestReferer']!="off") {
-       $Settings['TestReferer'] = "off"; }
-if($Settings['charset']==null) {
-       $Settings['charset'] = "iso-8859-15"; }
-if($Settings['qstr']==null) {
-       $Settings['qstr'] = "&"; }
-if($Settings['qsep']==null) {
-       $Settings['qsep'] = "="; }
-if($Settings['qsep']=="#"||
-       $Settings['qstr']=="#") {
-       $Settings['qstr'] = "&";
-       $Settings['qsep'] = "="; }
-if($Settings['qsep']==$Settings['qstr']) {
-       $Settings['qstr'] = "&";
-       $Settings['qsep'] = "="; }
-if($Settings['qstr']=="/"||
-       $Settings['qstr']=="&") {
-       $Settings['qsep'] = "="; }
-/*if($Settings['qstr']!="&"&&
-       $Settings['qstr']!="/") {
-qstring($Settings['qstr'],$Settings['qsep']); }*/
-if(!isset($_GET['page'])) { $_GET['page'] = null; }
-if(!isset($_GET['act'])) { $_GET['act'] = null; }
-if(!isset($_POST['act'])) { $_POST['act'] = null; }
-if(!isset($_GET['id'])) { $_GET['id'] = null; } 
-if(!isset($_GET['debug'])) { $_GET['debug'] = "false"; }
-if(!isset($_GET['post'])) { $_GET['post'] = null; }
-if(!isset($_POST['License'])) { $_POST['License'] = null; }
-if(!isset($Settings['enable_https'])) {
-  $Settings['enable_https'] = "off";  }
-if($Settings['enable_https']!="on"&&
-       $Settings['enable_https']!="off") {
-  $Settings['enable_https'] = "off";  }
-if(!isset($Settings['file_ext'])||
-       $Settings['file_ext']==null) {
-       $Settings['file_ext'] = ".php"; }
-if(!isset($Settings['rss_ext'])||
-       $Settings['rss_ext']==null) {
-       $Settings['rss_ext'] = ".php"; }
-if(!isset($Settings['js_ext'])||
-       $Settings['js_ext']==null) {
-       $Settings['js_ext'] = ".js"; }
-if(!isset($Settings['add_power_by'])) {
-  $Settings['add_power_by'] = "off";  }
-if($Settings['add_power_by']=="on") {
-$idbpowertitle = " (Powered by ".$iDB.")";
-$itbpowertitle = " (Powered by ".$iTB.")"; }
-if($Settings['add_power_by']!="on") {
-$idbpowertitle = null;
-$itbpowertitle = null; }
-if($Settings['GuestGroup']==null) {
-       $Settings['GuestGroup'] = "Guest"; }
-if($Settings['MemberGroup']==null) {
-       $Settings['MemberGroup'] = "Member"; }
-if($Settings['ValidateGroup']==null&&
-       $Settings['AdminValidate']=="on") {
-$Settings['ValidateGroup'] = "Validate"; }
-if($Settings['html_type']=="html4") { 
-       $Settings['html_type'] = "html5"; }
-/*if($_GET['debug']!="off"||$_GET['debug']=="on") {
-       output_add_rewrite_var("amp;debug",$_GET['debug']); }*/
-if (!isset($_GET['action'])) { $_GET['action'] = null; }
-if (!isset($_GET['activity'])) { $_GET['activity'] = null; }
-if (!isset($_GET['function'])) { $_GET['function'] = null; }
-if (!isset($_GET['mode'])) { $_GET['mode'] = null; }
-if (!isset($_GET['show'])) { $_GET['show'] = null; }
-if (!isset($_GET['do'])) { $_GET['do'] = null; }
-if ($_GET['act']==null&&$_GET['action']!=null) { $_GET['act']=$_GET['action']; }
-if ($_GET['act']==null&&$_GET['activity']!=null) { $_GET['act']=$_GET['activity']; }
-if ($_GET['act']==null&&$_GET['function']!=null) { $_GET['act']=$_GET['function']; }
-if ($_GET['act']==null&&$_GET['mode']!=null) { $_GET['act']=$_GET['mode']; }
-if ($_GET['act']==null&&$_GET['show']!=null) { $_GET['act']=$_GET['show']; }
-if ($_GET['act']==null&&$_GET['do']!=null) { $_GET['act']=$_GET['do']; }
-if ($_GET['act']=="idx"||$_GET['act']=="View") { $_GET['act']="view"; }
-if ($_GET['act']=="Lo-Fi"||$_GET['act']=="lo-fi") { $_GET['act']="lowview"; }
-if ($_GET['act']=="Low-View"||$_GET['act']=="low-view") { $_GET['act']="lowview"; }
-if ($_GET['act']=="LowView"||$_GET['act']=="loview") { $_GET['act']="lowview"; }
-if ($_GET['act']=="iDBInfo") { header('Location: http://sourceforge.net/projects/intdb/'); }
-if ($_GET['act']=="iDBSite") { header('Location: http://intdb.sourceforge.net/'); }
-if ($_GET['act']=="OldiDBInfo") { header('Location: http://developer.berlios.de/projects/idb/'); }
-if ($_GET['act']=="OldiDBSite") { header('Location: http://idb.berlios.de/'); }
-if ($_GET['act']=="DF2kInfo") { header('Location: http://developer.berlios.de/projects/df2k/'); }
-if ($_GET['act']=="DF2kSite") { header('Location: http://df2k.berlios.de/'); }
-if ($_GET['act']=="GM2kSite") { header('Location: http://upload.idb.s1.jcink.com/'); }
-?>
diff --git a/inc/misc/sql/cubrid.php.bak b/inc/misc/sql/cubrid.php.bak
deleted file mode 100644 (file)
index 0361d80..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: cubrid.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="cubrid.php"||$File3Name=="/cubrid.php") {
-       @header('Location: index.php');
-       exit(); }
-// CUBRID Functions.
-function sql_error($link=null) {
-       $result = cubrid_error_msg();
-       return $result; }
-function sql_errno($link=null) {
-       $result = cubrid_error_code();
-       return $result; }
-function sql_errorno($link=null) {
-       $result = sql_error();
-       $resultno = sql_errno();
-       $result = $resultno.": ".$result;
-       return $result; }
-// Execute a query :P
-$NumQueries = 0;
-function sql_query($query,$link=null) {
-global $NumQueries;
-if(isset($link)) {
-       $result = cubrid_query($query,$link); }
-if(!isset($link)) {
-       $result = cubrid_query($query); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($result!==false) {
-       ++$NumQueries;
-       return $result; } }
-//Fetch Number of Rows
-function sql_num_rows($result) {
-$num = cubrid_num_rows($result);
-if ($num===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $num; }
-// Connect to mysql database
-function sql_connect_db($server,$username,$password,$database=null,$new_link=false) {
-if($new_link!==true) { $new_link = false; }
-if($database===null) {
-return true; }
-if($database!==null) {
-$myport = "30000";
-$hostex = explode(":", $server);
-if(isset($hostex[1])&&
-       !is_numeric($hostex[1])) {
-       $hostex[1] = $myport; }
-if(isset($hostex[1])) { 
-       $server = $hostex[0];
-       $myport = $hostex[1]; }
-$link = cubrid_connect($server,$myport,$database,$username,$password); 
-cubrid_set_autocommit($link,CUBRID_AUTOCOMMIT_TRUE); }
-if ($link===false) {
-    output_error("Not connected: ".$sqliteerror,E_USER_ERROR);
-       return false; }
-return $link; }
-function sql_disconnect_db($link=null) {
-return cubrid_disconnect($link); }
-// Query Results :P
-function sql_result($result,$row,$field=0) {
-if(isset($field)&&!is_numeric($field)) {
-       $field = strtolower($field); }
-$value = cubrid_result($result, $row, $field);
-if ($value===false) { 
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $value; }
-// Free Results :P
-function sql_free_result($result) {
-$fresult = cubrid_free_result($result);
-if ($fresult===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-$fresult = cubrid_close_request($result);
-if ($fresult===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($fresult===true) {
-       return true; } }
-//Fetch Results to Array
-function sql_fetch_array($result,$result_type=CUBRID_BOTH) {
-$row = cubrid_fetch_array($result,$result_type);
-       return $row; }
-//Fetch Results to Associative Array
-function sql_fetch_assoc($result) {
-$row = cubrid_fetch_assoc($result);
-       return $row; }
-//Fetch Row Results
-function sql_fetch_row($result) {
-$row = cubrid_fetch_row($result);
-       return $row; }
-//Get Server Info
-function sql_server_info($link=null) {
-if(isset($link)) {
-       $result = cubrid_get_server_info($link); }
-if(!isset($link)) {
-       $result = cubrid_get_server_info(); }
-       return $result; }
-//Get Client Info
-function sql_client_info($link=null) {
-       $result = cubrid_get_client_info();
-       return $result; }
-function sql_escape_string($string,$link=null) {
-if(isset($link)) {
-       $string = cubrid_real_escape_string($string,$link); }
-if(!isset($link)) {
-       $string = cubrid_real_escape_string($string); }
-if ($string===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $string; }
-// SafeSQL Lite Source Code by Cool Dude 2k
-// Make SQL Query's safe
-function sql_pre_query($query_string,$query_vars) {
-   $query_array = array(array("%i","%I","%F","%S"),array("%d","%d","%f","%s"));
-   $query_string = str_replace($query_array[0], $query_array[1], $query_string);
-   if (get_magic_quotes_gpc()) {
-       $query_vars  = array_map("stripslashes", $query_vars); }
-   $query_vars = array_map("sql_escape_string", $query_vars);
-   $query_val = $query_vars;
-$query_num = count($query_val);
-$query_i = 0;
-while ($query_i < $query_num) {
-$query_is = $query_i+1;
-$query_val[$query_is] = $query_vars[$query_i];
-++$query_i; }
-   $query_val[0] = $query_string;
-   return call_user_func_array("sprintf",$query_val); }
-function sql_set_charset($charset,$link=null) {
-       return true; }
-/*
-function sql_set_charset($charset,$link=null) {
-if(function_exists('mysql_set_charset')===false) {
-if(!isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'",$link); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if(!isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'",$link); } 
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===true) {
-if(isset($link)) {
-       $result = mysql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = mysql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===false) {
-function mysql_set_charset($charset,$link) {
-if(isset($link)) {
-       $result = sql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = sql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-*/
-// Get next id for stuff
-function sql_get_next_id($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SELECT ".$tablepre.$table."_ai_id.current_value;", array());
-if(!isset($link)) {
-       $result = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-       return sql_result($getnextidr,0);
-       sql_free_result($getnextidr); }
-// Get number of rows for table
-function sql_get_num_rows($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SHOW TABLE STATUS LIKE '".$tablepre.$table."'", array());
-if(!isset($link)) {
-       $getnextidr = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-   $getnextid = sql_fetch_assoc($getnextidr);
-   return $getnextid['Rows'];
-   @sql_free_result($getnextidr); }
-?>
diff --git a/inc/misc/sql/index.php.bak b/inc/misc/sql/index.php.bak
deleted file mode 100644 (file)
index fa2d8e3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/misc/sql/mysql.php.bak b/inc/misc/sql/mysql.php.bak
deleted file mode 100644 (file)
index 9182d87..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: mysql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="mysql.php"||$File3Name=="/mysql.php") {
-       @header('Location: index.php');
-       exit(); }
-// MySQL Functions.
-function sql_error($link=null) {
-if(isset($link)) {
-       $result = mysql_error($link); }
-if(!isset($link)) {
-       $result = mysql_error(); }
-if ($result=="") {
-       return ""; }
-       return $result; }
-function sql_errno($link=null) {
-if(isset($link)) {
-       $result = mysql_errno($link); }
-if(!isset($link)) {
-       $result = mysql_errno(); }
-if ($result===0) {
-       return 0; }
-       return $result; }
-function sql_errorno($link=null) {
-if(isset($link)) {
-       $result = sql_error($link);
-       $resultno = sql_errno($link); }
-if(!isset($link)) {
-       $result = sql_error();
-       $resultno = sql_errno(); }
-if ($result==""&&$result===0) {
-       return ""; }
-if ($result!=""&&$result!==0) {
-       $result = $resultno.": ".$result; }
-       return $result; }
-// Execute a query :P
-$NumQueries = 0;
-function sql_query($query,$link=null) {
-global $NumQueries;
-if(isset($link)) {
-       $result = mysql_query($query,$link); }
-if(!isset($link)) {
-       $result = mysql_query($query); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($result!==false) {
-       ++$NumQueries;
-       return $result; } }
-//Fetch Number of Rows
-function sql_num_rows($result) {
-$num = mysql_num_rows($result);
-if ($num===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $num; }
-// Connect to mysql database
-function sql_connect_db($server,$username,$password,$database=null,$new_link=false) {
-if($new_link!==true) { $new_link = false; }
-if($new_link!==true||$new_link===false) {
-$link = mysql_connect($server,$username,$password); }
-if($new_link===true) {
-$link = mysql_connect($server,$username,$password,$new_link); }
-if ($link===false) {
-    output_error("Not connected: ".sql_error(),E_USER_ERROR);
-       return false; }
-if($database!==null) {
-$dlink = mysql_select_db($database,$link);
-if ($dlink===false) {
-    output_error("Can't use database ".$database.": ".sql_error(),E_USER_ERROR);
-       return false; } }
-$result = sql_query("SET SESSION SQL_MODE='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO';",$link);
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-return $link; }
-function sql_disconnect_db($link=null) {
-return mysql_close($link); }
-// Query Results :P
-function sql_result($result,$row,$field=0) {
-$value = mysql_result($result, $row, $field);
-if ($value===false) { 
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $value; }
-// Free Results :P
-function sql_free_result($result) {
-$fresult = mysql_free_result($result);
-if ($fresult===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($fresult===true) {
-       return true; } }
-//Fetch Results to Array
-function sql_fetch_array($result,$result_type=MYSQL_BOTH) {
-$row = mysql_fetch_array($result,$result_type);
-       return $row; }
-//Fetch Results to Associative Array
-function sql_fetch_assoc($result) {
-$row = mysql_fetch_assoc($result);
-       return $row; }
-//Fetch Row Results
-function sql_fetch_row($result) {
-$row = mysql_fetch_row($result);
-       return $row; }
-//Get Server Info
-function sql_server_info($link=null) {
-if(isset($link)) {
-       $result = mysql_get_server_info($link); }
-if(!isset($link)) {
-       $result = mysql_get_server_info(); }
-       return $result; }
-//Get Client Info
-function sql_client_info($link=null) {
-       $result = mysql_get_client_info();
-       return $result; }
-function sql_escape_string($string,$link=null) {
-if(isset($link)) {
-       $string = mysql_real_escape_string($string,$link); }
-if(!isset($link)) {
-       $string = mysql_real_escape_string($string); }
-if ($string===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $string; }
-// SafeSQL Lite Source Code by Cool Dude 2k
-// Make SQL Query's safe
-function sql_pre_query($query_string,$query_vars) {
-   $query_array = array(array("%i","%I","%F","%S"),array("%d","%d","%f","%s"));
-   $query_string = str_replace($query_array[0], $query_array[1], $query_string);
-   if (get_magic_quotes_gpc()) {
-       $query_vars  = array_map("stripslashes", $query_vars); }
-   $query_vars = array_map("sql_escape_string", $query_vars);
-   $query_val = $query_vars;
-$query_num = count($query_val);
-$query_i = 0;
-while ($query_i < $query_num) {
-$query_is = $query_i+1;
-$query_val[$query_is] = $query_vars[$query_i];
-++$query_i; }
-   $query_val[0] = $query_string;
-   return call_user_func_array("sprintf",$query_val); }
-function sql_set_charset($charset,$link=null) {
-if(function_exists('mysql_set_charset')===false) {
-if(!isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'",$link); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if(!isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'",$link); } 
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===true) {
-if(isset($link)) {
-       $result = mysql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = mysql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-/*
-if(function_exists('mysql_set_charset')===false) {
-function mysql_set_charset($charset,$link) {
-if(isset($link)) {
-       $result = sql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = sql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-*/
-// Get next id for stuff
-function sql_get_next_id($tablepre,$table,$link=null) {
-       $nid = mysql_insert_id($link);
-       return $nid; }
-// Get number of rows for table
-function sql_get_num_rows($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SHOW TABLE STATUS LIKE '".$tablepre.$table."'", array());
-if(!isset($link)) {
-       $getnextidr = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-   $getnextid = sql_fetch_assoc($getnextidr);
-   return $getnextid['Rows'];
-   @sql_free_result($getnextidr); }
-?>
diff --git a/inc/misc/sql/mysqli.php.bak b/inc/misc/sql/mysqli.php.bak
deleted file mode 100644 (file)
index 3eb5343..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: mysqli.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="mysqli.php"||$File3Name=="/mysqli.php") {
-       @header('Location: index.php');
-       exit(); }
-// MySQL Functions.
-function sql_error($link=null) {
-if(isset($link)) {
-       $result = mysqli_error($link); }
-if(!isset($link)) {
-       $result = mysqli_error(); }
-if ($result=="") {
-       return ""; }
-       return $result; }
-function sql_errno($link=null) {
-if(isset($link)) {
-       $result = mysqli_errno($link); }
-if(!isset($link)) {
-       $result = mysqli_errno(); }
-if ($result===0) {
-       return 0; }
-       return $result; }
-function sql_errorno($link=null) {
-if(isset($link)) {
-       $result = sql_error($link);
-       $resultno = sql_errno($link); }
-if(!isset($link)) {
-       $result = sql_error();
-       $resultno = sql_errno(); }
-if ($result==""&&$result===0) {
-       return ""; }
-if ($result!=""&&$result!==0) {
-       $result = $resultno.": ".$result; }
-       return $result; }
-// Execute a query :P
-$NumQueries = 0;
-function sql_query($query,$link=null) {
-global $NumQueries;
-if(isset($link)) {
-       $result = mysqli_query($link,$query); }
-if(!isset($link)) {
-       $result = mysqli_query(null,$query); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($result!==false) {
-       ++$NumQueries;
-       return $result; } }
-//Fetch Number of Rows
-function sql_num_rows($result) {
-$num = mysqli_num_rows($result);
-if ($num===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $num; }
-// Connect to mysql database
-function sql_connect_db($server,$username,$password,$database=null,$new_link=false) {
-$myport = "3306";
-$hostex = explode(":", $server);
-if(isset($hostex[1])&&
-       !is_numeric($hostex[1])) {
-       $hostex[1] = $myport; }
-if(isset($hostex[1])) { 
-       $server = $hostex[0];
-       $myport = $hostex[1]; }
-if($database===null) {
-$link = mysqli_connect($server,$username,$password,null,$myport); }
-if($database!==null) {
-$link = mysqli_connect($server,$username,$password,$database,$myport); }
-if ($link===false) {
-    output_error("MySQLi Error ".mysqli_connect_errno().": ".mysqli_connect_error(),E_USER_ERROR);
-       return false; }
-$result = sql_query("SET SESSION SQL_MODE='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO';",$link);
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-return $link; }
-function sql_disconnect_db($link=null) {
-return mysqli_close($link); }
-// Query Results :P
-function sql_result($result,$row,$field=0) {
-$check = mysqli_data_seek($result,$row);
-if ($check===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-$trow = mysqli_fetch_array($result);
-if(!isset($trow[$field])) { $trow[$field] = null; }
-$retval = $trow[$field]; 
-return $retval; }
-// Free Results :P
-function sql_free_result($result) {
-$fresult = mysqli_free_result($result);
-if ($fresult===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($fresult===true) {
-       return true; } }
-//Fetch Results to Array
-function sql_fetch_array($result,$result_type=MYSQLI_BOTH) {
-$row = mysqli_fetch_array($result,$result_type);
-       return $row; }
-//Fetch Results to Associative Array
-function sql_fetch_assoc($result) {
-$row = mysqli_fetch_assoc($result);
-       return $row; }
-//Fetch Row Results
-function sql_fetch_row($result) {
-$row = mysqli_fetch_row($result);
-       return $row; }
-//Get Server Info
-function sql_server_info($link=null) {
-if(isset($link)) {
-       $result = mysqli_get_server_info($link); }
-if(!isset($link)) {
-       $result = mysqli_get_server_info(); }
-       return $result; }
-//Get Client Info
-function sql_client_info($link=null) {
-       $result = mysqli_get_client_info();
-       return $result; }
-function sql_escape_string($string,$link=null) {
-global $SQLStat;
-if(isset($link)) {
-       $string = mysqli_real_escape_string($link,$string); }
-if(!isset($link)) {
-       $string = mysqli_real_escape_string($SQLStat,$string); }
-if ($string===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $string; }
-// SafeSQL Lite Source Code by Cool Dude 2k
-// Make SQL Query's safe
-function sql_pre_query($query_string,$query_vars) {
-   $query_array = array(array("%i","%I","%F","%S"),array("%d","%d","%f","%s"));
-   $query_string = str_replace($query_array[0], $query_array[1], $query_string);
-   if (get_magic_quotes_gpc()) {
-       $query_vars  = array_map("stripslashes", $query_vars); }
-   $query_vars = array_map("sql_escape_string", $query_vars);
-   $query_val = $query_vars;
-$query_num = count($query_val);
-$query_i = 0;
-while ($query_i < $query_num) {
-$query_is = $query_i+1;
-$query_val[$query_is] = $query_vars[$query_i];
-++$query_i; }
-   $query_val[0] = $query_string;
-   return call_user_func_array("sprintf",$query_val); }
-function sql_set_charset($charset,$link=null) {
-if(function_exists('mysqli_set_charset')===false) {
-if(!isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'",$link); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if(!isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'",$link); } 
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysqli_set_charset')===true) {
-if(isset($link)) {
-       $result = mysqli_set_charset($link,$charset); }
-if(!isset($link)) {
-       $result = mysqli_set_charset(null,$charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-/*
-if(function_exists('mysqli_set_charset')===false) {
-function mysqli_set_charset($charset,$link) {
-if(isset($link)) {
-       $result = sql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = sql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-*/
-// Get next id for stuff
-function sql_get_next_id($tablepre,$table,$link=null) {
-       $nid = mysqli_insert_id($link);
-       return $nid; }
-// Get number of rows for table
-function sql_get_num_rows($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SHOW TABLE STATUS LIKE '".$tablepre.$table."'", array());
-if(!isset($link)) {
-       $getnextidr = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-   $getnextid = sql_fetch_assoc($getnextidr);
-   return $getnextid['Rows'];
-   @sql_free_result($getnextidr); }
-?>
diff --git a/inc/misc/sql/pgsql.php.bak b/inc/misc/sql/pgsql.php.bak
deleted file mode 100644 (file)
index dd10809..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: pgsql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="pgsql.php"||$File3Name=="/pgsql.php") {
-       @header('Location: index.php');
-       exit(); }
-// PostgreSQL Functions.
-function sql_error($link=null) {
-if(isset($link)) {
-       $result = pg_last_error($link); }
-if(!isset($link)) {
-       $result = pg_last_error(); }
-if ($result=="") {
-       return ""; }
-       return $result; }
-function sql_errno($link=null) {
-if(isset($link)) {
-       $result = pg_last_error($link); }
-if(!isset($link)) {
-       $result = pg_last_error(); }
-if ($result===0) {
-       return 0; }
-       return $result; }
-function sql_errorno($link=null) {
-if(isset($link)) {
-       $result = pg_last_error($link); }
-if(!isset($link)) {
-       $result = pg_last_error(); }
-if ($result=="") {
-       return ""; }
-       return $result; }
-// Execute a query :P
-$NumQueries = 0;
-function sql_query($query,$link=null) {
-global $NumQueries;
-if(isset($link)) {
-       $result = pg_query($link,$query); }
-if(!isset($link)) {
-       $result = pg_query(null,$query); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($result!==false) {
-       ++$NumQueries;
-       return $result; } }
-//Fetch Number of Rows
-function sql_num_rows($result) {
-$num = pg_num_rows($result);
-if ($num===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $num; }
-// Connect to pgsql database
-function sql_connect_db($server,$username,$password,$database=null,$new_link=false) {
-if($new_link!==true) { $new_link = false; }
-$pgport = "5432";
-$hostex = explode(":", $server);
-if(isset($hostex[1])&&
-       !is_numeric($hostex[1])) {
-       $hostex[1] = $pgport; }
-if(isset($hostex[1])) { 
-       $server = $hostex[0];
-       $pgport = $hostex[1]; }
-$pgstring = null;
-if($database===null) {
-$pgstring = "host=".$server." port=".$pgport." user=".$username." password=".$password; }
-if($database!==null) {
-$pgstring = "host=".$server." port=".$pgport." dbname=".$database." user=".$username." password=".$password; }
-$link = pg_connect($pgstring);
-if ($link===false) {
-    output_error("Not connected: ".sql_error(),E_USER_ERROR);
-       return false; }
-return $link; }
-function sql_disconnect_db($link=null) {
-return cubrid_disconnect($link); }
-// Query Results :P
-function sql_result($result,$row,$field=0) {
-if(is_numeric($field)) {
-$value = pg_fetch_result($result, $row, $field); }
-if(!is_numeric($field)) {
-$value = pg_fetch_result($result, $row, "\"".$field."\""); }
-if ($value===false) { 
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $value; }
-// Free Results :P
-function sql_free_result($result) {
-$fresult = pg_free_result($result);
-if ($fresult===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($fresult===true) {
-       return true; } }
-//Fetch Results to Array
-function sql_fetch_array($result,$result_type=MYSQL_BOTH) {
-$row = pg_fetch_array($result,$result_type);
-       return $row; }
-//Fetch Results to Associative Array
-function sql_fetch_assoc($result) {
-$row = pg_fetch_assoc($result);
-       return $row; }
-//Fetch Row Results
-function sql_fetch_row($result) {
-$row = pg_fetch_row($result);
-       return $row; }
-//Get Server Info
-function sql_server_info($link=null) {
-if(isset($link)) {
-       $result = pg_version($link); }
-if(!isset($link)) {
-       $result = pg_version(); }
-       return $result['server']; }
-//Get Client Info
-function sql_client_info($link=null) {
-if(isset($link)) {
-       $result = pg_version($link); }
-if(!isset($link)) {
-       $result = pg_version(); }
-       return $result['client']; }
-function sql_escape_string($string,$link=null) {
-global $SQLStat;
-if(!isset($link)) { $link = $SQLStat; }
-if(isset($link)) {
-       $string = pg_escape_string($link,$string); }
-if(!isset($link)) {
-       $string = pg_escape_string($SQLStat,$string); }
-if ($string===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $string; }
-// SafeSQL Lite Source Code by Cool Dude 2k
-// Make SQL Query's safe
-function sql_pre_query($query_string,$query_vars) {
-   $query_array = array(array("%i","%I","%F","%S"),array("%d","%d","%f","%s"));
-   $query_string = str_replace($query_array[0], $query_array[1], $query_string);
-   if (get_magic_quotes_gpc()) {
-       $query_vars  = array_map("stripslashes", $query_vars); }
-   $query_vars = array_map("sql_escape_string", $query_vars);
-   $query_val = $query_vars;
-$query_num = count($query_val);
-$query_i = 0;
-while ($query_i < $query_num) {
-$query_is = $query_i+1;
-$query_val[$query_is] = $query_vars[$query_i];
-++$query_i; }
-   $query_val[0] = $query_string;
-   return call_user_func_array("sprintf",$query_val); }
-function sql_set_charset($charset,$link=null) {
-       return true; }
-/*
-function sql_set_charset($charset,$link=null) {
-if(function_exists('mysql_set_charset')===false) {
-if(!isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'",$link); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if(!isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'",$link); } 
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===true) {
-if(isset($link)) {
-       $result = mysql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = mysql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===false) {
-function mysql_set_charset($charset,$link) {
-if(isset($link)) {
-       $result = sql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = sql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-*/
-// Get next id for stuff
-function sql_get_next_id($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SELECT currval('".$tablepre.$table."_id_seq');", array());
-if(!isset($link)) {
-       $result = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-       return sql_result($getnextidr,0);
-       sql_free_result($getnextidr); }
-// Get number of rows for table
-function sql_get_num_rows($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SHOW TABLE STATUS LIKE '".$tablepre.$table."'", array());
-if(!isset($link)) {
-       $getnextidr = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-   $getnextid = sql_fetch_assoc($getnextidr);
-   return $getnextid['Rows'];
-   @sql_free_result($getnextidr); }
-?>
diff --git a/inc/misc/sql/sqlite.php.bak b/inc/misc/sql/sqlite.php.bak
deleted file mode 100644 (file)
index 3f2272b..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: sqlite.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="sqlite.php"||$File3Name=="/sqlite.php") {
-       @header('Location: index.php');
-       exit(); }
-// SQLite Functions.
-function sql_error($link=null) {
-global $SQLStat;
-if(isset($link)) {
-       $result = sqlite_error_string(sqlite_last_error($link)); }
-if(!isset($link)) {
-       $result = sqlite_error_string(sqlite_last_error($SQLStat)); }
-if ($result=="") {
-       return ""; }
-       return $result; }
-function sql_errno($link=null) {
-global $SQLStat;
-if(isset($link)) {
-       $result = sqlite_last_error($link); }
-if(!isset($link)) {
-       $result = sqlite_last_error($SQLStat); }
-if ($result===0) {
-       return 0; }
-       return $result; }
-function sql_errorno($link=null) {
-global $SQLStat;
-if(isset($link)) {
-       $result = sqlite_last_error($link).": ".sqlite_error_string(sqlite_last_error($link)); }
-if(!isset($link)) {
-       $result = sqlite_last_error($SQLStat).": ".sqlite_error_string(sqlite_last_error($SQLStat)); }
-if ($result=="") {
-       return ""; }
-       return $result; }
-// Execute a query :P
-$NumQueries = 0;
-function sql_query($query,$link=null) {
-global $NumQueries,$SQLStat;
-if(isset($link)) {
-       $result = sqlite_query($link,$query); }
-if(!isset($link)) {
-       $result = sqlite_query(null,$query); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if ($result!==false) {
-       ++$NumQueries;
-       return $result; } }
-//Fetch Number of Rows
-function sql_num_rows($result) {
-$num = sqlite_num_rows($result);
-if ($num===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $num; }
-// Connect to sqlite database
-function sql_connect_db($server,$username,$password,$database=null,$new_link=false) {
-if($new_link!==true) { $new_link = false; }
-if($database===null) {
-return true; }
-if($database!==null) {
-$link = sqlite_open($database,0666,$sqliteerror); }
-if ($link===false) {
-    output_error("Not connected: ".$sqliteerror,E_USER_ERROR);
-       return false; }
-return $link; }
-function sql_disconnect_db($link=null) {
-return sqlite_close($link); }
-// Query Results :P
-function sql_result($result,$row,$field=0) {
-$check = sqlite_seek($result,$row);
-if ($check===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-$trow = sqlite_fetch_array($result);
-if(!isset($trow[$field])) { $trow[$field] = null; }
-$retval = $trow[$field]; 
-return $retval; }
-// Free Results :P
-function sql_free_result($result) {
-       return true; }
-//Fetch Results to Array
-function sql_fetch_array($result,$result_type=SQLITE_BOTH) {
-$row = sqlite_fetch_array($result,$result_type);
-       return $row; }
-//Fetch Results to Associative Array
-function sql_fetch_assoc($result) {
-$row = sqlite_fetch_array($result,SQLITE_ASSOC);
-       return $row; }
-//Fetch Row Results
-function sql_fetch_row($result) {
-$row = sqlite_fetch_array($result,SQLITE_NUM);
-       return $row; }
-//Get Server Info
-function sql_server_info($link=null) {
-       $result = sqlite_libversion();
-       return $result; }
-//Get Client Info
-function sql_client_info($link=null) {
-       return null; }
-function sql_escape_string($string,$link=null) {
-       $string = sqlite_escape_string($string);
-if ($string===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return $string; }
-// SafeSQL Lite Source Code by Cool Dude 2k
-// Make SQL Query's safe
-function sql_pre_query($query_string,$query_vars) {
-   $query_array = array(array("%i","%I","%F","%S"),array("%d","%d","%f","%s"));
-   $query_string = str_replace($query_array[0], $query_array[1], $query_string);
-   if (get_magic_quotes_gpc()) {
-       $query_vars  = array_map("stripslashes", $query_vars); }
-   $query_vars = array_map("sql_escape_string", $query_vars);
-   $query_val = $query_vars;
-$query_num = count($query_val);
-$query_i = 0;
-while ($query_i < $query_num) {
-$query_is = $query_i+1;
-$query_val[$query_is] = $query_vars[$query_i];
-++$query_i; }
-   $query_val[0] = $query_string;
-   return call_user_func_array("sprintf",$query_val); }
-function sql_set_charset($charset,$link=null) {
-       return true; }
-/*
-function sql_set_charset($charset,$link=null) {
-if(function_exists('mysql_set_charset')===false) {
-if(!isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET CHARACTER SET '".$charset."'",$link); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-if(!isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'"); }
-if(isset($link)) {
-       $result = sql_query("SET NAMES '".$charset."'",$link); } 
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===true) {
-if(isset($link)) {
-       $result = mysql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = mysql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; }
-if(function_exists('mysql_set_charset')===false) {
-function mysql_set_charset($charset,$link) {
-if(isset($link)) {
-       $result = sql_set_charset($charset,$link); }
-if(!isset($link)) {
-       $result = sql_set_charset($charset); }
-if ($result===false) {
-    output_error("SQL Error: ".sql_error(),E_USER_ERROR);
-       return false; }
-       return true; } }
-*/
-// Get next id for stuff
-function sql_get_next_id($tablepre,$table,$link=null) {
-       $nid = sqlite_last_insert_rowid($link);
-       return $nid; }
-// Get number of rows for table
-function sql_get_num_rows($tablepre,$table,$link=null) {
-   $getnextidq = sql_pre_query("SHOW TABLE STATUS LIKE '".$tablepre.$table."'", array());
-if(!isset($link)) {
-       $getnextidr = sql_query($getnextidq); }
-if(isset($link)) {
-       $getnextidr = sql_query($getnextidq,$link); } 
-   $getnextid = sql_fetch_assoc($getnextidr);
-   return $getnextid['Rows'];
-   @sql_free_result($getnextidr); }
-?>
diff --git a/inc/misc/useragents.php.bak b/inc/misc/useragents.php.bak
deleted file mode 100644 (file)
index 201ced7..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: useragents.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-// User Agent Checker
-function user_agent_check($user_agent) {
-global $Settings;
-if(!isset($Settings['log_spiders_bots'])) {
-       $Settings['log_spiders_bots'] = "yes"; }
-if($Settings['log_spiders_bots']!=="yes") {
-       return false; }
-if (preg_match("/".preg_quote("; 008/", "/")."/i", $user_agent)) {
-    return "80legs"; }
-if (preg_match("/".preg_quote("Aboundex", "/")."/i", $user_agent)) {
-    return "Aboundex"; }
-if (preg_match("/".preg_quote("AboutUsBot", "/")."/i", $user_agent)) {
-    return "AboutUs"; }
-if (preg_match("/".preg_quote("AhrefsBot", "/")."/i", $user_agent)) {
-    return "Ahrefs"; }
-if (preg_match("/".preg_quote("ia_archiver", "/")."/i", $user_agent)) {
-    return "Alexa"; }
-if (preg_match("/".preg_quote("aiHitBot", "/")."/i", $user_agent)) {
-    return "aiHit"; }
-if (preg_match("/".preg_quote("AlkalineBot", "/")."/i", $user_agent)) {
-    return "Alkaline"; }
-if (preg_match("/".preg_quote("AltaVista", "/")."/i", $user_agent)) {
-    return "AltaVista"; }
-if (preg_match("/".preg_quote("Ask Jeeves", "/")."/i", $user_agent)) {
-    return "Ask Jeeves"; }
-if (preg_match("/".preg_quote("askpeter_bot", "/")."/i", $user_agent)) {
-    return "Ask Peter"; }
-if (preg_match("/".preg_quote("ASPseek", "/")."/i", $user_agent)) {
-    return "ASPseek"; }
-if (preg_match("/".preg_quote("Baiduspider", "/")."/i", $user_agent)) {
-    return "Baidu"; }
-if (preg_match("/".preg_quote("BaiduImagespider", "/")."/i", $user_agent)) {
-    return "Baidu"; }
-if (preg_match("/".preg_quote("bingbot", "/")."/i", $user_agent)) {
-    return "Bing"; }
-if (preg_match("/".preg_quote("msnbot", "/")."/i", $user_agent)) {
-    return "Bing"; }
-if (preg_match("/".preg_quote("CatchBot", "/")."/i", $user_agent)) {
-    return "CatchBot"; }
-if (preg_match("/".preg_quote("Cityreview Robot", "/")."/i", $user_agent)) {
-    return "Cityreview"; }
-if (preg_match("/".preg_quote("CCBot", "/")."/i", $user_agent)) {
-    return "CommonCrawl"; }
-if (preg_match("/".preg_quote("cmsworldmap.com", "/")."/i", $user_agent)) {
-    return "CMSWorldMap"; }
-if (preg_match("/".preg_quote("CSE HTML Validator", "/")."/i", $user_agent)) {
-    return "CSE HTML Validator"; }
-if (preg_match("/".preg_quote("discobot", "/")."/i", $user_agent)) {
-    return "DiscoveryEngine"; }
-if (preg_match("/".preg_quote("DnsQueries", "/")."/i", $user_agent)) {
-    return "DNSQueries"; }
-if (preg_match("/".preg_quote("Domnutch-Bot", "/")."/i", $user_agent)) {
-    return "Nutch"; }
-if (preg_match("/".preg_quote("DotBot", "/")."/i", $user_agent)) {
-    return "DotBot"; }
-if (preg_match("/".preg_quote("DuckDuckBot", "/")."/i", $user_agent)) {
-    return "DuckDuckGo"; }
-if (preg_match("/".preg_quote("Exabot", "/")."/i", $user_agent)) {
-    return "Exabot"; }
-if (preg_match("/".preg_quote("Ezooms", "/")."/i", $user_agent)) {
-    return "Ezooms"; }
-if (preg_match("/".preg_quote("facebookexternalhit", "/")."/i", $user_agent)) {
-    return "Facebook"; }
-if (preg_match("/".preg_quote("Feedtrace-bot", "/")."/i", $user_agent)) {
-    return "FeedtraceBot"; }
-if (preg_match("/".preg_quote("findfiles.net", "/")."/i", $user_agent)) {
-    return "FindFiles Bot"; }
-if (preg_match("/".preg_quote("FreeWebMonitoring", "/")."/i", $user_agent)) {
-    return "FreeWebMonitoring"; }
-if (preg_match("/".preg_quote("FlightDeckReportsBot", "/")."/i", $user_agent)) {
-    return "FlightDeck Reports"; }
-if (preg_match("/".preg_quote("GIDBot", "/")."/i", $user_agent)) {
-    return "GIDNetwork"; }
-if (preg_match("/".preg_quote("ichiro", "/")."/i", $user_agent)) {
-    return "Goo Japan"; }
-if (preg_match("/".preg_quote("moget", "/")."/i", $user_agent)) {
-    return "Goo Japan"; }
-if (preg_match("/".preg_quote("mogimogi", "/")."/i", $user_agent)) {
-    return "Goo Japan"; }
-if (preg_match("/".preg_quote("AdsBot-Google", "/")."/i", $user_agent)) {
-    return "Google"; }
-if (preg_match("/".preg_quote("AppEngine-Google", "/")."/i", $user_agent)) {
-    return "Google"; }
-if (preg_match("/".preg_quote("Googlebot", "/")."/i", $user_agent)) {
-    return "Google"; }
-if (preg_match("/".preg_quote("Mediapartners-Google", "/")."/i", $user_agent)) {
-    return "Google"; }
-if (preg_match("/".preg_quote("Gigabot", "/")."/i", $user_agent)) {
-    return "Gigablast"; }
-if (preg_match("/".preg_quote("Grub", "/")."/i", $user_agent)) {
-    return "GrubBot"; }
-if (preg_match("/".preg_quote("Hailoobot", "/")."/i", $user_agent)) {
-    return "Hailoobot"; }
-if (preg_match("|".preg_quote("HTML/XML Validator", "|")."|i", $user_agent)) {
-    return "HTML/XML Validator"; }
-if (preg_match("/".preg_quote("Huaweisymantecspider", "/")."/i", $user_agent)) {
-    return "Huaweisymantecspider"; }
-if (preg_match("|".preg_quote("iDB-VerCheck", "|")."|i", $user_agent)) {
-    return "iDB Version Checker"; }
-if (preg_match("|".preg_quote("iDB-Forum", "|")."|i", $user_agent)) {
-    return "iDB Message Board"; }
-if (preg_match("/".preg_quote("Infoseek", "/")."/i", $user_agent)) {
-    return "InfoSeek"; }
-if (preg_match("/".preg_quote("IRLbot", "/")."/i", $user_agent)) {
-    return "IRLbot"; }
-if (preg_match("/".preg_quote("Linguee Bot", "/")."/i", $user_agent)) {
-    return "Linguee"; }
-if (preg_match("/".preg_quote("Lycos", "/")."/i", $user_agent)) {
-    return "Lycos"; }
-if (preg_match("/".preg_quote("LexxeBot", "/")."/i", $user_agent)) {
-    return "LexxeBot"; }
-if (preg_match("/".preg_quote("MJ12bot", "/")."/i", $user_agent)) {
-    return "Majestic-12"; }
-if (preg_match("/".preg_quote("MLBot", "/")."/i", $user_agent)) {
-    return "MLBot"; }
-if (preg_match("/".preg_quote("montastic-monitor", "/")."/i", $user_agent)) {
-    return "Montastic"; }
-if (preg_match("/".preg_quote("montastic-webmonitor", "/")."/i", $user_agent)) {
-    return "Montastic"; }
-if (preg_match("/".preg_quote("mozDex", "/")."/i", $user_agent)) {
-    return "Mozdex"; }
-if (preg_match("/".preg_quote("Mail.Ru", "/")."/i", $user_agent)) {
-    return "Mail RU"; }
-if (preg_match("/".preg_quote("MP3Bot", "/")."/i", $user_agent)) {
-    return "MP3Realm"; }
-if (preg_match("/".preg_quote("mxbot", "/")."/i", $user_agent)) {
-    return "mxbot"; }
-if (preg_match("/".preg_quote("NaverBot", "/")."/i", $user_agent)) {
-    return "NaverBot"; }
-if (preg_match("/".preg_quote("NetSprint", "/")."/i", $user_agent)) {
-    return "NetSprint"; }
-if (preg_match("/".preg_quote("NextGenSearchBot", "/")."/i", $user_agent)) {
-    return "ZoomInfo"; }
-if (preg_match("/".preg_quote("; oBot\/", "/")."/i", $user_agent)) {
-    return "oBot"; }
-if (preg_match("/".preg_quote("Openbot", "/")."/i", $user_agent)) {
-    return "OpenFind"; }
-if (preg_match("/".preg_quote("Page2RSS", "/")."/i", $user_agent)) {
-    return "Page2RSS"; }
-if (preg_match("/".preg_quote("Peew", "/")."/i", $user_agent)) {
-    return "Peew"; }
-if (preg_match("/".preg_quote("PicoSearch", "/")."/i", $user_agent)) {
-    return "PicoSearch"; }
-if (preg_match("/".preg_quote("Plukkie", "/")."/i", $user_agent)) {
-    return "Plukkie"; }
-if (preg_match("/".preg_quote("Purebot", "/")."/i", $user_agent)) {
-    return "PuritySearch"; }
-if (preg_match("/".preg_quote("QweeryBot", "/")."/i", $user_agent)) {
-    return "QweeryBot"; }
-if (preg_match("/".preg_quote("R6_FeedFetcher", "/")."/i", $user_agent)) {
-    return "Radian6"; }
-if (preg_match("/".preg_quote("radian6_linkcheck", "/")."/i", $user_agent)) {
-    return "Radian6"; }
-if (preg_match("/".preg_quote("smerity", "/")."/i", $user_agent)) {
-    return "Schwa Lab"; }
-if (preg_match("/".preg_quote("ScoutJet", "/")."/i", $user_agent)) {
-    return "ScoutJet"; }
-if (preg_match("/".preg_quote("Search17Bot", "/")."/i", $user_agent)) {
-    return "Search17"; }
-if (preg_match("/".preg_quote("Setooz", "/")."/i", $user_agent)) {
-    return "Setooz"; }
-if (preg_match("/".preg_quote("Speedy Spider", "/")."/i", $user_agent)) {
-    return "Entireweb"; }
-if (preg_match("/".preg_quote("Argus", "/")."/i", $user_agent)) {
-    return "Simpy"; }
-if (preg_match("/".preg_quote("seexie.com_bot", "/")."/i", $user_agent)) {
-    return "Seexie"; }
-if (preg_match("/".preg_quote("SemrushBot", "/")."/i", $user_agent)) {
-    return "SemrushBot"; }
-if (preg_match("/".preg_quote("SiteBot", "/")."/i", $user_agent)) {
-    return "SiteBot"; }
-if (preg_match("/".preg_quote("Sogou", "/")."/i", $user_agent)) {
-    return "Sogou"; }
-if (preg_match("/".preg_quote("Sosospider", "/")."/i", $user_agent)) {
-    return "Soso"; }
-if (preg_match("/".preg_quote("spbot", "/")."/i", $user_agent)) {
-    return "spbot"; }
-if (preg_match("/".preg_quote("Speedy Spider", "/")."/i", $user_agent)) {
-    return "Speedy"; }
-if (preg_match("/".preg_quote("SpiderMonkey", "/")."/i", $user_agent)) {
-    return "SpiderMonkey"; }
-if (preg_match("/".preg_quote("Spider_Monkey", "/")."/i", $user_agent)) {
-    return "SpiderMonkey"; }
-if (preg_match("/".preg_quote("SISTRIX Crawler", "/")."/i", $user_agent)) {
-    return "SISTRIX Crawler"; }
-if (preg_match("/".preg_quote("Szukacz", "/")."/i", $user_agent)) {
-    return "Szukacz.pl"; }
-if (preg_match("/".preg_quote("tangyang9@gmail.com", "/")."/i", $user_agent)) {
-    return "tangyangbot"; }
-if (preg_match("/".preg_quote("Thriceler", "/")."/i", $user_agent)) {
-    return "Thriceler"; }
-if (preg_match("/".preg_quote("TotalValidator", "/")."/i", $user_agent)) {
-    return "Total Validator"; }
-if (preg_match("/".preg_quote("Twitterbot", "/")."/i", $user_agent)) {
-    return "Twitterbot"; }
-if (preg_match("/".preg_quote("Ultraseek", "/")."/i", $user_agent)) {
-    return "UltraSeek"; }
-if (preg_match("/".preg_quote("Validator.nu", "/")."/i", $user_agent)) {
-    return "Validator.nu"; }
-if (preg_match("/".preg_quote("Voyager", "/")."/i", $user_agent)) {
-    return "Kosmix"; }
-if (preg_match("/".preg_quote("W3CRobot", "/")."/i", $user_agent)) {
-    return "W3C Checklink"; }
-if (preg_match("/".preg_quote("W3C-checklink", "/")."/i", $user_agent)) {
-    return "W3C Checklink"; }
-if (preg_match("/".preg_quote("FeedValidator", "/")."/i", $user_agent)) {
-    return "W3C Validator"; }
-if (preg_match("/".preg_quote("W3C_CSS_Validator", "/")."/i", $user_agent)) {
-    return "W3C Validator"; }
-if (preg_match("/".preg_quote("W3C_Validator", "/")."/i", $user_agent)) {
-    return "W3C Validator"; }
-if (preg_match("/".preg_quote("WDG_SiteValidator", "/")."/i", $user_agent)) {
-    return "WDG Validator"; }
-if (preg_match("/".preg_quote("WDG_Validator", "/")."/i", $user_agent)) {
-    return "WDG Validator"; }
-if (preg_match("/".preg_quote("HTTP Compression Test", "/")."/i", $user_agent)) {
-    return "WhatsMyIP"; }
-if (preg_match("/".preg_quote("HuaweiSymantecSpider", "/")."/i", $user_agent)) {
-    return "Huawei Symantec"; }
-if (preg_match("/".preg_quote("WhatsMyIP.org", "/")."/i", $user_agent)) {
-    return "WhatsMyIP"; }
-if (preg_match("/".preg_quote("WTABOT", "/")."/i", $user_agent)) {
-    return "WTABOT"; }
-if (preg_match("/".preg_quote("Yahoo", "/")."/i", $user_agent)) {
-    return "Yahoo"; }
-if (preg_match("/".preg_quote("Yandex", "/")."/i", $user_agent)) {
-    return "Yandex"; }
-if (preg_match("/".preg_quote("YoudaoBot", "/")."/i", $user_agent)) {
-    return "YoudaoBot"; }
-if (preg_match("/".preg_quote("YodaoBot", "/")."/i", $user_agent)) {
-    return "YodaoBot"; }
-if (preg_match("/".preg_quote("Yeti", "/")."/i", $user_agent)) {
-    return "NHN Naver"; }
-       return false; }
-?>
\ No newline at end of file
diff --git a/inc/misc/utf8.php.bak b/inc/misc/utf8.php.bak
deleted file mode 100644 (file)
index d775d35..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: utf8.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-// UTF8 helper functions
-// author: Scott Michael Reynen "scott@randomchaos.com"
-// url: http://www.randomchaos.com/document.php?source=php_and_unicode
-// utf8_substr by frank at jkelloggs dot dk
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="utf8.php"||$File3Name=="/utf8.php") {
-       require('index.php');
-       exit(); }
-
-function utf8_strlen($str) {
-  return strlen(utf8_decode($_GET['text'])); }
-function pre_strlen($str) {
-global $chkcharset;
-if($chkcharset=="UTF-8") {
-if(!defined('UTF8_NOMBSTRING')&&function_exists('mb_strlen')) {
-return mb_strlen($str,'utf-8'); }
-else { return utf8_strlen($str); } }
-if($chkcharset!="UTF-8") { return strlen($str); } }
-
-// utf8_substr by frank at jkelloggs dot dk
-// http://us3.php.net/manual/en/function.substr.php#55107
-function utf8_substr($str,$start)
-{
-   preg_match_all("/./su", $str, $ar);
-   if(func_num_args() >= 3) {
-       $end = func_get_arg(2);
-       return join("",array_slice($ar[0],$start,$end));
-   } else {
-       return join("",array_slice($ar[0],$start));
-   }
-}
-
-function pre_substr($string,$start,$length) {
-   global $chkcharset;
-   if($chkcharset=="UTF-8") {
-      if(!defined('UTF8_NOMBSTRING')&&function_exists('mb_substr')) {
-      return mb_substr($string,$start,$length,'utf-8'); }
-   else { return utf8_substr($string,$start,$length); } }
-   if($chkcharset!="UTF-8") { return substr($string,$start,$length); } }
-      if(isset($_GET['text'])) {
-   echo pre_substr($_GET['text'],0,6); }
-
-// author: Scott Michael Reynen "scott@randomchaos.com"
-// url: http://www.randomchaos.com/document.php?source=php_and_unicode
-function utf8_strpos($haystack, $needle,$offset=0) {
-  if(!defined('UTF8_NOMBSTRING')&&function_exists('mb_strpos')) {
-  return mb_strpos($haystack,$needle,$offset,'utf-8'); }
-  $haystack = utf8_to_unicode($haystack);
-  $needle   = utf8_to_unicode($needle);
-  $position = $offset;
-  $found = false;
-  while( (! $found ) && ( $position < count( $haystack ) ) ) {
-    if ( $needle[0] == $haystack[$position] ) {
-      for ($i = 1; $i < count( $needle ); $i++ ) {
-        if ( $needle[$i] != $haystack[ $position + $i ] ) break;
-      } // for
-      if ( $i == count( $needle ) ) {
-        $found = true;
-        $position--;
-      } // if
-    } // if
-    $position++;
-  } // while
-  return ( $found == true ) ? $position : false;
-} // strpos_unicode
-
-// author: Scott Michael Reynen "scott@randomchaos.com"
-// url: http://www.randomchaos.com/document.php?source=php_and_unicode
-function utf8_to_unicode( $str ) {
-  $unicode = array();  
-  $values = array();
-  $lookingFor = 1;
-  for ($i = 0; $i < strlen( $str ); $i++ ) {
-    $thisValue = ord( $str[ $i ] );
-    if ( $thisValue < 128 ) $unicode[] = $thisValue;
-    else {
-      if ( count( $values ) == 0 ) $lookingFor = ( $thisValue < 224 ) ? 2 : 3;
-      $values[] = $thisValue;
-      if ( count( $values ) == $lookingFor ) {
-  $number = ( $lookingFor == 3 ) ?
-    ( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ):
-       ( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );
-  $unicode[] = $number;
-  $values = array();
-  $lookingFor = 1;
-      } // if
-    } // if
-  } // for
-  return $unicode;
-} // utf8_to_unicode
-
-// author: Scott Michael Reynen "scott@randomchaos.com"
-// url: http://www.randomchaos.com/document.php?source=php_and_unicode
-function unicode_to_utf8( $str ) {
-  $utf8 = '';
-  foreach( $str as $unicode ) {
-    if ( $unicode < 128 ) {
-      $utf8.= chr( $unicode );
-    } elseif ( $unicode < 2048 ) {
-      $utf8.= chr( 192 +  ( ( $unicode - ( $unicode % 64 ) ) / 64 ) );
-      $utf8.= chr( 128 + ( $unicode % 64 ) );
-    } else {
-      $utf8.= chr( 224 + ( ( $unicode - ( $unicode % 4096 ) ) / 4096 ) );
-      $utf8.= chr( 128 + ( ( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ) );
-      $utf8.= chr( 128 + ( $unicode % 64 ) );
-    } // if
-  } // foreach
-  return $utf8;
-} // unicode_to_utf8
-?>
\ No newline at end of file
diff --git a/inc/mod/index.php.bak b/inc/mod/index.php.bak
deleted file mode 100644 (file)
index de16c80..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/mplayer/index.php.bak b/inc/mplayer/index.php.bak
deleted file mode 100644 (file)
index de16c80..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/inc/navbar.php.bak b/inc/navbar.php.bak
deleted file mode 100644 (file)
index 19403a3..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: navbar.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="navbar.php"||$File3Name=="/navbar.php") {
-       require('index.php');
-       exit(); }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']||$GroupInfo['CanPM']=="yes") {
-$pmquery1 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE \"ReciverID\"=%i AND \"Read\"=0", array($_SESSION['UserID']));
-$pmresult1=sql_query($pmquery1,$SQLStat);
-$PMNumber=sql_num_rows($pmresult1);
-sql_free_result($pmresult1); /*
-$pmquery2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."messenger\" WHERE \"SenderID\"=%i AND \"Read\"=0", array($_SESSION['UserID']));
-$pmresult2=sql_query($pmquery2,$SQLStat);
-$SentPMNumber=sql_num_rows($pmresult2);
-sql_free_result($pmresult2); */ }
-if($ThemeSet['LogoStyle']==null) { $logostyle = ""; }
-if($ThemeSet['LogoStyle']!=null) { $logostyle = "style=\"".$ThemeSet['LogoStyle']."\" "; }
-// Am I hidden from everyone
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-$PreAmIHidden = GetUserName($_SESSION['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHidden = $PreAmIHidden['Hidden']; }
-// Hide me from everyone! >_> ^_^ <_< 
-$NavBarCurMonth = $usercurtime->format("m");
-$NavBarCurYear = $usercurtime->format("Y");
-$NavBarCurDate = $NavBarCurMonth.$NavBarCurYear;
-?>
-<div class="NavBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="NavBarRow1">
-<span class="NavBarSpan1">
-<?php echo $ThemeSet['PreLogo']; ?>
-<a <?php echo $logostyle; ?>title="<?php echo $Settings['board_name'].$idbpowertitle; ?>" href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">
-<?php echo $ThemeSet['Logo']; ?></a>
-<?php echo $ThemeSet['SubLogo']; ?>
-</span></div>
-<?php } ?>
-<table id="NavBarTable" class="NavBar">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="NavBarRow1">
-<td id="NavBarLogo" class="NavBarColumn1"><?php echo $ThemeSet['PreLogo']; ?>
-<a <?php echo $logostyle; ?>title="<?php echo $Settings['board_name'].$idbpowertitle; ?>" href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">
-<?php echo $ThemeSet['Logo']; ?></a>
-<?php echo $ThemeSet['SubLogo']; ?></td>
-</tr><?php } ?>
-<tr class="NavBarRow2">
-<td id="NavBarLinks" class="NavBarColumn2">
-<span style="float: left;">&nbsp;<?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { if(!isset($_SESSION['GuestName'])) { ?>Welcome Guest
-<?php } if(isset($_SESSION['GuestName'])) { ?>Welcome <?php echo $_SESSION['GuestName']; } ?> ( <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a><?php echo $ThemeSet['LineDivider']; ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Register</a> )
-<?php } if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>Logged as: <?php if($_SESSION['UserID']>0&&$AmIHidden=="no") { ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_SESSION['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php } if($_SESSION['UserID']<0||$AmIHidden=="yes") { echo "<span>"; } echo $_SESSION['MemberName']; ?><?php if($_SESSION['UserID']>0&&$AmIHidden=="no") { ?></a><?php } if($_SESSION['UserID']<0||$AmIHidden=="yes") { echo "</span>"; } ?> ( <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log out</a><?php if($GroupInfo['HasAdminCP']=="yes") { ?><?php echo $ThemeSet['LineDivider']; ?><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=view&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Admin CP</a><?php } ?> )<?php } ?></span>
-<span style="float: right;">
-<?php
-       if($Settings['enable_search']=="on"&&
-       $GroupInfo['CanSearch']=="yes") { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Search</a><?php echo $ThemeSet['LineDivider']; }
-       if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { 
-       if($GroupInfo['CanEditProfile']=="yes") { ?>
-<a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Profile</a><?php echo $ThemeSet['LineDivider']; } 
-               if($GroupInfo['CanPM']=="yes") { ?>
-<a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=view&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>" title="<?php echo "You have ".$PMNumber." new messages."; ?>">MailBox</a><?php echo $ThemeSet['LineDivider']; ?><?php } } ?>
-<a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Members</a><?php echo $ThemeSet['LineDivider']; ?>
-<a href="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act=view&caldate=".$NavBarCurDate,$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Calendar</a><?php if(isset($Settings['weburl'])) { echo $ThemeSet['LineDivider']; ?>
-<a href="<?php echo $Settings['weburl']; ?>">Homepage</a><?php } ?>&nbsp;</span>
-</td></tr>
-</table></div>
-<div class="DivNavBar">&nbsp;</div>
diff --git a/inc/prelogin.php.bak b/inc/prelogin.php.bak
deleted file mode 100644 (file)
index fff3a58..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: prelogin.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="prelogin.php"||$File3Name=="/prelogin.php") {
-       require('index.php');
-       exit(); }
-$_SESSION['CheckCookie']="done";
-$querylog2 = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' AND \"UserPassword\"='%s' AND \"id\"=%i LIMIT 1", array($_COOKIE['MemberName'],$_COOKIE['SessPass'],$_COOKIE['UserID']));
-$resultlog2=sql_query($querylog2,$SQLStat);
-$numlog2=sql_num_rows($resultlog2);
-if($numlog2==1) {
-$YourIDAM=sql_result($resultlog2,0,"id");
-$YourNameAM=sql_result($resultlog2,0,"Name");
-$YourGroupAM=sql_result($resultlog2,0,"GroupID");
-$YourGroupIDAM=$YourGroupAM;
-$YourPassAM=sql_result($resultlog2,0,"UserPassword");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($YourGroupAM));
-$gresult=sql_query($gquery,$SQLStat);
-$YourGroupAM=sql_result($gresult,0,"Name");
-sql_free_result($gresult);
-$BanError = null;
-$YourTimeZoneAM=sql_result($resultlog2,0,"TimeZone");
-$UseThemeAM=sql_result($resultlog2,0,"UseTheme");
-$YourDSTAM=sql_result($resultlog2,0,"DST");
-$YourLastPostTime=sql_result($resultlog2,0,"LastPostTime");
-$YourBanTime=sql_result($resultlog2,0,"BanTime");
-sql_free_result($resultlog2);
-$CGMTime = $utccurtime->getTimestamp();
-if($YourBanTime!=0&&$YourBanTime!=null) {
-if($YourBanTime>=$CGMTime) { $BanError = "yes"; } 
-if($YourBanTime<0) { $BanError = "yes"; } }
-$NewDay=$utccurtime->getTimestamp();
-$NewIP=$_SERVER['REMOTE_ADDR'];
-if($BanError!="yes") {
-$queryup = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LastActive\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($NewDay,$NewIP,$YourIDAM));
-$_SESSION['Theme']=$UseThemeAM;
-$_SESSION['MemberName']=$_COOKIE['MemberName'];
-$_SESSION['UserID']=$YourIDAM;
-$_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
-$_SESSION['UserTimeZone']=$YourTimeZoneAM;
-$_SESSION['UserGroup']=$YourGroupAM;
-$_SESSION['UserGroupID']=$YourGroupIDAM;
-$_SESSION['UserDST']=$YourDSTAM;
-$_SESSION['UserPass']=$YourPassAM;
-$_SESSION['LastPostTime'] = $YourLastPostTime;
-$_SESSION['DBName']=$Settings['sqldb'];
-if($cookieDomain==null) {
-setcookie("MemberName", $YourNameAM, time() + (7 * 86400), $cbasedir);
-setcookie("UserID", $YourIDAM, time() + (7 * 86400), $cbasedir);
-setcookie("SessPass", $YourPassAM, time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("MemberName", $YourNameAM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
-setcookie("UserID", $YourIDAM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", $YourPassAM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("MemberName", $YourNameAM, time() + (7 * 86400), $cbasedir, $cookieDomain);
-setcookie("UserID", $YourIDAM, time() + (7 * 86400), $cbasedir, $cookieDomain);
-setcookie("SessPass", $YourPassAM, time() + (7 * 86400), $cbasedir, $cookieDomain); } }
-/*redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die();*/
-} } if($numlog2<=0||$numlog2>1||$BanError=="yes") { session_unset();
-if($cookieDomain==null) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
-setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain); } }
-unset($_COOKIE[session_name()]);
-$_SESSION = array(); //session_unset(); session_destroy();
-$temp_user_ip = $_SERVER['REMOTE_ADDR'];
-$exptime = $utccurtime->getTimestamp() - ini_get("session.gc_maxlifetime");
-sql_query(sql_pre_query("DELETE FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" < %i OR ip_address='%s'", array($exptime,$temp_user_ip)),$SQLStat);
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false)); sql_free_result($resultlog2); sql_free_result($gresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-?>
diff --git a/inc/profilemain.php.bak b/inc/profilemain.php.bak
deleted file mode 100644 (file)
index 4c9ce81..0000000
+++ /dev/null
@@ -1,1216 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: profilemain.php - Last Update: 09/10/2015 SVN 801 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="profilemain.php"||$File3Name=="/profilemain.php") {
-       require('index.php');
-       exit(); }
-
-// Check if we can edit the profile
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['CanEditProfile']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_POST['update'])) { $_POST['update'] = null; }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "UserCP";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Profile Editor</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<table class="Table3">
-<tr style="width: 100%; vertical-align: top;">
-       <td style="width: 15%; vertical-align: top;">
-       <div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Profile Settings</div>
-<?php } ?>
-<table id="ProfileLinks" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Profile Settings</td>
-</tr><?php } ?>
-<tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit NotePad</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=profile",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit Profile</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=signature",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit Signature</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=avatar",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit Avatar</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-<div class="DivSMenu">&nbsp;</div>
-<div class="TableSMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableSMenuRow1">
-<?php echo $ThemeSet['TitleIcon']; ?>Board Settings</div>
-<?php } ?>
-<table class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableSMenuRow1">
-<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Board Settings</td>
-</tr><?php } ?>
-<tr class="TableSMenuRow2">
-<td class="TableSMenuColumn2">&nbsp;</td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Board Settings</a></td>
-</tr><tr class="TableSMenuRow3">
-<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=userinfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Change User Info</a></td>
-</tr><tr class="TableSMenuRow4">
-<td class="TableSMenuColumn4">&nbsp;</td>
-</tr></table></div>
-</td>
-       <td style="width: 85%; vertical-align: top;">
-<?php if($_POST['update']=="now"&&$_GET['act']!=null) {
-$updateact = url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
-redirect("refresh",$rbasedir.url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile'],FALSE),"3");
-$noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Updating Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileUpdate">
-<td class="TableMenuColumn3">
-<div style="text-align: center;">
-<br />Profile updated <a href="<?php echo $updateact; ?>">click here</a> to go back. ^_^<br />&nbsp;</div>
-<?php } if($_GET['act']=="view") {
-if($_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$Notes=sql_result($result,$i,"Notes");
-$noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">NotePad</th>
-</tr>
-<tr class="TableMenuRow3" id="NotePadRow">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
-<label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
-<textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
-<input type="hidden" name="act" value="view" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
-</div></form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php sql_free_result($result); }
-if($_POST['update']=="now") {
-if($_POST['act']=="view"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       $_POST['NotePad'] = htmlspecialchars($_POST['NotePad'], ENT_QUOTES, $Settings['charset']);
-       $_POST['NotePad'] = remove_bad_entities($_POST['NotePad']);
-       //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
-       //$_POST['Signature'] = remove_spaces($_POST['Signature']);
-       //$_POST['Signature'] = remove_bad_entities($_POST['Signature']);
-       /*    <_<  iWordFilter  >_>      
-    by Kazuki Przyborowski - Cool Dude 2k */
-       $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-       $katarzynart=sql_query($katarzynaqy,$SQLStat);
-       $katarzynanm=sql_num_rows($katarzynart);
-       $katarzynas=0;
-       while ($katarzynas < $katarzynanm) {
-       $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-       $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-       $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-       if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-       if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-       if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-       $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-       if($WholeWord=="on") { $WholeWord = "yes"; }
-       if($WholeWord=="off") { $WholeWord = "no"; }
-       if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-       $Filter = preg_quote($Filter, "/");
-       if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-       $_POST['NotePad'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['NotePad']); }
-       if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-       $_POST['NotePad'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['NotePad']); }
-       if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-       $_POST['NotePad'] = preg_replace("/".$Filter."/", $Replace, $_POST['NotePad']); }
-       if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-       $_POST['NotePad'] = preg_replace("/".$Filter."/i", $Replace, $_POST['NotePad']); }
-       ++$katarzynas; } sql_free_result($katarzynart);
-       $NewDay=$utccurtime->getTimestamp();
-       $NewIP=$_SERVER['REMOTE_ADDR'];
-       $querynewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Notes\"='%s',\"LastActive\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($_POST['NotePad'],$NewDay,$NewIP,$_SESSION['UserID']));
-               sql_query($querynewskin,$SQLStat); } } }
-if($_GET['act']=="signature") {
-if($_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$Signature=sql_result($result,$i,"Signature"); 
-$signatureact = url_maker($exfile['profile'],$Settings['file_ext'],"act=signature",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." Signature Editor";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Signature Editor</th>
-</tr>
-<tr class="TableMenuRow3" id="SignatureRow">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $signatureact; ?>"><div style="text-align: center;">
-<label class="TextBoxLabel" for="Signature">Your Signature</label><br />
-<textarea class="TextBox" name="Signature" id="Signature" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Signature; ?></textarea>
-<input type="hidden" name="act" value="signature" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
-</div></form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php sql_free_result($result); }
-if($_POST['update']=="now") {
-if($_POST['act']=="signature"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       $_POST['Signature'] = stripcslashes(htmlspecialchars($_POST['Signature'], ENT_QUOTES));
-       //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
-       //$_POST['Signature'] = remove_spaces($_POST['Signature']);
-       $_POST['Signature'] = remove_bad_entities($_POST['Signature']);
-       /*    <_<  iWordFilter  >_>      
-    by Kazuki Przyborowski - Cool Dude 2k */
-       $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-       $katarzynart=sql_query($katarzynaqy,$SQLStat);
-       $katarzynanm=sql_num_rows($katarzynart);
-       $katarzynas=0;
-       while ($katarzynas < $katarzynanm) {
-       $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-       $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-       $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-       if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-       if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-       if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-       $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-       if($WholeWord=="on") { $WholeWord = "yes"; }
-       if($WholeWord=="off") { $WholeWord = "no"; }
-       if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-       $Filter = preg_quote($Filter, "/");
-       if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-       $_POST['Signature'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Signature']); }
-       if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-       $_POST['Signature'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Signature']); }
-       if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-       $_POST['Signature'] = preg_replace("/".$Filter."/", $Replace, $_POST['Signature']); }
-       if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-       $_POST['Signature'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Signature']); }
-       ++$katarzynas; } sql_free_result($katarzynart);
-       $NewDay=$utccurtime->getTimestamp();
-       $NewIP=$_SERVER['REMOTE_ADDR'];
-       $querynewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Signature\"='%s',\"LastActive\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($_POST['Signature'],$NewDay,$NewIP,$_SESSION['UserID']));
-       sql_query($querynewskin,$SQLStat); } } }
-if($_GET['act']=="avatar") {
-if($_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$User1Avatar=sql_result($result,$i,"Avatar"); 
-$User1AvatarSize=sql_result($result,$i,"AvatarSize");
-$avataract = url_maker($exfile['profile'],$Settings['file_ext'],"act=avatar",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." Avatar Editor";
-$Pre1Avatar = $User1Avatar;
-if ($User1Avatar==null) { $User1Avatar="http://"; }
-if ($Pre1Avatar=="http://"||$Pre1Avatar==null||
-       strtolower($Pre1Avatar)=="noavatar") {
-$Pre1Avatar=$ThemeSet['NoAvatar'];
-$User1AvatarSize=$ThemeSet['NoAvatarSize']; }
-$AvatarSize1=explode("x", $User1AvatarSize);
-$AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Avatar Editor</th>
-</tr>
-<tr class="TableMenuRow3" id="AvatarEditor">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $avataract; ?>">
-<?php  // Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/  
- ?>
- <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
-       <tr class="AvatarRow" style="width: 100%; height: 100%;">
-               <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
-               <img src="<?php echo $Pre1Avatar; ?>" alt="<?php echo $_SESSION['MemberName']; ?>'s Avatar" title="<?php echo $_SESSION['MemberName']; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
-               </td>
-       </tr>
- </table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="Avatar">Your Avatar</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="Avatar" id="Avatar" value="<?php echo $User1Avatar; ?>" size="20" /></td>
-       </tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="AvatarSizeW">Avatar Width</label></td>
-       <td style="width: 60%;"><select size="1" name="AvatarSizeW" id="AvatarSizeW" class="TextBox">
-       <option value="<?php echo $AvatarSize1W; ?>" selected="selected"><?php echo $AvatarSize1W; ?></option><?php echo "\n"; $r=1; while ($r <= 100) { ?><option value="<?php echo $r ?>"><?php echo $r; ?></option><?php echo "\n"; ++$r; } ?>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="AvatarSizeH">Avatar Height</label></td>
-       <td style="width: 60%;"><select size="1" name="AvatarSizeH" id="AvatarSizeH" class="TextBox">
-<option value="<?php echo $AvatarSize1H; ?>" selected="selected"><?php echo $AvatarSize1H; ?></option><?php echo "\n"; $s=1; while ($s <= 100) { ?><option value="<?php echo $s ?>"><?php echo $s; ?></option><?php echo "\n"; ++$s; } ?>
-</select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="avatar" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Save" />
-<input class="Button" type="reset" />
-</td></tr></table>
-</form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php sql_free_result($result); }
-if($_POST['update']=="now") {
-if($_POST['Avatar']!=null&&$_POST['AvatarSizeW']!=null&&$_POST['AvatarSizeH']!=null&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       if(!is_numeric($_POST['AvatarSizeW'])) { $_POST['AvatarSizeW'] = 100; }
-       if($_POST['AvatarSizeW']>=100) { $_POST['AvatarSizeW']=100; }
-       if(!is_numeric($_POST['AvatarSizeH'])) { $_POST['AvatarSizeH'] = 100; }
-       if($_POST['AvatarSizeH']>=100) { $_POST['AvatarSizeH']=100; }
-       $fullavatarsize = $_POST['AvatarSizeW']."x".$_POST['AvatarSizeH'];
-       $_POST['Avatar'] = htmlentities($_POST['Avatar'], ENT_QUOTES, $Settings['charset']);
-       $NewDay=$utccurtime->getTimestamp();
-       $NewIP=$_SERVER['REMOTE_ADDR'];
-       $_POST['Avatar'] = remove_spaces($_POST['Avatar']);
-       $querynewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Avatar\"='%s',\"AvatarSize\"='%s',\"LastActive\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($_POST['Avatar'],$fullavatarsize,$NewDay,$NewIP,$_SESSION['UserID']));
-       sql_query($querynewskin,$SQLStat); } } }
-if($_GET['act']=="settings") {
-if($_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$User1TimeZone=sql_result($result,$i,"TimeZone"); 
-$User1DateFormat=sql_result($result,$i,"DateFormat");
-$User1DateFormat = htmlspecialchars($User1DateFormat, ENT_QUOTES, $Settings['charset']);
-$User1TimeFormat=sql_result($result,$i,"TimeFormat");
-$User1TimeFormat= htmlspecialchars($User1TimeFormat, ENT_QUOTES, $Settings['charset']);
-$settingsact = url_maker($exfile['profile'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." Board Settings"; 
-// http://www.tutorialspoint.com/php/php_function_timezone_identifiers_list.htm
-$timezone_identifiers = DateTimeZone::listIdentifiers();
-//$timezone_identifiers = timezone_identifiers_list();
-$zonelist['africa'] = array();
-$zonelist['america'] = array();
-$zonelist['antarctica'] = array();
-$zonelist['asia'] = array();
-$zonelist['atlantic'] = array();
-$zonelist['australia'] = array();
-$zonelist['europe'] = array();
-$zonelist['indian'] = array();
-$zonelist['pacific'] = array();
-$zonelist['etcetera'] = array();
-for ($i=0; $i < count($timezone_identifiers); $i++) {
-    $zonelookup = explode("/", $timezone_identifiers[$i]);
-    if(count($zonelookup)==1) { array_push($zonelist['etcetera'], array($timezone_identifiers[$i], $timezone_identifiers[$i])); }
-    if(count($zonelookup)>1) { 
-        if($zonelookup[0]=="Africa") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['africa'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['africa'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="America") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['america'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['america'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Antarctica") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['antarctica'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['antarctica'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Asia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['asia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['asia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Atlantic") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['atlantic'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['atlantic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Australia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['australia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['australia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Europe") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['europe'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['europe'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Indian") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['indian'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['indian'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Pacific") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['pacific'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['pacific'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-    }
-}
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Board Settings</th>
-</tr>
-<tr class="TableMenuRow3" id="BoardSettings">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $settingsact; ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
-       <td style="width: 60%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
-<optgroup label="Africa">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['africa']); $i++) {
-    if($User1TimeZone==$zonelist['africa'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['africa'][$i][1]."\">".str_replace("_", " ", $zonelist['africa'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="America">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['america']); $i++) {
-    if($User1TimeZone==$zonelist['america'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['america'][$i][1]."\">".str_replace("_", " ", $zonelist['america'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Antarctica">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['antarctica']); $i++) {
-    if($User1TimeZone==$zonelist['antarctica'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['antarctica'][$i][1]."\">".str_replace("_", " ", $zonelist['antarctica'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Asia">
-<?php
-for ($i=0; $i < count($zonelist['asia']); $i++) {
-    if($User1TimeZone==$zonelist['asia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['asia'][$i][1]."\">".str_replace("_", " ", $zonelist['asia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Atlantic">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['atlantic']); $i++) {
-    if($User1TimeZone==$zonelist['atlantic'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['atlantic'][$i][1]."\">".str_replace("_", " ", $zonelist['atlantic'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Australia">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['australia']); $i++) {
-    if($User1TimeZone==$zonelist['australia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['australia'][$i][1]."\">".str_replace("_", " ", $zonelist['australia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Europe">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['europe']); $i++) {
-    if($User1TimeZone==$zonelist['europe'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['europe'][$i][1]."\">".str_replace("_", " ", $zonelist['europe'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Indian">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['indian']); $i++) {
-    if($User1TimeZone==$zonelist['indian'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['indian'][$i][1]."\">".str_replace("_", " ", $zonelist['indian'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Pacific">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['pacific']); $i++) {
-    if($User1TimeZone==$zonelist['pacific'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['pacific'][$i][1]."\">".str_replace("_", " ", $zonelist['pacific'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Etcetera">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['etcetera']); $i++) {
-    if($User1TimeZone==$zonelist['etcetera'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['etcetera'][$i][1]."\">".str_replace("_", " ", $zonelist['etcetera'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="iDBTimeFormat" id="iDBTimeFormat" value="<?php echo $User1DateFormat; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="iDBDateFormat" id="iDBDateFormat" value="<?php echo $User1TimeFormat; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="skin">Pick a CSS Theme</label></td>
-       <td style="width: 60%;"><select id="skin" name="skin" class="TextBox">
-<option selected="selected" value="<?php echo $_SESSION['Theme']; ?>">Old Value (<?php echo $_SESSION['Theme']; ?>)</option><?php
-if($Settings['SQLThemes']=="off") {
-$skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
-if ($handle = opendir($skindir)) { $dirnum = null;
-   while (false !== ($file = readdir($handle))) {
-          if ($dirnum==null) { $dirnum = 0; }
-          if (file_exists($skindir.$file."/info.php")) {
-                  if ($file != "." && $file != "..") {
-          include($skindir.$file."/info.php");
-       $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>";
-          ++$dirnum; } } }
-   closedir($handle); asort($themelist);
-   $themenum=count($themelist); $themei=0; 
-   while ($themei < $themenum) {
-   echo $themelist[$themei]."\n";
-   ++$themei; } } }
-if($Settings['SQLThemes']=="on") {
-$sknquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" ORDER BY \"id\" ASC, \"Name\" ASC", array(null));
-$sknresult=sql_query($sknquery,$SQLStat);
-$sknum=sql_num_rows($sknresult);
-$skni=0;
-while ($skni < $sknum) {
-$ThemeInfo['Name'] = sql_result($sknresult,$skni,"Name");
-$ThemeInfo['ThemeName'] = sql_result($sknresult,$skni,"ThemeName");
-echo "<option value=\"".$ThemeInfo['Name']."\">".$ThemeInfo['ThemeName']."</option>\n";
-++$skni; }
-} ?></select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="RepliesPerPage">Replies Per Page:</label></td>
-       <td style="width: 60%;"><select id="RepliesPerPage" name="RepliesPerPage" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="TopicsPerPage">Topics Per Page:</label></td>
-       <td style="width: 60%;"><select id="TopicsPerPage" name="TopicsPerPage" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="MessagesPerPage">Messages/Members Per Page:</label></td>
-       <td style="width: 60%;"><select id="MessagesPerPage" name="MessagesPerPage" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="settings" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Save" />
-<input class="Button" type="reset" />
-</td></tr></table>
-</form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php sql_free_result($result); }
-if($_POST['update']=="now") {
-if($_POST['act']=="settings"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       $NewDay=$utccurtime->getTimestamp();
-       $NewIP=$_SERVER['REMOTE_ADDR'];
-       $_SESSION['UserTimeZone'] = $_POST['YourOffSet'];
-       $usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-       $usercurtime->setTimezone($usertz);
-       if(!is_numeric($_POST['RepliesPerPage'])) { $_POST['RepliesPerPage'] = "10"; }
-       if(!is_numeric($_POST['TopicsPerPage'])) { $_POST['TopicsPerPage'] = "10"; }
-       if(!is_numeric($_POST['MessagesPerPage'])) { $_POST['MessagesPerPage'] = "10"; }
-       $_POST['iDBTimeFormat'] = convert_strftime($_POST['iDBTimeFormat']);
-       $_POST['iDBDateFormat'] = convert_strftime($_POST['iDBDateFormat']);
-       $querynewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"TimeZone\"='%s',\"DateFormat\"='%s',\"TimeFormat\"='%s',\"LastActive\"=%i,\"RepliesPerPage\"=%i,\"TopicsPerPage\"=%i,\"MessagesPerPage\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array(chack_themes($_POST['skin']),$_POST['YourOffSet'],$_POST['iDBTimeFormat'],$_POST['iDBDateFormat'],$NewDay,$_POST['RepliesPerPage'],$_POST['TopicsPerPage'],$_POST['MessagesPerPage'],$NewIP,$_SESSION['UserID']));
-       sql_query($querynewskin,$SQLStat); } } }
-if($_GET['act']=="profile") {
-if($_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$User1Interests=sql_result($result,$i,"Interests"); 
-$User1Title=sql_result($result,$i,"Title");
-$User1Website=sql_result($result,$i,"Website"); 
-$User1Website = urlcheck($User1Website);
-$User1Gender=sql_result($result,$i,"Gender");
-$User1TimeZone=sql_result($result,$i,"TimeZone");
-$User1DateFormat=sql_result($result,$i,"DateFormat");
-$User1DateFormat = htmlspecialchars($User1DateFormat, ENT_QUOTES, $Settings['charset']);
-$User1TimeFormat=sql_result($result,$i,"TimeFormat");
-$User1TimeFormat= htmlspecialchars($User1TimeFormat, ENT_QUOTES, $Settings['charset']);
-$BirthDay=sql_result($result,$i,"BirthDay");
-$BirthMonth=sql_result($result,$i,"BirthMonth");
-$BirthYear=sql_result($result,$i,"BirthYear");
-$User1Birthday = "MM/DD/YYYY";
-if($BirthMonth!=null&&$BirthDay!=null&&$BirthYear!=null) { 
-       if($BirthYear=="0") { $BirthYear = "YYYY"; }
-       if($BirthDay=="0") { $BirthDay = "DD"; }
-       if($BirthMonth=="0") { $BirthMonth = "MM"; }
-       if(pre_strlen($BirthMonth)=="1") { $BirthMonth = "0".$BirthMonth; }
-       if(pre_strlen($BirthDay)=="1") { $BirthDay = "0".$BirthDay; }
-    if($BirthYear!="MM"&&$BirthYear!="DD"&&$BirthYear!="YYYY"&&
-       checkdate($BirthMonth,$BirthDay,$BirthYear)===false) {
-       $BirthMonth = "MM"; $BirthDay = "DD"; $BirthYear = "YYYY"; }
-       $User1Birthday = $BirthMonth."/".$BirthDay."/".$BirthYear; }
-$profileact = url_maker($exfile['profile'],$Settings['file_ext'],"act=profile",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." Profile Editor";
-// http://www.tutorialspoint.com/php/php_function_timezone_identifiers_list.htm
-$timezone_identifiers = DateTimeZone::listIdentifiers();
-//$timezone_identifiers = timezone_identifiers_list();
-$zonelist['africa'] = array();
-$zonelist['america'] = array();
-$zonelist['antarctica'] = array();
-$zonelist['asia'] = array();
-$zonelist['atlantic'] = array();
-$zonelist['australia'] = array();
-$zonelist['europe'] = array();
-$zonelist['indian'] = array();
-$zonelist['pacific'] = array();
-$zonelist['etcetera'] = array();
-for ($i=0; $i < count($timezone_identifiers); $i++) {
-    $zonelookup = explode("/", $timezone_identifiers[$i]);
-    if(count($zonelookup)==1) { array_push($zonelist['etcetera'], array($timezone_identifiers[$i], $timezone_identifiers[$i])); }
-    if(count($zonelookup)>1) { 
-        if($zonelookup[0]=="Africa") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['africa'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['africa'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="America") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['america'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['america'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Antarctica") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['antarctica'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['antarctica'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Asia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['asia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['asia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Atlantic") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['atlantic'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['atlantic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Australia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['australia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['australia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Europe") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['europe'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['europe'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Indian") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['indian'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['indian'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Pacific") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['pacific'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['pacific'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-    }
-}
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">Profile Editor</th>
-</tr>
-<tr class="TableMenuRow3" id="ProfileEditor">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $profileact; ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="Interests">Your Interests</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="Interests" id="Interests" value="<?php echo $User1Interests; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="Title">Your Title</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="Title" id="Title" value="<?php echo $User1Title; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="Website">Your Website</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="Website" id="Website" value="<?php echo $User1Website; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="EventDay">Your Birthday</label></td>
-       <td style="width: 60%;"><input maxlength="10" type="text" class="TextBox" name="EventDay" id="EventDay" value="<?php echo $User1Birthday; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
-       <td style="width: 60%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
-<optgroup label="Africa">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['africa']); $i++) {
-    if($User1TimeZone==$zonelist['africa'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['africa'][$i][1]."\">".str_replace("_", " ", $zonelist['africa'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="America">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['america']); $i++) {
-    if($User1TimeZone==$zonelist['america'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['america'][$i][1]."\">".str_replace("_", " ", $zonelist['america'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Antarctica">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['antarctica']); $i++) {
-    if($User1TimeZone==$zonelist['antarctica'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['antarctica'][$i][1]."\">".str_replace("_", " ", $zonelist['antarctica'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Asia">
-<?php
-for ($i=0; $i < count($zonelist['asia']); $i++) {
-    if($User1TimeZone==$zonelist['asia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['asia'][$i][1]."\">".str_replace("_", " ", $zonelist['asia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Atlantic">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['atlantic']); $i++) {
-    if($User1TimeZone==$zonelist['atlantic'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['atlantic'][$i][1]."\">".str_replace("_", " ", $zonelist['atlantic'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Australia">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['australia']); $i++) {
-    if($User1TimeZone==$zonelist['australia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['australia'][$i][1]."\">".str_replace("_", " ", $zonelist['australia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Europe">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['europe']); $i++) {
-    if($User1TimeZone==$zonelist['europe'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['europe'][$i][1]."\">".str_replace("_", " ", $zonelist['europe'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Indian">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['indian']); $i++) {
-    if($User1TimeZone==$zonelist['indian'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['indian'][$i][1]."\">".str_replace("_", " ", $zonelist['indian'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Pacific">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['pacific']); $i++) {
-    if($User1TimeZone==$zonelist['pacific'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['pacific'][$i][1]."\">".str_replace("_", " ", $zonelist['pacific'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Etcetera">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['etcetera']); $i++) {
-    if($User1TimeZone==$zonelist['etcetera'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['etcetera'][$i][1]."\">".str_replace("_", " ", $zonelist['etcetera'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="iDBTimeFormat" id="iDBTimeFormat" value="<?php echo $User1DateFormat; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="iDBDateFormat" id="iDBDateFormat" value="<?php echo $User1TimeFormat; ?>" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
-       <td style="width: 60%;"><select id="YourGender" name="YourGender" class="TextBox">
-<option selected="selected" value="<?php echo $User1Gender; ?>">Old Value (<?php echo $User1Gender; ?>)</option>
-<option value="Male">Male</option>
-<option value="Female">Female</option>
-<option value="Unknown">Unknown</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="RepliesPerPage">Replies Per Page:</label></td>
-       <td style="width: 60%;"><select id="RepliesPerPage" name="RepliesPerPage" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="TopicsPerPage">Topics Per Page:</label></td>
-       <td style="width: 60%;"><select id="TopicsPerPage" name="TopicsPerPage" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-<option value="30">35</option>
-<option value="30">40</option>
-</select></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="MessagesPerPage">Messages/Members Per Page:</label></td>
-       <td style="width: 60%;"><select id="MessagesPerPage" name="MessagesPerPage" class="TextBox">
-<option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
-<option value="5">5</option>
-<option value="10">10</option>
-<option value="15">15</option>
-<option value="20">20</option>
-<option value="25">25</option>
-<option value="30">30</option>
-</select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="profile" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Save" />
-<input class="Button" type="reset" />
-</td></tr></table>
-</form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php sql_free_result($result); }
-if($_POST['update']=="now") {
-if($_POST['act']=="profile"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       $_POST['Interests'] = htmlspecialchars($_POST['Interests'], ENT_QUOTES, $Settings['charset']);
-       $_POST['Interests'] = remove_spaces($_POST['Interests']);
-       $_POST['Title'] = htmlspecialchars($_POST['Title'], ENT_QUOTES, $Settings['charset']);
-       $_POST['Title'] = remove_spaces($_POST['Title']);
-       $_POST['Website'] = htmlentities($_POST['Website'], ENT_QUOTES, $Settings['charset']);
-       $_POST['Website'] = remove_spaces($_POST['Website']);
-       //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
-       //$_POST['Signature'] = remove_spaces($_POST['Signature']);
-       //$_POST['Signature'] = remove_bad_entities($_POST['Signature']);
-       /*    <_<  iWordFilter  >_>      
-    by Kazuki Przyborowski - Cool Dude 2k */
-       $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-       $katarzynart=sql_query($katarzynaqy,$SQLStat);
-       $katarzynanm=sql_num_rows($katarzynart);
-       $katarzynas=0;
-       while ($katarzynas < $katarzynanm) {
-       $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-       $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-       $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-       if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-       if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-       if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-       $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-       if($WholeWord=="on") { $WholeWord = "yes"; }
-       if($WholeWord=="off") { $WholeWord = "no"; }
-       if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-       $Filter = preg_quote($Filter, "/");
-       if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-       $_POST['Interests'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Interests']);
-       $_POST['Title'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Title']); }
-       if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-       $_POST['Interests'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Interests']);
-       $_POST['Title'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Title']); }
-       if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-       $_POST['Interests'] = preg_replace("/".$Filter."/", $Replace, $_POST['Interests']);
-       $_POST['Title'] = preg_replace("/".$Filter."/", $Replace, $_POST['Title']); }
-       if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-       $_POST['Interests'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Interests']); 
-       $_POST['Title'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Title']); }
-       ++$katarzynas; } sql_free_result($katarzynart);
-       if(!is_numeric($_POST['RepliesPerPage'])) { $_POST['RepliesPerPage'] = "10"; }
-       if(!is_numeric($_POST['TopicsPerPage'])) { $_POST['TopicsPerPage'] = "10"; }
-       if(!is_numeric($_POST['MessagesPerPage'])) { $_POST['MessagesPerPage'] = "10"; }
-       if(!isset($_POST['EventDay'])) { $_POST['EventDay'] = null; }
-       if($_POST['EventDay']!=null) {
-       $BirthExpl = explode("/",$_POST['EventDay']);
-       if(count($BirthExpl)!="3") { 
-       $BirthExpl[0] = "0"; $BirthExpl[1] = "0"; $BirthExpl[2] = "0"; }
-       if(!is_numeric($BirthExpl[0])) { $BirthExpl[0] = "0"; }
-       if(!is_numeric($BirthExpl[1])) { $BirthExpl[1] = "0"; }
-       if(!is_numeric($BirthExpl[2])) { $BirthExpl[2] = "0"; }
-       if(count($BirthExpl)=="3"&&checkdate($BirthExpl[0],$BirthExpl[1],$BirthExpl[2])===true) {
-       if(is_numeric($BirthExpl[0])&&is_numeric($BirthExpl[1])&&is_numeric($BirthExpl[2])) {
-       if(pre_strlen($BirthExpl[0])=="1") { $BirthExpl[0] = "0".$BirthExpl[0]; }
-       if(pre_strlen($BirthExpl[1])=="1") { $BirthExpl[1] = "0".$BirthExpl[1]; }
-       if(pre_strlen($BirthExpl[0])=="2"&&pre_strlen($BirthExpl[1])=="2"&&pre_strlen($BirthExpl[2])=="4") {
-       $BirthIn = mktime(12,12,12,$BirthExpl[0],$BirthExpl[1],$BirthExpl[2]);
-       $tmpusrcurtime = new DateTime();
-       $tmpusrcurtime->setTimestamp($BirthIn);
-       $tmpusrcurtime->setTimezone($utctz);
-       $BirthMonth=$tmpusrcurtime->format("m");
-       $BirthDay=$tmpusrcurtime->format("d");
-       $BirthYear=$tmpusrcurtime->format("Y"); }
-       if(pre_strlen($BirthExpl[0])!="2"||pre_strlen($BirthExpl[1])!="2"||pre_strlen($BirthExpl[2])!="4") { 
-               $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
-       if (!is_numeric($BirthExpl[0])||!is_numeric($BirthExpl[1])||!is_numeric($BirthExpl[2])) { 
-               $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
-       if(count($BirthExpl)=="3"&&
-       checkdate($BirthExpl[0],$BirthExpl[1],$BirthExpl[2])===false) {
-       $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; }
-       if(count($BirthExpl)!="3") { $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
-       if($_POST['EventDay']==null) { $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; }
-       $_SESSION['UserTimeZone'] = $_POST['YourOffSet'];
-       $usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-       $usercurtime->setTimezone($usertz);
-       $NewDay=$utccurtime->getTimestamp();
-       $NewIP=$_SERVER['REMOTE_ADDR'];
-       $_POST['Website'] = urlcheck($_POST['Website']);
-       $_POST['iDBTimeFormat'] = convert_strftime($_POST['iDBTimeFormat']);
-       $_POST['iDBDateFormat'] = convert_strftime($_POST['iDBDateFormat']);
-       $querynewprofile = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Interests\"='%s',\"Title\"='%s',\"Website\"='%s',\"TimeZone\"='%s',\"DateFormat\"='%s',\"TimeFormat\"='%s',\"Gender\"='%s',\"LastActive\"=%i,\"BirthMonth\"=%i,\"BirthDay\"=%i,\"BirthYear\"=%i,\"RepliesPerPage\"=%i,\"TopicsPerPage\"=%i,\"MessagesPerPage\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($_POST['Interests'],$_POST['Title'],$_POST['Website'],$_POST['YourOffSet'],$_POST['iDBTimeFormat'],$_POST['iDBDateFormat'],$_POST['YourGender'],$NewDay,$BirthMonth,$BirthDay,$BirthYear,$_POST['RepliesPerPage'],$_POST['TopicsPerPage'],$_POST['MessagesPerPage'],$NewIP,$_SESSION['UserID']));
-       sql_query($querynewprofile,$SQLStat); } } }
-if($_GET['act']=="userinfo") {
-if($_POST['update']!="now") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-$YourID=sql_result($result,$i,"id");
-$User1Email=sql_result($result,$i,"Email"); 
-$userinfoact = url_maker($exfile['profile'],$Settings['file_ext'],"act=userinfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
-$profiletitle = " ".$ThemeSet['TitleDivider']." User Info Editer";
-?>
-<div class="TableMenuBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableMenuRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
-</span></div>
-<?php } ?>
-<table class="TableMenu" style="width: 100%;">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableMenuRow1">
-<td class="TableMenuColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
-</span></td>
-</tr><?php } ?>
-<tr id="ProfileTitle" class="TableMenuRow2">
-<th class="TableMenuColumn2">User Info Editer</th>
-</tr>
-<tr class="TableMenuRow3" id="UserInfoEditor">
-<td class="TableMenuColumn3">
-<form style="display: inline;" method="post" action="<?php echo $userinfoact; ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="OldPass">Insert old Password:</label></td>
-       <td style="width: 60%;"><input maxlength="30" type="password" class="TextBox" name="OldPass" size="20" id="OldPass" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
-       <td style="width: 60%;"><input maxlength="30" type="password" class="TextBox" name="Password" size="20" id="Password" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
-       <td style="width: 60%;"><input maxlength="30" type="password" class="TextBox" name="RePassword" size="20" id="RePassword" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 40%;"><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
-       <td style="width: 60%;"><input type="text" class="TextBox" name="Email" size="20" id="Email" value="<?php echo $User1Email; ?>" /></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="userinfo" style="display: none;" />
-<input type="hidden" name="update" value="now" style="display: none;" />
-<input type="submit" class="Button" value="Save" />
-<input class="Button" type="reset" />
-</td></tr></table>
-</form></td>
-</tr>
-<tr id="ProfileEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr>
-</table>
-</div>
-<?php sql_free_result($result); }
-if($_POST['update']=="now") {
-if($_POST['act']=="userinfo"&&
-       $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-       $result=sql_query($query,$SQLStat);
-       $num=sql_num_rows($result);
-       $i=0;
-       $OldPassword=sql_result($result,$i,"UserPassword");
-       $OldHashType=sql_result($result,$i,"HashType");
-       $OldJoined=sql_result($result,$i,"Joined");
-       $OldSalt=sql_result($result,$i,"Salt");
-       $UpdateHash = false;
-if($OldHashType=="ODFH") { 
-       $YourPassword = PassHash2x($_POST['OldPass']); }
-if($OldHashType=="IPB2") { 
-       $YourPassword = hash2xkey($_POST['OldPass'],$OldSalt); }
-if($OldHashType=="DF4H") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1"); }
-if($OldHashType=="iDBH2") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"md2"); }
-if($OldHashType=="iDBH4") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"md4"); }
-if($OldHashType=="iDBH5") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"md5"); }
-if($OldHashType=="iDBH") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1"); }
-if($OldHashType=="iDBH1") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1"); }
-if($OldHashType=="iDBH224") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha224"); }
-if($OldHashType=="iDBH256") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha256"); }
-if($OldHashType=="iDBH384") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha384"); }
-if($OldHashType=="iDBH512") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha512"); }
-if($OldHashType=="iDBHRMD128") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"ripemd128"); }
-if($OldHashType=="iDBHRMD160") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"ripemd160"); }
-if($OldHashType=="iDBHRMD256") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"ripemd256"); }
-if($OldHashType=="iDBHRMD320") { 
-       $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"ripemd320"); }
-if($YourPassword!=$OldPassword) { $Error="Yes"; ?>
-<div class="TableMessage" style="text-align: center;">Your old Password did not match.<br />&nbsp;</div>
-<?php } if(pre_strlen($_POST['Password'])>"60") { $Error="Yes"; ?>
-<div class="TableMessage" style="text-align: center;">Your password is too big.<br />&nbsp;</div>
-<?php } if(pre_strlen($_POST['OldPass'])>"60") { $Error="Yes"; ?>
-<div class="TableMessage" style="text-align: center;">Your old password is too big.<br />&nbsp;</div>
-<?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes";  ?>
-<div class="TableMessage" style="text-align: center;">Your passwords did not match.<br />&nbsp;</div>
-<?php }
-       $NewIP=$_SERVER['REMOTE_ADDR'];
-       if($Error!="Yes") { 
-       if($_POST['Password']!="") {
-       $NewSalt = salt_hmac(); $NewDay = $utccurtime->getTimestamp();
-       if($Settings['use_hashtype']=="md2") { $iDBHash = "iDBH2";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"md2"); }
-       if($Settings['use_hashtype']=="md4") { $iDBHash = "iDBH4";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"md4"); }
-       if($Settings['use_hashtype']=="md5") { $iDBHash = "iDBH5";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"md5"); }
-       if($Settings['use_hashtype']=="sha1") { $iDBHash = "iDBH";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
-       if($Settings['use_hashtype']=="sha224") { $iDBHash = "iDBH224";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha224"); }
-       if($Settings['use_hashtype']=="sha256") { $iDBHash = "iDBH256";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha256"); }
-       if($Settings['use_hashtype']=="sha384") { $iDBHash = "iDBH384";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha384"); }
-       if($Settings['use_hashtype']=="sha512") { $iDBHash = "iDBH512";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha512"); }
-       if($Settings['use_hashtype']=="ripemd128") { $iDBHash = "iDBHRMD128";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"ripemd128"); }
-       if($Settings['use_hashtype']=="ripemd160") { $iDBHash = "iDBHRMD160";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"ripemd160"); }
-       if($Settings['use_hashtype']=="ripemd256") { $iDBHash = "iDBHRMD256";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"ripemd256"); }
-       if($Settings['use_hashtype']=="ripemd320") { $iDBHash = "iDBHRMD320";
-       $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"ripemd320"); }
-       $_SESSION['UserPass']=$NewPassword;
-       if($cookieDomain==null) {
-       setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
-       if($cookieDomain!=null) {
-       if($cookieSecure===true) {
-       setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-       if($cookieSecure===false) {
-       setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } }
-       $_POST['Email'] = remove_spaces($_POST['Email']);
-       if($_POST['Password']!="") {
-       $querynewuserinfo = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UserPassword\"='%s',\"HashType\"='%s',\"Email\"='%s',\"LastActive\"=%i,\"IP\"='%s',\"Salt\"='%s' WHERE \"id\"=%i", array($NewPassword,$iDBHash,$_POST['Email'],$NewDay,$NewIP,$NewSalt,$_SESSION['UserID']));
-       sql_query($querynewuserinfo,$SQLStat); }
-       if($_POST['Password']=="") {
-       echo $querynewuserinfo = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Email\"='%s',\"LastActive\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($_POST['Email'],$NewDay,$NewIP,$_SESSION['UserID']));
-       sql_query($querynewuserinfo,$SQLStat); } } } } }
-?>
-<?php if($_POST['update']=="now"&&$_GET['act']!=null) {
-       $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
-</td></tr>
-<tr id="ProfileTitleEnd" class="TableMenuRow4">
-<td class="TableMenuColumn4">&nbsp;</td>
-</tr></table></div><?php } ?>
-</td></tr>
-</table>
-<div class="DivProfile">&nbsp;</div>
\ No newline at end of file
diff --git a/inc/replies.php.bak b/inc/replies.php.bak
deleted file mode 100644 (file)
index 9244924..0000000
+++ /dev/null
@@ -1,2101 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: replies.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="replies.php"||$File3Name=="/replies.php") {
-       require('index.php');
-       exit(); }
-$pstring = null; $pagenum = null;
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!is_numeric($_GET['post'])) { $_GET['post'] = null; }
-if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
-if(!isset($_GET['st'])) { $_GET['st'] = 0; }
-if(!is_numeric($_GET['st'])) { $_GET['st'] = 0; }
-if(!isset($_GET['modact'])) { $_GET['modact'] = null; }
-if(!isset($_GET['link'])) { $_GET['link'] = "no"; } 
-if(!isset($_GET['level'])) { $_GET['level'] = 1; } 
-if(!is_numeric($_GET['level'])) { $_GET['level'] = 1; }
-if($_GET['link']!="yes"&&$_GET['link']!="no") { $_GET['link'] = "no"; }
-if($_GET['modact']=="pin"||$_GET['modact']=="unpin"||$_GET['modact']=="open"||
-       $_GET['modact']=="move"||$_GET['modact']=="close"||$_GET['modact']=="edit"||
-       $_GET['modact']=="delete"||$_GET['modact']=="announce")
-               { $_GET['act'] = $_GET['modact']; }
-if($_GET['act']=="announce") { $_GET['act'] = "pin"; $_GET['level'] = 2; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i".$ForumIgnoreList4." LIMIT 1", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$TopicName=sql_result($preresult,0,"TopicName");
-$TopicID=sql_result($preresult,0,"id");
-$TopicForumID=sql_result($preresult,0,"ForumID");
-$TopicCatID=sql_result($preresult,0,"CategoryID");
-$TopicClosed=sql_result($preresult,0,"Closed");
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_GET['post'])||$_GET['post']!==null) {
-$NumberReplies=sql_result($preresult,0,"NumReply"); }
-if(isset($_GET['post'])&&$_GET['post']!==null) {
-$NumberReplies=1; }
-$ViewTimes=sql_result($preresult,0,"NumViews");
-sql_free_result($preresult);
-$forumcheckx = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."  LIMIT 1", array($TopicForumID));
-$fmckresult=sql_query($forumcheckx,$SQLStat);
-$fmcknum=sql_num_rows($fmckresult);
-if($fmcknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ForumID=sql_result($fmckresult,0,"id");
-$ForumName=sql_result($fmckresult,0,"Name");
-$ForumType=sql_result($fmckresult,0,"ForumType");
-$ForumShow=sql_result($fmckresult,0,"ShowForum");
-$InSubForum=sql_result($fmckresult,0,"InSubForum");
-if($InSubForum!=0) {
-$subforumcheckx = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."  LIMIT 1", array($InSubForum));
-$subfmckresult=sql_query($subforumcheckx,$SQLStat);
-$subfmcknum=sql_num_rows($subfmckresult);
-$SubForumName=sql_result($subfmckresult,0,"Name");
-$SubForumType=sql_result($subfmckresult,0,"ForumType");
-$SubForumShow=sql_result($subfmckresult,0,"ShowForum");
-sql_free_result($subfmckresult); }
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CanHaveTopics=sql_result($fmckresult,0,"CanHaveTopics");
-$ForumPostCountView=sql_result($fmckresult,0,"PostCountView");
-$ForumKarmaCountView=sql_result($fmckresult,0,"KarmaCountView");
-sql_free_result($fmckresult);
-$catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2."  LIMIT 1", array($TopicCatID));
-$catresult=sql_query($catcheck,$SQLStat);
-$CategoryID=sql_result($catresult,0,"id");
-$CategoryName=sql_result($catresult,0,"Name");
-$CategoryShow=sql_result($catresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($catresult,0,"CategoryType");
-$InSubCategory=sql_result($catresult,0,"InSubCategory");
-$CategoryPostCountView=sql_result($catresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
-sql_free_result($catresult);
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($ForumCheck!="skip") {
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$TopicCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php echo $ThemeSet['NavLinkDivider']; if($InSubForum!=0 && $subfmcknum>0) { ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$InSubForum."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $SubForumName; ?></a><?php echo $ThemeSet['NavLinkDivider']; } ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$TopicForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php }
-if(!isset($CatPermissionInfo['CanViewCategory'][$TopicCatID])) {
-       $CatPermissionInfo['CanViewCategory'][$TopicCatID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$TopicCatID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($PermissionInfo['CanViewForum'][$TopicForumID])) {
-       $PermissionInfo['CanViewForum'][$TopicForumID] = "no"; }
-if($PermissionInfo['CanViewForum'][$TopicForumID]=="no"||
-       $PermissionInfo['CanViewForum'][$TopicForumID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_GET['act']!="view") { 
-$CanMakeReply = "no"; $CanMakeTopic = "no";
-if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") { 
-       $CanMakeTopic = "yes"; }
-if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-       $CanMakeReply = "yes"; }
-if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
-       &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-               $CanMakeReply = "yes"; } ?>
-<table style="width: 100%;" class="Table2">
-<tr>
- <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
- <td style="width: 70%; text-align: right;">
- <?php if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="yes"&&$PermissionInfo['CanViewForum'][$TopicForumID]=="yes") {
- if($CanMakeReply=="yes") { ?>
- <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['AddReply']; ?></a>
- <?php } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
-       if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?>
- <?php echo $ThemeSet['ButtonDivider']; } ?>
- <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$TopicForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
- <?php } ?></td>
-</tr>
-</table>
-<div class="DivTable2">&nbsp;</div>
-<?php } } if($_GET['act']=="view") {
-if($ForumCheck!="skip") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id']."&page=".$_GET['page'],"&","=",$prexqstr['topic'],$exqstr['topic']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['topic'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['topic']; }
-$_SESSION['PreViewingTitle'] = "Viewing Topic:";
-$_SESSION['ViewingTitle'] = $TopicName; 
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:".$TopicID."; currentmessageid:0; currenteventid:0; currentmemberid:0;"; }
-if($NumberReplies==null) { 
-       $NumberReplies = 0; }
-$num=$NumberReplies+1;
-//Start Reply Page Code
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$nums = $_GET['page'] * $Settings['max_posts']; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$nums = $_GET['st']; }
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_posts'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_posts']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_posts']) { 
-       $pnum = $pnum - $Settings['max_posts']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_posts']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-$snumber = $_GET['page'] - 1;
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$PageLimit = $Settings['max_posts'] * $snumber; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$PageLimit = $_GET['st']; }
-if($PageLimit<0) { $PageLimit = 0; }
-//End Reply Page Code
-$i=0;
-if(!isset($_GET['post'])||$_GET['post']!==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$PageLimit,$Settings['max_posts'])); }
-if(isset($_GET['post'])&&$_GET['post']!==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i AND \"id\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$_GET['post'],$PageLimit,$Settings['max_posts'])); }
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-if($num==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($num!=0) { 
-if($ViewTimes==0||$ViewTimes==null) { $NewViewTimes = 1; }
-if($ViewTimes!=0&&$ViewTimes!=null) { $NewViewTimes = $ViewTimes + 1; }
-$viewsup = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumViews\"='%s' WHERE \"id\"=%i", array($NewViewTimes,$_GET['id']));
-sql_query($viewsup,$SQLStat); }
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($num==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-//List Page Number Code end
-$CanMakeReply = "no"; $CanMakeTopic = "no";
-if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") { 
-       $CanMakeTopic = "yes"; }
-if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-       $CanMakeReply = "yes"; }
-if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
-       &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
-               $CanMakeReply = "yes"; }
-if($pstring!=null||$CanMakeReply=="yes"||$CanMakeTopic=="yes") {
-?>
-<table style="width: 100%;" class="Table2">
-<tr>
- <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
- <td style="width: 70%; text-align: right;">
- <?php if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="yes"&&$PermissionInfo['CanViewForum'][$TopicForumID]=="yes") {
- if($CanMakeReply=="yes") { ?>
- <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['AddReply']; ?></a>
- <?php } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
-       if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?>
- <?php echo $ThemeSet['ButtonDivider']; } ?>
- <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$TopicForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
- <?php } ?></td>
-</tr>
-</table>
-<?php }
-/* <div class="DivPageLinks">&nbsp;</div> */
-?>
-<div class="DivTable2">&nbsp;</div>
-<?php }
-while ($i < $num) {
-$MyPostID=sql_result($result,$i,"id");
-$MyTopicID=sql_result($result,$i,"TopicID");
-$MyPostIP=sql_result($result,$i,"IP");
-$MyForumID=sql_result($result,$i,"ForumID");
-$MyCategoryID=sql_result($result,$i,"CategoryID");
-$MyUserID=sql_result($result,$i,"UserID");
-$MyGuestName=sql_result($result,$i,"GuestName");
-$MyTimeStamp=sql_result($result,$i,"TimeStamp");
-$MyEditTime=sql_result($result,$i,"LastUpdate");
-$MyEditUserID=sql_result($result,$i,"EditUser");
-$MyEditUserName=sql_result($result,$i,"EditUserName");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($MyTimeStamp);
-$tmpusrcurtime->setTimezone($usertz);
-$MyTimeStamp=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$MyPost=sql_result($result,$i,"Post");
-$MyDescription=sql_result($result,$i,"Description");
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-if($renum<1) { $MyUserID = -1;
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult); }
-$memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$memreresult=sql_query($memrequery,$SQLStat);
-$memrenum=sql_num_rows($memreresult);
-$rei=0; $ipshow = "two";
-$User1ID=$MyUserID; $GuestsName = $MyGuestName;
-$User1Name=sql_result($reresult,$rei,"Name");
-$User1IP=sql_result($reresult,$rei,"IP");
-if($User1IP==$MyPostIP) { $ipshow = "one"; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$PreUserCanExecPHP=sql_result($memreresult,$rei,"CanExecPHP");
-if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
-       $PreUserCanExecPHP = "no"; }
-$PreUserCanDoHTML=sql_result($memreresult,$rei,"CanDoHTML");
-if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
-       $PreUserCanDoHTML = "no"; }
-$PreUserCanUseBBTags=sql_result($memreresult,$rei,"CanUseBBTags");
-if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
-       $PreUserCanUseBBTags = "no"; }
-sql_free_result($memreresult);
-$User1Joined=sql_result($reresult,$rei,"Joined");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($User1Joined);
-$tmpusrcurtime->setTimezone($usertz);
-$User1Joined=$tmpusrcurtime->format($_SESSION['iDBDateFormat']);
-$User1Hidden=sql_result($reresult,$rei,"HiddenMember");
-$User1LevelID=sql_result($reresult,$rei,"LevelID");
-$lquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($User1LevelID));
-$lresult=sql_query($lquery,$SQLStat);
-$User1Level=sql_result($lresult,0,"Name");
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-$User1CanExecPHP = $PreUserCanExecPHP;
-if($PreUserCanExecPHP=="group") {
-$User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
-if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
-       $User1CanExecPHP = "no"; }
-$User1CanDoHTML = $PreUserCanDoHTML;
-if($PreUserCanDoHTML=="group") {
-$User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
-if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
-       $User1CanDoHTML = "no"; }
-$User1CanUseBBTags = $PreUserCanUseBBTags;
-if($User1CanUseBBTags=="group") {
-$User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
-if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
-       $User1CanUseBBTags = "no"; }
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-$User1PermissionID=sql_result($gresult,0,"PermissionID");
-sql_free_result($gresult); sql_free_result($lresult);
-$per1query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i LIMIT 1", array($User1PermissionID));
-$per1esult=sql_query($per1query,$SQLStat);
-$per1num=sql_num_rows($per1esult);
-$User1CanDoHTML1=sql_result($per1esult,0,"CanDoHTML");
-if($User1CanDoHTML1!="yes"&&$User1CanDoHTML1!="no") {
-       $User1CanDoHTML1 = "no"; }
-$User1CanUseBBTags1=sql_result($per1esult,0,"CanUseBBTags");
-if($User1CanUseBBTags1!="yes"&&$User1CanUseBBTags1!="no") {
-       $User1CanUseBBTags1 = "no"; }
-sql_free_result($per1esult);
-if($User1Title=="") { $User1Title = $User1Group; }
-$User1Signature=sql_result($reresult,$rei,"Signature");
-$User1Avatar=sql_result($reresult,$rei,"Avatar");
-$User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
-if ($User1Avatar=="http://"||$User1Avatar==null||
-       strtolower($User1Avatar)=="noavatar") {
-$User1Avatar=$ThemeSet['NoAvatar'];
-$User1AvatarSize=$ThemeSet['NoAvatarSize']; }
-$AvatarSize1=explode("x", $User1AvatarSize);
-$AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
-$User1Website=sql_result($reresult,$rei,"Website");
-if($User1Website=="http://") { 
-       $User1Website = $Settings['idburl']; }
-$User1Website = urlcheck($User1Website);
-$BoardWWWChCk = parse_url($Settings['idburl']);
-$User1WWWChCk = parse_url($User1Website);
-$opennew = " onclick=\"window.open(this.href);return false;\"";
-if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
-       $opennew = null; }
-$User1PostCount=sql_result($reresult,$rei,"PostCount");
-$User1Karma=sql_result($reresult,$rei,"Karma");
-$User1IP=sql_result($reresult,$rei,"IP");
-sql_free_result($reresult);
-if($User1Name=="Guest") { $User1Name=$GuestsName;
-if($User1Name==null) { $User1Name="Guest"; } }
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $User1Name = $GroupNamePrefix.$User1Name; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $User1Name = $User1Name.$GroupNameSuffix; }
-$MySubPost = null;
-if($MyEditTime!=$MyTimeStamp&&$MyEditUserID!=0) {
-if($MyEditUserID!=$MyUserID) {
-$euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
-$euresult = sql_query($euquery,$SQLStat);
-$eunum = sql_num_rows($euresult);
-if($eunum<1) { $MyEditUserID = -1;
-$euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
-$euresult = sql_query($euquery,$SQLStat);
-$eunum = sql_num_rows($euresult); }
-       $EditUserID = $MyEditUserID;
-       $EditUserGroupID = sql_result($euresult,0,"GroupID");
-       $EditUserHidden=sql_result($euresult,0,"HiddenMember");
-       $EditUserName = sql_result($euresult,0,"Name");
-       sql_free_result($euresult);
-       $eugquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($EditUserGroupID));
-       $eugresult=sql_query($eugquery,$SQLStat);
-       $EditUserGroup=sql_result($eugresult,0,"Name");
-       $EditUserNamePrefix=sql_result($eugresult,0,"NamePrefix");
-       $EditUserNameSuffix=sql_result($eugresult,0,"NameSuffix");
-       sql_free_result($eugresult);    }
-       if($MyEditUserID==$MyUserID) {
-       $EditUserID = $User1ID;
-       $EditUserGroupID = $User1GroupID;
-       $EditUserHidden=$User1Hidden;
-       $EditUserName = $User1Name;
-       $EditUserGroup=$User1Group;
-       $EditUserNamePrefix=null;
-       $EditUserNameSuffix=null; }
-       if($EditUserName=="Guest") { $EditUserName=$MyEditUserName;
-       if($EditUserName==null) { $EditUserName="Guest"; } }
-       if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-               $EditUserName = $EditUserNamePrefix.$EditUserName; }
-       if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-               $EditUserName = $EditUserName.$EditUserNameSuffix; }
-       $tmpusrcurtime = new DateTime();
-       $tmpusrcurtime->setTimestamp($MyEditTime);
-       $tmpusrcurtime->setTimezone($usertz);
-       $MyEditTime = $tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-       $MySubPost = "<div class=\"EditReply\"><br />This post has been edited by <b>".$EditUserName."</b> on ".$MyEditTime."</div>"; }
-if($User1CanUseBBTags1=="yes") { $MyPost = bbcode_parser($MyPost); }
-if($User1CanExecPHP=="no") {
-$MyPost = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$MyPost); }
-if($User1CanExecPHP=="yes") { $MyPost = php_execute($MyPost); }
-if($User1CanDoHTML1=="no") {
-$MyPost = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$MyPost); }
-if($User1CanDoHTML1=="yes") { $MyPost = do_html_bbcode($MyPost); }
-$MyPost = text2icons($MyPost,$Settings['sqltable'],$SQLStat);
-$MyPost = preg_replace("/\<br\>/", "<br />", nl2br($MyPost));
-$MyPost = url2link($MyPost);
-if($MySubPost!=null) { $MyPost = $MyPost."\n".$MySubPost; }
-if($User1CanUseBBTags=="yes") { $User1Signature = bbcode_parser($User1Signature); }
-if($User1CanExecPHP=="no") {
-$User1Signature = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$User1Signature); }
-if($User1CanExecPHP=="yes") { $User1Signature = php_execute($User1Signature); }
-if($User1CanDoHTML1=="no") {
-$User1Signature = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$User1Signature); }
-if($User1CanDoHTML=="yes") { $User1Signature = do_html_bbcode($User1Signature); }
-$User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
-$User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
-$User1Signature = url2link($User1Signature);
-$CanEditReply = false; $CanDeleteReply = false;
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanEditReplys'][$MyForumID]=="yes"&&
-       $_SESSION['UserID']==$MyUserID) { $CanEditReply = true; }
-if($PermissionInfo['CanDeleteReplys'][$MyForumID]=="yes"&&
-       $_SESSION['UserID']==$MyUserID) { $CanDeleteReply = true; }
-if($PermissionInfo['CanModForum'][$MyForumID]=="yes") { 
-       $CanEditReply = true; $CanDeleteReply = true; } }
-if($_SESSION['UserID']==0) { 
-       $CanEditReply = false; $CanDeleteReply = false; }
-$ReplyNum = $i + $PageLimit + 1;
-?>
-<div class="TableInfo1Border" id="reply<?php echo $ReplyNum; ?>">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableInfoRow1">
-<span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$ReplyNum; ?>"><?php echo $TopicName; ?></a> ( <?php echo $MyDescription; ?> )</span>
-</div>
-<?php } ?>
-<table class="TableInfo1" id="post<?php echo $MyPostID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableInfoRow1">
-<td class="TableInfoColumn1" colspan="2"><span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$ReplyNum; ?>"><?php echo $TopicName; ?></a> ( <?php echo $MyDescription; ?> )</span>
-</td>
-</tr><?php } ?>
-<tr class="TableInfoRow2">
-<td class="TableInfoColumn2" style="vertical-align: middle; width: 160px;">
-&nbsp;<?php
-if($User1ID>0&&$User1Hidden=="no") {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$User1Name."</a>"; }
-if($User1ID<=0||$User1Hidden=="yes") {
-echo "<span>".$User1Name."</span>"; }
-?></td>
-<td class="TableInfoColumn2" style="vertical-align: middle;">
-<div style="float: left; text-align: left;">
-<span style="font-weight: bold; vertical-align: middle;">Time Posted: </span><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>" style="vertical-align: middle;"><?php echo $MyTimeStamp; ?></a>
-</div>
-<div style="float: right;">
-<?php if(isset($ThemeSet['Report'])&&$ThemeSet['Report']!=null) { ?>
-<a href="#Act/Report"><?php echo $ThemeSet['Report']; ?></a>
-<?php } if($CanEditReply===true&&isset($ThemeSet['EditReply'])&&$ThemeSet['EditReply']!=null) {
-echo $ThemeSet['LineDividerTopic']; echo "<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=edit&id=".$MyTopicID."&post=".$MyPostID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$ThemeSet['EditReply']; ?></a>
-<?php } if($CanDeleteReply===true&&isset($ThemeSet['DeleteReply'])&&$ThemeSet['DeleteReply']!=null) { 
-echo $ThemeSet['LineDividerTopic']; echo "<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=delete&id=".$MyTopicID."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$ThemeSet['DeleteReply']; ?></a>
-<?php } if($CanMakeReply=="yes"&&isset($ThemeSet['QuoteReply'])&&$ThemeSet['QuoteReply']!=null) { 
-echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['QuoteReply']; ?></a>
-<?php } ?>&nbsp;</div>
-</td>
-</tr>
-<tr class="TableInfoRow3">
-<td class="TableInfoColumn3" style="vertical-align: top; width: 180px;">
-<?php  // Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/  
- ?>
- <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
-       <tr class="AvatarRow" style="width: 100%; height: 100%;">
-               <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
-               <img src="<?php echo $User1Avatar; ?>" alt="<?php echo $User1Name; ?>'s Avatar" title="<?php echo $User1Name; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
-               </td>
-       </tr>
- </table><br />
-<?php echo $User1Title; ?><br />
-Group: <?php echo $User1Group; ?><br />
-Level: <?php echo $User1Level; ?><br />
-Member: <?php 
-if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
-if($User1ID<=0||$User1Hidden=="yes") { echo 0; }
-?><br />
-Posts: <?php echo $User1PostCount; ?><br />
-Karma: <?php echo $User1Karma; ?><br />
-Joined: <?php echo $User1Joined; ?><br />
-<?php if($GroupInfo['CanViewIPAddress']=="yes") { ?>
-User IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$User1IP); ?>">
-<?php echo $User1IP; ?></a><br />
-<?php if($ipshow=="two") { ?>
-Post IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$MyPostIP); ?>">
-<?php echo $MyPostIP; ?></a><br />
-<?php } } ?><br />
-</td>
-<td class="TableInfoColumn3" style="vertical-align: middle;">
-<div class="replypost"><?php echo $MyPost; ?></div>
-<?php if(isset($User1Signature)&&$User1Signature!="") { ?> <br />--------------------
-<div class="signature"><?php echo $User1Signature; ?></div><?php } ?>
-</td>
-</tr>
-<tr class="TableInfoRow4">
-<td class="TableInfoColumn4" colspan="2">
-<span style="text-align: left; float: left;">&nbsp;<a href="<?php
-if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); }
-if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
-echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-?>"><?php echo $ThemeSet['Profile']; ?></a>
-<?php if(isset($ThemeSet['WWW'])&&$ThemeSet['WWW']!=null) {
-echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo $User1Website; ?>"<?php echo $opennew; ?>><?php echo $ThemeSet['WWW']; ?></a><?php } echo $ThemeSet['LineDividerTopic']; ?><a href="<?php
-if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
-echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); }
-if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
-echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
-?>"><?php echo $ThemeSet['PM']; ?></a></span>
-<span style="text-align: right; float: right; font-weight: bold;"><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>" title="Link to post #<?php echo $ReplyNum; ?>" style="vertical-align: middle; font-weight: bold;">
-#<?php echo $ReplyNum; ?></a>&nbsp;</span>
-</td>
-</tr>
-</table></div>
-<div class="DivReplies">&nbsp;</div>
-<?php ++$i; } sql_free_result($result); } 
-if(($utccurtime->getTimestamp()<$_SESSION['LastPostTime']&&$_SESSION['LastPostTime']!=0)&&
-($_GET['act']=="create"||$_GET['act']=="edit"||$_GET['act']=="makereply"||$_GET['act']=="editreply")) { 
-$_GET['act'] = "view"; $_POST['act'] = null; 
-redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE),"3"); ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Reply Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<tr>
-       <td><span class="TableMessage"><br />
-       You have to wait before making/editing another post.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to view your reply.<br />&nbsp;
-       </span><br /></td>
-</tr>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkReply">&nbsp;</div>
-<?php } if($_GET['act']=="create") {
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$QuoteReply = null; $QuoteDescription = null;
-if($_GET['post']==null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC  LIMIT 1", array($_GET['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$QuoteDescription=sql_result($result,0,"Description"); 
-$QuoteDescription = str_replace("Re: ","",$QuoteDescription);
-$QuoteDescription = "Re: ".$QuoteDescription;
-sql_free_result($result); }
-if($_GET['post']!=null) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-if($num>=1) {
-$QuoteReplyID=sql_result($result,0,"id");
-$QuoteReplyFID=sql_result($result,0,"ForumID");
-$QuoteReplyCID=sql_result($result,0,"CategoryID");
-$QuoteUserID=sql_result($result,0,"UserID");
-$QuoteReply=sql_result($result,0,"Post");
-$QuoteReply = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","",$QuoteReply);
-$QuoteDescription=sql_result($result,0,"Description");
-$QuoteGuestName=sql_result($result,0,"GuestName");
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($QuoteUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-if($renum<1) { $QuoteUserID = -1;
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($QuoteUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult); }
-$QuoteUserName=sql_result($reresult,0,"Name");
-if($QuoteUserName=="Guest") { $QuoteUserName=$QuoteGuestName;
-if($QuoteUserName==null) { $QuoteUserName="Guest"; } }
-$QuoteUserName = stripcslashes(htmlspecialchars($QuoteUserName, ENT_QUOTES, $Settings['charset']));
-//$QuoteUserName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $QuoteUserName);
-$QuoteUserName = remove_spaces($QuoteUserName);
-/*$QuoteReply = stripcslashes(htmlspecialchars($QuoteReply, ENT_QUOTES, $Settings['charset']));
-$QuoteReply = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $QuoteReply);
-//$QuoteReply = remove_spaces($QuoteReply);*/
-$QuoteReply = remove_bad_entities($QuoteReply);
-$QuoteDescription = str_replace("Re: ","",$QuoteDescription);
-$QuoteDescription = "Re: ".$QuoteDescription;
-$QuoteReply = $QuoteUserName.":\n(&quot;".$QuoteReply."&quot;)";
-if(!isset($PermissionInfo['CanViewForum'][$QuoteReplyFID])) {
-       $PermissionInfo['CanViewForum'][$QuoteReplyFID] = "no"; }
-if($PermissionInfo['CanViewForum'][$QuoteReplyFID]=="no") {
-       $QuoteReply = null; $QuoteDescription = null; }
-if(!isset($CatPermissionInfo['CanViewCategory'][$QuoteReplyCID])) {
-       $CatPermissionInfo['CanViewCategory'][$QuoteReplyCID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$QuoteReplyCID]=="no") {
-       $QuoteReply = null; $QuoteDescription = null; } } }
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($_GET['post']!=null&&$num>=1) {
-$rforumcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."  LIMIT 1", array($QuoteReplyFID));
-$rfmckresult=sql_query($rforumcheck,$SQLStat);
-$rForumPostCountView=sql_result($rfmckresult,0,"PostCountView");
-$rForumKarmaCountView=sql_result($rfmckresult,0,"KarmaCountView");
-sql_free_result($rfmckresult);
-$rcatcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2."  LIMIT 1", array($QuoteReplyCID));
-$rcatresult=sql_query($rcatcheck,$SQLStat);
-$rCategoryPostCountView=sql_result($rcatresult,0,"PostCountView");
-$rCategoryKarmaCountView=sql_result($rcatresult,0,"KarmaCountView");
-sql_free_result($rcatresult);
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($rForumPostCountView!=0&&$MyPostCountChk<$rForumPostCountView) {
-$QuoteReply = null; $QuoteDescription = null; }
-if($rCategoryPostCountView!=0&&$MyPostCountChk<$rCategoryPostCountView) {
-$QuoteReply = null; $QuoteDescription = null; }
-if($rForumKarmaCountView!=0&&$MyKarmaCount<$rForumKarmaCountView) {
-$QuoteReply = null; $QuoteDescription = null; }
-if($rCategoryKarmaCountView!=0&&$MyKarmaCount<$rCategoryKarmaCountView) {
-$QuoteReply = null; $QuoteDescription = null; } } }
-if($_GET['post']==null||$num<1) { $QuoteReply = null; /*$QuoteDescription = null;*/ }
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="MakeReply<?php echo $TopicForumID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="ReplyStart<?php echo $TopicForumID; ?>">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="MakeReplyRow<?php echo $TopicForumID; ?>" class="TableRow2">
-<td class="TableColumn2" colspan="2" style="width: 100%;">Making a Reply in Topic <?php echo $TopicName; ?></td>
-</tr>
-<tr class="TableRow3" id="MkReply<?php echo $TopicForumID; ?>">
-<td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
-<div style="width: 100%; height: 160px; overflow: auto;">
-<table style="width: 100%; text-align: center;"><?php
-$renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
-$renee_result=sql_query($renee_query,$SQLStat);
-$renee_num=sql_num_rows($renee_result);
-$renee_s=0; $rose_a=0; $SmileRow=0; $SmileCRow=0;
-while ($renee_s < $renee_num) { ++$SmileRow;
-$FileName=sql_result($renee_result,$renee_s,"FileName");
-$SmileName=sql_result($renee_result,$renee_s,"SmileName");
-$SmileText=sql_result($renee_result,$renee_s,"SmileText");
-$SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
-$ShowSmile=sql_result($renee_result,$renee_s,"Display");
-$ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
-if($SmileRow==1) { ?><tr>
-       <?php } if($SmileRow<5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
-       <?php ++$rose_a; } if($SmileRow==5) { ++$SmileCRow; $rose_a = 0; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
-       <?php $SmileCRow=0; $SmileRow=0; }
-++$renee_s; }
-if($SmileCRow<5&&$SmileCRow!=0) {
-$SmileCRowL = 5 - $SmileCRow;
-echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
-echo "</table>";
-sql_free_result($renee_result);
-?></div></td>
-<td class="TableColumn3" style="width: 85%;">
-<form style="display: inline;" method="post" id="MkReplyForm" action="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=makereply&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
-       <td style="width: 50%;"><input maxlength="45" type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" value="<?php echo $QuoteDescription; ?>" /></td>
-</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-<?php } ?></tr><?php } ?>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
-<textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"><?php echo $QuoteReply; ?></textarea><br />
-<?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
-<label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
-<input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
-<?php } ?>
-<input type="hidden" name="act" value="makereplies" style="display: none;" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="submit" class="Button" value="Make Reply" name="make_reply" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form></td></tr>
-<tr id="MkReplyEnd<?php echo $TopicForumID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkReply">&nbsp;</div>
-<?php } if($_GET['act']=="makereply"&&$_POST['act']=="makereplies") {
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$MyUsersID = $_SESSION['UserID']; if($MyUsersID=="0"||$MyUsersID==null) { $MyUsersID = -1; }
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; }
-if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; }
-if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-require($SettDir['inc']."captcha.php"); }
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Reply Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php if (pre_strlen($_POST['ReplyDesc'])>"80") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your Reply Description is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-if (PhpCaptcha::Validate($_POST['signcode'])) {
-//echo 'Valid code entered';
-} else { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Invalid code entered<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You Guest Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Settings['TestReferer']=="on") {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } }
-$_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ReplyDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
-$_POST['ReplyDesc'] = remove_spaces($_POST['ReplyDesc']);
-$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
-$_POST['GuestName'] = remove_spaces($_POST['GuestName']);
-$_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ReplyPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
-//$_POST['ReplyPost'] = remove_spaces($_POST['ReplyPost']);
-$_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']);
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
-if($cookieDomain==null) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain); } }
-$_SESSION['GuestName']=$_POST['GuestName']; } }
-/*    <_<  iWordFilter  >_>      
-   by Kazuki Przyborowski - Cool Dude 2k */
-$katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-$katarzynart=sql_query($katarzynaqy,$SQLStat);
-$katarzynanm=sql_num_rows($katarzynart);
-$katarzynas=0;
-while ($katarzynas < $katarzynanm) {
-$Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-$Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-$CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-$WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-if($WholeWord=="on") { $WholeWord = "yes"; }
-if($WholeWord=="off") { $WholeWord = "no"; }
-if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-$Filter = preg_quote($Filter, "/");
-if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-$_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyPost']); }
-if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-$_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyPost']); }
-if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-$_POST['ReplyDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyPost']); }
-if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-$_POST['ReplyDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyPost']); }
-++$katarzynas; } sql_free_result($katarzynart);
-if ($_POST['ReplyDesc']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Reply Description.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $_POST['GuestName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Guest Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You do not have permission to make a reply here.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&
-       $TopicClosed==1) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You do not have permission to make a reply here.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['ReplyPost']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Reply.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if ($Error!="Yes") { $LastActive = $utccurtime->getTimestamp();
-$gnrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($TopicForumID));
-$gnrresult=sql_query($gnrquery,$SQLStat); $gnrnum=sql_num_rows($gnrresult);
-$NumberPosts=sql_result($gnrresult,0,"NumPosts"); 
-$PostCountAdd=sql_result($gnrresult,0,"PostCountAdd"); 
-sql_free_result($gnrresult);
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUsersID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0;
-while ($rei < $renum) {
-$User1ID=$MyUsersID;
-$User1Name=sql_result($reresult,$rei,"Name");
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$PostCount=sql_result($reresult,$rei,"PostCount");
-$NewPostCount = null;
-if($PostCountAdd=="on") { $NewPostCount = $PostCount + 1; }
-if(!isset($NewPostCount)) { $NewPostCount = $PostCount; }
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-sql_free_result($gresult);
-$User1IP=$_SERVER['REMOTE_ADDR'];
-++$rei; } sql_free_result($reresult);
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
-"(%i, %i, %i, %i, '%s', %i, %i, 0, '', '%s', '%s', '%s', '0')", array($TopicID,$TopicForumID,$TopicCatID,$User1ID,$User1Name,$LastActive,$LastActive,$_POST['ReplyPost'],$_POST['ReplyDesc'],$User1IP));
-sql_query($query,$SQLStat);
-$postid = sql_get_next_id($Settings['sqltable'],"posts",$SQLStat);
-$_SESSION['LastPostTime'] = $utccurtime->getTimestamp() + $GroupInfo['FloodControl'];
-if($User1ID!=0&&$User1ID!=-1) {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LastActive\"=%i,\"IP\"='%s',\"PostCount\"=%i,\"LastPostTime\"=%i WHERE \"id\"=%i", array($LastActive,$User1IP,$NewPostCount,$_SESSION['LastPostTime'],$User1ID));
-sql_query($queryupd,$SQLStat); }
-$NewNumPosts = $NumberPosts + 1; $NewNumReplies = $NumberReplies + 1;
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i WHERE \"id\"=%i", array($NewNumPosts,$TopicForumID));
-sql_query($queryupd,$SQLStat);
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumReply\"=%i,LastUpdate=%i WHERE \"id\"=%i", array($NewNumReplies,$LastActive,$TopicID));
-sql_query($queryupd,$SQLStat);
-$MyPostNum = $NewNumReplies + 1; $NumPages = null;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($MyPostNum>$Settings['max_posts']) {
-$NumPages = ceil($MyPostNum/$Settings['max_posts']); }
-if($MyPostNum<=$Settings['max_posts']) {
-$NumPages = 1; }
-redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE).$Settings['qstr']."#reply".$MyPostNum,"3");
-?><tr>
-       <td><span class="TableMessage"><br />
-       Reply to Topic <?php echo $TopicName; ?> was posted.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>&amp;&#35;reply<?php echo $MyPostNum; ?>">here</a> to view your reply.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } ?>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkReply">&nbsp;</div>
-<?php } if($_GET['act']=="pin"||$_GET['act']=="unpin") {
-$gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
-$gtsresult=sql_query($gtsquery,$SQLStat);
-$gtsnum=sql_num_rows($gtsresult);
-$TTopicID=sql_result($gtsresult,0,"id");
-$TForumID=sql_result($gtsresult,0,"ForumID");
-$TUsersID=sql_result($gtsresult,0,"UserID");
-$TPinned=sql_result($gtsresult,0,"Pinned");
-$TClosed=sql_result($gtsresult,0,"Closed");
-if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if ($TPinned>2) { $TPinned = 1; } 
-if ($TPinned<0) { $TPinned = 0; }
-$CanPinTopics = false;
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanPinTopics'][$TForumID]=="yes"&&
-       $_SESSION['UserID']==$TUsersID) { $CanPinTopics = true; }
-if($PermissionInfo['CanPinTopics'][$TForumID]=="yes"&&
-       $PermissionInfo['CanModForum'][$TForumID]=="yes") { 
-       $CanPinTopics = true; }
-       if($PermissionInfo['CanPinTopics'][$TForumID]=="no"&&
-               $TopicClosed==1) { $CanPinTopics = false; } }
-if($_SESSION['UserID']==0) { $CanPinTopics = false; }
-if($_GET['level']<1) { $_GET['level'] = 1; }
-if($_GET['level']>2) { $_GET['level'] = 1; }
-if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
-if($_GET['level']>1) { $_GET['level'] = 1; } }
-if($CanPinTopics===false) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($gtsresult);
-if($CanPinTopics===true) {
-       if($_GET['act']=="pin") {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Pinned\"=%i WHERE \"id\"=%i", array($_GET['level'],$TTopicID)); }
-       if($_GET['act']=="unpin") {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Pinned\"=0 WHERE \"id\"=%i", array($TTopicID)); } 
-sql_query($queryupd,$SQLStat); 
-redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],false).$Settings['qstr']."#post".$_GET['post'],"4");
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Pin/Unpin Topic Message: </th>
-</tr>
-<tr class="TableRow3" style="text-align: center;">
-       <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
-       Topic was successfully unpinned/pinned.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to go back to topic.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } } if($_GET['act']=="open"||$_GET['act']=="close") {
-$gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
-$gtsresult=sql_query($gtsquery,$SQLStat);
-$gtsnum=sql_num_rows($gtsresult);
-$TTopicID=sql_result($gtsresult,0,"id");
-$TForumID=sql_result($gtsresult,0,"ForumID");
-$TUsersID=sql_result($gtsresult,0,"UserID");
-$TClosed=sql_result($gtsresult,0,"Closed");
-if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if ($TClosed>3) { $TClosed = 3; } 
-if ($TClosed<0) { $TClosed = 0; }
-$CanCloseTopics = false;
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanCloseTopics'][$TForumID]=="yes"&&
-       $_SESSION['UserID']==$TUsersID) { $CanCloseTopics = true; }
-if($PermissionInfo['CanCloseTopics'][$TForumID]=="yes"&&
-       $PermissionInfo['CanModForum'][$TForumID]=="yes") { 
-       $CanCloseTopics = true; } }
-if($_GET['level']<1) { $_GET['level'] = 1; }
-if($_GET['level']>3) { $_GET['level'] = 1; }
-if($PermissionInfo['CanModForum'][$TForumID]=="no") {
-if($_GET['level']>1) { $_GET['level'] = 1; } }
-if($_SESSION['UserID']==0) { $CanCloseTopics = false; }
-if($CanCloseTopics===false) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($gtsresult);
-if($CanCloseTopics===true) {
-       if($_GET['act']=="close") {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Closed\"=%i WHERE \"id\"=%i", array($_GET['level'],$TTopicID)); }
-       if($_GET['act']=="open") {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Closed\"=0 WHERE \"id\"=%i", array($TTopicID)); } 
-sql_query($queryupd,$SQLStat); 
-redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],false).$Settings['qstr']."#post".$_GET['post'],"4");
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Open/Close Topic Message: </th>
-</tr>
-<tr class="TableRow3" style="text-align: center;">
-       <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
-       Topic was successfully opened/closed.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to go back to topic.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } } if($_GET['act']=="move") {
-if(!isset($_GET['newid'])) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!is_numeric($_GET['newid'])) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
-$gtsresult=sql_query($gtsquery,$SQLStat);
-$gtsnum=sql_num_rows($gtsresult);
-$TTopicID=sql_result($gtsresult,0,"id");
-$OldForumID=sql_result($gtsresult,0,"ForumID");
-$OldCatID=sql_result($gtsresult,0,"CategoryID");
-$TClosed=sql_result($gtsresult,0,"Closed");
-if($TopicClosed==2&&$PermissionInfo['CanModForum'][$OldForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$OldForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$CanMoveTopics = false;
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanCloseTopics'][$OldForumID]=="yes"&&
-       $PermissionInfo['CanModForum'][$OldForumID]=="yes") { 
-       $CanMoveTopics = true; }
-if($PermissionInfo['CanCloseTopics'][$_GET['newid']]=="yes"&&
-       $PermissionInfo['CanModForum'][$_GET['newid']]=="yes") { 
-       $CanMoveTopics = true; } }
-if($_SESSION['UserID']==0) { $CanMoveTopics = false; }
-//if($CanMoveTopics===false||$_GET['newid']==$OldForumID) {
-if($CanMoveTopics===false) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($gtsresult);
-if($CanMoveTopics===true) {
-$TNumberPosts = $NumberReplies + 1;
-$mvquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['newid']));
-$mvresult=sql_query($mvquery,$SQLStat);
-$mvnum=sql_num_rows($mvresult);
-if($mvnum<1) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult); $urlstatus = 302;
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($mvresult);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$NumberPosts=sql_result($mvresult,0,"NumPosts");
-$NumberPosts = $NumberPosts + $TNumberPosts;
-$NumberTopics=sql_result($mvresult,0,"NumTopics");
-$NumberTopics = $NumberTopics + 1;
-$NewCatID=sql_result($mvresult,0,"CategoryID");
-sql_free_result($mvresult);
-$recountq = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NumberPosts,$NumberTopics,$_GET['newid']));
-sql_query($recountq,$SQLStat);
-$mvquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($OldForumID));
-$mvresult=sql_query($mvquery,$SQLStat);
-$mvnum=sql_num_rows($mvresult);
-$NumberPosts=sql_result($mvresult,0,"NumPosts");
-$NumberPosts = $NumberPosts - $TNumberPosts;
-$NumberTopics=sql_result($mvresult,0,"NumTopics");
-$NumberTopics = $NumberTopics - 1;
-sql_free_result($mvresult);
-$recountq = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NumberPosts,$NumberTopics,$OldForumID));
-sql_query($recountq,$SQLStat);
-if($_GET['link']=="no") {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"ForumID\"=%i,\"CategoryID\"=%i,\"OldForumID\"=%i,\"OldCategoryID\"=%i WHERE \"id\"=%i", array($_GET['newid'],$NewCatID,$_GET['newid'],$NewCatID,$TTopicID)); }
-if($_GET['link']=="yes") {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"ForumID\"=%i,\"CategoryID\"=%i,\"OldForumID\"=%i,\"OldCategoryID\"=%i WHERE \"id\"=%i", array($_GET['newid'],$NewCatID,$OldForumID,$OldCatID,$TTopicID)); }
-sql_query($queryupd,$SQLStat);
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"ForumID\"=%i,\"CategoryID\"=%i WHERE \"TopicID\"=%i", array($_GET['newid'],$NewCatID,$TTopicID)); 
-sql_query($queryupd,$SQLStat);
-} 
-redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],false),"4");
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Move Topic Message: </th>
-</tr>
-<tr class="TableRow3" style="text-align: center;">
-       <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
-       Topic was successfully moved.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to go back to topic.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } if($_GET['act']=="delete") {
-$predquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
-$predresult=sql_query($predquery,$SQLStat);
-$prednum=sql_num_rows($predresult);
-$ReplyID=sql_result($predresult,0,"id");
-$ReplyTopicID=sql_result($predresult,0,"TopicID");
-$ReplyForumID=sql_result($predresult,0,"ForumID");
-$ReplyUserID=sql_result($predresult,0,"UserID");
-sql_free_result($predresult);
-$CanDeleteReply = false;
-if($_SESSION['UserID']!=0) {
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanDeleteReplys'][$ReplyForumID]=="yes"&&
-       $_SESSION['UserID']==$ReplyUserID) { $CanDeleteReply = true; } 
-if($PermissionInfo['CanDeleteReplys'][$ReplyForumID]=="yes"&&
-       $PermissionInfo['CanModForum'][$ReplyForumID]=="yes") { 
-       $CanDeleteReply = true; } } 
-       if($PermissionInfo['CanDeleteReplysClose'][$TopicForumID]=="no"&&
-               $TopicClosed==1) { $CanDeleteReply = false; } }
-if($_SESSION['UserID']==0) { $CanDeleteReply = false; }
-if($CanDeleteReply===false) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$delquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($_GET['id']));
-$delresult=sql_query($delquery,$SQLStat);
-$delnum=sql_num_rows($delresult);
-$DelTopic = false;
-$gnrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($ReplyForumID));
-$gnrresult=sql_query($gnrquery,$SQLStat); $gnrnum=sql_num_rows($gnrresult);
-$NumberPosts=sql_result($gnrresult,0,"NumPosts"); $NumberTopics=sql_result($gnrresult,0,"NumTopics"); 
-sql_free_result($gnrresult);
-$FReplyID=sql_result($delresult,0,"id");
-if($ReplyID==$FReplyID) { $DelTopic = true;
-$gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($ReplyTopicID));
-$gtsresult=sql_query($gtsquery,$SQLStat);
-$gtsnum=sql_num_rows($gtsresult);
-$TUsersID=sql_result($gtsresult,0,"UserID");
-$TForumID=sql_result($gtsresult,0,"ForumID");
-$TClosed=sql_result($gtsresult,0,"Closed");
-if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$CanDeleteTopics = false;
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($PermissionInfo['CanDeleteTopics'][$ReplyForumID]=="yes"&&
-       $_SESSION['UserID']==$TUsersID) { $CanDeleteTopics = true; }
-if($PermissionInfo['CanDeleteTopics'][$ReplyForumID]=="yes"&&
-       $PermissionInfo['CanModForum'][$ReplyForumID]=="yes") { 
-       $CanDeleteTopics = true; }
-       if($PermissionInfo['CanDeleteTopicsClose'][$TopicForumID]=="no"&&
-               $TopicClosed==1) { $CanDeleteTopics = false; } }
-if($_SESSION['UserID']==0) { $CanDeleteTopics = false; }
-if($CanDeleteTopics===false) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($delresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CanDeleteTopics===true) { $NewNumTopics = $NumberTopics - 1; $NewNumPosts = $NumberPosts - $delnum;
-$drquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i", array($ReplyTopicID));
-sql_query($drquery,$SQLStat); 
-$dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i", array($ReplyTopicID));
-sql_query($dtquery,$SQLStat);
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NewNumPosts,$NewNumTopics,$ReplyForumID));
-sql_query($queryupd,$SQLStat); } }
-if($ReplyID!=$FReplyID) {
-$LReplyID=sql_result($delresult,$delnum-1,"id");
-$SLReplyID=sql_result($delresult,$delnum-2,"id");
-$NewLastUpdate=sql_result($delresult,$delnum-2,"TimeStamp");
-if($ReplyID==$LReplyID) { $NewNumReplies = $NumberReplies - 1; $NewNumPosts = $NumberPosts - 1;
-$drquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i", array($ReplyID));
-sql_query($drquery,$SQLStat); 
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i WHERE \"id\"=%i", array($NewNumPosts,$ReplyForumID));
-sql_query($queryupd,$SQLStat);
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"LastUpdate\"=%i,\"NumReply\"=%i WHERE \"id\"=%i", array($NewLastUpdate,$NewNumReplies,$ReplyTopicID));
-sql_query($queryupd,$SQLStat); } }
-if($ReplyID!=$FReplyID&&$ReplyID!=$LReplyID) { $NewNumReplies = $NumberReplies - 1; $NewNumPosts = $NumberPosts - 1;
-$drquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i", array($ReplyID));
-sql_query($drquery,$SQLStat);
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i WHERE \"id\"=%i", array($NewNumPosts,$ReplyForumID));
-sql_query($queryupd,$SQLStat);
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumReply\"=%i WHERE \"id\"=%i", array($NewNumReplies,$ReplyTopicID));
-sql_query($queryupd,$SQLStat); }
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],FALSE),"3");
-sql_free_result($delresult);
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Delete Reply Message: </th>
-</tr>
-<tr class="TableRow3" style="text-align: center;">
-       <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
-       Reply was deleted successfully.<br />
-       Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to go back to index.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } if($_GET['act']=="edit") {
-if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no"||$_SESSION['UserID']==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ShowEditTopic = null;
-if($PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
-$editquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($TopicID));
-$editresult=sql_query($editquery,$SQLStat);
-$editnum=sql_num_rows($editresult);
-$FReplyID=sql_result($editresult,0,"id");
-sql_free_result($editresult);
-if($_GET['post']==$FReplyID) { $ShowEditTopic = true; } }
-if($PermissionInfo['CanEditTopics'][$TopicForumID]=="no") { $ShowEditTopic = null; }
-$ersquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
-$ersresult=sql_query($ersquery,$SQLStat);
-$ersnum=sql_num_rows($ersresult);
-if($ersnum==0) { sql_free_result($ersresult);
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ReplyPost=sql_result($ersresult,0,"Post");
-/*$ReplyPost = stripcslashes(htmlspecialchars($ReplyPost, ENT_QUOTES, $Settings['charset']));
-$ReplyPost = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ReplyPost);
-//$ReplyPost = remove_spaces($ReplyPost);*/
-$ReplyPost = remove_bad_entities($ReplyPost);
-$ReplyDescription=sql_result($ersresult,0,"Description");
-/*$ReplyDescription = stripcslashes(htmlspecialchars($ReplyDescription, ENT_QUOTES, $Settings['charset']));
-$ReplyDescription = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ReplyDescription);
-//$ReplyDescription = remove_spaces($ReplyDescription);*/
-$ReplyGuestName=sql_result($ersresult,0,"GuestName");
-//$ReplyGuestName = stripcslashes(htmlspecialchars($ReplyGuestName, ENT_QUOTES, $Settings['charset']));
-//$ReplyGuestName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ReplyGuestName);
-$ReplyGuestName = remove_spaces($ReplyGuestName);
-$ReplyUser=sql_result($ersresult,0,"UserID");
-if($_SESSION['UserID']!=$ReplyUser&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($ersresult);
-if($ShowEditTopic===true) {
-$gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($TopicID));
-$gtsresult=sql_query($gtsquery,$SQLStat);
-$gtsnum=sql_num_rows($gtsresult);
-$TUsersID=sql_result($gtsresult,0,"UserID");
-$TForumID=sql_result($gtsresult,0,"ForumID");
-$TClosed=sql_result($gtsresult,0,"Closed");
-if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserID']!=$TUsersID) { $ShowEditTopic = null; }
-if($PermissionInfo['CanModForum'][$TopicForumID]=="yes"&&
-       $PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") { 
-       $ShowEditTopic = true; } 
-if($PermissionInfo['CanEditTopicsClose'][$TopicForumID]=="no"&&$TopicClosed==1) {
-       $ShowEditTopic = null; } }
-//$TopicName = stripcslashes(htmlspecialchars($TopicName, ENT_QUOTES, $Settings['charset']));
-//$TopicName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $TopicName);
-$TopicName = remove_spaces($TopicName);
-if($ShowEditTopic===true) {
-sql_free_result($gtsresult); }
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="EditReply<?php echo $_GET['post']; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="ReplyEdit<?php echo $_GET['post']; ?>">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="EditReplyRow<?php echo $_GET['post']; ?>" class="TableRow2">
-<td class="TableColumn2" colspan="2" style="width: 100%;">Editing a Reply in Topic <?php echo $TopicName; ?></td>
-</tr>
-<tr class="TableRow3" id="EditReplies<?php echo $_GET['post']; ?>">
-<td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
-<div style="width: 100%; height: 160px; overflow: auto;"><?php
-$renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
-$renee_result=sql_query($renee_query,$SQLStat);
-$renee_num=sql_num_rows($renee_result);
-$renee_s=0; $SmileRow=1;
-while ($renee_s < $renee_num) {
-$FileName=sql_result($renee_result,$renee_s,"FileName");
-$SmileName=sql_result($renee_result,$renee_s,"SmileName");
-$SmileText=sql_result($renee_result,$renee_s,"SmileText");
-$SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
-$ShowSmile=sql_result($renee_result,$renee_s,"Display");
-$ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
-if($SmileRow<5) { ?>
-       <img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" />&nbsp;&nbsp;
-       <?php } if($SmileRow==5) { ?>
-       <img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /><br />
-       <?php $SmileRow=1; }
-++$renee_s; ++$SmileRow; }
-sql_free_result($renee_result);
-?></div></td>
-<td class="TableColumn3" style="width: 85%;">
-<form style="display: inline;" method="post" id="EditReplyForm" action="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=editreply&id=".$TopicID."&post=".$_GET['post'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<?php if($ShowEditTopic===true) { ?>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="TopicName">Insert Topic Name:</label></td>
-       <td style="width: 50%;"><input maxlength="30" type="text" name="TopicName" class="TextBox" id="TopicName" size="20" value="<?php echo $TopicName; ?>" /></td>
-</tr><tr style="text-align: left;"><?php } ?>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
-       <td style="width: 50%;"><input maxlength="45" type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" value="<?php echo $ReplyDescription; ?>" /></td>
-</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-<?php } ?></tr><?php } ?>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
-<textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"><?php echo $ReplyPost; ?></textarea><br />
-<input type="hidden" name="act" value="editreplies" style="display: none;" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if(isset($_GET['page'])&&is_numeric($_GET['page'])) { ?>
-<input type="hidden" style="display: none;" name="page" value="<?php echo $_GET['page']; ?>" />
-<?php } if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="submit" class="Button" value="Edit Reply" name="edit_reply" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form></td></tr>
-<tr id="EditReplyEnd<?php echo $_GET['post']; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkReply">&nbsp;</div>
-<?php } if($_GET['act']=="editreply"&&$_POST['act']=="editreplies") {
-if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no"||$_SESSION['UserID']==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; }
-if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; }
-if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
-if(!isset($_POST['TopicName'])) { $_POST['TopicName'] = null; }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-require($SettDir['inc']."captcha.php"); }
-$ShowEditTopic = null;
-if($PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
-$editquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($TopicID));
-$editresult=sql_query($editquery,$SQLStat);
-$editnum=sql_num_rows($editresult);
-$FReplyID=sql_result($editresult,0,"id");
-sql_free_result($editresult);
-if($_GET['post']==$FReplyID) { $ShowEditTopic = true; } }
-if($PermissionInfo['CanEditTopics'][$TopicForumID]=="no") { $ShowEditTopic = null; }
-$ersquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
-$ersresult=sql_query($ersquery,$SQLStat);
-$ersnum=sql_num_rows($ersresult);
-if($ersnum==0) { sql_free_result($ersresult);
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ReplyUser=sql_result($ersresult,0,"UserID");
-if($_SESSION['UserID']!=$ReplyUser&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($ersresult); 
-if($ShowEditTopic===true) {
-$gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($TopicID));
-$gtsresult=sql_query($gtsquery,$SQLStat);
-$gtsnum=sql_num_rows($gtsresult);
-$TUsersID=sql_result($gtsresult,0,"UserID");
-$TForumID=sql_result($gtsresult,0,"ForumID");
-$TClosed=sql_result($gtsresult,0,"Closed");
-if($_SESSION['UserID']!=$TUsersID) { $ShowEditTopic = null; }
-if($PermissionInfo['CanModForum'][$TopicForumID]=="yes"&&
-       $PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") { 
-       $ShowEditTopic = true; } 
-if($PermissionInfo['CanEditTopicsClose'][$TopicForumID]=="no"&&$TopicClosed==1) {
-       $ShowEditTopic = null; } }
-if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") { 
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Edit Reply Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php if (pre_strlen($_POST['ReplyDesc'])>"80") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your Reply Description is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-if (PhpCaptcha::Validate($_POST['signcode'])) {
-//echo 'Valid code entered';
-} else { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Invalid code entered<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You Guest Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($ShowEditTopic===true&&
-       pre_strlen($_POST['TopicName'])>"50") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You Topic Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Settings['TestReferer']=="on") {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } }
-$_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ReplyDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
-$_POST['ReplyDesc'] = remove_spaces($_POST['ReplyDesc']);
-$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
-$_POST['GuestName'] = remove_spaces($_POST['GuestName']);
-$_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES, $Settings['charset']));
-//$_POST['ReplyPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
-$_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']);
-if($ShowEditTopic===true) {
-$_POST['TopicName'] = stripcslashes(htmlspecialchars($_POST['TopicName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['TopicName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicName']);
-$_POST['TopicName'] = remove_spaces($_POST['TopicName']); }
-/*    <_<  iWordFilter  >_>      
-   by Kazuki Przyborowski - Cool Dude 2k */
-$katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-$katarzynart=sql_query($katarzynaqy,$SQLStat);
-$katarzynanm=sql_num_rows($katarzynart);
-$katarzynas=0;
-while ($katarzynas < $katarzynanm) {
-$Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-$Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-$CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-$WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-if($WholeWord=="on") { $WholeWord = "yes"; }
-if($WholeWord=="off") { $WholeWord = "no"; }
-if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-$Filter = preg_quote($Filter, "/");
-if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-$_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyPost']); }
-if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-$_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyPost']); }
-if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-$_POST['ReplyDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyPost']); }
-if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-$_POST['ReplyDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyDesc']); 
-$_POST['ReplyPost'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyPost']); }
-++$katarzynas; } sql_free_result($katarzynart);
-$lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedTopicName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
-$lonewolfrt=sql_query($lonewolfqy,$SQLStat);
-$lonewolfnm=sql_num_rows($lonewolfrt);
-$lonewolfs=0; $RMatches = null; $RGMatches = null;
-while ($lonewolfs < $lonewolfnm) {
-$RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
-$RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
-if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
-if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
-if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
-$RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
-if($RWholeWord=="on") { $RWholeWord = "yes"; }
-if($RWholeWord=="off") { $RWholeWord = "no"; }
-if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
-$RestrictedTopicName=sql_result($lonewolfrt,$lonewolfs,"RestrictedTopicName");
-if($RestrictedTopicName=="on") { $RestrictedTopicName = "yes"; }
-if($RestrictedTopicName=="off") { $RestrictedTopicName = "no"; }
-if($RestrictedTopicName!="yes"||$RestrictedTopicName!="no") { $RestrictedTopicName = "no"; }
-$RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
-if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
-if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
-if($RestrictedUserName!="yes"||$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
-$RWord = preg_quote($RWord, "/");
-if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/".$RWord."/", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/".$RWord."/i", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-++$lonewolfs; } sql_free_result($lonewolfrt);
-if ($_POST['ReplyDesc']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Reply Description.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $_POST['GuestName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Guest Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $RGMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Guest Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You do not have permission to edit a reply here.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You do not have permission to edit a reply here.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($ShowEditTopic===true&&$_POST['TopicName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Topic Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['ReplyPost']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Reply.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($RMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Topic Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']),"3"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if ($Error!="Yes") { $LastActive = $utccurtime->getTimestamp();
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0;
-while ($rei < $renum) {
-$User1ID=$_SESSION['UserID'];
-$User1Name=sql_result($reresult,$rei,"Name");
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
-++$rei; }
-sql_free_result($reresult);
-$EditUserIP=$_SERVER['REMOTE_ADDR'];
-$_SESSION['LastPostTime'] = $utccurtime->getTimestamp() + $GroupInfo['FloodControl'];
-if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=-1) {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LastActive\"=%i,\"IP\"='%s',\"LastPostTime\"=%i WHERE \"id\"=%i", array($LastActive,$EditUserIP,$_SESSION['LastPostTime'],$_SESSION['UserID']));
-sql_query($queryupd,$SQLStat); }
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"LastUpdate\"=%i,\"EditUser\"=%i,\"EditUserName\"='%s',\"Post\"='%s',\"Description\"='%s',\"EditIP\"='%s' WHERE \"id\"=%i", array($LastActive,$User1ID,$User1Name,$_POST['ReplyPost'],$_POST['ReplyDesc'],$EditUserIP,$_GET['post']));
-sql_query($queryupd,$SQLStat);
-if($ShowEditTopic===true) {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"TopicName\"='%s',\"Description\"='%s' WHERE \"id\"=%i", array($_POST['TopicName'],$_POST['ReplyDesc'],$TopicID));
-sql_query($queryupd,$SQLStat); } } 
-redirect(url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE).$Settings['qstr']."#post".$_GET['post'],"3");
-$erpage = "&page=1";
-if(isset($_POST['page'])&&is_numeric($_POST['page'])) {
-       $erpage = "&page=".$_POST['page']; }
-?>
-<tr>
-       <td><span class="TableMessage"><br />
-       Reply to Topic <?php echo $TopicName; ?> was edited.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID.$erpage,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;post".$_GET['post']; ?>">here</a> to view topic.<br />&nbsp;
-       </span><br /></td>
-</tr>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } $frnext = "off";
-if(!isset($_GET['fastreply'])) {
-       $_GET['fastreply'] = "off"; }
-if($_GET['fastreply']=="on") {
-       $frnext = "off"; $extrafe = null; }
-if($_GET['fastreply']!="on") {
-       $frnext = "on"; $extrafe = "&#35;FastReply"; }
-if($pstring!=null||$CanMakeReply=="yes"||$CanMakeTopic=="yes") {
-?>
-<table class="Table2" style="width: 100%;">
-<tr>
- <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
- <td style="width: 70%; text-align: right;">
- <?php if($CanMakeReply=="yes") { ?>
- <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['AddReply']; ?></a>
- <?php if(isset($ThemeSet['FastReply'])&&$ThemeSet['FastReply']!=null) { ?>
- <?php echo $ThemeSet['ButtonDivider']; ?>
- <a onclick="toggletag('FastReply'); toggletag('MkFastReply'); return false;" href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page']."&fastreply=".$frnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$extrafe; ?>"><?php echo $ThemeSet['FastReply']; ?></a>
- <?php } } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
-       if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?>
- <?php echo $ThemeSet['ButtonDivider']; } ?>
- <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$TopicForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
- <?php } ?></td>
-</tr>
-</table>
-<div class="DivTable2">&nbsp;</div>
-<?php } }
-if($_GET['act']=="view"&&$CanMakeReply=="yes") {  
-if(!isset($_GET['fastreply'])) { $_GET['fastreply'] = false; }
-if($_GET['fastreply']===true||
-       $_GET['fastreply']=="on") { $fps = " "; }
-if($_GET['fastreply']!==true&&
-       $_GET['fastreply']!="on") { $fps = " style=\"display: none;\" "; }
-$QuoteReply = null; $QuoteDescription = null;
-$queryra = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC LIMIT 1", array($_GET['id']));
-$resultra=sql_query($queryra,$SQLStat);
-$numrose=sql_num_rows($resultra);
-$QuoteDescription=sql_result($resultra,0,"Description"); 
-$QuoteDescription = str_replace("Re: ","",$QuoteDescription);
-$QuoteDescription = "Re: ".$QuoteDescription;
-sql_free_result($resultra);
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="Table1Border"<?php echo $fps; ?>id="FastReply">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="MakeReply<?php echo $TopicForumID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="ReplyStart<?php echo $TopicForumID; ?>">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="MakeReplyRow<?php echo $TopicForumID; ?>" class="TableRow2">
-<td class="TableColumn2" colspan="2" style="width: 100%;">Making a Reply in Topic <?php echo $TopicName; ?></td>
-</tr>
-<tr class="TableRow3" id="MkReply<?php echo $TopicForumID; ?>">
-<td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
-<div style="width: 100%; height: 160px; overflow: auto;">
-<table style="width: 100%; text-align: center;"><?php
-$renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
-$renee_result=sql_query($renee_query,$SQLStat);
-$renee_num=sql_num_rows($renee_result);
-$renee_s=0; $SmileRow=0; $SmileCRow=0;
-while ($renee_s < $renee_num) { ++$SmileRow;
-$FileName=sql_result($renee_result,$renee_s,"FileName");
-$SmileName=sql_result($renee_result,$renee_s,"SmileName");
-$SmileText=sql_result($renee_result,$renee_s,"SmileText");
-$SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
-$ShowSmile=sql_result($renee_result,$renee_s,"Display");
-$ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
-if($SmileRow==1) { ?><tr>
-       <?php } if($SmileRow<5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
-       <?php } if($SmileRow==5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
-       <?php $SmileCRow=0; $SmileRow=0; }
-++$renee_s; }
-if($SmileCRow<5&&$SmileCRow!=0) {
-$SmileCRowL = 5 - $SmileCRow;
-echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
-echo "</table>";
-sql_free_result($renee_result);
-?></div></td>
-<td class="TableColumn3" style="width: 85%;">
-<form style="display: inline;" method="post" id="MkReplyForm" action="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=makereply&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
-       <td style="width: 50%;"><input maxlength="45" type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" value="<?php echo $QuoteDescription; ?>" /></td>
-</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-<?php } ?></tr><?php } ?>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
-<textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"><?php echo $QuoteReply; ?></textarea><br />
-<?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
-<label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
-<input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
-<?php } ?>
-<input type="hidden" name="act" value="makereplies" style="display: none;" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="hidden" name="act" value="makereplies" style="display: none;" />
-<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="submit" class="Button" value="Make Reply" name="make_reply" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form></td></tr>
-<tr id="MkReplyEnd<?php echo $TopicForumID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div<?php echo $fps; ?>id="MkFastReply" class="MkFastReply">&nbsp;</div>
-<?php }
-$uviewlcuttime = $utccurtime->getTimestamp();
-$uviewltime = $uviewlcuttime - ini_get("session.gc_maxlifetime");
-$uviewlquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"session_id\"<>'%s' AND \"serialized_data\" LIKE '%s' ORDER BY \"expires\" DESC", array($uviewltime, session_id(), "%currenttopicid:".$TopicID.";%"));
-$uviewlresult=sql_query($uviewlquery,$SQLStat);
-$uviewlnum=sql_num_rows($uviewlresult);
-$uviewli=0; $uviewlmn = 0; $uviewlgn = 0; $uviewlan = 0; $uviewlmbn = 0;
-$MembersViewList = null; $GuestsOnline = null;
-while ($uviewli < $uviewlnum) {
-$session_data=sql_result($uviewlresult,$uviewli,"session_data"); 
-$serialized_data=sql_result($uviewlresult,$uviewli,"serialized_data");
-$session_user_agent=sql_result($uviewlresult,$uviewli,"user_agent"); 
-$session_ip_address=sql_result($uviewlresult,$uviewli,"ip_address");
-//$UserSessInfo = unserialize_session($session_data);
-$UserSessInfo = unserialize($serialized_data);
-if(!isset($UserSessInfo['UserGroup'])) { $UserSessInfo['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($session_user_agent)) {
-       $user_agent_check = user_agent_check($session_user_agent); }
-if($UserSessInfo['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($UserSessInfo['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$UserSessInfo['UserID']>0)||$user_agent_check!==false) {
-if($uviewlmbn>0) { $MembersViewList .= ", "; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$UserSessInfo['MemberName']."</a>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$uviewlmn; ++$uviewlmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList .= "<span".$uatitleadd.">".$user_agent_check."</span>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$uviewlmbn; } }
-if($UserSessInfo['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$uviewlan; } } }
-if($UserSessInfo['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$GuestsViewList .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>";
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; } */
-++$uviewlgn; }
-++$uviewli; }
-if(!isset($_SESSION['UserGroup'])) { $_SESSION['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($_SERVER['HTTP_USER_AGENT'])) {
-       $user_agent_check = user_agent_check($_SERVER['HTTP_USER_AGENT']); }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($_SESSION['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$_SESSION['UserID']>0)||$user_agent_check!==false) {
-if($uviewlmbn>0) { $MembersViewList = ", ".$MembersViewList; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$MembersViewList; }
-$MembersViewList = "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_SESSION['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$_SESSION['MemberName']."</a>".$MembersViewList; 
-++$uviewlmn; ++$uviewlmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$MembersViewList; }
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList = "<span".$uatitleadd.">".$user_agent_check."</span>".$MembersViewList; 
-++$uviewlmbn; } }
-if($_SESSION['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$uviewlan; } } }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$GuestsViewList; }
-$GuestsViewList = "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>".$GuestsViewList; */
-++$uviewlgn; }
-++$uviewlnum;
-?>
-<div class="StatsBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableStatsRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">Topic Statistics</a></span></div>
-<?php } ?>
-<table id="BoardStats" class="TableStats1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableStatsRow1">
-<td class="TableStatsColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">Topic Statistics</a></span>
-</td>
-</tr><?php } ?>
-<tr id="Stats1" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;"><?php echo $uviewlnum; ?> users viewing topic</td>
-</tr>
-<tr class="TableStatsRow3" id="Stats2">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-&nbsp;<span style="font-weight: bold;"><?php echo $uviewlgn; ?></span> guests, <span style="font-weight: bold;"><?php echo $uviewlmn; ?></span> members, <span style="font-weight: bold;"><?php echo $uviewlan; ?></span> anonymous members <br />
-<?php if($MembersViewList!=null) { ?>&nbsp;<?php echo $MembersViewList."\n<br />"; } ?>
-</div></td>
-</tr>
-<tr id="Stats7" class="TableStatsRow4">
-<td class="TableStatsColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivStats">&nbsp;</div>
-
diff --git a/inc/rssfeed.php.bak b/inc/rssfeed.php.bak
deleted file mode 100644 (file)
index a945f0e..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: rssfeed.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="rssfeed.php"||$File3Name=="/rssfeed.php") {
-       require('index.php');
-       exit(); }
-if(!isset($_GET['debug'])) { $_GET['debug'] = null; }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-$boardsname = htmlentities($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
-$boardsname = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $boardsname);
-$_GET['feedtype'] = strtolower($_GET['feedtype']);
-if($_GET['feedtype']!="rss"&&$_GET['feedtype']!="atom"&&$_GET['feedtype']!="oldrss"&&
-       $_GET['feedtype']!="opml"&&$_GET['feedtype']!="opensearch") { 
-       $_GET['feedtype'] = "rss"; }
-//$basepath = pathinfo($_SERVER['REQUEST_URI']);
-/*if(dirname($_SERVER['REQUEST_URI'])!="."||
-       dirname($_SERVER['REQUEST_URI'])!=null) {
-$basedir = dirname($_SERVER['REQUEST_URI'])."/"; }*/
-if(dirname($_SERVER['SCRIPT_NAME'])!="."||
-       dirname($_SERVER['SCRIPT_NAME'])!=null) {
-$basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
-if($basedir==null||$basedir==".") {
-if(dirname($_SERVER['SCRIPT_NAME'])=="."||
-       dirname($_SERVER['SCRIPT_NAME'])==null) {
-$basedir = dirname($_SERVER['PHP_SELF'])."/"; } }
-if($basedir=="\/") { $basedir="/"; }
-$basedir = str_replace("//", "/", $basedir);
-if($Settings['fixpathinfo']!="on"&&
-       $Settings['fixpathinfo']!="off"&&
-       $Settings['fixpathinfo']!==null) {
-               $basedir = "/"; } $BaseURL = $basedir;
-if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = 'off'; }
-if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
-if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
-if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
-       $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$BaseURL; }
-if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
-       $BoardURL = $Settings['idburl']; 
-       if($Settings['qstr']!="/") {
-       $AltBoardURL = $BoardURL; } 
-       if($Settings['qstr']=="/") { 
-       $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
-if ($_GET['id']==null) { $_GET['id']="1"; }
-if($rssurlon=="on") { $BoardURL =  $rssurl; }
-$feedsname = basename($_SERVER['SCRIPT_NAME']);
-if($_SERVER['PATH_INFO']!=null) {
-$feedsname .= htmlentities($_SERVER['PATH_INFO'], ENT_QUOTES, $Settings['charset']); }
-if($_SERVER['QUERY_STRING']!=null) {
-$feedsname .= "?".htmlentities($_SERVER['QUERY_STRING'], ENT_QUOTES, $Settings['charset']); }
-$checkfeedtype = "application/rss+xml";
-if($_GET['feedtype']=="oldrss") { $checkfeedtype = "application/xml"; }
-if($_GET['feedtype']=="rss") { $checkfeedtype = "application/rss+xml"; }
-if($_GET['feedtype']=="atom") { $checkfeedtype = "application/atom+xml"; }
-if($_GET['feedtype']=="opml") { $checkfeedtype = "text/x-opml"; }
-if($_GET['feedtype']=="opensearch") { $checkfeedtype = "application/opensearchdescription+xml"; }
-if(stristr($_SERVER["HTTP_ACCEPT"],$checkfeedtype) ) {
-header("Content-Type: ".$checkfeedtype."; charset=".$Settings['charset']); }
-else { if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
-header("Content-Type: application/xml; charset=".$Settings['charset']); }
-else { if (stristr($_SERVER["HTTP_USER_AGENT"],"FeedValidator")) {
-   header("Content-Type: application/xml; charset=".$Settings['charset']);
-} else { header("Content-Type: text/xml; charset=".$Settings['charset']); } } }
-header("Content-Language: en");
-header("Vary: Accept");
-if($_GET['feedtype']=="oldrss"||$_GET['feedtype']=="rss"||$_GET['feedtype']=="atom"||$_GET['feedtype']=="opml") { 
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2."", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$ForumID=sql_result($preresult,0,"id");
-$ForumName=sql_result($preresult,0,"Name");
-$ForumName = htmlentities($ForumName, ENT_QUOTES, $Settings['charset']);
-$ForumName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ForumName);
-$ForumCatID=sql_result($preresult,0,"CategoryID");
-$ForumType=sql_result($preresult,0,"ForumType");
-$ForumType = strtolower($ForumType);
-sql_free_result($preresult);
-if($PermissionInfo['CanViewForum'][$ForumID]=="no"||
-       $PermissionInfo['CanViewForum'][$ForumID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"id\"", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$SubsForumID=sql_result($apcresult,$apci,"id");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-$Atom = null; $RSS = null; $PreRSS = null;
-$gltnum = count($gltf); $glti = 0; 
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC LIMIT %i", array($gltf[$glti],$Settings['max_topics']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result); $i=0;
-while ($i < $num) {
-$TopicID=sql_result($result,$i,"id");
-$ForumID=sql_result($result,$i,"ForumID");
-$CategoryID=sql_result($result,$i,"CategoryID");
-$pquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC LIMIT %i", array($TopicID,1));
-$presult=sql_query($pquery,$SQLStat);
-$pnum=sql_num_rows($presult);
-$MyDescription=sql_result($presult,0,"Post");
-$UsersID=sql_result($result,$i,"UserID");
-$GuestsName=sql_result($result,$i,"GuestName");
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-if($renum<1) { $UsersID = -1;
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult); }
-$memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
-$memreresult=sql_query($memrequery,$SQLStat);
-$memrenum=sql_num_rows($memreresult);
-$UsersName=sql_result($reresult,0,"Name");
-$UsersGroupID=sql_result($reresult,0,"GroupID");
-$PreUserCanExecPHP=sql_result($memreresult,0,"CanExecPHP");
-if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
-       $PreUserCanExecPHP = "no"; }
-$PreUserCanDoHTML=sql_result($memreresult,0,"CanDoHTML");
-if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
-       $PreUserCanDoHTML = "no"; }
-$PreUserCanUseBBTags=sql_result($memreresult,0,"CanUseBBTags");
-if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
-       $PreUserCanUseBBTags = "no"; }
-sql_free_result($memreresult);
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-sql_free_result($reresult);
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($UsersGroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$UsersGroup=sql_result($gresult,0,"Name");
-$User1CanExecPHP = $PreUserCanExecPHP;
-if($PreUserCanExecPHP=="group") {
-$User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
-if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
-       $User1CanExecPHP = "no"; }
-$User1CanDoHTML = $PreUserCanDoHTML;
-if($PreUserCanDoHTML=="group") {
-$User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
-if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
-       $User1CanDoHTML = "no"; }
-$User1CanUseBBTags = $PreUserCanUseBBTags;
-if($User1CanUseBBTags=="group") {
-$User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
-if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
-       $User1CanUseBBTags = "no"; }
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-sql_free_result($gresult);
-if($User1CanUseBBTags=="yes") { $MyDescription = bbcode_parser($MyDescription); }
-if($User1CanExecPHP=="no") {
-$MyDescription = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$MyDescription); }
-if($User1CanExecPHP=="yes") { $MyDescription = php_execute($MyDescription); }
-if($User1CanDoHTML=="no") {
-$MyDescription = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$MyDescription); }
-if($User1CanDoHTML=="yes") { $MyDescription = do_html_bbcode($MyDescription); }
-$MyDescription = text2icons($MyDescription,$Settings['sqltable'],$SQLStat);
-$MyDescription = preg_replace("/\<br\>/", "<br />", nl2br($MyDescription));
-$MyDescription = url2link($MyDescription);
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $UsersName = $GroupNamePrefix.$UsersName; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $UsersName = $UsersName.$GroupNameSuffix; }
-$TheTime=sql_result($result,$i,"TimeStamp");
-$atomcurtime = new DateTime();
-$atomcurtime->setTimestamp($TheTime);
-$atomcurtime->setTimezone($utctz);
-$AtomTime=$atomcurtime->format("Y-m-d\TH:i:s\Z");
-//$OldRSSTime=$atomcurtime->format("Y-m-d\TH:i:s+0:00");
-$OldRSSTime=$AtomTime;
-$TheTime=$atomcurtime->format("D, j M Y G:i:s \G\M\T");
-$TopicName=sql_result($result,$i,"TopicName");
-$ForumDescription=sql_result($result,$i,"Description");
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes"&&
-       isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-if($_GET['feedtype']=="atom") {
-$CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
-$Atom .= '<entry>'."\n".'<title>'.$TopicName.'</title>'."\n".'<summary>'.$CDataDescription.'</summary>'."\n".'<link rel="alternate" href="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'" />'."\n".'<id>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</id>'."\n".'<author>'."\n".'<name>'.$UsersName.'</name>'."\n".'</author>'."\n".'<updated>'.$AtomTime.'</updated>'."\n".'</entry>'."\n"; }
-if($_GET['feedtype']=="oldrss") {
-$CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
-$PreRSS .= '      <rdf:li rdf:resource="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'" />'."\n";
-$RSS .= '<item rdf:about="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'">'."\n".'<title>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</description>'."\n".'<dc:publisher>'.$UsersName.'</dc:publisher>'."\n".'<dc:creator>'.$UsersName.'</dc:creator>'."\n".'<dc:date>'.$OldRSSTime.'</dc:date>'."\n".'</item>'."\n"; }
-if($_GET['feedtype']=="rss") {
-$CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
-$RSS .= '<item>'."\n".'<pubDate>'.$TheTime.'</pubDate>'."\n".'<author>'.$UsersName.'</author>'."\n".'<title>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</description>'."\n".'<link>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</link>'."\n".'<guid>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</guid>'."\n".'</item>'."\n"; } }
-++$i; sql_free_result($presult); }
-sql_free_result($result);
-++$glti; } }
-$endtag = " \n";
-xml_doc_start("1.0",$Settings['charset']);
-if($Settings['showverinfo']=="on") { ?>
-<!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
-<?php } if($Settings['showverinfo']!="on") { ?>
-<!-- generator="<?php echo $iDB; ?>" -->
-<?php } echo "\n"; if($_GET['feedtype']=="oldrss") { ?>
-<rdf:RDF 
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
->
-<channel rdf:about="<?php echo $BoardURL.$feedsname; ?>">
- <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
-  <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
-  <description>RSS Feed of the Topics in Forum <?php echo $ForumName; ?></description>
-  <image rdf:resource="<?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif" />
-  <items>
-    <rdf:Seq>
-<?php echo $PreRSS; ?>
-    </rdf:Seq>
-  </items>
-</channel>
-
-<image rdf:about="<?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif">
-  <title><?php echo $boardsname; ?></title>
-  <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
-  <url><?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif</url>
-</image>
-<?php echo "\n".$RSS."\n"; ?></rdf:RDF>
-<?php } if($_GET['feedtype']=="rss") { ?>
-<rss version="2.0">
-<channel>
-   <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
-   <description>RSS Feed of the Topics in Forum <?php echo $ForumName; ?></description>
-   <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
-   <language>en</language>
-   <?php if($Settings['showverinfo']=="on") { ?>
-   <generator><?php echo $VerInfo['iDB_Ver_Show']; ?></generator>
-   <?php } if($Settings['showverinfo']!="on") { ?>
-   <generator><?php echo $iDB; ?></generator>
-   <?php } echo "\n"; ?>
-   <copyright><?php echo $SettInfo['Author']; ?></copyright>
-   <ttl>120</ttl>
-   <image>
-       <url><?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif</url>
-       <title><?php echo $boardsname; ?></title>
-       <link><?php echo $AltBoardURL; ?></link>
-   </image>
- <?php echo $endtag; ?>
- <?php echo "\n".$RSS."\n"; ?></channel>
-</rss>
-<?php } if($_GET['feedtype']=="atom") { ?>
-<feed xmlns="http://www.w3.org/2005/Atom">
-  <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
-   <subtitle>Atom Feed of the Topics in Forum <?php echo $ForumName; ?></subtitle>
-   <link rel="self" href="<?php echo $BoardURL.$feedsname; ?>" />
-   <id><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></id>
-   <updated><?php echo gmdate("Y-m-d\TH:i:s\Z"); ?></updated>
-   <?php if($Settings['showverinfo']=="on") { ?>
-   <generator><?php echo $VerInfo['iDB_Ver_Show']; ?></generator>
-   <?php } if($Settings['showverinfo']!="on") { ?>
-   <generator><?php echo $iDB; ?></generator>
-   <?php } ?>
-  <icon><?php echo $AltBoardURL.$SettDir['inc']; ?>rss.gif</icon>
-<?php echo $endtag; ?>
- <?php echo "\n".$Atom."\n"; ?>
-</feed>
-<?php } if($_GET['feedtype']=="opml") { ?>
-<opml version="1.0">
-  <head>
-    <dateCreated><?php echo gmdate("d-M-Y"); ?></dateCreated>
-  </head>
-  <body>
-    <?php /*<!--
-       <outline text="<?php echo $ForumName; ?> Topics RSS 1.0 Feed" type="link" url="<?php echo $BoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" htmlUrl="<?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>" xmlUrl="<?php echo $BoardURL.url_maker($exfile['rss'],$Settings['rss_ext'],"act=oldrss&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-       -->*/ ?>
-<outline text="<?php echo $ForumName; ?> Topics RSS 2.0 Feed" type="rss" url="<?php echo $BoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" htmlUrl="<?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>" xmlUrl="<?php echo $BoardURL.url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-    <outline text="<?php echo $ForumName; ?> Topics Atom Feed" type="atom" url="<?php echo $BoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" htmlUrl="<?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>" xmlUrl="<?php echo $BoardURL.url_maker($exfile['rss'],$Settings['rss_ext'],"act=atom&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-  </body>
-</opml>
-<?php echo $endtag; ?>
-<?php } if($_GET['feedtype']=="opensearch") { ?>
-<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
-                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
-<ShortName><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Search</ShortName>
-<Description><?php echo $SettInfo['Description']; ?></Description>
-<InputEncoding><?php echo $Settings['charset']; ?></InputEncoding>
-<Image width="16" height="16" type="image/x-icon"><?php echo $AltBoardURL.$ThemeSet['FavIcon']; ?></Image>
-<Url type="text/html" method="POST" template="<?php echo $BoardURL.url_maker("search",$Settings['file_ext'],null,"search","search"); ?>">
-  <Param name="act" value="topics"/>
-  <Param name="search" value="{searchTerms}"/>
-  <Param name="type" value="wildcard"/>
-  <Param name="page" value="1"/>
-</Url>
-<?php echo $endtag; ?>
-<moz:SearchForm><?php echo $BoardURL.url_maker("search",$Settings['file_ext'],null,"search","search"); ?></moz:SearchForm>
-</OpenSearchDescription>
-<?php } if($_GET['debug']=="true"||$_GET['debug']=="on") {
-function execution_time($starttime) {
-list($uetime, $etime) = explode(" ", microtime());
-$endtime = $uetime + $etime;
-return bcsub($endtime, $starttime, 4); }
-echo "<!-- execution_time=\"".execution_time($starttime)."\" -->"; }
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); ?>
diff --git a/inc/searches.php.bak b/inc/searches.php.bak
deleted file mode 100644 (file)
index cddc8f9..0000000
+++ /dev/null
@@ -1,513 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: searches.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="searches.php"||$File3Name=="/searches.php") {
-       require('index.php');
-       exit(); }
-if($Settings['enable_search']=="off"||
-       $GroupInfo['CanSearch']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-header("Content-Type: text/plain; charset=".$Settings['charset']);
-ob_clean(); echo "Sorry you do not have permission to do a search."; $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$pagenum = null;
-if($Settings['enable_search']=="on"||
-       $GroupInfo['CanSearch']=="yes") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=topics","&","=",$prexqstr['search'],$exqstr['search']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['search'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['search']; }
-$_SESSION['PreViewingTitle'] = "Searching";
-$_SESSION['ViewingTitle'] = "Topics";
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($_GET['act']=="topics") {
-       if($_GET['search']==null&&$_GET['type']==null) {
-       ?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Search topics</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Topic Search</a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr id="SearchStart" class="TableRow1">
-<td class="TableColumn1" colspan="6"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Topic Search</a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Search for topic: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<form style="display: inline;" method="post" action="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" for="search">Enter SearchTerm: </label></td>
-       <td style="width: 70%;"><input maxlength="35" class="TextBox" id="search" type="text" name="search" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" for="msearch">Filter by Member (optional): </label></td>
-       <td style="width: 70%;"><input maxlength="25" class="TextBox" id="msearch" type="text" name="msearch" /></td>
-</tr><tr style="text-align: left;">
-       <td style="width: 30%;"><label class="TextBoxLabel" title="Wildcard is %" for="type">Search Type: </label></td>
-       <td style="width: 70%;"><select id="type" name="type" class="TextBox">
-<option value="normal">Normal Search</option>
-<option value="wildcard">Wildcard Search</option>
-</select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="act" value="topics" style="display: none;" />
-<input class="Button" type="submit" value="Search" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<?php } if(($_GET['search']!=null&&$_GET['type']!=null)||$_GET['type']=="getactive") {
-if(pre_strlen($_GET['msearch'])>="25") { 
-       $_GET['msearch'] = null; }
-if(isset($_GET['msearch'])&&$_GET['msearch']!=null) {
-$_GET['memid'] = null;
-$memsiquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' LIMIT 1", array($_GET['msearch']));
-$memsiresult=sql_query($memsiquery,$SQLStat);
-$memsinum=sql_num_rows($memsiresult);
-$memsi=0;
-if($memsinum==0) { $memsid = -1; }
-if($memsinum!=0) {
-$memsid=sql_result($memsiresult,$memsi,"id"); 
-sql_free_result($memsiresult); } }
-if(!isset($_GET['memid'])) { $_GET['memid'] = null; }
-if(!is_numeric($_GET['memid'])||$_GET['memid']<1) { 
-       $_GET['memid'] = null; }
-if($_GET['memid']!=null&&is_numeric($_GET['memid'])) {
-       $memnamea = GetUserName($_GET['memid'],$Settings['sqltable']);
-       if($memnamea['Hidden']=="no") {
-       $_GET['msearch'] = $memnamea['Name'];
-       $memsid = $_GET['memid'];  }
-       if($memnamea['Hidden']=="yes") {
-       $_GET['msearch'] = null;
-       $_GET['memid'] = null;
-       $memsid = null; } }
-//Get SQL LIMIT Number
-$nums = $_GET['page'] * $Settings['max_topics'];
-$PageLimit = $nums - $Settings['max_topics'];
-if($PageLimit<0) { $PageLimit = 0; }
-if($_GET['msearch']==null) {
-if($_GET['type']=="normal") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s'".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($_GET['search'],$PageLimit,$Settings['max_topics'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s'".$ForumIgnoreList4."", array($_GET['search'])); }
-if($_GET['type']=="wildcard") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s'".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($_GET['search'],$PageLimit,$Settings['max_topics'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s'".$ForumIgnoreList4."", array($_GET['search'])); } }
-if($_GET['msearch']!=null) {
-if($_GET['type']=="normal") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"UserID\"=%i".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($_GET['search'],$memsid,$PageLimit,$Settings['max_topics']));
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"UserID\"=%i".$ForumIgnoreList4."", array($_GET['search']));
-if($memsid==-1) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"GuestName\"='%s'".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($_GET['search'],$_GET['msearch'],$PageLimit,$Settings['max_topics'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"GuestName\"='%s'".$ForumIgnoreList4."", array($_GET['search'],$_GET['msearch'])); } }
-if($_GET['type']=="wildcard") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"UserID\"=%i".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($_GET['search'],$memsid,$PageLimit,$Settings['max_topics']));
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"UserID\"=%i".$ForumIgnoreList4."", array($_GET['search'],$_GET['msearch']));
-if($memsid==-1) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"GuestName\"='%s'".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($_GET['search'],$_GET['msearch'],$PageLimit,$Settings['max_topics'])); 
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"GuestName\"='%s'".$ForumIgnoreList4."", array($_GET['search'],$_GET['msearch'])); } } }
-if($_GET['type']=="getactive") {
-$active_month = $usercurtime->format("m");
-$active_day = $usercurtime->format("d");
-$active_year = $usercurtime->format("Y");
-$active_start = mktime(0,0,0,$active_month,$active_day,$active_year);
-$active_end = mktime(23,59,59,$active_month,$active_day,$active_year);
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE (\"TimeStamp\">=%i AND \"TimeStamp\"<=%i) OR (\"LastUpdate\">=%i AND \"LastUpdate\"<=%i)".$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC ".$SQLimit, array($active_start,$active_end,$active_start,$active_end,$PageLimit,$Settings['max_topics']));
-$rnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\" WHERE (\"TimeStamp\">=%i AND \"TimeStamp\"<=%i) OR (\"LastUpdate\">=%i AND \"LastUpdate\"<=%i)".$ForumIgnoreList4."", array($active_start,$active_end,$active_start,$active_end)); }
-$result=sql_query($query,$SQLStat);
-$rnresult=sql_query($rnquery,$SQLStat);
-$NumberTopics = sql_result($rnresult,0);
-sql_free_result($rnresult);
-if($NumberTopics==null) { 
-       $NumberTopics = 0; }
-$num = $NumberTopics;
-//Start Topic Page Code
-if(!isset($Settings['max_topics'])) { $Settings['max_topics'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-$nums = $_GET['page'] * $Settings['max_topics'];
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_topics'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_topics']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_topics']) { 
-       $pnum = $pnum - $Settings['max_topics']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_topics']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-//End Topic Page Code
-$num=sql_num_rows($result);
-if($num<=0) { 
-redirect("location",$rbasedir.url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'],false));
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-ob_clean(); echo "Sorry could not find any search results."; sql_free_result($result);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$i=0;
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($num==0) {
-$pagenumi = 0;
-if($_GET['msearch']==null) { 
-$pstring = null; }
-if($_GET['msearch']!=null) {
-$pstring = null; }
-}
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['msearch']==null) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&lt;</a></span> "; } }
-if($_GET['msearch']!=null) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&lt;</a></span> "; } }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($_GET['msearch']==null) {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($_GET['msearch']!=null) {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">".$Pagez[$pagei]."</a></span> "; } 
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">".$Pagez[$pagei]."</a></span> "; } } }
-if($Pagez[$pagei]=="First") {
-if($_GET['msearch']==null) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&laquo;</a></span> "; }
-if($_GET['msearch']!=null) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&laquo;</a></span> "; } }
-if($Pagez[$pagei]=="Last") {
-if($_GET['msearch']==null) {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&gt;</a></span> "; 
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&raquo;</a></span> "; } }
-if($_GET['msearch']!=null) {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&gt;</a></span> "; 
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'])."\">&raquo;</a></span> "; } } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Search topics</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-echo $pstring;
-//List Page Number Code end
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php } ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon'];
-if($_GET['msearch']==null&&$_GET['search']!=null) { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Searching for <?php echo $_GET['search']; ?></a>
-<?php } if($_GET['msearch']!=null&&$_GET['search']!=null) { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Searching for <?php echo $_GET['search']; ?> by <?php echo $_GET['msearch']; ?></a>
-<?php } if($_GET['type']=="getactive") { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Todays Active Topics</a>
-<?php } ?></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr id="SearchStart" class="TableRow1">
-<td class="TableColumn1" colspan="6"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon'];
-if($_GET['msearch']==null&&$_GET['search']!=null) { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Searching for <?php echo $_GET['search']; ?></a>
-<?php } if($_GET['msearch']!=null&&$_GET['search']!=null) { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&msearch=".$_GET['msearch']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Searching for <?php echo $_GET['search']; ?> by <?php echo $_GET['msearch']; ?></a>
-<?php } if($_GET['type']=="getactive") { ?>
-<a href="<?php echo url_maker($exfile['search'],$Settings['file_ext'],"act=topics&search=".$_GET['search']."&type=".$_GET['type']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search']); ?>">Todays Active Topics</a>
-<?php } ?></span>
-</td>
-</tr><?php } ?>
-<tr id="SearchStatRow" class="TableRow2">
-<th class="TableColumn2" style="width: 4%;">State</th>
-<th class="TableColumn2" style="width: 36%;">Topic Name</th>
-<th class="TableColumn2" style="width: 15%;">Author</th>
-<th class="TableColumn2" style="width: 15%;">Time</th>
-<th class="TableColumn2" style="width: 5%;">Replys</th>
-<th class="TableColumn2" style="width: 25%;">Last Reply</th>
-</tr>
-<?php
-while ($i < $num) {
-$TopicID=sql_result($result,$i,"id");
-$ForumID=sql_result($result,$i,"ForumID");
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($ForumID));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$HotTopicPosts = $Settings['hot_topic_num'];
-if($prenum > 0) {
-$HotTopicPosts = sql_result($preresult,0,"HotTopicPosts"); }
-sql_free_result($preresult);
-if($HotTopicPosts!=0&&is_numeric($HotTopicPosts)) {
-       $Settings['hot_topic_num'] = $HotTopicPosts; }
-if(!is_numeric($Settings['hot_topic_num'])) {
-       $Settings['hot_topic_num'] = 15; }
-$CategoryID=sql_result($result,$i,"CategoryID");
-$UsersID=sql_result($result,$i,"UserID");
-$GuestsName=sql_result($result,$i,"GuestName");
-$TheTime=sql_result($result,$i,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TheTime);
-$tmpusrcurtime->setTimezone($usertz);
-$TheTime=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$NumReply=sql_result($result,$i,"NumReply");
-$NumberPosts=$NumReply + 1;
-$prepagelist = null;
-if(!isset($Settings['max_posts'])) { 
-       $Settings['max_posts'] = 10; }
-if(!isset($ThemeSet['MiniPageAltStyle'])) { 
-       $ThemeSet['MiniPageAltStyle'] = "off"; }
-if($ThemeSet['MiniPageAltStyle']!="on"&&
-       $ThemeSet['MiniPageAltStyle']!="off") { 
-       $ThemeSet['MiniPageAltStyle'] = "off"; }
-if($NumberPosts>$Settings['max_posts']) {
-$NumberPages = ceil($NumberPosts/$Settings['max_posts']); }
-if($NumberPosts<=$Settings['max_posts']) {
-$NumberPages = 1; }
-if($NumberPages>4) {
-       $prepagelist = " &nbsp;"; }
-if($NumberPages>=2) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { 
-       $prepagelist = "<span class=\"small\">(Pages: "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelink\">"; }
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">1</a>";
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; }
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelink\">"; }
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=2",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">2</a>";
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; }
-       if($NumberPages>=3) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelink\">"; }
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=3",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">3</a>";
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; } }
-       if($NumberPages==4) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelinklast\">"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=4",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">4</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="off") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=4",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\"> ...4</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; } }
-       if($NumberPages>4) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelinklast\">"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumberPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&raquo; ".$NumberPages."</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="off") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumberPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\"> ...".$NumberPages."</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; } }
-       if($ThemeSet['MiniPageAltStyle']=="off") { 
-       $prepagelist = $prepagelist.")</span>"; } }
-$TopicName=sql_result($result,$i,"TopicName");
-$TopicDescription=sql_result($result,$i,"Description");
-$PinnedTopic=sql_result($result,$i,"Pinned");
-if ($PinnedTopic>2) { $PinnedTopic = 1; } 
-if ($PinnedTopic<0) { $PinnedTopic = 0; }
-if(!is_numeric($PinnedTopic)) { $PinnedTopic = 0; }
-$TopicStat=sql_result($result,$i,"Closed");
-if ($TopicStat>3) { $TopicStat = 1; } 
-if ($TopicStat<0) { $TopicStat = 0; }
-if(!is_numeric($TopicStat)) { $TopicStat = 1; }
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
-if($PreUsersName['Name']===null) { $UsersID = -1;
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
-$UsersName = $PreUsersName['Name'];
-$UsersHidden = $PreUsersName['Hidden'];
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-if(($PermissionInfo['CanViewForum'][$ForumID]=="yes"&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes"&&
-       $TopicStat>=0&&$TopicStat<3)||
-       ($PermissionInfo['CanViewForum'][$ForumID]=="yes"&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes"&&
-       $PermissionInfo['CanModForum'][$ForumID]=="yes"&&$TopicStat==3)) {
-$LastReply = "&nbsp;<br />&nbsp;";
-$glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
-$glrresult=sql_query($glrquery,$SQLStat);
-$glrnum=sql_num_rows($glrresult);
-if($glrnum>0){
-$ReplyID1=sql_result($glrresult,0,"id");
-$UsersID1=sql_result($glrresult,0,"UserID");
-$GuestsName1=sql_result($glrresult,0,"GuestName");
-$TimeStamp1=sql_result($glrresult,0,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TimeStamp1);
-$tmpusrcurtime->setTimezone($usertz);
-$TimeStamp1=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$PreUsersName1 = GetUserName($UsersID1,$Settings['sqltable'],$SQLStat);
-if($PreUsersName1['Name']===null) { $UsersID1 = -1;
-$PreUsersName1 = GetUserName($UsersID1,$Settings['sqltable'],$SQLStat); }
-$UsersName1 = $PreUsersName1['Name'];
-$UsersHidden1 = $PreUsersName1['Hidden']; }
-$NumPages = null; $NumRPosts = $NumReply + 1;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($NumRPosts>$Settings['max_posts']) {
-$NumPages = ceil($NumRPosts/$Settings['max_posts']); }
-if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
-$Users_Name1 = pre_substr($UsersName1,0,20);
-if($UsersName1=="Guest") { $UsersName1=$GuestsName1;
-if($UsersName1==null) { $UsersName1="Guest"; } }
-if (pre_strlen($UsersName1)>20) { $Users_Name1 = $Users_Name1."...";
-$oldusername=$UsersName1; $UsersName1=$Users_Name1; } $lul = null;
-if($TimeStamp1!=null) { $lul = null;
-if($UsersID1>0&&$UsersHidden1=="no") {
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID1,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$luln = url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts;
-$LastReply = "Time: <a href=\"".$luln."\">".$TimeStamp1."</a><br />\nUser: <a href=\"".$lul."\" title=\"".$oldusername."\">".$UsersName1."</a>"; }
-if($UsersID1<=0||$UsersHidden1=="yes") {
-if($UsersID1==-1) { $UserPre = "Guest:"; }
-if(($UsersID1<-1&&$UsersHidden1=="yes")||$UsersID1==0||($UsersID1>0&&$UsersHidden1=="yes")) { 
-       $UserPre = "Hidden:"; }
-$lul = url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-$luln = url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts;
-$LastReply = "Time: <a href=\"".$luln."\">".$TimeStamp1."</a><br />\n".$UserPre." <span title=\"".$oldusername."\">".$UsersName1."</span>"; } }
-sql_free_result($glrresult);
-if($TimeStamp1==null) { $LastReply = "&nbsp;<br />&nbsp;"; }
-$PreTopic = $ThemeSet['TopicIcon'];
-if ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat==0) {
-       if($NumReply>=$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['HotPinTopic']; }
-       if($NumReply<$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['PinTopic']; } }
-if ($TopicStat>=0&&$TopicStat<=3&&$PinnedTopic==0) {
-       if($NumReply>=$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['HotClosedTopic']; }
-       if($NumReply<$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['ClosedTopic']; } }
-if ($PinnedTopic==0&&$TopicStat==0) {
-               if($NumReply>=$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['HotTopic']; }
-               if($NumReply<$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['TopicIcon']; } }
-if ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat>=0&&$TopicStat<=3) {
-               if($NumReply>=$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['HotPinClosedTopic']; }
-               if($NumReply<$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['PinClosedTopic']; } }
-?>
-<tr class="TableRow3" id="Topic<?php echo $TopicID; ?>">
-<td class="TableColumn3"><div class="topicstate">
-<?php echo $PreTopic; ?></div></td>
-<td class="TableColumn3"><div class="topicname">
-<a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a>
-<?php if($prepagelist!==null) { echo $prepagelist; } ?></div>
-<div class="topicdescription"><?php echo $TopicDescription; ?></div></td>
-<td class="TableColumn3" style="text-align: center;"><?php
-if($UsersID>0) {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$UsersName."</a>"; }
-if($UsersID<=0) {
-echo "<span>".$UsersName."</span>"; }
-?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $TheTime; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $NumReply; ?></td>
-<td class="TableColumn3"><?php echo $LastReply; ?></td>
-</tr>
-<?php } ++$i; }
-?>
-<tr id="SearchEnd" class="TableRow4">
-<td class="TableColumn4" colspan="6">&nbsp;</td>
-</tr>
-</table></div>
-<?php if($pagenum>1) { ?>
-<div class="DivSearch">&nbsp;</div>
-<?php }
-echo $pstring;
-//List Page Number Code end
-if($pagenum>1) {
-?>
-<div class="DivPageLinks">&nbsp;</div>
-<?php }
-sql_free_result($result); } } } 
-if($pagenum<=1) { ?>
-<div class="DivSearch">&nbsp;</div>
-<?php } ?>
diff --git a/inc/sqlthemes.php.bak b/inc/sqlthemes.php.bak
deleted file mode 100644 (file)
index 01b5aff..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: sqlthemes.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="sqlthemes.php"||$File3Name=="/sqlthemes.php") {
-       require('index.php');
-       exit(); }
-// Change SQLThemes to iDB Themes Settings
-$ThemeSet = array();
-$ThemeSet['ThemeName'] = sql_result($themeresult,0,"ThemeName");
-if($ThemeSet['ThemeName']=="") { $ThemeSet['ThemeName'] = null; }
-$ThemeSet['ThemeMaker'] = sql_result($themeresult,0,"ThemeMaker");
-if($ThemeSet['ThemeMaker']=="") { $ThemeSet['ThemeMaker'] = null; }
-$ThemeSet['ThemeVersion'] = sql_result($themeresult,0,"ThemeVersion");
-if($ThemeSet['ThemeVersion']=="") { $ThemeSet['ThemeVersion'] = null; }
-$ThemeSet['ThemeVersionType'] = sql_result($themeresult,0,"ThemeVersionType");
-if($ThemeSet['ThemeVersionType']=="") { $ThemeSet['ThemeVersionType'] = null; }
-$ThemeSet['ThemeSubVersion'] = sql_result($themeresult,0,"ThemeSubVersion");
-if($ThemeSet['ThemeSubVersion']=="") { $ThemeSet['ThemeSubVersion'] = null; }
-$ThemeSet['MakerURL'] = sql_result($themeresult,0,"MakerURL");
-if($ThemeSet['MakerURL']=="") { $ThemeSet['MakerURL'] = null; }
-$ThemeSet['CopyRight'] = sql_result($themeresult,0,"CopyRight");
-if($ThemeSet['CopyRight']=="") { $ThemeSet['CopyRight'] = null; }
-$ThemeSet['WrapperString'] = sql_result($themeresult,0,"WrapperString");
-if($ThemeSet['WrapperString']=="") { $ThemeSet['WrapperString'] = null; }
-$ThemeSet['CSS'] = sql_result($themeresult,0,"CSS");
-if($ThemeSet['CSS']=="") { $ThemeSet['CSS'] = null; }
-$ThemeSet['CSSType'] = sql_result($themeresult,0,"CSSType");
-if($ThemeSet['CSSType']=="") { $ThemeSet['CSSType'] = null; }
-$ThemeSet['FavIcon'] = sql_result($themeresult,0,"FavIcon");
-if($ThemeSet['FavIcon']=="") { $ThemeSet['FavIcon'] = null; }
-$ThemeSet['TableStyle'] = sql_result($themeresult,0,"TableStyle");
-if($ThemeSet['TableStyle']=="") { $ThemeSet['TableStyle'] = null; }
-$ThemeSet['MiniPageAltStyle'] = sql_result($themeresult,0,"MiniPageAltStyle");
-if($ThemeSet['MiniPageAltStyle']=="") { $ThemeSet['MiniPageAltStyle'] = null; }
-$ThemeSet['PreLogo'] = sql_result($themeresult,0,"PreLogo");
-if($ThemeSet['PreLogo']=="") { $ThemeSet['PreLogo'] = null; }
-$ThemeSet['Logo'] = sql_result($themeresult,0,"Logo");
-if($ThemeSet['Logo']=="") { $ThemeSet['Logo'] = null; }
-$ThemeSet['LogoStyle'] = sql_result($themeresult,0,"LogoStyle");
-if($ThemeSet['LogoStyle']=="") { $ThemeSet['LogoStyle'] = null; }
-$ThemeSet['SubLogo'] = sql_result($themeresult,0,"SubLogo");
-if($ThemeSet['SubLogo']=="") { $ThemeSet['SubLogo'] = null; }
-$ThemeSet['TopicIcon'] = sql_result($themeresult,0,"TopicIcon");
-if($ThemeSet['TopicIcon']=="") { $ThemeSet['TopicIcon'] = null; }
-$ThemeSet['MovedTopicIcon'] = sql_result($themeresult,0,"MovedTopicIcon");
-if($ThemeSet['MovedTopicIcon']=="") { $ThemeSet['MovedTopicIcon'] = $ThemeSet['TopicIcon']; }
-$ThemeSet['HotTopic'] = sql_result($themeresult,0,"HotTopic");
-if($ThemeSet['HotTopic']=="") { $ThemeSet['HotTopic'] = null; }
-$ThemeSet['MovedHotTopic'] = sql_result($themeresult,0,"MovedHotTopic");
-if($ThemeSet['MovedHotTopic']=="") { $ThemeSet['MovedHotTopic'] = $ThemeSet['HotTopic']; }
-$ThemeSet['PinTopic'] = sql_result($themeresult,0,"PinTopic");
-if($ThemeSet['PinTopic']=="") { $ThemeSet['PinTopic'] = null; }
-$ThemeSet['AnnouncementTopic'] = sql_result($themeresult,0,"AnnouncementTopic");
-if($ThemeSet['AnnouncementTopic']=="") { $ThemeSet['AnnouncementTopic'] = $ThemeSet['PinTopic']; }
-$ThemeSet['MovedPinTopic'] = sql_result($themeresult,0,"MovedPinTopic");
-if($ThemeSet['MovedPinTopic']=="") { $ThemeSet['MovedPinTopic'] = $ThemeSet['PinTopic']; }
-$ThemeSet['HotPinTopic'] = sql_result($themeresult,0,"HotPinTopic");
-if($ThemeSet['HotPinTopic']=="") { $ThemeSet['HotPinTopic'] = null; }
-$ThemeSet['MovedHotPinTopic'] = sql_result($themeresult,0,"MovedHotPinTopic");
-if($ThemeSet['MovedHotPinTopic']=="") { $ThemeSet['MovedHotPinTopic'] = $ThemeSet['HotPinTopic']; }
-$ThemeSet['ClosedTopic'] = sql_result($themeresult,0,"ClosedTopic");
-if($ThemeSet['ClosedTopic']=="") { $ThemeSet['ClosedTopic'] = null; }
-$ThemeSet['MovedClosedTopic'] = sql_result($themeresult,0,"MovedClosedTopic");
-if($ThemeSet['MovedClosedTopic']=="") { $ThemeSet['MovedClosedTopic'] = $ThemeSet['ClosedTopic']; }
-$ThemeSet['HotClosedTopic'] = sql_result($themeresult,0,"HotClosedTopic");
-if($ThemeSet['HotClosedTopic']=="") { $ThemeSet['HotClosedTopic'] = null; }
-$ThemeSet['MovedHotClosedTopic'] = sql_result($themeresult,0,"MovedHotClosedTopic");
-if($ThemeSet['MovedHotClosedTopic']=="") { $ThemeSet['MovedHotClosedTopic'] = $ThemeSet['HotClosedTopic']; }
-$ThemeSet['PinClosedTopic'] = sql_result($themeresult,0,"PinClosedTopic");
-if($ThemeSet['PinClosedTopic']=="") { $ThemeSet['PinClosedTopic'] = null; }
-$ThemeSet['MovedPinClosedTopic'] = sql_result($themeresult,0,"MovedPinClosedTopic");
-if($ThemeSet['MovedPinClosedTopic']=="") { $ThemeSet['MovedPinClosedTopic'] = $ThemeSet['PinClosedTopic']; }
-$ThemeSet['HotPinClosedTopic'] = sql_result($themeresult,0,"HotPinClosedTopic");
-if($ThemeSet['HotPinClosedTopic']=="") { $ThemeSet['HotPinClosedTopic'] = null; }
-$ThemeSet['MovedHotPinClosedTopic'] = sql_result($themeresult,0,"MovedHotPinClosedTopic");
-if($ThemeSet['MovedHotPinClosedTopic']=="") { $ThemeSet['MovedHotPinClosedTopic'] = $ThemeSet['HotPinClosedTopic']; }
-$ThemeSet['MessageRead'] = sql_result($themeresult,0,"MessageRead");
-if($ThemeSet['MessageRead']=="") { $ThemeSet['MessageRead'] = null; }
-$ThemeSet['MessageUnread'] = sql_result($themeresult,0,"MessageUnread");
-if($ThemeSet['MessageUnread']=="") { $ThemeSet['MessageUnread'] = null; }
-$ThemeSet['Profile'] = sql_result($themeresult,0,"Profile");
-if($ThemeSet['Profile']=="") { $ThemeSet['Profile'] = null; }
-$ThemeSet['WWW'] = sql_result($themeresult,0,"WWW");
-if($ThemeSet['WWW']=="") { $ThemeSet['WWW'] = null; }
-$ThemeSet['PM'] = sql_result($themeresult,0,"PM");
-if($ThemeSet['PM']=="") { $ThemeSet['PM'] = null; }
-$ThemeSet['TopicLayout'] = sql_result($themeresult,0,"TopicLayout");
-if($ThemeSet['TopicLayout']=="") { $ThemeSet['TopicLayout'] = null; }
-$ThemeSet['AddReply'] = sql_result($themeresult,0,"AddReply");
-if($ThemeSet['AddReply']=="") { $ThemeSet['AddReply'] = null; }
-$ThemeSet['FastReply'] = sql_result($themeresult,0,"FastReply");
-if($ThemeSet['FastReply']=="") { $ThemeSet['FastReply'] = null; }
-$ThemeSet['NewTopic'] = sql_result($themeresult,0,"NewTopic");
-if($ThemeSet['NewTopic']=="") { $ThemeSet['NewTopic'] = null; }
-$ThemeSet['QuoteReply'] = sql_result($themeresult,0,"QuoteReply");
-if($ThemeSet['QuoteReply']=="") { $ThemeSet['QuoteReply'] = null; }
-$ThemeSet['EditReply'] = sql_result($themeresult,0,"EditReply");
-if($ThemeSet['EditReply']=="") { $ThemeSet['EditReply'] = null; }
-$ThemeSet['DeleteReply'] = sql_result($themeresult,0,"DeleteReply");
-if($ThemeSet['DeleteReply']=="") { $ThemeSet['DeleteReply'] = null; }
-$ThemeSet['Report'] = sql_result($themeresult,0,"Report");
-if($ThemeSet['Report']=="") { $ThemeSet['Report'] = null; }
-$ThemeSet['LineDivider'] = sql_result($themeresult,0,"LineDivider");
-if($ThemeSet['LineDivider']=="") { $ThemeSet['LineDivider'] = null; }
-$ThemeSet['ButtonDivider'] = sql_result($themeresult,0,"ButtonDivider");
-if($ThemeSet['ButtonDivider']=="") { $ThemeSet['ButtonDivider'] = null; }
-$ThemeSet['LineDividerTopic'] = sql_result($themeresult,0,"LineDividerTopic");
-if($ThemeSet['LineDividerTopic']=="") { $ThemeSet['LineDividerTopic'] = null; }
-$ThemeSet['TitleDivider'] = sql_result($themeresult,0,"TitleDivider");
-if($ThemeSet['TitleDivider']=="") { $ThemeSet['TitleDivider'] = null; }
-$ThemeSet['ForumStyle'] = sql_result($themeresult,0,"ForumStyle");
-if($ThemeSet['ForumStyle']=="") { $ThemeSet['ForumStyle'] = null; }
-$ThemeSet['ForumIcon'] = sql_result($themeresult,0,"ForumIcon");
-if($ThemeSet['ForumIcon']=="") { $ThemeSet['ForumIcon'] = null; }
-$ThemeSet['SubForumIcon'] = sql_result($themeresult,0,"SubForumIcon");
-if($ThemeSet['SubForumIcon']=="") { $ThemeSet['SubForumIcon'] = null; }
-$ThemeSet['RedirectIcon'] = sql_result($themeresult,0,"RedirectIcon");
-if($ThemeSet['RedirectIcon']=="") { $ThemeSet['RedirectIcon'] = null; }
-$ThemeSet['TitleIcon'] = sql_result($themeresult,0,"TitleIcon");
-if($ThemeSet['TitleIcon']=="") { $ThemeSet['TitleIcon'] = null; }
-$ThemeSet['NavLinkIcon'] = sql_result($themeresult,0,"NavLinkIcon");
-if($ThemeSet['NavLinkIcon']=="") { $ThemeSet['NavLinkIcon'] = null; }
-$ThemeSet['NavLinkDivider'] = sql_result($themeresult,0,"NavLinkDivider");
-if($ThemeSet['NavLinkDivider']=="") { $ThemeSet['NavLinkDivider'] = null; }
-$ThemeSet['StatsIcon'] = sql_result($themeresult,0,"StatsIcon");
-if($ThemeSet['StatsIcon']=="") { $ThemeSet['StatsIcon'] = null; }
-$ThemeSet['NoAvatar'] = sql_result($themeresult,0,"NoAvatar");
-if($ThemeSet['NoAvatar']=="") { $ThemeSet['NoAvatar'] = null; }
-$ThemeSet['NoAvatarSize'] = sql_result($themeresult,0,"NoAvatarSize");
-if($ThemeSet['NoAvatarSize']=="") { $ThemeSet['NoAvatarSize'] = null; }
-?>
\ No newline at end of file
diff --git a/inc/stats.php.bak b/inc/stats.php.bak
deleted file mode 100644 (file)
index 004d3a5..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: stats.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="stats.php"||$File3Name=="/stats.php") {
-       require('index.php');
-       exit(); }
-if($_GET['act']=="stats") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=stats","&","=",$prexqstr['index'],$exqstr['index']);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile['index']; }
-$_SESSION['PreViewingTitle'] = "Viewing";
-$_SESSION['ViewingTitle'] = "Board Stats"; 
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=stats",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>#bstats">Board Statistics</a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php }
-$uolcuttime = $utccurtime->getTimestamp();
-$uoltime = $uolcuttime - ini_get("session.gc_maxlifetime");
-$uolquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i ORDER BY \"expires\" DESC", array($uoltime));
-$uolresult=sql_query($uolquery,$SQLStat);
-$uolnum=sql_num_rows($uolresult);
-$uoli=0; $olmn = 0; $olgn = 0; $olan = 0; $olmbn = 0;
-$MembersOnline = null; $GuestsOnline = null;
-while ($uoli < $uolnum) {
-$session_data=sql_result($uolresult,$uoli,"session_data"); 
-$serialized_data=sql_result($uolresult,$uoli,"serialized_data");
-$session_user_agent=sql_result($uolresult,$uoli,"user_agent"); 
-$session_ip_address=sql_result($uolresult,$uoli,"ip_address");
-//$UserSessInfo = unserialize_session($session_data);
-$UserSessInfo = unserialize($serialized_data);
-if(!isset($UserSessInfo['UserGroup'])) { $UserSessInfo['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($session_user_agent)) {
-       $user_agent_check = user_agent_check($session_user_agent); }
-if($UserSessInfo['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($UserSessInfo['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$UserSessInfo['UserID']>0)||$user_agent_check!==false) {
-if($olmbn>0) { $MembersOnline .= ", "; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersOnline .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$UserSessInfo['MemberName']."</a>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersOnline .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$olmn; ++$olmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersOnline .= "<span".$uatitleadd.">".$user_agent_check."</span>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersOnline .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$olmbn; } }
-if($UserSessInfo['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$olan; } } }
-if($UserSessInfo['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$GuestsOnline .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>";
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsOnline .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; } */
-++$olgn; }
-++$uoli; }
-if($_GET['act']=="view"||$_GET['act']=="stats") {
-$ntquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."topics\"".$ForumIgnoreList3, array(null));
-$ntresult = sql_query($ntquery,$SQLStat);
-$numtopics = sql_result($ntresult,0);
-sql_free_result($ntresult);
-$npquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."posts\"".$ForumIgnoreList3, array(null));
-$npresult = sql_query($npquery,$SQLStat);
-$numposts = sql_result($npresult,0);
-sql_free_result($npresult);
-if($Settings['AdminValidate']=="on") {
-$nmquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\">=%i AND \"HiddenMember\"='no' AND \"Validated\"='yes' AND \"GroupID\"<>%i ORDER BY \"Joined\" DESC LIMIT 1", array(1,$Settings['ValidateGroup'])); 
-$rnmquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"id\">=%i AND \"HiddenMember\"='no' AND \"Validated\"='yes' AND \"GroupID\"<>%i", array(1,$Settings['ValidateGroup'])); }
-if($Settings['AdminValidate']!="on") {
-$nmquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\">=%i AND \"HiddenMember\"='no' ORDER BY \"Joined\" DESC LIMIT 1", array(1,$Settings['ValidateGroup'])); 
-$rnmquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"id\">=%i AND \"HiddenMember\"='no'", array(1,$Settings['ValidateGroup'])); }
-$nmresult = sql_query($nmquery,$SQLStat);
-$rnmresult = sql_query($rnmquery,$SQLStat);
-//$nummembers = sql_num_rows($nmresult);
-$nummembers = sql_result($rnmresult,0);
-sql_free_result($rnmresult);
-$NewestMem = array(null);
-$NewestMem['ID'] = "0"; $NewestMem['Name'] = "Anonymous";
-if($nummembers>0) {
-$NewestMem['ID']=sql_result($nmresult,0,"id");
-$NewestMem['Name']=sql_result($nmresult,0,"Name");
-$NewestMem['IP']=sql_result($nmresult,0,"IP"); }
-if($nummembers<=0) { $NewestMem['ID'] = 0; }
-if($NewestMem['ID']<=0) { $NewestMem['ID'] = "0"; $NewestMem['Name'] = "Anonymous"; $NewestMem['IP'] = "127.0.0.1"; }
-$NewestMemTitle = null;
-$NewestMemExtraIP = null;
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$NewestMemTitle = " title=\"".$NewestMem['IP']."\"";
-$NewestMemExtraIP = " (<a title=\"".$NewestMem['IP']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$NewestMem['IP'])."\">".$NewestMem['IP']."</a>)"; }
-$bdMonthChCk = $usercurtime->format("m");
-$bdDayChCk = $usercurtime->format("d");
-if($Settings['AdminValidate']=="on") {
-$bdquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"BirthDay\"=%i AND \"BirthMonth\"=%i AND \"HiddenMember\"='no' AND \"Validated\"='yes' AND \"GroupID\"<>%i ORDER BY \"id\"", array($bdDayChCk,$bdMonthChCk,$Settings['ValidateGroup'])); } 
-if($Settings['AdminValidate']!="on") {
-$bdquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"BirthDay\"=%i AND \"BirthMonth\"=%i AND \"HiddenMember\"='no' ORDER BY \"id\"", array($bdDayChCk,$bdMonthChCk)); } 
-$bdresult = sql_query($bdquery,$SQLStat);
-$bdmembers = sql_num_rows($bdresult); $bdi = 0;
-if($bdmembers>0) { $bdstring = $bdmembers." member(s) have a birthday today"; }
-if($bdmembers<=0) { $bdstring = "<div>&nbsp;</div>&nbsp;No members have a birthday today<div>&nbsp;</div>"; }
-while ($bdi < $bdmembers) {
-$bdmemberz = $bdmembers - 1;
-$birthday['ID']=sql_result($bdresult,$bdi,"id");
-$birthday['Name']=sql_result($bdresult,$bdi,"Name");
-$birthday['IP']=sql_result($bdresult,$bdi,"IP");
-$birthday['BirthYear']=sql_result($bdresult,$bdi,"BirthYear");
-$bdThisYear = $usercurtime->format("Y");
-$birthday['Age'] = $bdThisYear - $birthday['BirthYear'];
-$bdMemTitle = null;
-if($GroupInfo['HasAdminCP']=="yes") {
-$bdMemTitle = " title=\"".$birthday['IP']."\""; }
-if($bdi===0) { $bdstring = $bdstring."\n<br />&nbsp;"; }
-$bdMemURL = "<a".$bdMemTitle." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$birthday['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$birthday['Name']."</a>";
-if($bdi<$bdmemberz) { $bdstring = $bdstring.$bdMemURL." (<span style=\"font-weight: bold;\" title=\"".$birthday['Name']." is ".$birthday['Age']." years old\">".$birthday['Age']."</span>), "; }
-if($bdi==$bdmemberz) { $bdstring = $bdstring.$bdMemURL." (<span style=\"font-weight: bold;\" title=\"".$birthday['Name']." is ".$birthday['Age']." years old\">".$birthday['Age']."</span>)"; }
-++$bdi; }
-sql_free_result($bdresult);
-$active_month = $usercurtime->format("m");
-$active_day = $usercurtime->format("d");
-$active_year = $usercurtime->format("Y");
-$active_start = mktime(0,0,0,$active_month,$active_day,$active_year);
-$active_end = mktime(23,59,59,$active_month,$active_day,$active_year);
-$tdMembersOnline = null;
-$ggquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s'", array($Settings['GuestGroup']));
-$ggresult=sql_query($ggquery,$SQLStat);
-$GGroup=sql_result($ggresult,0,"id");
-sql_free_result($ggresult);
-$tdquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"<>%i AND \"id\">=0 AND \"HiddenMember\"='no' AND (\"LastActive\">=%i AND \"LastActive\"<=%i) ORDER BY \"LastActive\" DESC", array($GGroup,$active_start,$active_end)); 
-$tdrnquery = sql_pre_query("SELECT COUNT(*) FROM \"".$Settings['sqltable']."members\" WHERE \"GroupID\"<>%i AND \"id\">=0 AND \"HiddenMember\"='no' AND (\"LastActive\">=%i AND \"LastActive\"<=%i)", array($GGroup,$active_start,$active_end));
-$tdrnresult=sql_query($tdrnquery,$SQLStat);
-$tdNumberMembers=sql_result($tdrnresult,0);
-$tdresult=sql_query($tdquery,$SQLStat);
-$tdnum=sql_num_rows($tdresult);
-$tdi=0;
-while($tdi < $tdnum) {
-$tdMemList['ID']=sql_result($tdresult,$tdi,"id");
-$tdMemList['Name']=sql_result($tdresult,$tdi,"Name");
-$tdMemList['IP']=sql_result($tdresult,$tdi,"IP");
-$tdMemList['LastActive']=sql_result($tdresult,$tdi,"LastActive");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($tdMemList['LastActive']);
-$tmpusrcurtime->setTimezone($usertz);
-$tdMemList['LastActive']=$tmpusrcurtime->format("M j Y, ".$_SESSION['iDBTimeFormat']);
-if($tdi>0) { $tdMembersOnline .= ", "; }
-$tdMembersOnline .= "<a title=\"".$tdMemList['Name']." was last active at ".$tdMemList['LastActive']."\" href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$tdMemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$tdMemList['Name']."</a>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$tdMembersOnline .= " (<a title=\"".$tdMemList['IP']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$tdMemList['IP'])."\">".$tdMemList['IP']."</a>)"; }
-++$tdi; }
-?>
-<div class="StatsBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableStatsRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a id="bstats" href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=stats",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>#bstats">Board Statistics</a></span></div>
-<?php } ?>
-<table id="BoardStats" class="TableStats1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableStatsRow1">
-<td class="TableStatsColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a id="bstats" href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=stats",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>#bstats">Board Statistics</a></span>
-</td>
-</tr><?php } ?>
-<tr id="Stats1" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;"><?php echo $uolnum; ?> users online</td>
-</tr>
-<tr class="TableStatsRow3" id="Stats2">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-&nbsp;<span style="font-weight: bold;"><?php echo $olgn; ?></span> guests, <span style="font-weight: bold;"><?php echo $olmn; ?></span> members, <span style="font-weight: bold;"><?php echo $olan; ?></span> anonymous members <br />
-<?php if($MembersOnline==null) { ?>&nbsp;<?php echo "\n<br />"; } ?>
-<?php if($MembersOnline!=null) { ?>&nbsp;<?php echo $MembersOnline."\n<br />"; } ?>
-&nbsp;Show detailed by: <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=all&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Last Click</a>, <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=online&list=members&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Member Name</a>
-</div></td>
-</tr>
-<tr id="Stats3" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;">Today's Birthdays</td>
-</tr>
-<tr class="TableStatsRow3" id="Stats4">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-<?php echo $bdstring; ?>
-</div></td>
-</tr>
-<tr id="Stats5" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;">Board Stats</td>
-</tr>
-<tr class="TableStatsRow3" id="Stats6">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-&nbsp;Our members have made a total of <?php echo $numposts; ?> posts<br />
-&nbsp;Our members have made a total of <?php echo $numtopics; ?> topics<br />
-&nbsp;We have <?php echo $nummembers; ?> registered members<br />
-&nbsp;Our newest member is <a<?php echo $NewestMemTitle; ?> href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$NewestMem['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $NewestMem['Name']; ?></a><?php echo $NewestMemExtraIP; ?>
-</div></td>
-</tr>
-<tr id="Stats7" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;">Members Online Today: <?php echo $tdNumberMembers; ?></td>
-</tr>
-<tr class="TableStatsRow3" id="Stats8">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-&nbsp;Number of members online today: <?php echo $tdNumberMembers; ?><br />
-&nbsp;The following members have visited today:<br />
-&nbsp;<?php echo $tdMembersOnline; ?>
-</div></td>
-</tr>
-<tr id="Stats9" class="TableStatsRow4">
-<td class="TableStatsColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivStats">&nbsp;</div>
-<?php } ?>
diff --git a/inc/subcategories.php.bak b/inc/subcategories.php.bak
deleted file mode 100644 (file)
index a1a9663..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: subcategories.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="subcategories.php"||$File3Name=="/subcategories.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!isset($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if(!is_numeric($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if($ThemeSet['ForumStyle']>2||$ThemeSet['ForumStyle']<1) {
-       $ThemeSet['ForumStyle'] = 1; }
-$checkquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($_GET['id']));
-$checkresult=sql_query($checkquery,$SQLStat);
-$checknum=sql_num_rows($checkresult);
-if($checknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($checkresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($checknum>=1) {
-$CategoryID=sql_result($checkresult,0,"id");
-$CategoryName=sql_result($checkresult,0,"Name");
-$CategoryShow=sql_result($checkresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($checkresult,0,"CategoryType");
-$InSubCategory=sql_result($checkresult,0,"InSubCategory");
-$SubShowForums=sql_result($checkresult,0,"SubShowForums");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-$SCategoryName = $CategoryName;
-if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
-       $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$CategoryID,"&","=",$prexqstr[$CategoryType],$exqstr[$CategoryType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$CategoryType]; }
-$_SESSION['PreViewingTitle'] = "Viewing SubCategory:";
-$_SESSION['ViewingTitle'] = $CategoryName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
-if($InSubCategory!="0") {
-$iscquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($InSubCategory));
-$iscresult=sql_query($iscquery,$SQLStat);
-$iscnum=sql_num_rows($iscresult);
-if($iscnum>=1) {
-$iscCategoryID=sql_result($iscresult,0,"id");
-$iscCategoryName=sql_result($iscresult,0,"Name");
-$iscCategoryShow=sql_result($iscresult,0,"ShowCategory");
-$iscCategoryType=sql_result($iscresult,0,"CategoryType");
-$iscCategoryType = strtolower($iscCategoryType); }
-if($iscnum<1) { $InSubCategory = "0"; } 
-sql_free_result($iscresult); }
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php if($InSubCategory!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$iscCategoryType],$Settings['file_ext'],"act=view&id=".$iscCategoryID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$iscCategoryType],$exqstr[$iscCategoryType]); ?>"><?php echo $iscCategoryName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-if($CategoryType=="category") {
-redirect("location",$rbasedir.url_maker($exfile['category'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['category'],$exqstr['category'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($checkresult);
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"InSubCategory\"=%i".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-while ($prei < $prenum) {
-$CategoryID=sql_result($preresult,$prei,"id");
-$CategoryName=sql_result($preresult,$prei,"Name");
-$CategoryShow=sql_result($preresult,$prei,"ShowCategory");
-$CategoryType=sql_result($preresult,$prei,"CategoryType");
-$SSubShowForums=sql_result($preresult,$prei,"SubShowForums");
-$CategoryDescription=sql_result($preresult,$prei,"Description");
-$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
-if(isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=0".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="SubCat<?php echo $CategoryID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr id="SubCatStart<?php echo $CategoryID; ?>" class="TableRow1">
-<td class="TableColumn1" colspan="5"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="ForumStatRow<?php echo $CategoryID; ?>" class="TableRow2">
-<th class="TableColumn2" style="width: 4%;">&nbsp;</th>
-<th class="TableColumn2" style="width: 58%;">Forum</th>
-<th class="TableColumn2" style="width: 7%;">Topics</th>
-<th class="TableColumn2" style="width: 7%;">Posts</th>
-<th class="TableColumn2" style="width: 24%;">Last Topic</th>
-</tr>
-<?php }
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<a href=\"".$sfurl."\">".$SubsForumName."</a>";
-if($apcl==1) {
-$sflist = "Subforums:";
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist.", ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<a href=\"".$sfurl."\">".$SubsForumName."</a>";
-if($apcl==1) {
-$sflist = "Subforums:";
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist.", ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$gltnum = count($gltf); $glti = 0; 
-$OldUpdateTime = 0; $UseThisFonum = null;
-if ($ForumType=="subforum") { 
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($gltf[$glti]));
-$gltforesult=sql_query($gltfoquery,$SQLStat);
-$gltfonum=sql_num_rows($gltforesult);
-if($gltfonum>0) {
-$NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
-if($NewUpdateTime>$OldUpdateTime) { 
-       $UseThisFonum = $gltf[$glti]; 
-$OldUpdateTime = $NewUpdateTime; }
-sql_free_result($gltforesult); }
-++$glti; } 
-if($UseThisFonum==0) {
-       $UseThisFonum = $gltf[0]; } }
-if ($ForumType!="subforum"&&$ForumType!="redirect") { $UseThisFonum = $gltf[0]; }
-if ($ForumType!="redirect") {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE (\"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") OR (\"OldForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") ORDER BY \"LastUpdate\" DESC LIMIT 1", array($UseThisFonum,$UseThisFonum));
-$gltresult=sql_query($gltquery,$SQLStat);
-$gltnum=sql_num_rows($gltresult);
-if($gltnum>0){
-$TopicID=sql_result($gltresult,0,"id");
-$TopicName=sql_result($gltresult,0,"TopicName");
-$NumReplys=sql_result($gltresult,0,"NumReply");
-$NumPages = null; $NumRPosts = $NumReplys + 1;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($NumRPosts>$Settings['max_posts']) {
-$NumPages = ceil($NumRPosts/$Settings['max_posts']); }
-if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
-$TopicName1 = pre_substr($TopicName,0,20);
-$oldtopicname=$TopicName;
-if (pre_strlen($TopicName)>20) {
-$TopicName1 = $TopicName1."..."; $TopicName=$TopicName1; }
-$glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
-$glrresult=sql_query($glrquery,$SQLStat);
-$glrnum=sql_num_rows($glrresult);
-if($glrnum>0){
-$ReplyID=sql_result($glrresult,0,"id");
-$UsersID=sql_result($glrresult,0,"UserID");
-$GuestsName=sql_result($glrresult,0,"GuestName");
-$TimeStamp=sql_result($glrresult,0,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TimeStamp);
-$tmpusrcurtime->setTimezone($usertz);
-$TimeStamp=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-sql_free_result($glrresult); }
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
-if($PreUsersName['Name']===null) { $UsersID = -1;
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
-$UsersName = $PreUsersName['Name'];
-$UsersHidden = $PreUsersName['Hidden'];
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-$UsersName1 = pre_substr($UsersName,0,20);
-$oldusername=$UsersName;
-if (pre_strlen($UsersName)>20) { 
-$UsersName1 = $UsersName1."..."; $UsersName=$UsersName1; } 
-$lul = null;
-if($UsersID>0&&$UsersHidden=="no") {
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\nUser: <a href=\"".$lul."\" title=\"".$oldusername."\">".$UsersName."</a>"; }
-if($UsersID<=0||$UsersHidden=="yes") {
-if($UsersID==-1) { $UserPre = "Guest:"; }
-if(($UsersID<-1&&$UsersHidden=="yes")||$UsersID==0||($UsersID>0&&$UsersHidden=="yes")) { 
-       $UserPre = "Hidden:"; }
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\n".$UserPre." <span title=\"".$oldusername."\">".$UsersName."</span>"; } }
-if($LastTopic==null) { $LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;"; }
-sql_free_result($gltresult); }
-if ($ForumType=="redirect") { $LastTopic="&nbsp;<br />Redirects: ".$NumRedirects."<br />&nbsp;"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-if($ThemeSet['ForumStyle']==1) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3\" ";
-       $ForumClass[4] = " class=\"TableColumn3\" ";
-       $ForumClass[5] = " class=\"TableColumn3\" "; }
-if($ThemeSet['ForumStyle']==2) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[4] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[5] = " class=\"TableColumn3Alt\" "; }
-?>
-<tr class="TableRow3" id="Forum<?php echo $ForumID; ?>">
-<td<?php echo $ForumClass[1]; ?>><div class="forumicon">
-<?php echo $PreForum; ?></div></td>
-<td<?php echo $ForumClass[2]; ?>><div class="forumname"><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a></div>
-<div class="forumdescription"><?php echo $ForumDescription; ?><br />
-<?php echo $sflist; ?></div></td>
-<td<?php echo $ForumClass[3]; ?>style="text-align: center;"><?php echo $NumTopics; ?></td>
-<td<?php echo $ForumClass[4]; ?>style="text-align: center;"><?php echo $NumPosts; ?></td>
-<td<?php echo $ForumClass[5]; ?>><?php echo $LastTopic; ?></td>
-</tr>
-<?php } ++$i; } sql_free_result($result);
-if($num>=1) {
-?>
-<tr id="SubCatEnd<?php echo $CategoryID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="5">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivSubCategories">&nbsp;</div>
-<?php } } ++$prei; } }
-sql_free_result($preresult);
-$CatCheck = "skip";
-if($SubShowForums!="yes") { 
-       $CategoryName = $SCategoryName; }
-if($SubShowForums!="no") {
-require($SettDir['inc'].'categories.php'); } }
-?>
diff --git a/inc/subforums.php.bak b/inc/subforums.php.bak
deleted file mode 100644 (file)
index 17a72bf..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: subforums.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="subforums.php"||$File3Name=="/subforums.php") {
-       require('index.php');
-       exit(); }
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!isset($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if(!is_numeric($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
-if($ThemeSet['ForumStyle']>2||$ThemeSet['ForumStyle']<1) {
-       $ThemeSet['ForumStyle'] = 1; }
-$checkquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['id']));
-$checkresult=sql_query($checkquery,$SQLStat);
-$checknum=sql_num_rows($checkresult);
-if($checknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($checkresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($checknum>=1) {
-$ForumID=sql_result($checkresult,0,"id");
-$SForumID=$ForumID;
-$ForumName=sql_result($checkresult,0,"Name");
-$ForumType=sql_result($checkresult,0,"ForumType");
-$ForumShow=sql_result($checkresult,0,"ShowForum");
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$InSubForum=sql_result($checkresult,0,"InSubForum");
-$SFInSubForum=$InSubForum;
-$CategoryID=sql_result($checkresult,0,"CategoryID");
-$RedirectURL=sql_result($checkresult,0,"RedirectURL");
-$RedirectTimes=sql_result($checkresult,0,"Redirects");
-$CanHaveTopics=sql_result($checkresult,0,"CanHaveTopics");
-$NumberViews=sql_result($checkresult,0,"NumViews");
-$SForumName = $ForumName;
-$ForumType = strtolower($ForumType); $CanHaveTopics = strtolower($CanHaveTopics);
-if($CanHaveTopics!="yes"&&$ForumType!="redirect") {
-if($NumberViews==0||$NumberViews==null) { $NewNumberViews = 1; }
-if($NumberViews!=0&&$NumberViews!=null) { $NewNumberViews = $NumberViews + 1; }
-$viewup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumViews\"='%s' WHERE \"id\"=%i", array($NewNumberViews,$_GET['id']));
-sql_query($viewup,$SQLStat); }
-if($ForumType=="redirect") {
-if($RedirectTimes==0||$RedirectTimes==null) { $NewRedirTime = 1; }
-if($RedirectTimes!=0&&$RedirectTimes!=null) { $NewRedirTime = $RedirectTimes + 1; }
-$redirup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"Redirects\"='%s' WHERE \"id\"=%i", array($NewRedirTime,$_GET['id']));
-sql_query($redirup,$SQLStat);
-if($RedirectURL!="http://"&&$RedirectURL!="") {
-redirect("location",$RedirectURL,0,null,false); ob_clean();
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($RedirectURL=="http://"||$RedirectURL=="") {
-redirect("location",url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($ForumType=="forum") {
-redirect("location",$rbasedir.url_maker($exfile['forum'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-sql_free_result($checkresult);
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"id\"=%i".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-$prei=0;
-$CategoryID=sql_result($preresult,0,"id");
-$CategoryName=sql_result($preresult,0,"Name");
-$CategoryShow=sql_result($preresult,0,"ShowCategory");
-$CategoryType=sql_result($preresult,0,"CategoryType");
-$InSubCategory=sql_result($preresult,0,"InSubCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryDescription=sql_result($preresult,0,"Description");
-if($InSubForum!="0") {
-$isfquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($InSubForum));
-$isfresult=sql_query($isfquery,$SQLStat);
-$isfnum=sql_num_rows($isfresult);
-if($isfnum>=1) {
-$isfForumID=sql_result($isfresult,0,"id");
-$isfForumCatID=sql_result($isfresult,0,"CategoryID");
-$isfForumName=sql_result($isfresult,0,"Name");
-$isfForumType=sql_result($isfresult,0,"ForumType");
-$isfForumType = strtolower($isfForumType);
-$isfRedirectURL=sql_result($isfresult,0,"RedirectURL"); }
-if($isfnum<1) { $InSubForum = "0"; } 
-sql_free_result($isfresult); }
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$ForumID."&page=".$_GET['page'],"&","=",$prexqstr[$ForumType],$exqstr[$ForumType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType]; }
-$_SESSION['PreViewingTitle'] = "Viewing SubForum:";
-$_SESSION['ViewingTitle'] = $ForumName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; 
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php if($InSubForum!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$isfForumType],$Settings['file_ext'],"act=view&id=".$isfForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$isfForumType],$exqstr[$isfForumType]); ?>"><?php echo $isfForumName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php
-if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
-       $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($PermissionInfo['CanViewForum'][$_GET['id']])) {
-       $PermissionInfo['CanViewForum'][$_GET['id']] = "no"; }
-if($PermissionInfo['CanViewForum'][$_GET['id']]=="no"||
-       $PermissionInfo['CanViewForum'][$_GET['id']]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes"&&
-       $PermissionInfo['CanViewForum'][$_GET['id']]=="yes") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"CategoryID\"=%i AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($CategoryID,$_GET['id']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-$i=0;
-if($num>=1) {
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['category'],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr['category'],$exqstr['category']); ?>"><?php echo $CategoryName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="Cat<?php echo $CategoryID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="CatStart<?php echo $CategoryID; ?>">
-<td class="TableColumn1" colspan="5"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['category'],$Settings['file_ext'],"act=view&id=".$CategoryID,$Settings['qstr'],$Settings['qsep'],$prexqstr['category'],$exqstr['category']); ?>"><?php echo $CategoryName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="ForumStatRow<?php echo $CategoryID; ?>" class="TableRow2">
-<th class="TableColumn2" style="width: 4%;">&nbsp;</th>
-<th class="TableColumn2" style="width: 58%;">Forum</th>
-<th class="TableColumn2" style="width: 7%;">Topics</th>
-<th class="TableColumn2" style="width: 7%;">Posts</th>
-<th class="TableColumn2" style="width: 24%;">Last Topic</th>
-</tr>
-<?php
-while ($i < $num) {
-$ForumID=sql_result($result,$i,"id");
-$ForumName=sql_result($result,$i,"Name");
-$ForumShow=sql_result($result,$i,"ShowForum");
-$ForumType=sql_result($result,$i,"ForumType");
-$ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
-$ForumShowTopics = strtolower($ForumShowTopics);
-$NumTopics=sql_result($result,$i,"NumTopics");
-$NumPosts=sql_result($result,$i,"NumPosts");
-$NumRedirects=sql_result($result,$i,"Redirects");
-$ForumDescription=sql_result($result,$i,"Description");
-$ForumType = strtolower($ForumType); $sflist = null;
-$gltf = array(null); $gltf[0] = $ForumID;
-if ($ForumType=="subforum") { 
-$apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
-$apcresult=sql_query($apcquery,$SQLStat);
-$apcnum=sql_num_rows($apcresult);
-$apci=0; $apcl=1; if($apcnum>=1) {
-while ($apci < $apcnum) {
-$NumsTopics=sql_result($apcresult,$apci,"NumTopics");
-$NumTopics = $NumsTopics + $NumTopics;
-$NumsPosts=sql_result($apcresult,$apci,"NumPosts");
-$NumPosts = $NumsPosts + $NumPosts;
-$SubsForumID=sql_result($apcresult,$apci,"id");
-$SubsForumName=sql_result($apcresult,$apci,"Name");
-$SubsForumType=sql_result($apcresult,$apci,"ForumType");
-$SubsForumShowTopics=sql_result($apcresult,$apci,"CanHaveTopics");
-$SubsForumDescription=sql_result($apcresult,$apci,"Description");
-if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
-       $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
-$ExStr = ""; if ($SubsForumType!="redirect"&&
-    $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
-//$sfurl = "<a href=\"";
-$sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
-$sfurl = "<a title=\"".$SubsForumDescription."\" href=\"".$sfurl."\">".$SubsForumName."</a>";
-if($apcl==1) {
-$sflist = "Subforums:";
-$sflist = $sflist." ".$sfurl; }
-if($apcl>1) {
-$sflist = $sflist.", ".$sfurl; }
-$gltf[$apcl] = $SubsForumID; ++$apcl; }
-++$apci; }
-sql_free_result($apcresult); } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-$LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
-if(!isset($LastTopic)) { $LastTopic = null; }
-$gltnum = count($gltf); $glti = 0; 
-$OldUpdateTime = 0; $UseThisFonum = null;
-if ($ForumType=="subforum") { 
-while ($glti < $gltnum) {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"CategoryID\"=%i".$ExtraIgnores.$ForumIgnoreList4." AND \"ForumID\"=%i ORDER BY \"LastUpdate\" DESC LIMIT 1", array($CategoryID,$gltf[$glti]));
-$gltforesult=sql_query($gltfoquery,$SQLStat);
-$gltfonum=sql_num_rows($gltforesult);
-if($gltfonum>0) {
-$NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
-if($NewUpdateTime>$OldUpdateTime) { 
-       $UseThisFonum = $gltf[$glti]; 
-$OldUpdateTime = $NewUpdateTime; }
-sql_free_result($gltforesult); }
-++$glti; } 
-if($UseThisFonum==0) {
-       $UseThisFonum = $gltf[0]; } }
-if ($ForumType!="subforum"&&$ForumType!="redirect") { $UseThisFonum = $gltf[0]; }
-if ($ForumType!="redirect") {
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$gltquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE (\"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") OR (\"OldForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") ORDER BY \"LastUpdate\" DESC LIMIT 1", array($UseThisFonum,$UseThisFonum));
-$gltresult=sql_query($gltquery,$SQLStat);
-$gltnum=sql_num_rows($gltresult);
-if($gltnum>0){
-$TopicID=sql_result($gltresult,0,"id");
-$TopicName=sql_result($gltresult,0,"TopicName");
-$NumReplys=sql_result($gltresult,0,"NumReply");
-$TopicName1 = pre_substr($TopicName,0,20);
-$oldtopicname=$TopicName; $NumRPosts = $NumReplys + 1;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($NumRPosts>$Settings['max_posts']) {
-$NumPages = ceil($NumRPosts/$Settings['max_posts']); }
-if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
-if (pre_strlen($TopicName)>20) { 
-$TopicName1 = $TopicName1."..."; $TopicName=$TopicName1; }
-$glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
-$glrresult=sql_query($glrquery,$SQLStat);
-$glrnum=sql_num_rows($glrresult);
-if($glrnum>0){
-$ReplyID=sql_result($glrresult,0,"id");
-$UsersID=sql_result($glrresult,0,"UserID");
-$GuestsName=sql_result($glrresult,0,"GuestName");
-$TimeStamp=sql_result($glrresult,0,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TimeStamp);
-$tmpusrcurtime->setTimezone($usertz);
-$TimeStamp=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-sql_free_result($glrresult); }
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
-if($PreUsersName['Name']===null) { $UsersID = -1;
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
-$UsersName = $PreUsersName['Name'];
-$UsersHidden = $PreUsersName['Hidden'];
-$UsersName1 = pre_substr($UsersName,0,20);
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-$oldusername=$UsersName;
-if (pre_strlen($UsersName)>20) {
-$UsersName1 = $UsersName1."..."; $UsersName=$UsersName1; } 
-$lul = null;
-if($UsersID>0&&$UsersHidden=="no") {
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\nUser: <a href=\"".$lul."\" title=\"".$oldusername."\">".$UsersName."</a>"; }
-if($UsersID<=0||$UsersHidden=="yes") {
-if($UsersID==-1) { $UserPre = "Guest:"; }
-if(($UsersID<-1&&$UsersHidden=="yes")||$UsersID==0||($UsersID>0&&$UsersHidden=="yes")) { 
-       $UserPre = "Hidden:"; }
-$LastTopic = $TimeStamp."<br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts."\" title=\"".$oldtopicname."\">".$TopicName."</a><br />\n".$UserPre." <span title=\"".$oldusername."\">".$UsersName."</span>"; } }
-if($LastTopic==null) { $LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;"; }
-sql_free_result($gltresult); }
-if ($ForumType=="redirect") { $LastTopic="&nbsp;<br />Redirects: ".$NumRedirects."<br />&nbsp;"; }
-$PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
-$ExStr = ""; if ($ForumType!="redirect"&&
-       $ForumShowTopics!="no") { $ExStr = "&page=1"; }
-if($ThemeSet['ForumStyle']==1) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3\" ";
-       $ForumClass[4] = " class=\"TableColumn3\" ";
-       $ForumClass[5] = " class=\"TableColumn3\" "; }
-if($ThemeSet['ForumStyle']==2) {
-       $ForumClass[1] = " class=\"TableColumn3\" ";
-       $ForumClass[2] = " class=\"TableColumn3\" ";
-       $ForumClass[3] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[4] = " class=\"TableColumn3Alt\" ";
-       $ForumClass[5] = " class=\"TableColumn3Alt\" "; }
-?>
-<tr class="TableRow3" id="SubForum<?php echo $ForumID; ?>">
-<td<?php echo $ForumClass[1]; ?>><div class="forumicon">
-<?php echo $PreForum; ?></div></td>
-<td<?php echo $ForumClass[2]; ?>><div class="forumname"><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"<?php if($ForumType=="redirect") { echo " onclick=\"window.open(this.href);return false;\""; } ?>><?php echo $ForumName; ?></a></div>
-<div class="forumdescription">
-<?php echo $ForumDescription; ?><br />
-<?php echo $sflist; ?></div></td>
-<td<?php echo $ForumClass[3]; ?>style="text-align: center;"><?php echo $NumTopics; ?></td>
-<td<?php echo $ForumClass[4]; ?>style="text-align: center;"><?php echo $NumPosts; ?></td>
-<td<?php echo $ForumClass[5]; ?>><?php echo $LastTopic; ?></td>
-</tr>
-<?php } ++$i; } sql_free_result($result);
-?>
-<tr id="CatEnd<?php echo $CategoryID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="5">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivSubForums">&nbsp;</div>
-<?php } } sql_free_result($preresult);
-$ForumCheck = "skip";
-if($CanHaveTopics!="yes") { 
-$ForumName = $SForumName; $ForumID = $SForumID; $InSubForum = $SFInSubForum;
-$uviewlcuttime = $utccurtime->getTimestamp();
-$uviewltime = $uviewlcuttime - ini_get("session.gc_maxlifetime");
-if($InSubForum==0) {
-$uviewlquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"session_id\"<>'%s' AND (\"serialized_data\" LIKE '%s' OR \"serialized_data\" LIKE '%s') ORDER BY \"expires\" DESC", array($uviewltime, session_id(), "%currentforumid:0,".$ForumID.";%", "%currentforumid:".$ForumID.",%")); }
-if($InSubForum!=0) {
-$uviewlquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"session_id\"<>'%s' AND (\"serialized_data\" LIKE '%s' OR \"serialized_data\" LIKE '%s') ORDER BY \"expires\" DESC", array($uviewltime, session_id(), "%currentforumid:".$InSubForum.",".$ForumID.";%", "%currentforumid:0,".$ForumID.";")); }
-$uviewlresult=sql_query($uviewlquery,$SQLStat);
-$uviewlnum=sql_num_rows($uviewlresult);
-$uviewli=0; $uviewlmn = 0; $uviewlgn = 0; $uviewlan = 0; $uviewlmbn = 0;
-$MembersViewList = null; $GuestsOnline = null;
-while ($uviewli < $uviewlnum) {
-$session_data=sql_result($uviewlresult,$uviewli,"session_data"); 
-$serialized_data=sql_result($uviewlresult,$uviewli,"serialized_data");
-$session_user_agent=sql_result($uviewlresult,$uviewli,"user_agent"); 
-$session_ip_address=sql_result($uviewlresult,$uviewli,"ip_address");
-//$UserSessInfo = unserialize_session($session_data);
-$UserSessInfo = unserialize($serialized_data);
-if(!isset($UserSessInfo['UserGroup'])) { $UserSessInfo['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($session_user_agent)) {
-       $user_agent_check = user_agent_check($session_user_agent); }
-if($UserSessInfo['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($UserSessInfo['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$UserSessInfo['UserID']>0)||$user_agent_check!==false) {
-if($uviewlmbn>0) { $MembersViewList .= ", "; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$UserSessInfo['MemberName']."</a>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$uviewlmn; ++$uviewlmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList .= "<span".$uatitleadd.">".$user_agent_check."</span>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$uviewlmbn; } }
-if($UserSessInfo['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$uviewlan; } } }
-if($UserSessInfo['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$GuestsViewList .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>";
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; } */
-++$uviewlgn; }
-++$uviewli; }
-if(!isset($_SESSION['UserGroup'])) { $_SESSION['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($_SERVER['HTTP_USER_AGENT'])) {
-       $user_agent_check = user_agent_check($_SERVER['HTTP_USER_AGENT']); }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($_SESSION['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$_SESSION['UserID']>0)||$user_agent_check!==false) {
-if($uviewlmbn>0) { $MembersViewList = ", ".$MembersViewList; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$MembersViewList; }
-$MembersViewList = "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_SESSION['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$_SESSION['MemberName']."</a>".$MembersViewList; 
-++$uviewlmn; ++$uviewlmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$MembersViewList; }
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList = "<span".$uatitleadd.">".$user_agent_check."</span>".$MembersViewList; 
-++$uviewlmbn; } }
-if($_SESSION['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$uviewlan; } } }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$GuestsViewList; }
-$GuestsViewList = "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>".$GuestsViewList; */
-++$uviewlgn; }
-++$uviewlnum;
-?>
-<div class="StatsBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableStatsRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">Forum Statistics</a></span></div>
-<?php } ?>
-<table id="BoardStats" class="TableStats1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableStatsRow1">
-<td class="TableStatsColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">Forum Statistics</a></span>
-</td>
-</tr><?php } ?>
-<tr id="Stats1" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;"><?php echo $uviewlnum; ?> users viewing forum</td>
-</tr>
-<tr class="TableStatsRow3" id="Stats2">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-&nbsp;<span style="font-weight: bold;"><?php echo $uviewlgn; ?></span> guests, <span style="font-weight: bold;"><?php echo $uviewlmn; ?></span> members, <span style="font-weight: bold;"><?php echo $uviewlan; ?></span> anonymous members <br />
-<?php if($MembersViewList!=null) { ?>&nbsp;<?php echo $MembersViewList."\n<br />"; } ?>
-</div></td>
-</tr>
-<tr id="Stats7" class="TableStatsRow4">
-<td class="TableStatsColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivStats">&nbsp;</div>
-<?php }
-if($CanHaveTopics!="no") {
-require($SettDir['inc'].'topics.php'); } }
-?>
diff --git a/inc/topics.php.bak b/inc/topics.php.bak
deleted file mode 100644 (file)
index 07124ae..0000000
+++ /dev/null
@@ -1,1097 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: topics.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="topics.php"||$File3Name=="/topics.php") {
-       require('index.php');
-       exit(); }
-$pstring = null; $pagenum = null;
-if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
-if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
-if(!isset($_GET['st'])) { $_GET['st'] = 0; }
-if(!is_numeric($_GET['st'])) { $_GET['st'] = 0; }
-$prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['id']));
-$preresult=sql_query($prequery,$SQLStat);
-$prenum=sql_num_rows($preresult);
-if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($prenum>=1) {
-$ForumID=sql_result($preresult,0,"id");
-$ForumCatID=sql_result($preresult,0,"CategoryID");
-$ForumName=sql_result($preresult,0,"Name");
-$ForumType=sql_result($preresult,0,"ForumType");
-$ForumShow=sql_result($preresult,0,"ShowForum");
-if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$InSubForum=sql_result($preresult,0,"InSubForum");
-$RedirectURL=sql_result($preresult,0,"RedirectURL");
-$RedirectTimes=sql_result($preresult,0,"Redirects");
-$NumberViews=sql_result($preresult,0,"NumViews");
-$NumberPosts=sql_result($preresult,0,"NumPosts");
-$NumberTopics=sql_result($preresult,0,"NumTopics");
-$PostCountAdd=sql_result($preresult,0,"PostCountAdd");
-$CanHaveTopics=sql_result($preresult,0,"CanHaveTopics");
-$HotTopicPosts=sql_result($preresult,0,"HotTopicPosts");
-if($HotTopicPosts!=0&&is_numeric($HotTopicPosts)) {
-       $Settings['hot_topic_num'] = $HotTopicPosts; }
-if(!is_numeric($Settings['hot_topic_num'])) {
-       $Settings['hot_topic_num'] = 15; }
-$ForumPostCountView=sql_result($preresult,0,"PostCountView");
-$ForumKarmaCountView=sql_result($preresult,0,"KarmaCountView");
-sql_free_result($preresult);
-$ForumType = strtolower($ForumType); $CanHaveTopics = strtolower($CanHaveTopics);
-if($CanHaveTopics=="yes"&&$ForumType=="subforum") { 
-if($_GET['act']=="create"||$_GET['act']=="maketopic"||
-       $_POST['act']=="maketopics") { $ForumCheck = "skip"; } }
-$catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2."  LIMIT 1", array($ForumCatID));
-$catresult=sql_query($catcheck,$SQLStat);
-$CategoryID=sql_result($catresult,0,"id");
-$CategoryName=sql_result($catresult,0,"Name");
-$CategoryShow=sql_result($catresult,0,"ShowCategory");
-if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
-$CategoryType=sql_result($catresult,0,"CategoryType");
-$InSubCategory=sql_result($catresult,0,"InSubCategory");
-$CategoryPostCountView=sql_result($catresult,0,"PostCountView");
-$CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
-sql_free_result($catresult);
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($MyPostCountChk==null) { $MyPostCountChk = 0; }
-if($MyKarmaCount==null) { $MyKarmaCount = 0; }
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($InSubForum!="0") {
-$isfquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($InSubForum));
-$isfresult=sql_query($isfquery,$SQLStat);
-$isfnum=sql_num_rows($isfresult);
-if($isfnum>=1) {
-$isfForumID=sql_result($isfresult,0,"id");
-$isfForumCatID=sql_result($isfresult,0,"CategoryID");
-$isfForumName=sql_result($isfresult,0,"Name");
-$isfForumType=sql_result($isfresult,0,"ForumType");
-$isfForumType = strtolower($isfForumType);
-$isfRedirectURL=sql_result($isfresult,0,"RedirectURL"); }
-if($isfnum<1) { $InSubForum = "0"; } 
-sql_free_result($isfresult); }
-if($ForumCheck!="skip") {
-$_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$ForumID."&page=".$_GET['page'],"&","=",$prexqstr[$ForumType],$exqstr[$ForumType]);
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$_SESSION['ViewingFile'] = $exfile[$ForumType]; }
-$_SESSION['PreViewingTitle'] = "Viewing Forum:";
-$_SESSION['ViewingTitle'] = $ForumName;
-$_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; 
-?>
-<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $Settings['board_name']; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$ForumCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php if($InSubForum!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$isfForumType],$Settings['file_ext'],"act=view&id=".$isfForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$isfForumType],$exqstr[$isfForumType]); ?>"><?php echo $isfForumName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
-<div class="DivNavLinks">&nbsp;</div>
-<?php }
-if(!isset($CatPermissionInfo['CanViewCategory'][$ForumCatID])) {
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID] = "no"; }
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
-       $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($PermissionInfo['CanViewForum'][$ForumID])) {
-       $PermissionInfo['CanViewForum'][$ForumID] = "no"; }
-if($PermissionInfo['CanViewForum'][$ForumID]=="no"||
-       $PermissionInfo['CanViewForum'][$ForumID]!="yes") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="yes"&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
-if($ForumType!="redirect") {
-if($NumberViews==0||$NumberViews==null) { $NewNumberViews = 1; }
-if($NumberViews!=0&&$NumberViews!=null) { $NewNumberViews = $NumberViews + 1; }
-$viewup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumViews\"=%i WHERE \"id\"=%i", array($NewNumberViews,$_GET['id']));
-sql_query($viewup,$SQLStat); }
-if($ForumType=="redirect") {
-if($RedirectTimes==0||$RedirectTimes==null) { $NewRedirTime = 1; }
-if($RedirectTimes!=0&&$RedirectTimes!=null) { $NewRedirTime = $RedirectTimes + 1; }
-$redirup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"Redirects\"=%i WHERE \"id\"=%i", array($NewRedirTime,$_GET['id']));
-sql_query($redirup,$SQLStat);
-if($RedirectURL!="http://"&&$RedirectURL!="") {
-redirect("location",$RedirectURL,0,null,false); ob_clean();
-header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($RedirectURL=="http://"||$RedirectURL=="") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($ForumCheck!="skip") {
-if($ForumType=="subforum") {
-redirect("location",$rbasedir.url_maker($exfile['subforum'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['subforum'],$exqstr['subforum'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($_GET['act']!="view") { ?>
-<table style="width: 100%;" class="Table2">
-<tr>
- <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
- <td style="width: 70%; text-align: right;">
- <?php if($PermissionInfo['CanMakeTopics'][$ForumID]=="yes"&&$CanHaveTopics=="yes") { ?>
- <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
- <?php } ?></td>
-</tr>
-</table>
-<div class="DivTable2">&nbsp;</div>
-<?php } if($_GET['act']=="view") {
-if($NumberTopics==null) { 
-       $NumberTopics = 0; }
-$num=$NumberTopics;
-//Start Topic Page Code
-if(!isset($Settings['max_topics'])) { $Settings['max_topics'] = 10; }
-if($_GET['page']==null) { $_GET['page'] = 1; } 
-if($_GET['page']<=0) { $_GET['page'] = 1; }
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$nums = $_GET['page'] * $Settings['max_topics']; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$nums = $_GET['st']; }
-if($nums>$num) { $nums = $num; }
-$numz = $nums - $Settings['max_topics'];
-if($numz<=0) { $numz = 0; }
-//$i=$numz;
-if($nums<$num) { $nextpage = $_GET['page'] + 1; }
-if($nums>=$num) { $nextpage = $_GET['page']; }
-if($numz>=$Settings['max_topics']) { $backpage = $_GET['page'] - 1; }
-if($_GET['page']<=1) { $backpage = 1; }
-$pnum = $num; $l = 1; $Pages = null;
-while ($pnum>0) {
-if($pnum>=$Settings['max_topics']) { 
-       $pnum = $pnum - $Settings['max_topics']; 
-       $Pages[$l] = $l; ++$l; }
-if($pnum<$Settings['max_topics']&&$pnum>0) { 
-       $pnum = $pnum - $pnum; 
-       $Pages[$l] = $l; ++$l; } }
-$snumber = $_GET['page'] - 1;
-if($_GET['st']<=0||!isset($_GET['st'])) {
-$PageLimit = $Settings['max_topics'] * $snumber; }
-if($_GET['st']>0&&isset($_GET['st'])) {
-$PageLimit = $_GET['st']; }
-if($PageLimit<0) { $PageLimit = 0; }
-//End Topic Page Code
-$i=0;
-$ExtraIgnores = null;
-if($PermissionInfo['CanModForum'][$_GET['id']]=="no") {
-       $ExtraIgnores = " AND \"Closed\"<>3"; }
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE (\"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") OR (\"OldForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4.") OR (\"Pinned\"=2".$ExtraIgnores.$ForumIgnoreList4.") ORDER BY \"Pinned\" DESC, \"LastUpdate\" DESC ".$SQLimit, array($_GET['id'],$_GET['id'],$PageLimit,$Settings['max_topics']));
-$result=sql_query($query,$SQLStat);
-$num=sql_num_rows($result);
-//List Page Number Code Start
-$pagenum=count($Pages);
-if($_GET['page']>$pagenum) {
-       $_GET['page'] = $pagenum; }
-$pagei=0; $pstring = null;
-if($pagenum>1) {
-$pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
-if($_GET['page']<4) { $Pagez[0] = null; }
-if($_GET['page']>=4) { $Pagez[0] = "First"; }
-if($_GET['page']>=3) {
-$Pagez[1] = $_GET['page'] - 2; }
-if($_GET['page']<3) {
-$Pagez[1] = null; }
-if($_GET['page']>=2) {
-$Pagez[2] = $_GET['page'] - 1; }
-if($_GET['page']<2) {
-$Pagez[2] = null; }
-$Pagez[3] = $_GET['page'];
-if($_GET['page']<$pagenum) {
-$Pagez[4] = $_GET['page'] + 1; }
-if($_GET['page']>=$pagenum) {
-$Pagez[4] = null; }
-$pagenext = $_GET['page'] + 1;
-if($pagenext<$pagenum) {
-$Pagez[5] = $_GET['page'] + 2; }
-if($pagenext>=$pagenum) {
-$Pagez[5] = null; }
-if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
-if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
-$pagenumi=count($Pagez);
-if($NumberTopics==0) {
-$pagenumi = 0;
-$pstring = null; }
-if($pagenum>1) {
-while ($pagei < $pagenumi) {
-if($_GET['page']!=1&&$pagei==1) {
-$Pback = $_GET['page'] - 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&lt;</a></span> "; }
-if($Pagez[$pagei]!=null&&
-   $Pagez[$pagei]!="First"&&
-   $Pagez[$pagei]!="Last") {
-if($pagei!=3) { 
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">".$Pagez[$pagei]."</a></span> "; }
-if($pagei==3) { 
-$pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">".$Pagez[$pagei]."</a></span> "; } }
-if($Pagez[$pagei]=="First") {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&laquo;</a></span> "; }
-if($Pagez[$pagei]=="Last") {
-$ptestnext = $pagenext + 1;
-$paget = $pagei - 1;
-$Pnext = $_GET['page'] + 1;
-$pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&gt;</a></span> ";
-if($ptestnext<$pagenum) {
-$pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&raquo;</a></span> "; } }
-       ++$pagei; } $pstring = $pstring."</div>"; }
-//List Page Number Code end
-if($pstring!=null||$PermissionInfo['CanMakeTopics'][$ForumID]=="yes"&&$CanHaveTopics=="yes") {
-?>
-<table style="width: 100%;" class="Table2">
-<tr>
- <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
- <td style="width: 70%; text-align: right;">
- <?php if($PermissionInfo['CanMakeTopics'][$ForumID]=="yes"&&$CanHaveTopics=="yes") { ?>
- <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
- <?php } ?></td>
-</tr>
-</table>
-<?php
-//List Page Number Code end
-?>
-<?php /*<div class="DivPageLinks">&nbsp;</div>*/?>
-<div class="DivTable2">&nbsp;</div>
-<?php } ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>#<?php echo $ForumID; ?>"><?php echo $ForumName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="Forum<?php echo $ForumID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr id="ForumStart<?php echo $ForumID; ?>" class="TableRow1">
-<td class="TableColumn1" colspan="6"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>#<?php echo $ForumID; ?>"><?php echo $ForumName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="TopicStatRow<?php echo $ForumID; ?>" class="TableRow2">
-<th class="TableColumn2" style="width: 4%;">State</th>
-<th class="TableColumn2" style="width: 36%;">Topic Name</th>
-<th class="TableColumn2" style="width: 15%;">Author</th>
-<th class="TableColumn2" style="width: 15%;">Time</th>
-<th class="TableColumn2" style="width: 5%;">Replys</th>
-<th class="TableColumn2" style="width: 25%;">Last Reply</th>
-</tr>
-<?php
-while ($i < $num) {
-$TopicID=sql_result($result,$i,"id");
-$TForumID=sql_result($result,$i,"ForumID");
-$OldForumID=sql_result($result,$i,"OldForumID");
-$UsersID=sql_result($result,$i,"UserID");
-$GuestsName=sql_result($result,$i,"GuestName");
-$TheTime=sql_result($result,$i,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TheTime);
-$tmpusrcurtime->setTimezone($usertz);
-$TheTime=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
-$NumReply=sql_result($result,$i,"NumReply");
-$NumberPosts=$NumReply + 1;
-$prepagelist = null;
-if(!isset($Settings['max_posts'])) { 
-       $Settings['max_posts'] = 10; }
-if(!isset($ThemeSet['MiniPageAltStyle'])) { 
-       $ThemeSet['MiniPageAltStyle'] = "off"; }
-if($ThemeSet['MiniPageAltStyle']!="on"&&
-       $ThemeSet['MiniPageAltStyle']!="off") { 
-       $ThemeSet['MiniPageAltStyle'] = "off"; }
-if($NumberPosts>$Settings['max_posts']) {
-$NumberPages = ceil($NumberPosts/$Settings['max_posts']); }
-if($NumberPosts<=$Settings['max_posts']) {
-$NumberPages = 1; }
-if($NumberPages>4) {
-       $prepagelist = " &nbsp;"; }
-if($NumberPages>=2) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { 
-       $prepagelist = "<span class=\"small\">(Pages: "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelink\">"; }
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">1</a>";
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; }
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelink\">"; }
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=2",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">2</a>";
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; }
-       if($NumberPages>=3) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelink\">"; }
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=3",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">3</a>";
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; } }
-       if($NumberPages==4) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelinklast\">"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=4",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">4</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="off") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=4",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\"> ...4</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; } }
-       if($NumberPages>4) {
-       if($ThemeSet['MiniPageAltStyle']=="off") { $prepagelist = $prepagelist." "; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<span class=\"minipagelinklast\">"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumberPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&raquo; ".$NumberPages."</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="off") {
-       $prepagelist = $prepagelist."<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumberPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\"> ...".$NumberPages."</a>"; }
-       if($ThemeSet['MiniPageAltStyle']=="on") {
-       $prepagelist = $prepagelist."</span>"; } }
-       if($ThemeSet['MiniPageAltStyle']=="off") { 
-       $prepagelist = $prepagelist.")</span>"; } }
-$TopicName=sql_result($result,$i,"TopicName");
-$TopicDescription=sql_result($result,$i,"Description");
-$PinnedTopic=sql_result($result,$i,"Pinned");
-$TopicStat=sql_result($result,$i,"Closed");
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-if($renum<1) { $UsersID = -1;
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($UsersID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult); }
-$UserHidden=sql_result($reresult,0,"HiddenMember");
-$UserGroupID=sql_result($reresult,0,"GroupID");
-sql_free_result($reresult);
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($UserGroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-$GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
-$GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
-sql_free_result($gresult);
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
-if($PreUsersName['Name']===null) { $UsersID = -1;
-$PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
-$UsersName = $PreUsersName['Name'];
-$UsersHidden = $PreUsersName['Hidden'];
-if($UsersName=="Guest") { $UsersName=$GuestsName;
-if($UsersName==null) { $UsersName="Guest"; } }
-if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
-       $UsersName = $GroupNamePrefix.$UsersName; }
-if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
-       $UsersName = $UsersName.$GroupNameSuffix; }
-$LastReply = "&nbsp;<br />&nbsp;";
-$glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
-$glrresult=sql_query($glrquery,$SQLStat);
-$glrnum=sql_num_rows($glrresult);
-if($glrnum>0){
-$ReplyID1=sql_result($glrresult,0,"id");
-$UsersID1=sql_result($glrresult,0,"UserID");
-$PreUsersName1 = GetUserName($UsersID1,$Settings['sqltable'],$SQLStat);
-if($PreUsersName1['Name']===null) { $UsersID1 = -1;
-$PreUsersName1 = GetUserName($UsersID1,$Settings['sqltable'],$SQLStat); }
-$UsersName1 = $PreUsersName1['Name'];
-$UsersHidden1 = $PreUsersName1['Hidden'];
-$GuestsName1=sql_result($glrresult,0,"GuestName");
-$TimeStamp1=sql_result($glrresult,0,"TimeStamp");
-$tmpusrcurtime = new DateTime();
-$tmpusrcurtime->setTimestamp($TimeStamp1);
-$tmpusrcurtime->setTimezone($usertz);
-$TimeStamp1=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']); }
-$NumPages = null; $NumRPosts = $NumReply + 1;
-if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
-if($NumRPosts>$Settings['max_posts']) {
-$NumPages = ceil($NumRPosts/$Settings['max_posts']); }
-if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
-$Users_Name1 = pre_substr($UsersName1,0,20);
-if($UsersName1=="Guest") { $UsersName1=$GuestsName1;
-if($UsersName1==null) { $UsersName1="Guest"; } }
-$oldusername=$UsersName1;
-if (pre_strlen($UsersName1)>20) { 
-$Users_Name1 = $Users_Name1."..."; $UsersName1=$Users_Name1; } $lul = null;
-if($TimeStamp1!=null) { $lul = null;
-if($UsersID1>0&&$UsersHidden1=="no") {
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID1,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$luln = url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts;
-$LastReply = "<a href=\"".$luln."\">".$TimeStamp1."</a><br />\nUser: <a href=\"".$lul."\" title=\"".$oldusername."\">".$UsersName1."</a>"; }
-if($UsersID1<=0||$UsersHidden1=="yes") {
-if($UsersID1==-1) { $UserPre = "Guest:"; }
-if(($UsersID1<-1&&$UsersHidden1=="yes")||$UsersID1==0||($UsersID1>0&&$UsersHidden1=="yes")) { 
-       $UserPre = "Hidden:"; }
-$lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID1,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-$luln = url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$NumRPosts;
-$LastReply = "<a href=\"".$luln."\">".$TimeStamp1."</a><br />\n".$UserPre." <span title=\"".$oldusername."\">".$UsersName1."</span>"; } }
-sql_free_result($glrresult);
-if(!isset($TimeStamp1)) { $TimeStamp1 = null; } if(!isset($LastReply)) { $LastReply = "&nbsp;<br />&nbsp;"; }
-if($TimeStamp1==null) { $LastReply = "&nbsp;<br />&nbsp;"; }
-$PreTopic = $ThemeSet['TopicIcon'];
-if ($PinnedTopic>2) { $PinnedTopic = 1; } 
-if ($PinnedTopic<0) { $PinnedTopic = 0; }
-if(!is_numeric($PinnedTopic)) { $PinnedTopic = 0; }
-if ($TopicStat>3) { $TopicStat = 1; } 
-if ($TopicStat<0) { $TopicStat = 0; }
-if(!is_numeric($TopicStat)) { $TopicStat = 1; }
-if(!is_numeric($OldForumID)) { $OldForumID = $ForumID; }
-if($OldForumID=="0") { $OldForumID = $ForumID; }
-if ($OldForumID!=$ForumID||$TForumID==$ForumID) {
-$PreTopic = $ThemeSet['TopicIcon'];
-$PreTopicText = null;
-if ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat==0) {
-       if($NumReply>=$Settings['hot_topic_num']) {
-               $PreTopicText = "<span style=\"font-weight: bold;\">Pinned: </span>";
-               $PreTopic=$ThemeSet['HotPinTopic']; }
-       if($NumReply<$Settings['hot_topic_num']) {
-               $PreTopicText = "<span style=\"font-weight: bold;\">Pinned: </span>";
-               $PreTopic=$ThemeSet['PinTopic']; } }
-if ($TopicStat>0&&$TopicStat<=3&&$PinnedTopic==0) {
-       if($NumReply>=$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['HotClosedTopic']; }
-       if($NumReply<$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['ClosedTopic']; } }
-if ($PinnedTopic==0&&$TopicStat==0) {
-               if($NumReply>=$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['HotTopic']; }
-               if($NumReply<$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['TopicIcon']; } }
-if ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat>0&&$TopicStat<=3) {
-               if($NumReply>=$Settings['hot_topic_num']) {
-                       $PreTopicText = "<span style=\"font-weight: bold;\">Pinned: </span>";
-                       $PreTopic=$ThemeSet['HotPinClosedTopic']; }
-               if($NumReply<$Settings['hot_topic_num']) {
-                       $PreTopicText = "<span style=\"font-weight: bold;\">Pinned: </span>";
-                       $PreTopic=$ThemeSet['PinClosedTopic']; } } 
-               if($PinnedTopic==2) {
-                       $PreTopicText = null;
-                       $PreTopic=$ThemeSet['AnnouncementTopic']; } }
-if ($OldForumID==$ForumID&&$TForumID!=$ForumID) {
-$PreTopicText = "<span>Moved: </span>";
-$PreTopic = $ThemeSet['MovedTopicIcon'];
-if ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat==0) {
-       if($NumReply>=$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['MovedHotPinTopic']; }
-       if($NumReply<$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['MovedPinTopic']; } }
-if ($TopicStat>0&&$TopicStat<=3&&$PinnedTopic==0) {
-       if($NumReply>=$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['MovedHotClosedTopic']; }
-       if($NumReply<$Settings['hot_topic_num']) {
-               $PreTopic=$ThemeSet['MovedClosedTopic']; } }
-if ($PinnedTopic==0&&$TopicStat==0) {
-               if($NumReply>=$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['MovedHotTopic']; }
-               if($NumReply<$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['MovedTopicIcon']; } }
-if ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat>0&&$TopicStat<=3) {
-               if($NumReply>=$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['MovedHotPinClosedTopic']; }
-               if($NumReply<$Settings['hot_topic_num']) {
-                       $PreTopic=$ThemeSet['MovedPinClosedTopic']; } } }
-?>
-<tr class="TableRow3" id="Topic<?php echo $TopicID; ?>">
-<td class="TableColumn3"><div class="topicstate">
-<?php echo $PreTopic; ?></div></td>
-<td class="TableColumn3"><div class="topicname">
-<?php echo $PreTopicText; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a>
-<?php if($prepagelist!==null) { echo $prepagelist; } ?></div>
-<div class="topicdescription"><?php echo $TopicDescription; ?></div></td>
-<td class="TableColumn3" style="text-align: center;"><?php
-if($UsersID>0&&$UserHidden=="no") {
-echo "<a href=\"";
-echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
-echo "\">".$UsersName."</a>"; }
-if($UsersID<=0||$UserHidden=="yes") {
-echo "<span>".$UsersName."</span>"; }
-?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $TheTime; ?></td>
-<td class="TableColumn3" style="text-align: center;"><?php echo $NumReply; ?></td>
-<td class="TableColumn3"><?php echo $LastReply; ?></td>
-</tr>
-<?php ++$i; } 
-?>
-<tr id="ForumEnd<?php echo $ForumID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="6">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivTopics">&nbsp;</div>
-<?php
-sql_free_result($result); }
-if(($utccurtime->getTimestamp()<$_SESSION['LastPostTime']&&$_SESSION['LastPostTime']!=0)&&($_GET['act']=="create"||$_GET['act']=="maketopic")) { 
-$_GET['act'] = "view"; $_POST['act'] = null; 
-redirect("refresh",$rbasedir.url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum'],FALSE),"3"); ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Reply Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<tr>
-       <td><span class="TableMessage"><br />
-       You have to wait before making another topic.<br />
-       Click <a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">here</a> to go back to forum.<br />&nbsp;
-       </span><br /></td>
-</tr>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkReply">&nbsp;</div>
-<?php } if($_GET['act']=="create") {
-if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
-if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
-if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
-if($PermissionInfo['CanMakeTopics'][$ForumID]=="no"||$CanHaveTopics=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$UFID = rand_uuid("rand");
-$_SESSION['UserFormID'] = $UFID;
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></span></div>
-<?php } ?>
-<table class="Table1" id="MakeTopic<?php echo $ForumID; ?>">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1" id="TopicStart<?php echo $ForumID; ?>">
-<td class="TableColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr id="MakeTopicRow<?php echo $ForumID; ?>" class="TableRow2">
-<td class="TableColumn2" colspan="2" style="width: 100%;">Making a Topic in <?php echo $ForumName; ?></td>
-</tr>
-<tr class="TableRow3" id="MkTopic<?php echo $ForumID; ?>">
-<td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
-<div style="width: 100%; height: 160px; overflow: auto;">
-<table style="width: 100%; text-align: center;"><?php
-$renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
-$renee_result=sql_query($renee_query,$SQLStat);
-$renee_num=sql_num_rows($renee_result);
-$renee_s=0; $SmileRow=0; $SmileCRow=0;
-while ($renee_s < $renee_num) { ++$SmileRow;
-$FileName=sql_result($renee_result,$renee_s,"FileName");
-$SmileName=sql_result($renee_result,$renee_s,"SmileName");
-$SmileText=sql_result($renee_result,$renee_s,"SmileText");
-$SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
-$ShowSmile=sql_result($renee_result,$renee_s,"Display");
-$ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
-if($SmileRow==1) { ?><tr>
-       <?php } if($SmileRow<5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('TopicPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
-       <?php } if($SmileRow==5) { ++$SmileCRow; ?>
-       <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('TopicPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
-       <?php $SmileCRow=0; $SmileRow=0; }
-++$renee_s; }
-if($SmileCRow<5&&$SmileCRow!=0) {
-$SmileCRowL = 5 - $SmileCRow;
-echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
-echo "</table>";
-sql_free_result($renee_result);
-?></div></td>
-<td class="TableColumn3" style="width: 85%;">
-<form style="display: inline;" method="post" id="MkTopicForm" action="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=maketopic&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="TopicName">Insert Topic Name:</label></td>
-       <td style="width: 50%;"><input maxlength="30" type="text" name="TopicName" class="TextBox" id="TopicName" size="20" /></td>
-</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
-       <?php if(!isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
-       <?php } if(isset($_SESSION['GuestName'])) { ?>
-       <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
-<?php } ?></tr><?php } ?><tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="TopicDesc">Insert Topic Description:</label></td>
-       <td style="width: 50%;"><input maxlength="45" type="text" name="TopicDesc" class="TextBox" id="TopicDesc" size="20" /></td>
-</tr>
-</table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<label class="TextBoxLabel" for="TopicPost">Insert Your Post:</label><br />
-<textarea rows="10" name="TopicPost" id="TopicPost" cols="40" class="TextBox"></textarea><br />
-<?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
-<label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
-<input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
-<?php } ?>
-<input type="hidden" name="act" value="maketopics" style="display: none;" />
-<input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
-<input type="hidden" style="display: none;" name="ubid" value="<?php echo $Settings['BoardUUID']; ?>" />
-<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
-<input type="hidden" name="GuestName" value="null" style="display: none;" />
-<?php } ?>
-<input type="submit" class="Button" value="Make Topic" name="make_topic" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form></td></tr>
-<tr id="MkTopicEnd<?php echo $ForumID; ?>" class="TableRow4">
-<td class="TableColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkTopics">&nbsp;</div>
-<?php } if($_GET['act']=="maketopic"&&$_POST['act']=="maketopics") {
-if($_POST['TopicDesc']==""&&$_POST['TopicName']!="") {
-       $_POST['TopicDesc'] = $_POST['TopicName']; }
-if($_POST['TopicDesc']!=""&&$_POST['TopicName']=="") {
-       $_POST['TopicName'] = $_POST['TopicDesc']; }
-if($PermissionInfo['CanMakeTopics'][$ForumID]=="no"||$CanHaveTopics=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$MyUserID = $_SESSION['UserID']; if($MyUserID=="0"||$MyUserID==null) { $MyUserID = -1; }
-$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
-$URL['REFERER'] = $REFERERurl['host'];
-$URL['HOST'] = $_SERVER["SERVER_NAME"];
-$REFERERurl = null;
-if(!isset($_POST['TopicName'])) { $_POST['TopicName'] = null; }
-if(!isset($_POST['TopicDesc'])) { $_POST['TopicDesc'] = null; }
-if(!isset($_POST['TopicPost'])) { $_POST['TopicPost'] = null; }
-if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-require($SettDir['inc']."captcha.php"); }
-?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></span></div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Topic Message: </th>
-</tr>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<table style="width: 100%; height: 25%; text-align: center;">
-<?php if (pre_strlen($_POST['TopicName'])>"50") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your Topic Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $Settings['captcha_guest']=="on") {
-if (PhpCaptcha::Validate($_POST['signcode'])) {
-//echo 'Valid code entered';
-} else { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Invalid code entered<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } } if (pre_strlen($_POST['TopicDesc'])>"80") { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Your Topic Description is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You Guest Name is too big.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Settings['TestReferer']=="on") {
-       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Sorry the referering url dose not match our host name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } }
-$_POST['TopicName'] = stripcslashes(htmlspecialchars($_POST['TopicName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['TopicName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicName']);
-$_POST['TopicName'] = remove_spaces($_POST['TopicName']);
-$_POST['TopicDesc'] = stripcslashes(htmlspecialchars($_POST['TopicDesc'], ENT_QUOTES, $Settings['charset']));
-//$_POST['TopicDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicDesc']);
-$_POST['TopicDesc'] = remove_spaces($_POST['TopicDesc']);
-$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
-$_POST['GuestName'] = remove_spaces($_POST['GuestName']);
-$_POST['TopicPost'] = stripcslashes(htmlspecialchars($_POST['TopicPost'], ENT_QUOTES, $Settings['charset']));
-//$_POST['TopicPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicPost']);
-$_POST['TopicPost'] = remove_bad_entities($_POST['TopicPost']);
-//$_POST['TopicPost'] = remove_spaces($_POST['TopicPost']);
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
-if($cookieDomain==null) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain); } }
-$_SESSION['GuestName']=$_POST['GuestName']; } }
-/*    <_<  iWordFilter  >_>      
-   by Kazuki Przyborowski - Cool Dude 2k */
-$katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
-$katarzynart=sql_query($katarzynaqy,$SQLStat);
-$katarzynanm=sql_num_rows($katarzynart);
-$katarzynas=0;
-while ($katarzynas < $katarzynanm) {
-$Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
-$Replace=sql_result($katarzynart,$katarzynas,"Replacement");
-$CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
-if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
-if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
-if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
-$WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
-if($WholeWord=="on") { $WholeWord = "yes"; }
-if($WholeWord=="off") { $WholeWord = "no"; }
-if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
-$Filter = preg_quote($Filter, "/");
-if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
-$_POST['TopicDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['TopicDesc']); 
-$_POST['TopicPost'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['TopicPost']); }
-if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
-$_POST['TopicDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['TopicDesc']); 
-$_POST['TopicPost'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['TopicPost']); }
-if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
-$_POST['TopicDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['TopicDesc']); 
-$_POST['TopicPost'] = preg_replace("/".$Filter."/", $Replace, $_POST['TopicPost']); }
-if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
-$_POST['TopicDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['TopicDesc']); 
-$_POST['TopicPost'] = preg_replace("/".$Filter."/i", $Replace, $_POST['TopicPost']); }
-++$katarzynas; } sql_free_result($katarzynart);
-$lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedTopicName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
-$lonewolfrt=sql_query($lonewolfqy,$SQLStat);
-$lonewolfnm=sql_num_rows($lonewolfrt);
-$lonewolfs=0; $RMatches = null; $RGMatches = null;
-while ($lonewolfs < $lonewolfnm) {
-$RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
-$RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
-if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
-if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
-if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
-$RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
-if($RWholeWord=="on") { $RWholeWord = "yes"; }
-if($RWholeWord=="off") { $RWholeWord = "no"; }
-if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
-$RestrictedTopicName=sql_result($lonewolfrt,$lonewolfs,"RestrictedTopicName");
-if($RestrictedTopicName=="on") { $RestrictedTopicName = "yes"; }
-if($RestrictedTopicName=="off") { $RestrictedTopicName = "no"; }
-if($RestrictedTopicName!="yes"||$RestrictedTopicName!="no") { $RestrictedTopicName = "no"; }
-$RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
-if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
-if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
-if($RestrictedUserName!="yes"||$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
-$RWord = preg_quote($RWord, "/");
-if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/".$RWord."/", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
-if($RestrictedTopicName=="yes") {
-$RMatches = preg_match("/".$RWord."/i", $_POST['TopicName']);
-       if($RMatches==true) { break 1; } }
-if($RestrictedUserName=="yes") {
-$RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
-       if($RGMatches==true) { break 1; } } }
-++$lonewolfs; } sql_free_result($lonewolfrt);
-if ($_POST['TopicName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Topic Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['TopicDesc']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Topic Description.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $_POST['GuestName']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Guest Name.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
-       $RGMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Guest Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($PermissionInfo['CanMakeTopics'][$ForumID]=="no"||$CanHaveTopics=="no") { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You do not have permission to make a topic here.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($_POST['TopicPost']==null) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />You need to enter a Topic Post.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if($RMatches==true) { $Error="Yes"; ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />This Topic Name is restricted to use.<br />
-       </span>&nbsp;</td>
-</tr>
-<?php } if ($Error=="Yes") {
-redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?>
-<tr>
-       <td><span class="TableMessage">
-       <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } if ($Error!="Yes") { $LastActive = $utccurtime->getTimestamp();
-$requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
-$reresult=sql_query($requery,$SQLStat);
-$renum=sql_num_rows($reresult);
-$rei=0;
-while ($rei < $renum) {
-$User1ID=$MyUserID;
-$User1Name=sql_result($reresult,$rei,"Name");
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
-$User1Email=sql_result($reresult,$rei,"Email");
-$User1Title=sql_result($reresult,$rei,"Title");
-$User1GroupID=sql_result($reresult,$rei,"GroupID");
-$PostCount=sql_result($reresult,$rei,"PostCount");
-if($PostCountAdd=="on") { $NewPostCount = $PostCount + 1; }
-if(!isset($NewPostCount)) { $NewPostCount = $PostCount; }
-$gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
-$gresult=sql_query($gquery,$SQLStat);
-$User1Group=sql_result($gresult,0,"Name");
-sql_free_result($gresult);
-$User1IP=$_SERVER['REMOTE_ADDR'];
-++$rei; } sql_free_result($reresult);
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."topics\" (\"PollID\", \"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
-"(0, %i, %i, %i, %i, %i, '%s', %i, %i, '%s', '%s', 0, 0, 0, 0)", array($ForumID,$ForumCatID,$ForumID,$ForumCatID,$User1ID,$User1Name,$LastActive,$LastActive,$_POST['TopicName'],$_POST['TopicDesc']));
-sql_query($query,$SQLStat);
-$topicid = sql_get_next_id($Settings['sqltable'],"topics",$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
-"(".$topicid.", %i, %i, %i, '%s', %i, %i, 0, '', '%s', '%s', '%s', '0')", array($ForumID,$ForumCatID,$User1ID,$User1Name,$LastActive,$LastActive,$_POST['TopicPost'],$_POST['TopicDesc'],$User1IP));
-sql_query($query,$SQLStat);
-$postid = sql_get_next_id($Settings['sqltable'],"posts",$SQLStat);
-$_SESSION['LastPostTime'] = $utccurtime->getTimestamp() + $GroupInfo['FloodControl'];
-if($User1ID!=0&&$User1ID!=-1) {
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LastActive\"=%i,\"IP\"='%s',\"PostCount\"=%i,\"LastPostTime\"=%i WHERE \"id\"=%i", array($LastActive,$User1IP,$NewPostCount,$_SESSION['LastPostTime'],$User1ID));
-sql_query($queryupd,$SQLStat); }
-$NewNumPosts = $NumberPosts + 1; $NewNumTopics = $NumberTopics + 1;
-$queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NewNumPosts,$NewNumTopics,$ForumID));
-sql_query($queryupd,$SQLStat);
-redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$topicid."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE),"3");
-?><tr>
-       <td><span class="TableMessage"><br />
-       Topic <?php echo $_POST['TopicName']; ?> was started.<br />
-       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$topicid."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to continue to topic.<br />&nbsp;
-       </span><br /></td>
-</tr>
-<?php } ?>
-</table>
-</td></tr>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivMkTopics">&nbsp;</div>
-<?php } ?>
-<table style="width: 100%;" class="Table2">
-<tr>
- <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
- <td style="width: 70%; text-align: right;">
- <?php if($PermissionInfo['CanMakeTopics'][$ForumID]=="yes"&&$CanHaveTopics=="yes") { ?>
- <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
- <?php } ?></td>
-</tr>
-</table>
-<?php
-//List Page Number Code end
-if($pstring!=null||$_GET['act']!="view"||
-       $PermissionInfo['CanMakeTopics'][$ForumID]=="yes"&&$CanHaveTopics=="yes") {
-?>
-<?php /*<div class="DivPageLinks">&nbsp;</div>*/ ?>
-<div class="DivTable2">&nbsp;</div>
-<?php } 
-$uviewlcuttime = $utccurtime->getTimestamp();
-$uviewltime = $uviewlcuttime - ini_get("session.gc_maxlifetime");
-if($InSubForum==0) {
-$uviewlquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"session_id\"<>'%s' AND (\"serialized_data\" LIKE '%s' OR \"serialized_data\" LIKE '%s') ORDER BY \"expires\" DESC", array($uviewltime, session_id(), "%currentforumid:0,".$ForumID.";%", "%currentforumid:".$ForumID.",%")); }
-if($InSubForum!=0) {
-$uviewlquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" >= %i AND \"session_id\"<>'%s' AND (\"serialized_data\" LIKE '%s' OR \"serialized_data\" LIKE '%s') ORDER BY \"expires\" DESC", array($uviewltime, session_id(), "%currentforumid:".$InSubForum.",".$ForumID.";%", "%currentforumid:0,".$ForumID.";")); }
-$uviewlresult=sql_query($uviewlquery,$SQLStat);
-$uviewlnum=sql_num_rows($uviewlresult);
-$uviewli=0; $uviewlmn = 0; $uviewlgn = 0; $uviewlan = 0; $uviewlmbn = 0;
-$MembersViewList = null; $GuestsOnline = null;
-while ($uviewli < $uviewlnum) {
-$session_data=sql_result($uviewlresult,$uviewli,"session_data"); 
-$serialized_data=sql_result($uviewlresult,$uviewli,"serialized_data");
-$session_user_agent=sql_result($uviewlresult,$uviewli,"user_agent"); 
-$session_ip_address=sql_result($uviewlresult,$uviewli,"ip_address");
-//$UserSessInfo = unserialize_session($session_data);
-$UserSessInfo = unserialize($serialized_data);
-if(!isset($UserSessInfo['UserGroup'])) { $UserSessInfo['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($session_user_agent)) {
-       $user_agent_check = user_agent_check($session_user_agent); }
-if($UserSessInfo['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($UserSessInfo['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$UserSessInfo['UserID']>0)||$user_agent_check!==false) {
-if($uviewlmbn>0) { $MembersViewList .= ", "; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UserSessInfo['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$UserSessInfo['MemberName']."</a>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$uviewlmn; ++$uviewlmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList .= "<span".$uatitleadd.">".$user_agent_check."</span>"; 
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; }
-++$uviewlmbn; } }
-if($UserSessInfo['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$uviewlan; } } }
-if($UserSessInfo['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($session_user_agent, ENT_QUOTES, $Settings['charset'])."\""; }
-$GuestsViewList .= "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>";
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsViewList .= " (<a title=\"".$session_ip_address."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$session_ip_address)."\">".$session_ip_address."</a>)"; } */
-++$uviewlgn; }
-++$uviewli; }
-if(!isset($_SESSION['UserGroup'])) { $_SESSION['UserGroup'] = $Settings['GuestGroup']; }
-$AmIHiddenUser = "no";
-$user_agent_check = false;
-if(user_agent_check($_SERVER['HTTP_USER_AGENT'])) {
-       $user_agent_check = user_agent_check($_SERVER['HTTP_USER_AGENT']); }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']||$user_agent_check!==false) {
-$PreAmIHiddenUser = GetUserName($_SESSION['UserID'],$Settings['sqltable'],$SQLStat);
-$AmIHiddenUser = $PreAmIHiddenUser['Hidden'];
-if(($AmIHiddenUser=="no"&&$_SESSION['UserID']>0)||$user_agent_check!==false) {
-if($uviewlmbn>0) { $MembersViewList = ", ".$MembersViewList; }
-if($user_agent_check===false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$MembersViewList; }
-$MembersViewList = "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_SESSION['UserID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$_SESSION['MemberName']."</a>".$MembersViewList; 
-++$uviewlmn; ++$uviewlmbn; }
-if($user_agent_check!==false) {
-$uatitleadd = null;
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$MembersViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$MembersViewList; }
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-$MembersViewList = "<span".$uatitleadd.">".$user_agent_check."</span>".$MembersViewList; 
-++$uviewlmbn; } }
-if($_SESSION['UserID']<=0||$AmIHiddenUser=="yes") {
-if($user_agent_check===false) {
-++$uviewlan; } } }
-if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
-/*$uatitleadd = null;
-if($GroupInfo['CanViewUserAgent']=="yes") { $uatitleadd = " title=\"".htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $Settings['charset'])."\""; }
-if($GroupInfo['CanViewIPAddress']=="yes") {
-$GuestsViewList = " (<a title=\"".$_SERVER['REMOTE_ADDR']."\" onclick=\"window.open(this.href);return false;\" href=\"".sprintf($IPCheckURL,$_SERVER['REMOTE_ADDR'])."\">".$_SERVER['REMOTE_ADDR']."</a>)".$GuestsViewList; }
-$GuestsViewList = "<a".$uatitleadd." href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$MemList['Name']."</a>".$GuestsViewList; */
-++$uviewlgn; }
-++$uviewlnum;
-?>
-<div class="StatsBorder">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableStatsRow1">
-<span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">Forum Statistics</a></span></div>
-<?php } ?>
-<table id="BoardStats" class="TableStats1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableStatsRow1">
-<td class="TableStatsColumn1" colspan="2"><span style="text-align: left;">
-<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>">Forum Statistics</a></span>
-</td>
-</tr><?php } ?>
-<tr id="Stats1" class="TableStatsRow2">
-<td class="TableStatsColumn2" colspan="2" style="width: 100%; font-weight: bold;"><?php echo $uviewlnum; ?> users viewing forum</td>
-</tr>
-<tr class="TableStatsRow3" id="Stats2">
-<td style="width: 4%;" class="TableStatsColumn3"><div class="statsicon">
-<?php echo $ThemeSet['StatsIcon']; ?></div></td>
-<td style="width: 96%;" class="TableStatsColumn3"><div class="statsinfo">
-&nbsp;<span style="font-weight: bold;"><?php echo $uviewlgn; ?></span> guests, <span style="font-weight: bold;"><?php echo $uviewlmn; ?></span> members, <span style="font-weight: bold;"><?php echo $uviewlan; ?></span> anonymous members <br />
-<?php if($MembersViewList!=null) { ?>&nbsp;<?php echo $MembersViewList."\n<br />"; } ?>
-</div></td>
-</tr>
-<tr id="Stats7" class="TableStatsRow4">
-<td class="TableStatsColumn4" colspan="2">&nbsp;</td>
-</tr>
-</table></div>
-<div class="DivStats">&nbsp;</div>
-<?php } } ?>
index ea1f3bc..cf011b7 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2017 iDB Support - http://idb.berlios.de/
     Copyright 2004-2017 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 01/26/2017 SVN 812 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 01/26/2017 SVN 813 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,7 +27,7 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 4; $VER1[2] = 8; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 812;
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 813;
 $SVNDay[0] = 1; $SVNDay[1] = 26; $SVNDay[2] = 2017; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $AltName = "DF2k"; $AltName2 = "DF2k"; $RName = "iDB"; $SFName = "IntDB";
 $RFullName = "Internet Discussion Boards"; $AltFullName = "Discussion Forums 2k"; $AltGM2k = "DF2k Team";
diff --git a/inc/versioninfo.php.bak b/inc/versioninfo.php.bak
deleted file mode 100644 (file)
index f5b56b1..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: versioninfo.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
-       require('index.php');
-       exit(); }
-       $rssurlon = "off";
-// Version info stuff. :P 
-function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
-       $return_var = $proname." ".$reltype." ".$subver.".".$ver.".".$supver;
-       if($showsvn===false) { $showsvn = null; }
-       if($showsvn===true) { $return_var .= " SVN ".$svnver; }
-       if($showsvn!==true&&$showsvn!==null) { $return_var .= " ".$showsvn." ".$svnver; }
-       return $return_var; }
-// Version number and date stuff. :P
-$VER1[0] = 0; $VER1[1] = 4; $VER1[2] = 8; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 810;
-$SVNDay[0] = 1; $SVNDay[1] = 26; $SVNDay[2] = 2017; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
-$AltName = "DF2k"; $AltName2 = "DF2k"; $RName = "iDB"; $SFName = "IntDB";
-$RFullName = "Internet Discussion Boards"; $AltFullName = "Discussion Forums 2k"; $AltGM2k = "DF2k Team";
-$VerCheckName = "iDB"; $AltVerCheckName = "DF2k"; $AltiDBHome = "http://df2k.gamemaker2k.org/";
-$AltGM2kHome = "http://df2k.gamemaker2k.org/"; $AltGM2kURL = "<a href=\"".$AltGM2kHome."\" title=\"".$AltGM2k."\" onclick=\"window.open(this.href);return false;\">".$AltGM2k."</a>";
-$iDBTheme = "iDB"; $AltiDBTheme = "Gray"; 
-$UserAgentName = "iDB-Forum"; $AltUserAgentName = "DF2k-Forum";
-if(!isset($Settings['usealtname'])) { $Settings['usealtname'] = "no"; }
-if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") {
-if(isset($iDBAltName['VER1'][0])) { $VER1[0] = $iDBAltName['VER1'][0]; }
-if(isset($iDBAltName['VER1'][1])) { $VER1[1] = $iDBAltName['VER1'][1]; }
-if(isset($iDBAltName['VER1'][2])) { $VER1[2] = $iDBAltName['VER1'][2]; }
-if(isset($iDBAltName['VER1'][0])&&
-       isset($iDBAltName['VER1'][1])&&
-       isset($iDBAltName['VER1'][2])) { 
-       $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2]; }
-if(isset($iDBAltName['VER2'][0])) { $VER2[0] = $iDBAltName['VER2'][0]; }
-if(isset($iDBAltName['VER2'][1])) { $VER2[1] = $iDBAltName['VER2'][1]; }
-if(isset($iDBAltName['VER2'][2])) { $VER2[2] = $iDBAltName['VER2'][2]; }
-if(isset($iDBAltName['SubVerN'])) { $SubVerN = $iDBAltName['SubVerN']; }
-if(isset($iDBAltName['SVNDay'][0])) { $SVNDay[0] = $iDBAltName['SVNDay'][0]; }
-if(isset($iDBAltName['SVNDay'][1])) { $SVNDay[1] = $iDBAltName['SVNDay'][1]; }
-if(isset($iDBAltName['SVNDay'][2])) { $SVNDay[2] = $iDBAltName['SVNDay'][2]; }
-if(isset($iDBAltName['SVNDay'][0])&&
-       isset($iDBAltName['SVNDay'][1])&&
-       isset($iDBAltName['SVNDay'][2])) { 
-       $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; }
-if(isset($iDBAltName['AltName'])) { $AltName = $iDBAltName['AltName']; }
-if(isset($iDBAltName['AltName2'])) { $AltName2 = $iDBAltName['AltName2']; }
-if(isset($iDBAltName['AltFullName'])) { $AltFullName = $iDBAltName['AltFullName']; } 
-if(isset($iDBAltName['AltVerCheckName'])) { $AltVerCheckName = $iDBAltName['AltVerCheckName']; } 
-if(isset($iDBAltName['AltUserAgentName'])) { $AltUserAgentName = $iDBAltName['AltUserAgentName']; } 
-if(isset($iDBAltName['AltiDBHome'])) { $AltiDBHome = $iDBAltName['AltiDBHome']; } 
-if(isset($iDBAltName['AltGM2k'])) { $AltGM2k = $iDBAltName['AltGM2k']; } 
-if(isset($iDBAltName['AltGM2kHome'])) { $AltGM2kHome = $iDBAltName['AltGM2kHome']; } 
-if(isset($iDBAltName['AltGM2kURL'])) { $AltGM2kURL = $iDBAltName['AltGM2kURL']; } 
-if(isset($iDBAltName['AltiDBTheme'])) { $AltiDBTheme = $iDBAltName['AltiDBTheme']; } 
-if(isset($iDBAltName['VerCheckURL'])) { $Settings['VerCheckURL'] = $iDBAltName['VerCheckURL']; } }
-if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") {
-       $RName = $AltName2; $SFName = $AltName; $RFullName = $AltFullName; $VerCheckName = $AltVerCheckName; $UserAgentName = $AltUserAgentName; }
-$VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false);
-$VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,$VER2[2]);
-$VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false);
-$VerInfo['iDB_Full_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,$VER2[2]);
-$VerInfo['iDB_Ver_Show'] = $VerInfo['iDB_Ver_SVN']; $VerInfo['iDB_Full_Ver_Show'] = $VerInfo['iDB_Full_Ver_SVN'];
-define("_iDB_Ver_", $VerInfo['iDB_Ver']); define("_iDB_Ver_SVN_", $VerInfo['iDB_Ver_SVN']);
-define("_iDB_Full_Ver_", $VerInfo['iDB_Full_Ver']); define("_iDB_Full_Ver_SVN_", $VerInfo['iDB_Full_Ver_SVN']);
-define("_iDB_Ver_Show_", $VerInfo['iDB_Ver_Show']); define("_iDB_Full_Ver_Show_", $VerInfo['iDB_Full_Ver_Show']);
-/* 
-URLs and names and stuff. :P 
-$KSP = "Kazuki Suzuki Przyborowski";
-$KSPAlt = "Kazuki Suzuki Przyborowski";
-*/
-$iDBHome = "http://ja.gamemaker2k.org/"; $DF2kHome = "http://df2k.gamemaker2k.org/"; 
-$OrgName = "iDB"; $AltOrgName = "DF2k"; $AltiDB = "Discussion Forums 2k";
-$AltSQLDumper = null;
-if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") {
-if(isset($iDBAltName['AltOrgName'])) { $AltOrgName = $iDBAltName['AltOrgName']; }
-if(isset($iDBAltName['AltiDB'])) { $AltiDB = $iDBAltName['AltiDB']; }
-if(isset($iDBAltName['AltSQLDumperName'])) { $AltSQLDumper = $iDBAltName['AltSQLDumperName']; } }
-if(!isset($Settings['VerCheckURL'])||
-       $Settings['VerCheckURL']==="") {
-$VerCheckURL = $iDBHome."?act=vercheck"; }
-if(isset($Settings['VerCheckURL'])&&
-       $Settings['VerCheckURL']!=="") {
-$VerCheckURL = $Settings['VerCheckURL']; }
-$VerCheckQuery = parse_url($VerCheckURL);
-$VerCheckQuery = $VerCheckQuery['query'];
-if($VerCheckQuery=="") { $VerCheckURL = $VerCheckURL."?"; }
-if(!isset($Settings['IPCheckURL'])||
-       $Settings['IPCheckURL']==="") {
-$IPCheckURL = 'http://cqcounter.com/whois/?query=%s'; }
-if(isset($Settings['IPCheckURL'])&&
-       $Settings['IPCheckURL']!=="") {
-$IPCheckURL = $Settings['IPCheckURL']; }
-$CD2k = "Kazuki Przyborowski"; $GM2k = "Game Maker 2k"; $iDB_Author = "Kazuki";
-$iDB = "Internet Discussion Boards"; $iTB = "Internet Tag Boards"; 
-$DF2k = "Discussion Forums 2k"; $TB2k = "Tag Boards 2k";
-$TheProgrammerNaps = "The programmer has a nap. \nHold out! Programmer! ";
-if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { 
-       $iDB = $AltiDB; $OrgName = $AltOrgName; $iDBTheme = $AltiDBTheme; }
-$iDBURL1 = "<a href=\"".$iDBHome."\" onclick=\"window.open(this.href);return false;\">"; $iDBURL2 = $iDBURL1.$iDB."</a>";
-$DF2kURL1 = "<a href=\"".$DF2kHome."\" onclick=\"window.open(this.href);return false;\">"; $DF2kURL2 = $DF2kURL1.$DF2k."</a>";
-$GM2kHome = $iDBHome."support/category.php?act=view&amp;id=2";
-$GM2kURL = "<a href=\"".$GM2kHome."\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
-$iDBURL3 = "<a href=\"".$iDBHome."\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">".$iDB."</a>";
-$PHPQA = "PHP-Quick-Arcade|http://quickarcade.jcink.com/"; $TFBB = "TextFileBB|https://launchpad.net/tfbb";
-$PHPQA = explode("|",$PHPQA); $TFBB = explode("|",$TFBB);
-$PHPQA = "<a href=\"".$PHPQA[1]."\" title=\"".$PHPQA[0]."\" onclick=\"window.open(this.href);return false;\">".$PHPQA[0]."</a>";
-$TFBB = "<a href=\"".$TFBB[1]."\" title=\"".$TFBB[0]."\" onclick=\"window.open(this.href);return false;\">".$TFBB[0]."</a>";
-if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { 
-       $iDBHome = $AltiDBHome; $GM2k = $AltGM2k; $GM2kHome = $AltGM2kHome; $GM2kURL = $AltGM2kURL; }
-$PHPV1 = phpversion(); $PHPV2 = "PHP ".$PHPV1; $OSType = @php_uname("s"); $OSType .= " ".@php_uname("r");
-$OSType .= " ".@php_uname("m"); if($OSType==""||!isset($OSType)) { $OSType = PHP_OS; } // Check OS Name
-if($OSType=="WINNT") { $OSType="Windows NT"; } if($OSType=="WIN32") { $OSType="Windows 9x"; }
-$OSType2 = $PHPV2." / ".$OSType; $ZENDV1 = zend_version(); $ZENDV2 = "Zend engine ".$ZENDV1;
-// Show or hide the version number
-if($Settings['showverinfo']=="on") {
-//header("X-".$RName."-Powered-By: ".$VerInfo['iDB_Ver_Show']);
-header("Generator: ".$VerInfo['iDB_Ver_Show']); }
-if($Settings['showverinfo']!="on") {
-//header("X-".$RName."-Powered-By: ".$RName);
-//header("X-Powered-By: PHP");
-header("Generator: ".$RName); }
-if(!isset($Settings['hideverinfohttp'])) {
-       $Settings['hideverinfohttp'] = "off"; }
-if($Settings['hideverinfohttp']=="on") {
-header("X-Powered-By: ");
-header("Generator: "); }
-?>
diff --git a/index.php.bak b/index.php.bak
deleted file mode 100644 (file)
index 8d12b11..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$checklowview = true;
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['index'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("view", "lowview", "stats");
-
-if(isset($_GET['showcategory'])&&is_numeric($_GET['showcategory'])) {
-$showact = "view";
-if($_GET['act']=="lowview") { $showact = "lowview"; }
-redirect("location",$rbasedir.url_maker($exfile['category'],$Settings['file_ext'],"act=".$showact."&id=".$_GET['showcategory'],$Settings['qstr'],$Settings['qsep'],$prexqstr['category'],$exqstr['category'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-
-if(isset($_GET['showforum'])&&is_numeric($_GET['showforum'])) {
-$showact = "view";
-if($_GET['act']=="lowview") { $showact = "lowview"; }
-redirect("location",$rbasedir.url_maker($exfile['forum'],$Settings['file_ext'],"act=".$showact."&id=".$_GET['showforum'],$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-
-if(isset($_GET['showtopic'])&&is_numeric($_GET['showtopic'])) {
-$showact = "view";
-if($_GET['act']=="lowview") { $showact = "lowview"; }
-if(isset($_GET['showpost'])&&is_numeric($_GET['showpost'])) {
-redirect("location",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=".$showact."&id=".$_GET['showtopic']."&post=".$_GET['showpost'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); }
-if(!isset($_GET['showpost'])) { $_GET['showpost'] = null; }
-if(!isset($_GET['showpost'])||!is_numeric($_GET['showpost'])) {
-if(!isset($_GET['showpage'])) { $_GET['showpage'] = 1; }
-if(!isset($_GET['showpage'])||!is_numeric($_GET['showpage'])) { $_GET['showpage'] = 1; } $urlstatus = 302;
-redirect("location",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=".$showact."&id=".$_GET['showtopic']."&page=".$_GET['showpage'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); }
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-
-if(isset($_GET['showuser'])&&is_numeric($_GET['showuser'])) {
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_GET['showuser'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-
-if(isset($_GET['showevent'])&&is_numeric($_GET['showevent'])) {
-redirect("location",$rbasedir.url_maker($exfile['event'],$Settings['file_ext'],"act=view&id=".$_GET['showevent'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-?>
-
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']!="lowview") {
-require($SettDir['inc'].'navbar.php'); }
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if($_GET['act']=="view")
-{ require($SettDir['inc'].'forums.php'); }
-if($_GET['act']=="lowview")
-{ require($SettDir['inc'].'lowforums.php'); }
-if($_GET['act']=="view"||$_GET['act']=="stats")
-{ require($SettDir['inc'].'stats.php'); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-?>
-</body>
-</html>
-<?php $iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']); ?>
diff --git a/install.php.bak b/install.php.bak
deleted file mode 100644 (file)
index ee56d07..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.de/support/category.php?act=view&id=2
-
-    $FileInfo: install.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*//*
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-*//* Some ini setting changes uncomment if you need them. 
-   Display PHP Errors */
-$disfunc = @ini_get("disable_functions");
-$disfunc = @trim($disfunc);
-$disfunc = @preg_replace("/([\\s+|\\t+|\\n+|\\r+|\\0+|\\x0B+])/i", "", $disfunc);
-if($disfunc!="ini_set") { $disfunc = explode(",",$disfunc); }
-if($disfunc=="ini_set") { $disfunc = array("ini_set"); }
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("html_errors", false);
-@ini_set("track_errors", false);
-@ini_set("display_errors", false);
-@ini_set("report_memleaks", false);
-@ini_set("display_startup_errors", false);
-//@ini_set("error_log","logs/error.log"); 
-//@ini_set("log_errors","On");
-@ini_set("docref_ext", "");
-@ini_set("docref_root", "http://php.net/"); }
-if(!defined("E_DEPRECATED")) { define("E_DEPRECATED", 0); }
-@error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
-/* Get rid of session id in urls */
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("default_mimetype","text/html"); 
-@ini_set("zlib.output_compression", false);
-@ini_set("zlib.output_compression_level", -1);
-@ini_set("session.use_trans_sid", false);
-@ini_set("session.use_cookies", true);
-@ini_set("session.use_only_cookies", true);
-@ini_set("url_rewriter.tags",""); 
-@ini_set('zend.ze1_compatibility_mode', 0);
-@ini_set("ignore_user_abort", 1); }
-@set_time_limit(30); @ignore_user_abort(true);
-/* Change session garbage collection settings */
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("session.gc_probability", 1);
-@ini_set("session.gc_divisor", 100);
-@ini_set("session.gc_maxlifetime", 1440);
-/* Change session hash type here */
-@ini_set("session.hash_function", 1);
-@ini_set("session.hash_bits_per_character", 6); }
-if(file_exists('extrasettings.php')) {
-       require_once('extrasettings.php'); }
-if(file_exists('extendsettings.php')) {
-       require_once('extendsettings.php'); }
-$deftz = new DateTimeZone(date_default_timezone_get());
-$defcurtime = new DateTime();
-$defcurtime->setTimezone($deftz);
-$utctz = new DateTimeZone("UTC");
-$utccurtime = new DateTime();
-$utccurtime->setTimestamp($defcurtime->getTimestamp());
-$utccurtime->setTimezone($utctz);
-$servcurtime = new DateTime();
-$servcurtime->setTimestamp($defcurtime->getTimestamp());
-$usercurtime = new DateTime();
-$usercurtime->setTimestamp($defcurtime->getTimestamp());
-/* Do not change anything below this line unless you know what you are doing */
-if(!isset($Settings['clean_ob'])) { $Settings['clean_ob'] = "off"; }
-function idb_output_handler($buffer) { return $buffer; }
-if($Settings['clean_ob']=="on") {
-/* Check for other output handlers/buffers are open
-   and close and get the contents in an array */
-$numob = count(ob_list_handlers()); $iob = 0; 
-while ($iob < $numob) { 
-       $old_ob_var[$iob] = ob_get_clean(); 
-       ++$iob; } } ob_start("idb_output_handler");
-if(ini_get("register_globals")) { 
-       if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; }
-       require_once($SettDir['misc'].'killglobals.php'); }
-if(!isset($preact['idb'])) { $preact['idb'] = null; }
-if(!isset($_GET['act'])) { $_GET['act'] = null; }
-if(!isset($_POST['act'])) { $_POST['act'] = null; }
-if ($_GET['act']==null||$_GET['act']=="view") { $_GET['act']="Part1"; }
-if ($_POST['act']==null||$_POST['act']=="view") { $_POST['act']="Part1"; }
-$_TEG = array(null); $_TEG['part'] = preg_replace("/Part(1|2|3|4)/","\\1",$_GET['act']);
-$_GET['act'] = strtolower($_GET['act']); if(isset($_TEG['part'])) {
-if($_TEG['part']<=4&&$_TEG['part']>=1) { $_GET['act'] = "Part".$_TEG['part']; } }
-if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
-       $preact['idb'] = "installing";  }
-$SetupDir['setup'] = "setup/"; $ConvertDir['setup'] = $SetupDir['setup']; $SetupDir['sql'] = "setup/sql/"; 
-$SetupDir['convert'] = "setup/convert/"; $ConvertDir['convert'] = $SetupDir['convert']; $ConvertDir['sql'] = $SetupDir['sql'];
-$Settings['output_type'] = "html"; $Settings['html_type'] = "html5";
-$Settings['board_name'] = "Installing iDB"; 
-if(!isset($Settings['charset'])) {
-       $Settings['charset'] = "ISO-8859-15"; 
-       header("Content-Type: text/html; charset=ISO-8859-15"); }
-if(isset($Settings['charset'])) {
-if($Settings['charset']!="ISO-8859-15"&&$Settings['charset']!="ISO-8859-1"&&
-       $Settings['charset']!="UTF-8"&&$Settings['charset']!="CP866"&&
-       $Settings['charset']!="Windows-1251"&&$Settings['charset']!="Windows-1252"&&
-       $Settings['charset']!="KOI8-R"&&$Settings['charset']!="BIG5"&&
-       $Settings['charset']!="GB2312"&&$Settings['charset']!="BIG5-HKSCS"&&
-       $Settings['charset']!="Shift_JIS"&&$Settings['charset']!="EUC-JP") {
-       $Settings['charset'] = "ISO-8859-15"; 
-       header("Content-Type: text/html; charset=ISO-8859-15"); } }
-$SQLCharset = "latin1";
-if(isset($_POST['charset'])) { 
-if($_POST['charset']=="ISO-8859-1") {
-       $SQLCharset = "latin1"; }
-if($_POST['charset']=="ISO-8859-15") {
-       $SQLCharset = "latin1"; }
-if($_POST['charset']=="UTF-8") {
-       $SQLCharset = "utf8"; }
-       $Settings['charset'] = $_POST['charset']; }
-if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS']=="off"; }
-if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
-if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
-$this_dir = null;
-if(dirname($_SERVER['SCRIPT_NAME'])!="."||
-       dirname($_SERVER['SCRIPT_NAME'])!=null) {
-$this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
-if($this_dir==null||$this_dir==".") {
-if(dirname($_SERVER['SCRIPT_NAME'])=="."||
-       dirname($_SERVER['SCRIPT_NAME'])==null) {
-$this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
-if($this_dir=="\/") { $this_dir="/"; }
-$this_dir = str_replace("//", "/", $this_dir);
-$idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
-if(!isset($_POST['BoardURL'])) { 
-   $Settings['idburl'] = $prehost.$_SERVER["HTTP_HOST"].$this_dir; }
-if(isset($_POST['BoardURL'])) { 
-   $Settings['idburl'] = $_POST['BoardURL']; }
-$Settings['qstr'] = "&";
-$Settings['qsep'] = "=";
-require($SetupDir['setup'].'preinstall.php');
-require_once($SettDir['misc'].'utf8.php');
-require_once($SettDir['inc'].'filename.php');
-require_once($SettDir['inc'].'function.php');
-if($_GET['act']=="README"||$_GET['act']=="ReadME") { $_GET['act']="readme"; }
-if($_GET['act']=="readme"||$_GET['act']=="ReadMe") {
-header("Content-Type: text/plain; charset=".$Settings['charset']);
-require("README"); fix_amp(null); die(); }
-$Settings['board_name'] = "Installing ".$RName; 
-function get_theme_values($matches) {
-       global $ThemeSet;
-       $return_text = null;
-       if(isset($ThemeSet[$matches[1]])) { $return_text = $ThemeSet[$matches[1]]; }
-       if(!isset($ThemeSet[$matches[1]])) { $return_text = null; }
-       return $return_text; }
-foreach($ThemeSet AS $key => $value) {
-       $ThemeSet[$key] = preg_replace("/%%/s", "{percent}p", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}T/s", "get_theme_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}e/s", "get_env_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}i/s", "get_server_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}s/s", "get_setting_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}t/s", "get_time", $ThemeSet[$key]); 
-       $ThemeSet[$key] = preg_replace("/\{percent\}p/s", "%", $ThemeSet[$key]); }
-require($SetupDir['convert'].'info.php');
-require($SetupDir['setup'].'html5.php');
-$Error = null; $_GET['time'] = false;
-?>
-
-<title> <?php echo "Installing ".$VerInfo['iDB_Ver_Show']; ?> </title>
-</head>
-<body>
-<?php require($SettDir['inc'].'navbar.php'); ?>
-<div class="Table1Border">
-<?php if($ThemeSet['TableStyle']=="div") { ?>
-<div class="TableRow1">
-<span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']; ?> </a></span>
-</div>
-<?php } ?>
-<table class="Table1">
-<?php if($ThemeSet['TableStyle']=="table") { ?>
-<tr class="TableRow1">
-<td class="TableColumn1"><span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="Install.php">Install <?php echo $VerInfo['iDB_Ver_Show']; ?> </a></span>
-</td>
-</tr><?php } ?>
-<tr class="TableRow2">
-<th class="TableColumn2" style="width: 100%; text-align: left;">
-<span style="float: left;">&nbsp;Inert your install info: </span>
-<span style="float: right;">&nbsp;</span>
-</th>
-</tr>
-<?php
-if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
-if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
-$this_dir = null;
-if(dirname($_SERVER['SCRIPT_NAME'])!="."||
-       dirname($_SERVER['SCRIPT_NAME'])!=null) {
-$this_dir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
-if($this_dir==null||$this_dir==".") {
-if(dirname($_SERVER['SCRIPT_NAME'])=="."||
-       dirname($_SERVER['SCRIPT_NAME'])==null) {
-$this_dir = dirname($_SERVER['PHP_SELF'])."/"; } }
-if($this_dir=="\/") { $this_dir="/"; }
-$this_dir = str_replace("//", "/", $this_dir);
-$idbdir = addslashes(str_replace("\\","/",dirname(__FILE__)."/"));
-function sql_list_dbs() {
-   $result = sql_query("SHOW DATABASES;",$SQLStat);
-   while( $data = sql_fetch_row($result) ) {
-       $array[] = $data[0];
-   } return $array; }
-if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
-if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
-if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
-   require($SetupDir['setup'].'license.php'); } } }
-if ($_GET['act']=="Part2"&&$_POST['act']=="Part2") {
-if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
-if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
-   require($SetupDir['setup'].'presetup.php'); } } }
-if($_POST['SetupType']=="convert") {
-       require($ConvertInfo['ConvertFile']); }
-if($_POST['SetupType']=="install") {
-if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
-if ($_GET['act']=="Part3"&&$_POST['act']=="Part3") {
-if ($_GET['act']!="Part4"&&$_POST['act']!="Part4") {
-   require($SetupDir['setup'].'setup.php'); } } } }
-if($_POST['SetupType']=="install") {
-if ($_GET['act']!="Part2"&&$_POST['act']!="Part2") {
-if ($_GET['act']!="Part3"&&$_POST['act']!="Part3") {
-if ($_GET['act']=="Part4"&&$_POST['act']=="Part4") {
-   require($SetupDir['setup'].'mkconfig.php'); } } } }
-if ($Error=="Yes") { ?>
-<br />Install Failed with errors. <a href="install.php?act=view">Click here</a> to restart install. &lt;_&lt;
-<br /><br />
-</td>
-</tr>
-<?php } ?>
-<tr class="TableRow4">
-<td class="TableColumn4">&nbsp;<a href="install.php?act=ReadMe">Readme.txt</a>&nbsp;</td>
-</tr>
-</table></div>
-<div>&nbsp;</div>
-<?php 
-require($SettDir['inc'].'endpage.php'); 
-?>
-</body>
-</html>
-<?php
-fix_amp(null);
-?>
diff --git a/javascript.js.bak b/javascript.js.bak
deleted file mode 100644 (file)
index 6adf00b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: javascript.js - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-function getid(id) {
-var itm;
-itm = document.getElementById(id);
-return itm; }
-
-function toggletag(id) {
-var itm;
-itm = document.getElementById(id);
-if (itm.style.display == "none") {
-itm.style.display = ""; }
-else {
-itm.style.display = "none"; } }
-
-function bgchange(id,color) {
-var itm;
-itm = document.getElementById(id);
-itm.style.backgroundColor = ''+color+''; }
-
-function innerchange(tag,text1,text2) {
-var usrname;
-usrname = document.getElementsByTagName(tag);
-for (var i = 0; i < usrname.length; i++) {
-if(usrname[i].innerHTML==text1) {
-usrname[i].innerHTML = text2; } } }
-
-function addsmiley(id,code) {
-var itm;
-itm = document.getElementById(id);
-var pretext = itm.value;
-itm.value = pretext + code; }
\ No newline at end of file
diff --git a/logs/index.php.bak b/logs/index.php.bak
deleted file mode 100644 (file)
index 0c7c8e2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../index.php');
-?>
\ No newline at end of file
diff --git a/member.php.bak b/member.php.bak
deleted file mode 100644 (file)
index 6a01e62..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: member.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['member'].$Settings['file_ext'].$_SERVER['PATH_INFO'];
-if($_GET['act']==null) { $_GET['act'] = "login"; }
-if(!isset($_GET['view'])) { $_GET['view'] = null; }
-$idbactcheck = array("view", "signup", "login", "login_now", "logout", "online", "list", "getactive", "makemember", "makemembers");
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="login"; }
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']=="register")
-{ $_GET['act']="signup"; }
-if($_GET['act']=="signin")
-{ $_GET['act']="login"; }
-if($_GET['act']=="signout")
-{ $_GET['act']="logout"; }
-if(!is_numeric($_GET['id']))
-{ $_GET['id']="1"; }
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']=="login"||
-$_GET['act']=="online"||
-$_POST['act']=="loginmember"||
-$_GET['act']=="logout")
-{ require($SettDir['inc'].'members.php'); } 
-if($_GET['act']=="list"||
-$_GET['act']=="getactive"||
-$_GET['act']=="view"||
-$_GET['act']=="signup")
-{ require($SettDir['inc'].'members.php'); } 
-if($_GET['act']=="makemember") {
-if($_POST['act']=="makemembers") {
-require($SettDir['inc'].'members.php'); } }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($membertitle)) { $membertitle = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($membertitle==null) {
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']); }
-if($membertitle!=null) {
-change_title($Settings['board_name'].$membertitle,$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/messenger.php.bak b/messenger.php.bak
deleted file mode 100644 (file)
index 5d45c01..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: messenger.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['messenger'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("view", "viewsent", "read", "create", "sendmessage");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['CanPM']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-?>
-
-<?php 
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']||
-       $GroupInfo['CanPM']=="yes") {
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id'])&&$_GET['act']!="create")
-{ $_GET['id']="1"; }
-if($_GET['act']=="view"||$_GET['act']=="viewsent")
-{ require($SettDir['inc'].'messages.php'); }
-if($_GET['act']=="read"||$_GET['act']=="create"||
-       $_GET['act']=="sendmessage"||$_POST['act']=="sendmessages")
-{ require($SettDir['inc'].'messages.php'); } }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($MessageName)) { $MessageName = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($_GET['act']=="read") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$MessageName,$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="viewsent") { 
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Viewing Sent MailBox",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="view") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Viewing MailBox",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="create") { 
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making a Message",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="sendmessage"&&$_POST['act']=="sendmessages") { 
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Seanding a Message",$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/preindex.php.bak b/preindex.php.bak
deleted file mode 100644 (file)
index 92f97a2..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: preindex.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$pretime = explode(" ", microtime());
-$utime = $pretime[0];
-$time = $pretime[1];
-$starttime = $utime + $time;
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="preindex.php"||$File3Name=="/preindex.php") {
-       header('Location: index.php');
-       exit(); }
-require('sql.php');
-if($_GET['act']=="sqldumper"&&$Settings['sqltype']=="cubrid") { $_GET['act'] = "view"; }
-if($_GET['act']=="sqldumper"&&$_SESSION['UserGroup']!=$Settings['GuestGroup']&&
-       $GroupInfo['HasAdminCP']=="yes") { 
-       if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli") {
-       require($SettDir['sqldumper'].'mysql.php'); }
-       if($Settings['sqltype']=="pgsql") {
-       require($SettDir['sqldumper'].'pgsql.php'); } 
-       if($Settings['sqltype']=="sqlite") {
-       require($SettDir['sqldumper'].'sqlite.php'); } 
-       if($Settings['sqltype']=="cubrid") {
-       require($SettDir['sqldumper'].'cubrid.php'); } 
-       session_write_close(); die(); }
-if(!isset($checklowview)) {
-       $checklowview = false; }
-if($checklowview!==false&&$checklowview!==true) {
-       $checklowview = false; }
-if($_GET['act']=="lofi"||$_GET['act']=="lo-fi"||
-       $_GET['act']=="LoFi"||$_GET['act']=="Lo-Fi"||
-       $_GET['act']=="lores"||$_GET['act']=="lo-res"||
-       $_GET['act']=="LoRes"||$_GET['act']=="Lo-Res"||
-       $_GET['act']=="LowView"||$_GET['act']=="low-view"||
-       $_GET['act']=="Low-View") { $_GET['act'] = "lowview"; }
-if($_GET['act']!="lowview") { 
-       $checklowview = false; }
-if($Settings['enable_rss']=="on") {
-if(!isset($_GET['feed'])) { $_GET['feed'] = null; }
-if($_GET['feed']=="rss"||$_GET['act']=="feed"||
-       $_GET['feed']=="oldrss"||$_GET['feed']=="atom"||
-       $_GET['feed']=="opml"||$_GET['feed']=="opensearch") {
-       $_GET['feedtype'] = $_GET['feed']; }
-if($_GET['feed']=="rss"||$_GET['act']=="Feed"||
-       $_GET['feed']=="oldrss"||$_GET['feed']=="atom"||
-       $_GET['feed']=="opml"||$_GET['feed']=="opensearch"||
-       $_GET['act']=="feed") {
-       require($SettDir['inc'].'rssfeed.php'); } }
-if($Settings['output_type']=="htm") {
-       $Settings['output_type'] = "html"; }
-if($Settings['output_type']=="xhtm") {
-       $Settings['output_type'] = "xhtml"; }
-if($Settings['output_type']=="xml+htm") {
-       $Settings['output_type'] = "xhtml"; }
-if($Settings['html_type']=="html5"||
-       $Settings['html_type']=="xhtml5"||
-       ($Settings['html_type']!="html5"&&
-        $Settings['html_type']!="xhtml5")) {
-require($SettDir['inc'].'html5.php'); }
-?>
diff --git a/profile.php.bak b/profile.php.bak
deleted file mode 100644 (file)
index 76793d3..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: profile.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['profile'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("view", "signature", "avatar", "settings", "profile", "userinfo");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['CanEditProfile']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']||
-       $GroupInfo['CanEditProfile']=="yes") {
-if($_GET['act']==null||$_GET['act']=="notepad")
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if($_GET['act']=="view"||
-$_GET['act']=="signature"||
-$_GET['act']=="avatar"||
-$_GET['act']=="settings"||
-$_GET['act']=="profile"||
-$_GET['act']=="userinfo")
-{ require($SettDir['inc'].'profilemain.php'); } } 
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php'); 
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($profiletitle)) { $profiletitle = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($profiletitle==null) {
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']); }
-if($profiletitle!=null) {
-change_title($Settings['board_name'].$profiletitle,$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
diff --git a/rss.php.bak b/rss.php.bak
deleted file mode 100644 (file)
index d7d622d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: rss.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$pretime = explode(" ", microtime());
-$utime = $pretime[0];
-$time = $pretime[1];
-$starttime = $utime + $time;
-require_once('sql.php');
-$idbactcheck = array("rss", "oldrss", "atom", "opml", "opensearch");
-/*if($Settings['enable_search']=="off"||$GroupInfo['CanSearch']=="no") {
-header("Content-Type: text/plain; charset=".$Settings['charset']); 
-ob_clean(); echo "Sorry you can not search on this board."; $urlstatus = 503;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }*/
-if($Settings['enable_rss']=="off") {
-header("Content-Type: text/plain; charset=".$Settings['charset']); 
-ob_clean(); echo "Sorry RSS Feeds are not enabled for this board."; $urlstatus = 503;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_GET['act']==null) { $_GET['act'] = "rss"; }
-if(!in_array($_GET['act'], $idbactcheck)) { $_GET['act']="rss"; }
-if($_GET['act']=="rss"||$_GET['act']=="oldrss"||$_GET['act']=="atom"||
-       $_GET['act']=="opml"||$_GET['act']=="opensearch") {
-       $_GET['feedtype'] = $_GET['act']; $Feed['Feed']="Done";
-       require($SettDir['inc'].'rssfeed.php'); }
-?>
diff --git a/search.php.bak b/search.php.bak
deleted file mode 100644 (file)
index cb8bfe0..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: search.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['search'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("topic", "topics", "getactive");
-ob_start("idb_suboutput_handler");
-?>
-<link rel="search" type="application/opensearchdescription+xml" title="<?php echo $Settings['board_name']." ".$ThemeSet['TitleDivider']; ?> Search" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=opensearch",$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<?php $iWrappers['EXTRALINKS'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'navbar.php');
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($Settings['enable_search']=="off"||
-       $GroupInfo['CanSearch']=="no") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-header("Content-Type: text/plain; charset=".$Settings['charset']);
-ob_clean(); echo "Sorry you do not have permission to do a search."; $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($Settings['enable_search']=="on"||$GroupInfo['CanSearch']=="yes") {
-if($_GET['act']=="getactive") { 
-   $_GET['act'] = "topics"; 
-   $_GET['type'] = "getactive"; }
-if(isset($_GET['type'])&&$_GET['type']=="getactive") { 
-   $_POST['type'] = "getactive"; }
-if(!isset($_GET['search'])) { $_GET['search'] = null; }
-if(!isset($_POST['search'])) { $_POST['search'] = null; }
-if($_GET['search']==null&&
-       $_POST['search']!=null) { 
-               $_GET['search'] = $_POST['search']; }
-if(!isset($_GET['type'])) { $_GET['type'] = null; }
-if(!isset($_POST['type'])) { $_POST['type'] = null; }
-if($_GET['type']==null&&
-       $_POST['type']!=null) { 
-               $_GET['type'] = $_POST['type']; }
-if(!isset($_POST['act'])) { $_POST['act'] = null; }
-if($_GET['act']==null||$_GET['act']=="topic"||
-       $_POST['act']=="topic"||$_POST['act']=="topics")
-       {       $_GET['act']="topics";  }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="topics"; }
-if(!isset($_GET['msearch'])) { $_GET['msearch'] = null; }
-if(!isset($_POST['msearch'])) { $_POST['msearch'] = null; }
-if($_GET['msearch']==null&&
-       $_POST['msearch']!=null) { 
-               $_GET['msearch'] = $_POST['msearch']; }
-if($_GET['act']=="topics") { 
-require($SettDir['inc'].'searches.php'); } }
-if($_GET['act']=="opensearch") {
-redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($_GET['search'])) { $_GET['search'] = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($_GET['search']==null&&$_GET['type']==null) {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Searching",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['search']!=null&&$_GET['type']!=null) {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$_GET['search'],$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['type']=="getactive") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Todays Active Topics",$Settings['use_gzip'],$GZipEncode['Type']); }
-?>
\ No newline at end of file
diff --git a/setup/convert/index.php.bak b/setup/convert/index.php.bak
deleted file mode 100644 (file)
index 59f1ba7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/setup/convert/info.php.bak b/setup/convert/info.php.bak
deleted file mode 100644 (file)
index e765fbc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: info.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$ConvertInfo = array();
-$ConvertInfo['ConvertFrom'] = null;
-$ConvertInfo['ConvertTo'] = null;
-$ConvertInfo['ConvertName'] = null;
-$ConvertInfo['ConvertMaker'] = null;
-$ConvertInfo['ConvertMakerURL'] = null;
-$ConvertInfo['ConvertFile'] = null;
-$ConvertInfo['ConvertVersion'] = null;
-$ConvertInfo['ConvertPreVersion'] = null;
-/* Demo Convert File */
-// $ConvertInfo = array();
-// $ConvertInfo['ConvertFrom'] = "DF2k";
-// $ConvertInfo['ConvertTo'] = "iDB";
-// $ConvertInfo['ConvertName'] = "DF2k to iDB";
-// $ConvertInfo['ConvertMaker'] = "Cool Dude 2k";
-// $ConvertInfo['ConvertMakerURL'] = "http://upload.idb.s1.jcink.com/";
-// $ConvertInfo['ConvertFile'] = "setup/convert/convert.php";
-// $ConvertInfo['ConvertVersion'] = "1";
-// $ConvertInfo['ConvertPreVersion'] = "1";
-?>
\ No newline at end of file
diff --git a/setup/html5.php.bak b/setup/html5.php.bak
deleted file mode 100644 (file)
index 779d7d3..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: html5.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="xhtml10.php"||$File3Name=="/xhtml10.php") {
-       require('index.php');
-       exit(); }
-$XHTML5 = false;
-// Check to see if we serv the file as html or xhtml
-// if we do xhtml we also check to see if user's browser 
-// can dispay if or else fallback to html
-if($Settings['output_type']=="html") {
-       $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
-header("Content-Type: text/html; charset=".$Settings['charset']); }
-if($Settings['output_type']=="xhtml") {
-if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
-       $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
-       header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']); }
-else { if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
-       $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
-   header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
-} else { $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
-       header("Content-Type: text/html; charset=".$Settings['charset']); } } }
-if($Settings['output_type']!="xhtml") {
-       if($Settings['output_type']!="html") {
-               $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
-header("Content-Type: text/html; charset=".$Settings['charset']); } }
-if($checklowview===true&&$_GET['act']=="lowview") { 
-   $ThemeSet['CSSType'] = "lowview"; 
-   $ThemeSet['ThemeName'] = $OrgName." Low Theme";
-   $ThemeSet['ThemeMaker'] =$iDB_Author;
-   $ThemeSet['ThemeVersion'] = $VER1[0].".".$VER1[1].".".$VER1[2];
-   $ThemeSet['ThemeVersionType'] = $VER2[0];
-   $ThemeSet['ThemeSubVersion'] = $VER2[2]." ".$SubVerN;
-   $ThemeSet['MakerURL'] = $iDBHome."support/?act=lowview";
-   $ThemeSet['CopyRight'] = $ThemeSet['ThemeName']." was made by <a href=\"".$ThemeSet['MakerURL']."\" title=\"".$ThemeSet['ThemeMaker']."\">".$ThemeSet['ThemeMaker']."</a>";
-   $ThemeInfo['ThemeName'] = $ThemeSet['ThemeName'];
-   $ThemeInfo['ThemeMaker'] = $ThemeSet['ThemeMaker'];
-   $ThemeInfo['ThemeVersion'] = $ThemeSet['ThemeVersion'];
-   $ThemeInfo['ThemeVersionType'] = $ThemeSet['ThemeVersionType'];
-   $ThemeInfo['ThemeSubVersion'] = $ThemeSet['ThemeSubVersion'];
-   $ThemeInfo['MakerURL'] = $ThemeSet['MakerURL'];
-   $ThemeInfo['CopyRight'] = $ThemeSet['CopyRight']; }
-if($ThemeSet['CSSType']!="import"&&
-   $ThemeSet['CSSType']!="link"&&
-   $ThemeSet['CSSType']!="lowview"&&
-   $ThemeSet['CSSType']!="xml"&&
-   $ThemeSet['CSSType']!="sql") { 
-   $ThemeSet['CSSType'] = "import"; }
-header("Content-Style-Type: text/css");
-header("Content-Script-Type: text/javascript");
-if($Settings['showverinfo']!="on") {
-$iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">"; }
-if($Settings['showverinfo']=="on") {
-$iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$VerInfo['iDB_Ver_Show']."\" onclick=\"window.open(this.href);return false;\">"; }
-$GM2kURL = "<a href=\"".$GM2kHome."\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
-$csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
-$BSDL = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"".$RName." is dual-licensed under the Revised BSD License\">BSDL</a>";
-$GPL = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"".$RName." is dual-licensed under the Gnu General Public License\">GPL</a>";
-$DualLicense = $BSDL." &amp; ".$GPL;
-$extext = null;
-if($checklowview!==true) { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">Low-Version</a>"; }
-if($checklowview===true&&$_GET['act']!="lowview") { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">Low-Version</a>"; }
-if($checklowview===true&&$_GET['act']=="lowview") {  $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">High-Version</a>"; }
-$endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1.$RName."</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <br />\n".$ThemeSet['CopyRight']." | ".$extext; 
-header("Content-Language: en");
-header("Vary: Accept-Encoding");
-// Check if we are on a secure HTTP connection
-if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
-if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
-// Get the board's url
-if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
-       $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
-if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
-       $BoardURL = $Settings['idburl']; 
-       if($Settings['qstr']!="/") {
-       $AltBoardURL = $BoardURL; } 
-       if($Settings['qstr']=="/") { 
-       $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
-// Get the html level
-if($Settings['html_level']!="Strict") {
-       if($Settings['html_level']!="Transitional") {
-               $Settings['html_level'] = "Transitional"; } }
-// HTML Document Starts
-if($XHTML5===false) {
-?>
-<!DOCTYPE html>
-<?php // HTML meta tags and other html, head tags ?>
-<html lang="en">
-<?php } if($XHTML5===true) { ?>
-<!DOCTYPE html [
-<!ENTITY nbsp "&#160;">
-<!ENTITY copy "&#169;">
-<!ENTITY reg "&#174;">
-<!ENTITY Aacute "&#193;">
-<!ENTITY aacute "&#225;">
-<!ENTITY Agrave "&#224;">
-<!ENTITY agrave "&#192;">
-<!ENTITY Acirc "&#194;">
-<!ENTITY acirc "&#226;">
-<!ENTITY Auml "&#196;">
-<!ENTITY auml "&#228;">
-<!ENTITY Atilde "&#195;">
-<!ENTITY atilde "&#227;">
-<!ENTITY Aring "&#197;">
-<!ENTITY aring "&#229;">
-<!ENTITY Aelig "&#198;">
-<!ENTITY aelig "&#230;">
-<!ENTITY Ccedil "&#199;">
-<!ENTITY ccedil "&#231;">
-<!ENTITY Eth "&#208;">
-<!ENTITY eth "&#240;">
-<!ENTITY Eacute "&#201;">
-<!ENTITY eacute "&#233;">
-<!ENTITY Egrave "&#200;">
-<!ENTITY egrave "&#232;">
-<!ENTITY Ecirc "&#202;">
-<!ENTITY ecirc "&#234;">
-<!ENTITY Euml "&#203;">
-<!ENTITY euml "&#235;">
-<!ENTITY Iacute "&#205;">
-<!ENTITY iacute "&#237;">
-<!ENTITY Igrave "&#204;">
-<!ENTITY igrave "&#236;">
-<!ENTITY Icirc "&#206;">
-<!ENTITY icirc "&#238;">
-<!ENTITY Iuml "&#207;">
-<!ENTITY iuml "&#239;">
-<!ENTITY Ntilde "&#209;">
-<!ENTITY ntilde "&#241;">
-<!ENTITY Oacute "&#211;">
-<!ENTITY oacute "&#243;">
-<!ENTITY Ograve "&#210;">
-<!ENTITY ograve "&#242;">
-<!ENTITY Ocirc "&#212;">
-<!ENTITY ocirc "&#244;">
-<!ENTITY Ouml "&#214;">
-<!ENTITY ouml "&#246;">
-<!ENTITY Otilde "&#213;">
-<!ENTITY otilde "&#245;">
-<!ENTITY Oslash "&#216;">
-<!ENTITY oslash "&#248;">
-<!ENTITY szlig "&#223;">
-<!ENTITY Thorn "&#222;">
-<!ENTITY thorn "&#254;">
-<!ENTITY Uacute "&#218;">
-<!ENTITY uacute "&#250;">
-<!ENTITY Ugrave "&#217;">
-<!ENTITY ugrave "&#249;">
-<!ENTITY Ucirc "&#219;">
-<!ENTITY ucirc "&#251;">
-<!ENTITY Uuml "&#220;">
-<!ENTITY uuml "&#252;">
-<!ENTITY Yacute "&#221;">
-<!ENTITY yacute "&#253;">
-<!ENTITY yuml "&#255;">
-]>
-<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
-<?php } ?>
-<head>
-<?php if($XHTML5===false) { ?>
-<meta charset="<?php echo $Settings['charset']; ?>">
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>">
-<?php 
-if(!isset($_SERVER['HTTP_USER_AGENT'])) {
-       $_SERVER['HTTP_USER_AGENT'] = ""; }
-if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
-       !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge">
-<?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
-<?php } } if($XHTML5===true) { ?>
-<meta charset="<?php echo $Settings['charset']; ?>" />
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
-<?php 
-if(!isset($_SERVER['HTTP_USER_AGENT'])) {
-       $_SERVER['HTTP_USER_AGENT'] = ""; }
-if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
-       !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
-<?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
-<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
-<?php } } ?>
-<base href="<?php echo $BoardURL; ?>" />
-<?php if($Settings['showverinfo']=="on") { ?>
-<meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
-<?php } if($Settings['showverinfo']!="on") { ?>
-<meta name="Generator" content="<?php echo $iDB; ?>" />
-<?php } echo "\n"; ?>
-<meta name="Author" content="<?php echo $SettInfo['Author']; ?>" />
-<meta name="Keywords" content="<?php echo $SettInfo['Keywords']; ?>" />
-<meta name="Description" content="<?php echo $SettInfo['Description']; ?>" />
-<meta name="ROBOTS" content="Index, FOLLOW" />
-<meta name="GOOGLEBOT" content="Index, FOLLOW" />
-<?php if($Settings['showverinfo']=="on") { ?>
-<!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
-<?php } if($Settings['showverinfo']!="on") { ?>
-<!-- generator="<?php echo $iDB; ?>" -->
-<?php } echo "\n"; ?>
-
-<script type="text/javascript" src="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>"></script>
-<?php echo "\n";
-if($ThemeSet['CSSType']=="import") { ?>
-<style type="text/css">
-/* Import the theme css file */
-<?php echo "\n@import url(\"".$ThemeSet['CSS']."\");\n"; ?>
-</style>
-<?php } if($ThemeSet['CSSType']=="sql") { ?>
-<style type="text/css">
-<?php echo $ThemeSet['CSS']; ?>
-</style>
-<?php } if($ThemeSet['CSSType']=="link") { ?>
-<link rel="prefetch alternate stylesheet" href="<?php echo $ThemeSet['CSS']; ?>" />
-<link rel="stylesheet" type="text/css" href="<?php echo $ThemeSet['CSS']; ?>" />
-<?php } if($ThemeSet['CSSType']=="lowview") { ?>
-<style type="text/css">
-/* (Low View / Lo-Fi ) version start */
-body {
-background-color: #FFFFFF;
-color: #000000;
-font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
-font-size: 16px;
-margin: 20px;
-padding: 0px;
-}
-.copyright {
-text-align: center;
-font-family: Sans-Serif;
-font-size: 12px;
-line-height: 11px;
-color: #000000;
-}
-.EditReply {
-color: #000000;
-font-size: 9px;
-}
-</style>
-<?php }
-if($ThemeSet['FavIcon']!=null) { ?>
-<link rel="icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
-<link rel="shortcut icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
-<?php } ?>
\ No newline at end of file
diff --git a/setup/index.php.bak b/setup/index.php.bak
deleted file mode 100644 (file)
index 1f74edb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../index.php');
-?>
\ No newline at end of file
diff --git a/setup/license.php.bak b/setup/license.php.bak
deleted file mode 100644 (file)
index bbfff64..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: license.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="presetup.php"||$File3Name=="/presetup.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-?>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<form style="display: inline;" method="post" id="install" action="install.php?act=Part2">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="LicenseBox">License - Please read fully and check 'I agree' box ONLY if you agree to license</label><br />
-       <textarea rows="34" id="LicenseBox" name="LicenseBox" class="TextBox" cols="79" readonly="readonly" accesskey="L"><?php echo stripcslashes(htmlspecialchars(file_get_contents("LICENSE"), ENT_QUOTES, $Settings['charset'])); ?></textarea><br />
-       <input type="checkbox" class="TextBox" name="License" value="Agree" id="License" /><label class="TextBoxLabel" for="License">I Agree</label><br/></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<?php if($ConvertInfo['ConvertFile']==null) { ?>
-<input type="hidden" name="SetupType" value="install" style="display: none;" />
-<?php } ?>
-<input type="hidden" name="act" value="Part2" style="display: none;" />
-<input type="submit" class="Button" value="Next Page" name="Install_Board" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
diff --git a/setup/mkconfig.php.bak b/setup/mkconfig.php.bak
deleted file mode 100644 (file)
index f08d88c..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: mkconfig.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="mkconfig.php"||$File3Name=="/mkconfig.php") {
-       require('index.php');
-       exit(); }
-require_once('settings.php');
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['sql'])) { $SetupDir['sql'] = "setup/sql/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-$_POST['DatabaseHost'] = $Settings['sqlhost'];
-$_POST['DatabaseUserName'] = $Settings['sqluser'];
-$_POST['DatabasePassword'] = $Settings['sqlpass'];
-$Settings['charset'] = $_POST['charset'];
-$Settings['sqltype'] = $_POST['DatabaseType'];
-if(!isset($_POST['DefaultTheme'])) { $_POST['DefaultTheme'] = "iDB"; }
-if(isset($_POST['DefaultTheme'])) { 
-       $_POST['DefaultTheme'] = chack_themes($_POST['DefaultTheme']); }
-$Settings['vercheck'] = 2;
-if(!isset($_POST['SQLThemes'])) { $_POST['SQLThemes'] = "off"; }
-if($_POST['SQLThemes']!="on"&&$_POST['SQLThemes']!="off") { 
-       $_POST['SQLThemes'] = "off"; }
-$disfunc = @ini_get("disable_functions");
-$disfunc = @trim($disfunc);
-$disfunc = @preg_replace("/([\\s+|\\t+|\\n+|\\r+|\\0+|\\x0B+])/i", "", $disfunc);
-if($disfunc!="ini_set") { $disfunc = explode(",",$disfunc); }
-if($disfunc=="ini_set") { $disfunc = array("ini_set"); }
-$servtz = new DateTimeZone($_POST['YourOffSet']);
-$servcurtime->setTimezone($servtz);
-$usertz = new DateTimeZone($_POST['YourOffSet']);
-$usercurtime->setTimezone($usertz);
-?>
-<tr class="TableRow3" style="text-align: center;">
-<td class="TableColumn3" colspan="2">
-<?php
-$dayconv = array('second' => 1, 'minute' => 60, 'hour' => 3600, 'day' => 86400, 'week' => 604800, 'month' => 2630880, 'year' => 31570560, 'decade' => 315705600);
-$_POST['tableprefix'] = strtolower($_POST['tableprefix']);
-$_POST['tableprefix'] = preg_replace("/[^A-Za-z0-9_$]/", "", $_POST['tableprefix']);
-if($_POST['tableprefix']==null||$_POST['tableprefix']=="_") { $_POST['tableprefix']="idb_"; }
-if($_POST['sessprefix']==null||$_POST['sessprefix']=="_") { $_POST['sessprefix']="idb_"; }
-$checkfile="settings.php";
-@chmod("settings.php",0766);
-@chmod("settingsbak.php",0766);
-if (!is_writable($checkfile)) {
-   echo "<br />Settings is not writable.";
-   @chmod("settings.php",0766); $Error="Yes";
-   @chmod("settingsbak.php",0766);
-} else { /* settings.php is writable install iDB. ^_^ */ }
-if (session_id()) { session_destroy(); }
-session_name($_POST['tableprefix']."sess");
-if(preg_match("/\/$/", $_POST['BoardURL'])<1) { 
-       $_POST['BoardURL'] = $_POST['BoardURL']."/"; } 
-$URLsTest = parse_url($_POST['BoardURL']);
-$this_dir = $URLsTest['path'];
-$Settings['enable_https'] = "off";
-if($URLsTest['scheme']=="https") {
-       $Settings['enable_https'] = "on"; }
-session_set_cookie_params(0, $this_dir, $URLsTest['host']);
-session_cache_limiter("private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Cache-Control: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Pragma: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Date: ".$utccurtime->format("D, d M Y H:i:s")." GMT");
-header("Last-Modified: ".$utccurtime->format("D, d M Y H:i:s")." GMT");
-header("Expires: ".$utccurtime->format("D, d M Y H:i:s")." GMT");
-session_start();
-//@register_shutdown_function("session_write_close");
-if (pre_strlen($_POST['AdminPasswords'])<"3") { $Error="Yes";
-echo "<br />Your password is too small."; }
-if (pre_strlen($_POST['AdminUser'])<"3") { $Error="Yes";
-echo "<br />Your user name is too small."; }
-if (pre_strlen($_POST['AdminUser'])<"3") { $Error="Yes";
-echo "<br />Your user name is too small."; }
-if (pre_strlen($_POST['AdminEmail'])<"3") { $Error="Yes";
-echo "<br />Your email name is too small."; }
-if (pre_strlen($_POST['AdminPasswords'])>"60") { $Error="Yes";
-echo "<br />Your password is too big."; }
-if (pre_strlen($_POST['AdminUser'])>"30") { $Error="Yes";
-echo "<br />Your user name is too big."; }
-if ($_POST['AdminPasswords']!=$_POST['ReaPassword']) { $Error="Yes";
-echo "<br />Your passwords did not match."; }
-if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
-if($_POST['HTMLType']=="xhtml5") { $_POST['OutPutType'] = "xhtml"; }
-$_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['charset']);
-$_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
-$_POST['BoardURL'] = addslashes($_POST['BoardURL']);
-$YourDate = $utccurtime->getTimestamp();
-$YourEditDate = $YourDate + $dayconv['minute'];
-$GSalt = salt_hmac(); $YourSalt = salt_hmac();
-/* Fix The User Info for iDB */
-$_POST['NewBoardName'] = stripcslashes(htmlspecialchars($_POST['NewBoardName'], ENT_QUOTES, $Settings['charset']));
-//$_POST['NewBoardName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NewBoardName']);
-$_POST['NewBoardName'] = remove_spaces($_POST['NewBoardName']);
-//$_POST['AdminPassword'] = stripcslashes(htmlspecialchars($_POST['AdminPassword'], ENT_QUOTES, $Settings['charset']));
-//$_POST['AdminPassword'] = preg_replace("/\&amp;#(.*?);/is", "&#$1;", $_POST['AdminPassword']);
-$_POST['AdminUser'] = stripcslashes(htmlspecialchars($_POST['AdminUser'], ENT_QUOTES, $Settings['charset']));
-//$_POST['AdminUser'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['AdminUser']);
-$_POST['AdminUser'] = remove_spaces($_POST['AdminUser']);
-$_POST['AdminEmail'] = remove_spaces($_POST['AdminEmail']);
-if(!function_exists('hash')&&!function_exists('hash_algos')) {
-if($_POST['usehashtype']!="md5"&&
-   $_POST['usehashtype']!="sha1") {
-       $_POST['usehashtype'] = "sha1"; } }
-if(function_exists('hash')&&function_exists('hash_algos')) {
-if(!in_array($_POST['usehashtype'],hash_algos())) {
-       $_POST['usehashtype'] = "sha1"; }
-if($_POST['usehashtype']!="md2"&&
-   $_POST['usehashtype']!="md4"&&
-   $_POST['usehashtype']!="md5"&&
-   $_POST['usehashtype']!="sha1"&&
-   $_POST['usehashtype']!="sha224"&&
-   $_POST['usehashtype']!="sha256"&&
-   $_POST['usehashtype']!="sha384"&&
-   $_POST['usehashtype']!="sha512"&&
-   $_POST['usehashtype']!="ripemd128"&&
-   $_POST['usehashtype']!="ripemd160"&&
-   $_POST['usehashtype']!="ripemd256"&&
-   $_POST['usehashtype']!="ripemd320") {
-       $_POST['usehashtype'] = "sha1"; } }
-if($_POST['usehashtype']=="md2") { $iDBHashType = "iDBH2"; }
-if($_POST['usehashtype']=="md4") { $iDBHashType = "iDBH4"; }
-if($_POST['usehashtype']=="md5") { $iDBHashType = "iDBH5"; }
-if($_POST['usehashtype']=="sha1") { $iDBHashType = "iDBH"; }
-if($_POST['usehashtype']=="sha224") { $iDBHashType = "iDBH224"; }
-if($_POST['usehashtype']=="sha256") { $iDBHashType = "iDBH256"; }
-if($_POST['usehashtype']=="sha384") { $iDBHashType = "iDBH384"; }
-if($_POST['usehashtype']=="sha512") { $iDBHashType = "iDBH512"; }
-if($_POST['usehashtype']=="ripemd128") { $iDBHashType = "iDBHRMD128"; }
-if($_POST['usehashtype']=="ripemd160") { $iDBHashType = "iDBHRMD160"; }
-if($_POST['usehashtype']=="ripemd256") { $iDBHashType = "iDBHRMD256"; }
-if($_POST['usehashtype']=="ripemd320") { $iDBHashType = "iDBHRMD320"; }
-if ($_POST['AdminUser']=="Guest") { $Error="Yes";
-echo "<br />You can not use Guest as your name."; }
-/* We are done now with fixing the info. ^_^ */
-$SQLStat = sql_connect_db($_POST['DatabaseHost'],$_POST['DatabaseUserName'],$_POST['DatabasePassword'],$_POST['DatabaseName']);
-if(isset($_POST['sqlcollate'])) { $Settings['sql_collate'] = $_POST['sqlcollate']; }
-if(isset($Settings['sql_collate'])&&!isset($Settings['sql_charset'])) {
-       if($Settings['sql_collate']=="ascii_bin"||
-               $Settings['sql_collate']=="ascii_generel_ci") {
-               $Settings['sql_charset'] = "ascii"; }
-       if($Settings['sql_collate']=="latin1_bin"||
-               $Settings['sql_collate']=="latin1_general_ci"||
-               $Settings['sql_collate']=="latin1_general_cs") {
-               $Settings['sql_charset'] = "latin1"; }
-       if($Settings['sql_collate']=="utf8_bin"||
-               $Settings['sql_collate']=="utf8_general_ci"||
-               $Settings['sql_collate']=="utf8_unicode_ci"||
-               $Settings['sql_collate']=="utf8mb4_bin"||
-               $Settings['sql_collate']=="utf8mb4_general_ci"||
-               $Settings['sql_collate']=="utf8mb4_unicode_ci") {
-               $Settings['sql_charset'] = "utf8"; } }
-if(isset($Settings['sql_collate'])&&isset($Settings['sql_charset'])) {
-       if($Settings['sql_charset']=="ascii") {
-       if($Settings['sql_collate']!="ascii_bin"&&
-               $Settings['sql_collate']!="ascii_generel_ci") {
-               $Settings['sql_collate'] = "ascii_generel_ci"; } }
-       if($Settings['sql_charset']=="latin1") {
-       if($Settings['sql_collate']!="latin1_bin"&&
-               $Settings['sql_collate']!="latin1_general_ci"&&
-               $Settings['sql_collate']!="latin1_general_cs") {
-               $Settings['sql_collate'] = "latin1_general_ci"; } }
-       if($Settings['sql_charset']=="utf8" || $Settings['sql_charset']=="utf8mb4") {
-       if($Settings['sql_collate']!="utf8_bin"&&
-               $Settings['sql_collate']!="utf8_general_ci"&&
-               $Settings['sql_collate']!="utf8_unicode_ci"&&
-               $Settings['sql_collate']!="utf8mb4_bin"&&
-               $Settings['sql_collate']!="utf8mb4_general_ci"&&
-               $Settings['sql_collate']!="utf8mb4_unicode_ci") {
-               $Settings['sql_collate'] = "utf8mb4_unicode_ci"; } }
-       if($Settings['sql_collate']=="utf8_bin"||
-               $Settings['sql_collate']=="utf8_general_ci"||
-               $Settings['sql_collate']=="utf8_unicode_ci") {
-               $Settings['sql_charset'] = "utf8"; }
-       if($Settings['sql_collate']=="utf8mb4_bin"||
-               $Settings['sql_collate']=="utf8mb4_general_ci"||
-               $Settings['sql_collate']=="utf8mb4_unicode_ci") {
-               $Settings['sql_charset'] = "utf8mb4"; }
-       $SQLCollate = $Settings['sql_collate'];
-       $SQLCharset = $Settings['sql_charset']; }
-if(!isset($Settings['sql_collate'])||!isset($Settings['sql_charset'])) {
-$SQLCollate = "latin1_general_ci";
-$SQLCharset = "latin1"; 
-if($Settings['charset']=="ISO-8859-1") {
-       $SQLCollate = "latin1_general_ci";
-       $SQLCharset = "latin1"; }
-if($Settings['charset']=="ISO-8859-15") {
-       $SQLCollate = "latin1_general_ci";
-       $SQLCharset = "latin1"; }
-if($Settings['charset']=="UTF-8") {
-       $SQLCollate = "utf8mb4_unicode_ci";
-       $SQLCharset = "utf8mb4"; } 
-$Settings['sql_collate'] = $SQLCollate;
-$Settings['sql_charset'] = $SQLCharset; }
-sql_set_charset($SQLCharset,$SQLStat);
-if($SQLStat===false) { $Error="Yes";
-echo "<br />".sql_errorno($SQLStat)."\n"; }
-if ($Error!="Yes") {
-$ServerUUID = rand_uuid("rand");
-$MyDay = $usercurtime->format("d");
-$MyMonth = $usercurtime->format("m");
-$MyYear = $usercurtime->format("Y");
-$MyYear10 = $MyYear+10;
-$YourDateEnd = $YourDate;
-$EventMonth = $utccurtime->format("m");
-$EventMonthEnd = $utccurtime->format("m");
-$EventDay = $utccurtime->format("d");
-$EventDayEnd = $utccurtime->format("d");
-$EventYear = $utccurtime->format("Y");
-$EventYearEnd = $utccurtime->format("Y");
-$KarmaBoostDay = $EventMonth.$EventDay;
-$Settings['idb_time_format'] = "g:i A";
-if(!isset($_POST['iDBTimeFormat'])) { 
-       $_POST['iDBTimeFormat'] = "g:i A"; }
-if(isset($_POST['iDBTimeFormat'])) { 
-       $_POST['iDBTimeFormat'] = convert_strftime($_POST['iDBTimeFormat']); }
-$Settings['idb_date_format'] = "F j Y";
-if(!isset($_POST['iDBDateFormat'])) { 
-       $_POST['iDBDateFormat'] = "F j Y"; }
-if(isset($_POST['iDBDateFormat'])) { 
-       $_POST['iDBDateFormat'] = convert_strftime($_POST['iDBDateFormat']); }
-if(!isset($_POST['iDBHTTPLogger'])) { 
-       $_POST['iDBHTTPLogger'] = "off"; }
-if(isset($_POST['iDBHTTPLogger'])&&$_POST['iDBHTTPLogger']!="on"&&$_POST['iDBHTTPLogger']!="off") {
-       $_POST['iDBHTTPLogger'] = "off"; }
-if(!isset($_POST['iDBLoggerFormat'])) { 
-       $_POST['iDBLoggerFormat'] = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""; }
-$Settings['idb_time_format'] = $_POST['iDBTimeFormat'];
-$Settings['idb_date_format'] = $_POST['iDBDateFormat'];
-$NewPassword = b64e_hmac($_POST['AdminPasswords'],$YourDate,$YourSalt,$_POST['usehashtype']);
-//$Name = stripcslashes(htmlspecialchars($AdminUser, ENT_QUOTES, $Settings['charset']));
-//$YourWebsite = "http://".$_SERVER['HTTP_HOST'].$this_dir."index.php?act=view";
-$_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
-$_POST['WebURL'] = remove_spaces($_POST['WebURL']);
-$YourWebsite = $_POST['WebURL'];
-$UserIP = $_SERVER['REMOTE_ADDR'];
-$PostCount = 2;
-$Email = "admin@".$_SERVER['HTTP_HOST'];
-$GEmail = "guest@".$_SERVER['HTTP_HOST'];
-$grand = rand(6,16); $i = 0; $gpass = "";
-while ($i < $grand) {
-$csrand = rand(1,3);
-if($csrand!=1&&$csrand!=2&&$csrand!=3) { $csrand=1; }
-if($csrand==1) { $gpass .= chr(rand(48,57)); }
-if($csrand==2) { $gpass .= chr(rand(65,90)); }
-if($csrand==3) { $gpass .= chr(rand(97,122)); }
-++$i; } $GuestPassword = b64e_hmac($gpass,$YourDate,$GSalt,$_POST['usehashtype']);
-$url_this_dir = "http://".$_SERVER['HTTP_HOST'].$this_dir."index.php?act=view";
-$YourIP = $_SERVER['REMOTE_ADDR'];
-if($Settings['sqltype']!="cubrid") {
-@unlink($SettDir['sqldumper'].'cubrid.php');
-@unlink($SettDir['sql'].'cubrid.php'); }
-if($Settings['sqltype']!="mysql"&&
-       $Settings['sqltype']!="mysqli") {
-@unlink($SettDir['sqldumper'].'mysql.php'); }
-if($Settings['sqltype']!="mysql") {
-@unlink($SettDir['sql'].'mysql.php'); }
-if($Settings['sqltype']!="mysqli") {
-@unlink($SettDir['sql'].'mysqli.php'); }
-if($Settings['sqltype']!="pgsql") {
-@unlink($SettDir['sqldumper'].'pgsql.php');
-@unlink($SettDir['sql'].'pgsql.php'); }
-if($Settings['sqltype']!="sqlite") {
-@unlink($SettDir['sqldumper'].'sqlite.php');
-@unlink($SettDir['sql'].'sqlite.php'); }
-if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli") {
-require($SetupDir['sql'].'mysql.php'); }
-if($Settings['sqltype']=="pgsql") {
-require($SetupDir['sql'].'pgsql.php'); }
-if($Settings['sqltype']=="sqlite") {
-require($SetupDir['sql'].'sqlite.php'); }
-if($Settings['sqltype']=="cubrid") {
-require($SetupDir['sql'].'cubrid.php'); }
-if($_POST['SQLThemes']=="on") {
-$OldThemeSet = $ThemeSet; 
-$Settings['board_name'] = $_POST['NewBoardName'];
-$skindir = dirname(realpath("sql.php"))."/".$SettDir['themes'];
-if ($handle = opendir($skindir)) { $dirnum = null;
-   while (false !== ($file = readdir($handle))) {
-          if ($dirnum==null) { $dirnum = 0; }
-          if (file_exists($skindir.$file."/info.php")) {
-                  if ($file != "." && $file != "..") {
-          include($skindir.$file."/info.php");
-       $themelist[$dirnum] =  $file;
-          ++$dirnum; } } }
-   closedir($handle); asort($themelist);
-   $themenum=count($themelist); $themei=0; 
-   while ($themei < $themenum) {
-   include($skindir.$themelist[$themei]."/settings.php");
-   $query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."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".
-   "('%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']));
-   sql_query($query,$SQLStat);
-   ++$themei; } }
-sql_disconnect_db($SQLStat);
-$ThemeSet = $OldThemeSet; }
-$CHMOD = $_SERVER['PHP_SELF'];
-$iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
-$iDBRSVN = $VER2[2]." ".$SubVerN;
-$LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
-$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";
-$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   */");
-$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";
-$BoardSettings=$pretext2[0]."\n".
-"\$Settings['sqlhost'] = '".$_POST['DatabaseHost']."';\n".
-"\$Settings['sqldb'] = '".$_POST['DatabaseName']."';\n".
-"\$Settings['sqltable'] = '".$_POST['tableprefix']."';\n".
-"\$Settings['sqluser'] = '".$_POST['DatabaseUserName']."';\n".
-"\$Settings['sqlpass'] = '".$_POST['DatabasePassword']."';\n".
-"\$Settings['sqltype'] = '".$_POST['DatabaseType']."';\n".
-"\$Settings['board_name'] = '".$_POST['NewBoardName']."';\n".
-"\$Settings['idbdir'] = '".$idbdir."';\n".
-"\$Settings['idburl'] = '".$_POST['BoardURL']."';\n".
-"\$Settings['enable_https'] = '".$Settings['enable_https']."';\n".
-"\$Settings['weburl'] = '".$_POST['WebURL']."';\n".
-"\$Settings['SQLThemes'] = '".$_POST['SQLThemes']."';\n".
-"\$Settings['use_gzip'] = '".$_POST['GZip']."';\n".
-"\$Settings['html_type'] = '".$_POST['HTMLType']."';\n".
-"\$Settings['output_type'] = '".$_POST['OutPutType']."';\n".
-"\$Settings['GuestGroup'] = 'Guest';\n".
-"\$Settings['MemberGroup'] = 'Member';\n".
-"\$Settings['ValidateGroup'] = 'Validate';\n".
-"\$Settings['AdminValidate'] = 'off';\n".
-"\$Settings['TestReferer'] = '".$_POST['TestReferer']."';\n".
-"\$Settings['DefaultTheme'] = '".$_POST['DefaultTheme']."';\n".
-"\$Settings['DefaultTimeZone'] = '".$_POST['YourOffSet']."';\n".
-"\$Settings['start_date'] = ".$YourDate.";\n".
-"\$Settings['idb_time_format'] = '".$Settings['idb_time_format']."';\n".
-"\$Settings['idb_date_format'] = '".$Settings['idb_date_format']."';\n".
-"\$Settings['use_hashtype'] = '".$_POST['usehashtype']."';\n".
-"\$Settings['charset'] = '".$Settings['charset']."';\n".
-"\$Settings['sql_collate'] = '".$Settings['sql_collate']."';\n".
-"\$Settings['sql_charset'] = '".$Settings['sql_charset']."';\n".
-"\$Settings['add_power_by'] = 'off';\n".
-"\$Settings['send_pagesize'] = 'off';\n".
-"\$Settings['max_posts'] = '10';\n".
-"\$Settings['max_topics'] = '10';\n".
-"\$Settings['max_memlist'] = '10';\n".
-"\$Settings['max_pmlist'] = '10';\n".
-"\$Settings['hot_topic_num'] = '15';\n".
-"\$Settings['qstr'] = '&';\n".
-"\$Settings['qsep'] = '=';\n".
-"\$Settings['file_ext'] = '.php';\n".
-"\$Settings['rss_ext'] = '.php';\n".
-"\$Settings['js_ext'] = '.js';\n".
-"\$Settings['showverinfo'] = 'on';\n".
-"\$Settings['vercheck'] = 1;\n".
-"\$Settings['enable_rss'] = 'on';\n".
-"\$Settings['enable_search'] = 'on';\n".
-"\$Settings['sessionid_in_urls'] = 'off';\n".
-"\$Settings['fixpathinfo'] = 'off';\n".
-"\$Settings['fixbasedir'] = 'off';\n".
-"\$Settings['fixcookiedir'] = 'off';\n".
-"\$Settings['fixredirectdir'] = 'off';\n".
-"\$Settings['enable_pathinfo'] = 'off';\n".
-"\$Settings['rssurl'] = 'off';\n".
-"\$Settings['board_offline'] = 'off';\n".
-"\$Settings['VerCheckURL'] = '';\n".
-"\$Settings['IPCheckURL'] = '';\n".
-"\$Settings['log_http_request'] = '".$_POST['iDBHTTPLogger']."';\n".
-"\$Settings['log_config_format'] = '".$_POST['iDBLoggerFormat']."';\n".
-"\$Settings['BoardUUID'] = '".base64_encode($ServerUUID)."';\n".
-"\$Settings['KarmaBoostDays'] = '".$KarmaBoostDay."';\n".
-"\$Settings['KBoostPercent'] = '6|10';\n".$pretext2[1]."\n".
-"\$SettInfo['board_name'] = '".$_POST['NewBoardName']."';\n".
-"\$SettInfo['Author'] = '".$_POST['AdminUser']."';\n".
-"\$SettInfo['Keywords'] = '".$_POST['NewBoardName'].",".$_POST['AdminUser']."';\n".
-"\$SettInfo['Description'] = '".$_POST['NewBoardName'].",".$_POST['AdminUser']."';\n".$pretext2[2]."\n".
-"\$SettDir['maindir'] = '".$idbdir."';\n".
-"\$SettDir['inc'] = 'inc/';\n".
-"\$SettDir['logs'] = 'logs/';\n".
-"\$SettDir['archive'] = 'archive/';\n".
-"\$SettDir['misc'] = 'inc/misc/';\n".
-"\$SettDir['sql'] = 'inc/misc/sql/';\n".
-"\$SettDir['admin'] = 'inc/admin/';\n".
-"\$SettDir['sqldumper'] = 'inc/admin/sqldumper/';\n".
-"\$SettDir['mod'] = 'inc/mod/';\n".
-"\$SettDir['mplayer'] = 'inc/mplayer/';\n".
-"\$SettDir['themes'] = 'themes/';\n".$pretext2[3]."\n?>";
-$BoardSettingsBak = $pretext.$settcheck.$BoardSettings;
-$BoardSettings = $pretext.$settcheck.$BoardSettings;
-$fp = fopen("settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("settingsbak.php","w+");
-fwrite($fp, $BoardSettingsBak);
-fclose($fp);
-if($_POST['storecookie']=="true") {
-if($URLsTest['host']!="localhost") {
-setcookie("MemberName", $_POST['AdminUser'], time() + (7 * 86400), $this_dir, $URLsTest['host']);
-setcookie("UserID", 1, time() + (7 * 86400), $this_dir, $URLsTest['host']);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $this_dir, $URLsTest['host']); }
-if($URLsTest['host']=="localhost") {
-setcookie("MemberName", $_POST['AdminUser'], time() + (7 * 86400), $this_dir, false);
-setcookie("UserID", 1, time() + (7 * 86400), $this_dir, false);
-setcookie("SessPass", $NewPassword, time() + (7 * 86400), $this_dir, false); } }
-$chdel = true;
-if($Error!="Yes") {
-if($_POST['unlink']=="true") {
-if($ConvertInfo['ConvertFile']!=null) { 
-if(!@unlink($ConvertInfo['ConvertFile'])) { $chdel = false; } }
-if(!@unlink($SetupDir['convert'].'index.php')) { $chdel = false; }
-if(!@unlink($SetupDir['convert'].'info.php')) { $chdel = false; }
-if(!@rmdir($SetupDir['convert'])) { $chdel = false; }
-if(!@unlink($SetupDir['sql'].'cubrid.php')) { $chdel = false; }
-if(!@unlink($SetupDir['sql'].'index.php')) { $chdel = false; }
-if(!@unlink($SetupDir['sql'].'mysql.php')) { $chdel = false; }
-if(!@unlink($SetupDir['sql'].'pgsql.php')) { $chdel = false; }
-if(!@unlink($SetupDir['sql'].'sqlite.php')) { $chdel = false; }
-if(!@rmdir($SetupDir['sql'])) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'index.php')) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'license.php')) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'mkconfig.php')) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'preinstall.php')) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'presetup.php')) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'setup.php')) { $chdel = false; }
-if(!@unlink($SetupDir['setup'].'html5.php')) { $chdel = false; }
-if(!@rmdir('setup')) { $chdel = false; }
-if(!@unlink('install.php')) { $chdel = false; } } }
-?><span class="TableMessage">
-<br />Install Finish <a href="index.php?act=view">Click here</a> to goto board. ^_^</span>
-<?php if($chdel===false) { ?><span class="TableMessage">
-<br />Error: Cound not delete installer. Read readme.txt for more info.</span>
-<?php } ?><br /><br />
-</td>
-</tr>
-<?php } ?>
diff --git a/setup/preinstall.php.bak b/setup/preinstall.php.bak
deleted file mode 100644 (file)
index 49c436b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: preinstall.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-//error_reporting(E_ALL ^ E_NOTICE);
-/* Some ini setting changes uncomment if you need them. */
-//ini_set('session.use_trans_sid', false);
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="preinstall.php"||$File3Name=="/preinstall.php") {
-       header('Location: index.php');
-       exit(); }
-
-header("Cache-Control: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Pragma: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Date: ".$utccurtime->format("D, d M Y H:i:s")." GMT");
-header("Last-Modified: ".$utccurtime->format("D, d M Y H:i:s")." GMT");
-header("Expires: ".$utccurtime->format("D, d M Y H:i:s")." GMT");
-output_reset_rewrite_vars();
-if(!isset($SettDir['inc'])) { $SettDir['inc'] = "inc/"; }
-if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; }
-if(!isset($SettDir['sql'])) { $SettDir['sql'] = "inc/misc/sql/"; }
-if(!isset($SettDir['admin'])) { $SettDir['admin'] = "inc/admin/"; }
-if(!isset($SettDir['sqldumper'])) { $SettDir['sqldumper'] = "inc/admin/sqldumper/"; }
-if(!isset($SettDir['mod'])) { $SettDir['mod'] = "inc/mod/"; }
-if(!isset($SettDir['mplayer'])) { $SettDir['mplayer'] = "inc/mplayer/"; }
-if(!isset($SettDir['themes'])) { $SettDir['themes'] = "themes/"; }
-if(!isset($_POST['License'])) { $_POST['License'] = null; }
-if(isset($_POST['DatabaseType'])) { 
-       $Settings['sqltype'] = $_POST['DatabaseType']; }
-if(isset($Settings['sqltype'])) {
-if($Settings['sqltype']!="mysql"&&
-       $Settings['sqltype']!="mysqli"&&
-       $Settings['sqltype']!="pgsql"&&
-       $Settings['sqltype']!="sqlite"&&
-       $Settings['sqltype']!="cubrid") {
-       $Settings['sqltype'] = "mysql"; } }
-$Settings['idb_time_format'] = "g:i A";
-$iDBTheme = "iDB"; $AltiDBTheme = "Gray";
-if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") {
-if(isset($iDBAltName['AltiDBTheme'])) { $AltiDBTheme = $iDBAltName['AltiDBTheme']; } 
-$iDBTheme = $AltiDBTheme; }
-if($iDBTheme!="iDB") {
-if(file_exists($SettDir['themes'].$iDBTheme."/settings.php")) {
-       require($SettDir['themes'].$iDBTheme."/settings.php"); } }
-if($iDBTheme=="iDB") {
-if(file_exists($SettDir['themes']."iDB/settings.php")) {
-       require($SettDir['themes']."iDB/settings.php"); }
-if(!file_exists($SettDir['themes']."iDB/settings.php")) {
-       require($SettDir['themes']."Gray/settings.php"); } }
-?>
\ No newline at end of file
diff --git a/setup/presetup.php.bak b/setup/presetup.php.bak
deleted file mode 100644 (file)
index 58b6746..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: presetup.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="presetup.php"||$File3Name=="/presetup.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-if ($_POST['License']!="Agree") { $Error="Yes";  ?>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<span class="TableMessage">
-<br />You need to  agree to the tos.<br /></span>
-<?php }
-if($Error!="Yes") {
-?>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<form style="display: inline;" method="post" id="install" action="install.php?act=Part3">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseUserName">Insert Database User Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="DatabaseUserName" class="TextBox" id="DatabaseUserName" size="20" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabasePassword">Insert Database Password:</label></td>
-       <td style="width: 50%;"><input type="password" name="DatabasePassword" class="TextBox" id="DatabasePassword" size="20" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseHost">Insert Database Host:</label></td>
-       <td style="width: 50%;"><input type="text" name="DatabaseHost" class="TextBox" id="DatabaseHost" size="20" value="localhost" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseType">Select Database Type:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="DatabaseType" id="DatabaseType">
-       <?php if(function_exists("mysql_connect")) { ?>
-       <option value="mysql">MySQL Database</option>
-       <?php } if(function_exists("mysqli_connect")) { ?>
-       <option value="mysqli">MySQLi Database</option>
-       <?php } if(function_exists("pg_connect")) { ?>
-       <option value="pgsql">PostgreSQL Database</option>
-       <?php } if(function_exists("sqlite_open")) { ?>
-       <option value="sqlite">SQLite Database</option>
-       <?php } if(function_exists("cubrid_connect")) { ?>
-       <option value="cubrid">CUBRID Database</option>
-       <?php } if(!function_exists("mysql_connect")&&!function_exists("mysqli_connect")&&
-       !function_exists("pg_connect")&&!function_exists("sqlite_open")&&
-       !function_exists("cubrid_connect")) { ?>
-       <option value="none">No Database Available</option>
-       <?php } ?>
-       </select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="charset">Select html charset:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="charset" id="charset">
-       <option value="ISO-8859-15">Latin-9 (ISO-8859-15)</option>
-       <option value="ISO-8859-1">Latin-1 (ISO-8859-1)</option>
-       <option value="UTF-8">Unicode (UTF-8)</option>
-       </select></td>
-       <?php if($ConvertInfo['ConvertFile']!=null) { ?>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="SetupType">Type of install to do:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="SetupType" id="SetupType">
-       <option value="convert" selected="selected"><?php echo $ConvertInfo['ConvertName']; ?></option>
-       <option value="install">Install iDB</option>
-       </select></td>
-       <?php } ?>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<?php if($ConvertInfo['ConvertFile']==null) { ?>
-<input type="hidden" name="SetupType" value="install" style="display: none;" />
-<?php } ?>
-<input type="hidden" name="act" value="Part3" style="display: none;" />
-<input type="submit" class="Button" value="Next Page" name="Install_Board" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<?php } ?>
diff --git a/setup/setup.php.bak b/setup/setup.php.bak
deleted file mode 100644 (file)
index d16f589..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: setup.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="setup.php"||$File3Name=="/setup.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-?>
-<tr class="TableRow3">
-<td class="TableColumn3">
-<?php
-$checkfile="settings.php";
-$iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
-$iDBRSVN = $VER2[2]." ".$SubVerN;
-$LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
-$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";
-$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   */");
-$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";
-$BoardSettingsBak = $pretext.$settcheck;
-$BoardSettings = $pretext.$settcheck;
-$fp = fopen("settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("settingsbak.php","w+");
-fwrite($fp, $BoardSettingsBak);
-fclose($fp);
-if (!is_writable($checkfile)) {
-   echo "<br />Settings is not writable.";
-   chmod("settings.php",0755); $Error="Yes";
-   chmod("settingsbak.php",0755);
-} else { /* settings.php is writable install iDB. ^_^ */ }
-if(!function_exists("mysql_connect")&&!function_exists("mysqli_connect")&&
-!function_exists("pg_connect")&&!function_exists("sqlite_open")&&
-!function_exists("cubrid_connect")) { $Error="Yes";
-echo "<span class=\"TableMessage\">You need to enbale a database php extension to install ".$VerInfo['iDB_Ver_Show']." on this server.<br />\n"; 
-echo "You can use MySQL, MySQLi, PostgreSQL, or SQLite</span>"; }
-if ($Error!="Yes") {
-$StatSQL = sql_connect_db($_POST['DatabaseHost'],$_POST['DatabaseUserName'],$_POST['DatabasePassword']);
-if(!$StatSQL) { $Error="Yes";
-echo "<span class=\"TableMessage\">";
-echo "<br />".sql_errorno($StatSQL)."\n</span>\n"; } }
-if ($Error!="Yes") {
-$iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
-$iDBRSVN = $VER2[2]." ".$SubVerN;
-$LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
-$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";
-$BoardSettings=$pretext."\$Settings = array();\n\$Settings['sqlhost'] = '".$_POST['DatabaseHost']."';\n\$Settings['sqluser'] = '".$_POST['DatabaseUserName']."';\n\$Settings['sqlpass'] = '".$_POST['DatabasePassword']."';\n?>";
-$fp = fopen("./settings.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-//     cp("settings.php","settingsbak.php");
-$fp = fopen("./settingsbak.php","w+");
-fwrite($fp, $BoardSettings);
-fclose($fp);
-// http://www.tutorialspoint.com/php/php_function_timezone_identifiers_list.htm
-$timezone_identifiers = DateTimeZone::listIdentifiers();
-//$timezone_identifiers = timezone_identifiers_list();
-$zonelist['africa'] = array();
-$zonelist['america'] = array();
-$zonelist['antarctica'] = array();
-$zonelist['asia'] = array();
-$zonelist['atlantic'] = array();
-$zonelist['australia'] = array();
-$zonelist['europe'] = array();
-$zonelist['indian'] = array();
-$zonelist['pacific'] = array();
-$zonelist['etcetera'] = array();
-for ($i=0; $i < count($timezone_identifiers); $i++) {
-    $zonelookup = explode("/", $timezone_identifiers[$i]);
-    if(count($zonelookup)==1) { array_push($zonelist['etcetera'], array($timezone_identifiers[$i], $timezone_identifiers[$i])); }
-    if(count($zonelookup)>1) { 
-        if($zonelookup[0]=="Africa") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['africa'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['africa'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="America") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['america'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['america'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Antarctica") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['antarctica'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['antarctica'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Asia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['asia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['asia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Atlantic") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['atlantic'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['atlantic'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Australia") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['australia'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['australia'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Europe") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['europe'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['europe'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Indian") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['indian'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['indian'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-        if($zonelookup[0]=="Pacific") {
-            if(count($zonelookup)==2) {
-                array_push($zonelist['pacific'], array($zonelookup[1], $timezone_identifiers[$i])); }
-            if(count($zonelookup)==3) {
-                array_push($zonelist['pacific'], array($zonelookup[2].", ".$zonelookup[1], $timezone_identifiers[$i])); } }
-    }
-}
-?>
-<form style="display: inline;" method="post" id="install" action="install.php?act=Part4">
-<table style="text-align: left;">
-<tr style="text-align: left;">
-       <td style="width: 50%;"><label class="TextBoxLabel" for="NewBoardName">Insert Board Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="NewBoardName" class="TextBox" id="NewBoardName" size="20" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DatabaseName">Insert Database Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="DatabaseName" class="TextBox" id="DatabaseName" size="20" />
-       <?php /*<select id="dblist" name="dblist" class="TextBox" onchange="document.install.DatabaseName.value=this.value">
-       <option value=" ">none on list</option>
-       <?php $dblist = sql_list_dbs();
-       $num = count($dblist); $i = 0;
-       while ($i < $num) {
-               echo "<option value=\"".$dblist[$i]."\">";
-               echo $dblist[$i]."</option>\n";
-               ++$i;
-       } ?></select><?php */ ?></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="tableprefix">Insert Table Prefix:<br /></label></td>
-       <td style="width: 50%;"><input type="text" name="tableprefix" class="TextBox" id="tableprefix" value="idb_" size="20" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="AdminUser">Insert Admin User Name:</label></td>
-       <td style="width: 50%;"><input type="text" name="AdminUser" class="TextBox" id="AdminUser" size="20" /></td>
-</tr><tr>
-       <td style="width: 30%;"><label class="TextBoxLabel" for="AdminEmail">Insert Admin Email:</label></td>
-       <td style="width: 70%;"><input type="text" class="TextBox" name="AdminEmail" size="20" id="AdminEmail" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="AdminPassword">Insert Admin Password:</label></td>
-       <td style="width: 50%;"><input type="password" name="AdminPasswords" class="TextBox" id="AdminPassword" size="20" maxlength="30" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="ReaPassword">ReInsert Admin Password:</label></td>
-       <td style="width: 50%;"><input type="password" class="TextBox" name="ReaPassword" size="20" id="ReaPassword" maxlength="30" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="BoardURL">Insert The Board URL:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="BoardURL" size="20" id="BoardURL" value="<?php echo $prehost.$_SERVER['HTTP_HOST'].$this_dir; ?>" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="WebURL">Insert The WebSite URL:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="WebURL" size="20" id="WebURL" value="<?php echo $prehost.$_SERVER['HTTP_HOST']."/"; ?>" /></td>
-</tr><?php if($_POST['DatabaseType']=="mysql"||$_POST['DatabaseType']=="mysqli") { ?><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="sqlcollate">MySQL Collate:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="sqlcollate" id="sqlcollate">
-       <?php if($_POST['charset']=="ISO-8859-1"||$_POST['charset']=="ISO-8859-15") { ?>
-       <option value="latin1_general_ci">Latin1 Case-Insensitive</option>
-       <option value="latin1_general_cs">Latin1 Case-Sensitive</option>
-       <option value="latin1_bin">Latin1 Binary</option>
-       <option value="ascii_generel_ci">ASCII Case-Insensitive</option>
-       <option value="ascii_bin">ASICC Binary</option>
-       <?php } if($_POST['charset']=="UTF-8") { ?>
-       <option value="utf8_unicode_ci">UTF-8 Unicode Case-Insensitive</option>
-       <option value="utf8_general_ci">UTF-8 General Case-Insensitive</option>
-       <option value="utf8_bin">UTF-8 Binary</option>
-       <option value="utf8mb4_unicode_ci">UTF-8 Multibyte Unicode Case-Insensitive</option>
-       <option value="utf8mb4_general_ci">UTF-8 Multibyte General Case-Insensitive</option>
-       <option value="utf8mb4_bin">UTF-8 Multibyte Binary</option>
-       <?php } ?>
-       </select></td>
-</tr><?php } ?><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" title="Can save some bandwidth." for="UseGzip">Enable HTTP Compression:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="GZip" id="UseGzip">
-       <option value="off">No</option>
-       <option value="on">Yes</option>
-       <option value="gzip">Only GZip</option>
-       <option value="deflate">Only Deflate</option>
-       </select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLType">HTML Type to use:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="HTMLType" id="HTMLType">
-       <!--<option value="xhtml10">XHTML 1.0</option>-->
-       <!--<option value="xhtml11">XHTML 1.1</option>-->
-       <option value="html5">HTML 5</option>
-       <option value="xhtml5">XHTML 5</option>
-       </select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="OutPutType">Output file as:</label></td>
-       <td style="width: 50%;"><select size="1" class="TextBox" name="OutPutType" id="OutPutType">
-       <option value="html">HTML</option>
-       <option value="xhtml">XHTML</option>
-       </select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" title="Store userinfo as a cookie so you dont need to login again." for="storecookie">Store as cookie?</label></td>
-       <td style="width: 50%;"><select id="storecookie" name="storecookie" class="TextBox">
-<option value="true">Yes</option>
-<option value="false">No</option>
-</select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="usehashtype">Hash user passwords with?</label></td>
-       <td style="width: 50%;"><select id="usehashtype" name="usehashtype" class="TextBox">
-<?php // PHP 5 hash algorithms to functions :o 
-if(function_exists('hash')&&function_exists('hash_algos')) {
-if(in_array("md2",hash_algos())) { ?>
-<option value="md2">MD2</option>
-<?php } if(in_array("md4",hash_algos())) { ?>
-<option value="md4">MD4</option>
-<?php } if(in_array("md5",hash_algos())) { ?>
-<option value="md5">MD5</option>
-<?php } if(in_array("gost",hash_algos())) { ?>
-<option value="gost">GOST</option>
-<?php } if(in_array("joaat",hash_algos())) { ?>
-<option value="joaat">JOAAT</option>
-<?php } if(in_array("sha1",hash_algos())) { ?>
-<option value="sha1">SHA1</option>
-<?php } if(in_array("sha224",hash_algos())) { ?>
-<option value="sha224">SHA224</option>
-<?php } if(in_array("sha256",hash_algos())) { ?>
-<option value="sha256" selected="selected">SHA256</option>
-<?php } if(in_array("sha384",hash_algos())) { ?>
-<option value="sha384">SHA384</option>
-<?php } if(in_array("sha512",hash_algos())) { ?>
-<option value="sha512">SHA512</option>
-<?php } if(in_array("ripemd128",hash_algos())) { ?>
-<option value="ripemd128">RIPEMD128</option>
-<?php } if(in_array("ripemd160",hash_algos())) { ?>
-<option value="ripemd160">RIPEMD160</option>
-<?php } if(in_array("ripemd256",hash_algos())) { ?>
-<option value="ripemd256">RIPEMD256</option>
-<?php } if(in_array("ripemd320",hash_algos())) { ?>
-<option value="ripemd320">RIPEMD320</option>
-<?php } } 
-if(!function_exists('hash')&&!function_exists('hash_algos')) { ?>
-<option value="md5">MD5</option>
-<option value="sha1" selected="selected">SHA1</option>
-<?php } ?>
-</select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
-       <td style="width: 50%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
-<optgroup label="Africa">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['africa']); $i++) {
-    if(date_default_timezone_get()==$zonelist['africa'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['africa'][$i][1]."\">".str_replace("_", " ", $zonelist['africa'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="America">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['america']); $i++) {
-    if(date_default_timezone_get()==$zonelist['america'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['america'][$i][1]."\">".str_replace("_", " ", $zonelist['america'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Antarctica">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['antarctica']); $i++) {
-    if(date_default_timezone_get()==$zonelist['antarctica'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['antarctica'][$i][1]."\">".str_replace("_", " ", $zonelist['antarctica'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Asia">
-<?php
-for ($i=0; $i < count($zonelist['asia']); $i++) {
-    if(date_default_timezone_get()==$zonelist['asia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['asia'][$i][1]."\">".str_replace("_", " ", $zonelist['asia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Atlantic">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['atlantic']); $i++) {
-    if(date_default_timezone_get()==$zonelist['atlantic'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['atlantic'][$i][1]."\">".str_replace("_", " ", $zonelist['atlantic'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Australia">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['australia']); $i++) {
-    if(date_default_timezone_get()==$zonelist['australia'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['australia'][$i][1]."\">".str_replace("_", " ", $zonelist['australia'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Europe">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['europe']); $i++) {
-    if(date_default_timezone_get()==$zonelist['europe'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['europe'][$i][1]."\">".str_replace("_", " ", $zonelist['europe'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Indian">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['indian']); $i++) {
-    if(date_default_timezone_get()==$zonelist['indian'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['indian'][$i][1]."\">".str_replace("_", " ", $zonelist['indian'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Pacific">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['pacific']); $i++) {
-    if(date_default_timezone_get()==$zonelist['pacific'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['pacific'][$i][1]."\">".str_replace("_", " ", $zonelist['pacific'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-<optgroup label="Etcetera">
-<?php
-$optsel="";
-for ($i=0; $i < count($zonelist['etcetera']); $i++) {
-    if(date_default_timezone_get()==$zonelist['etcetera'][$i][1]) { $optsel = " selected=\"selected\""; }
-    echo "<option".$optsel." value=\"".$zonelist['etcetera'][$i][1]."\">".str_replace("_", " ", $zonelist['etcetera'][$i][0])."</option>\n"; 
-    $optsel=""; }
-?>
-</optgroup>
-</select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBTimeFormat">Insert time format string:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="iDBTimeFormat" size="20" id="iDBTimeFormat" value="<?php echo "g:i A"; ?>" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBDateFormat">Insert date format string:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="iDBDateFormat" size="20" id="iDBDateFormat" value="<?php echo "F j Y"; ?>" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="TestReferer">Test Referering URL:</label></td>
-       <td style="width: 50%;"><select id="TestReferer" name="TestReferer" class="TextBox">
-<option selected="selected" value="off">off</option>
-<option value="on">on</option>
-</select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBHTTPLogger">Log Every HTTP Requests:</label></td>
-       <td style="width: 50%;"><select id="iDBHTTPLogger" name="iDBHTTPLogger" class="TextBox">
-<option value="off">off</option>
-<option value="on">on</option>
-</select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="iDBLoggerFormat">Insert The Format for HTTP Logger:</label></td>
-       <td style="width: 50%;"><input type="text" class="TextBox" name="iDBLoggerFormat" size="20" id="iDBLoggerFormat" value="<?php echo "%h %l %u %t &quot;%r&quot; %&gt;s %b &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot;"; ?>" /></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="DefaultTheme">Default Theme</label></td>
-       <td style="width: 50%;"><select id="DefaultTheme" name="DefaultTheme" class="TextBox"><?php
-$skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
-if ($handle = opendir($skindir)) { $dirnum = null;
-   while (false !== ($file = readdir($handle))) {
-          $selected = null;
-          if ($dirnum==null) { $dirnum = 0; }
-          if (file_exists($skindir.$file."/info.php")) {
-                  if ($file != "." && $file != "..") {
-          include($skindir.$file."/info.php");
-          if($file=="iDB") { 
-       $themelist[$dirnum] =  "<option value=\"".$file."\" selected=\"selected\">".$ThemeInfo['ThemeName']."</option>"; }
-          if($file!="iDB") {
-          $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>"; }
-          ++$dirnum; } } }
-   closedir($handle); asort($themelist);
-   $themenum=count($themelist); $themei=0; 
-   while ($themei < $themenum) {
-   echo $themelist[$themei]."\n";
-   ++$themei; }
-} ?></select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" for="SQLThemes">Store Themes in SQL Database:</label></td>
-       <td style="width: 50%;"><select id="SQLThemes" name="SQLThemes" class="TextBox">
-<option selected="selected" value="off">off</option>
-<option value="on">on</option>
-</select></td>
-</tr><tr>
-       <td style="width: 50%;"><label class="TextBoxLabel" title="Might not work" for="unlink">Delete Installer?</label></td>
-       <td style="width: 50%;"><select id="unlink" name="unlink" class="TextBox">
-<option value="true">Yes</option>
-<option value="false">No</option>
-</select></td>
-</tr></table>
-<table style="text-align: left;">
-<tr style="text-align: left;">
-<td style="width: 100%;">
-<input type="hidden" name="charset" value="<?php echo $_POST['charset']; ?>" style="display: none;" />
-<input type="hidden" name="SetupType" value="install" style="display: none;" />
-<input type="hidden" name="DatabaseType" value="<?php echo $Settings['sqltype']; ?>" style="display: none;" />
-<input type="hidden" name="act" value="Part4" style="display: none;" />
-<input type="submit" class="Button" value="Install Board" name="Install_Board" />
-<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
-</td></tr></table>
-</form>
-</td>
-</tr>
-<?php } ?>
index 5744205..16c9b2f 100644 (file)
@@ -23,7 +23,7 @@ if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
 //$query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$Settings['sql_charset']." COLLATE ".$Settings['sql_collate'].";", array(null));
 //sql_query($query,$SQLStat);
 $parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
+if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host']) || $parsestr['host'] == "localhost") {
        $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
 "  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
diff --git a/setup/sql/cubrid.php.bak b/setup/sql/cubrid.php.bak
deleted file mode 100644 (file)
index 5b42852..0000000
+++ /dev/null
@@ -1,475 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: cubrid.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="cubrid.php"||$File3Name=="/cubrid.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-//$query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$Settings['sql_charset']." COLLATE ".$Settings['sql_collate'].";", array(null));
-//sql_query($query,$SQLStat);
-$parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
-       $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"OrderID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ShowCategory\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CategoryType\" VARCHAR(15) NOT NULL default '',\n".
-"  \"SubShowForums\" VARCHAR(5) NOT NULL default '',\n".
-"  \"InSubCategory\" INTEGER NOT NULL default '0',\n".
-"  \"PostCountView\" INTEGER NOT NULL default '0',\n".
-"  \"KarmaCountView\" INTEGER NOT NULL default '0',\n".
-"  \"Description\" STRING NOT NULL\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."categories\" (\"OrderID\", \"Name\", \"ShowCategory\", \"CategoryType\", \"SubShowForums\", \"InSubCategory\", \"PostCountView\", \"KarmaCountView\", \"Description\")\n". 
-"VALUES (1, 'A Test Category', 'yes', 'category', 'yes', 0, 0, 0, 'A test category that may be removed at any time.');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."catpermissions\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"CanViewCategory\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(1, 'Admin', 1, 'yes'),\n".
-"(2, 'Moderator', 1, 'yes'),\n".
-"(3, 'Member', 1, 'yes'),\n".
-"(4, 'Guest', 1, 'yes'),\n".
-"(5, 'Banned', 1, 'no'),\n".
-"(6, 'Validate', 1, 'yes');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."events\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"EventName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"EventText\" STRING NOT NULL,\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"TimeStampEnd\" INTEGER NOT NULL default '0',\n".
-"  \"EventMonth\" INTEGER NOT NULL default '0',\n".
-"  \"EventMonthEnd\" INTEGER NOT NULL default '0',\n".
-"  \"EventDay\" INTEGER NOT NULL default '0',\n".
-"  \"EventDayEnd\" INTEGER NOT NULL default '0',\n".
-"  \"EventYear\" INTEGER NOT NULL default '0',\n".
-"  \"EventYearEnd\" INTEGER NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."events\" (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
-"(-1, '".$iDB_Author."', 'iDB Install', 'This is the start date of your board. ^_^', %i, %i, %i, %i, %i, %i, %i, %i, '".$GuestLocalIP."');", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."forums\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"OrderID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ShowForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ForumType\" VARCHAR(15) NOT NULL default '',\n".
-"  \"InSubForum\" INTEGER NOT NULL default '0',\n".
-"  \"RedirectURL\" STRING NOT NULL,\n".
-"  \"Redirects\" INTEGER NOT NULL default '0',\n".
-"  \"NumViews\" INTEGER NOT NULL default '0',\n".
-"  \"Description\" STRING NOT NULL,\n".
-"  \"PostCountAdd\" VARCHAR(15) NOT NULL default '',\n".
-"  \"PostCountView\" INTEGER NOT NULL default '0',\n".
-"  \"KarmaCountView\" INTEGER NOT NULL default '0',\n".
-"  \"CanHaveTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"HotTopicPosts\" INTEGER NOT NULL default '0',\n".
-"  \"NumPosts\" INTEGER NOT NULL default '0',\n".
-"  \"NumTopics\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."forums\" (\"CategoryID\", \"OrderID\", \"Name\", \"ShowForum\", \"ForumType\", \"InSubForum\", \"RedirectURL\", \"Redirects\", \"NumViews\", \"Description\", \"PostCountAdd\", \"PostCountView\", \"KarmaCountView\", \"CanHaveTopics\", \"HotTopicPosts\", \"NumPosts\", \"NumTopics\") VALUES\n".
-"(1, 1, 'A Test Forum', 'yes', 'forum', 0, 'http://', 0, 0, 'A test forum that may be removed at any time.', 'off', 0, 0, 'yes', 15, 1, 1);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."groups\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '' UNIQUE,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"NamePrefix\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NameSuffix\" VARCHAR(150) NOT NULL default '',\n".
-"  \"CanViewBoard\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewOffLine\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditProfile\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanAddEvents\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanPM\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanSearch\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanModForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewIPAddress\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewUserAgent\" VARCHAR(5) NOT NULL default '',\n".
-"  \"FloodControl\" INTEGER NOT NULL default '0',\n".
-"  \"SearchFlood\" INTEGER NOT NULL default '0',\n".
-"  \"PromoteTo\" INTEGER NOT NULL default '0',\n".
-"  \"PromotePosts\" INTEGER NOT NULL default '0',\n".
-"  \"PromoteKarma\" INTEGER NOT NULL default '0',\n".
-"  \"HasModCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"HasAdminCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ViewDBInfo\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes'),\n".
-"('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no'),\n".
-"('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."levels\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '' UNIQUE,\n".
-"  \"PromoteTo\" INTEGER NOT NULL default '0',\n".
-"  \"PromotePosts\" INTEGER NOT NULL default '0',\n".
-"  \"PromoteKarma\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."levels\" (\"id\", \"Name\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\") VALUES\n".
-"(-1, 'Guest', 0, 0, 0),\n".
-"(1, 'Member', 0, 0, 0);", array(null));
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '' UNIQUE,\n".
-"  \"UserPassword\" VARCHAR(256) NOT NULL default '',\n".
-"  \"HashType\" VARCHAR(50) NOT NULL default '',\n".
-"  \"Email\" VARCHAR(256) NOT NULL default '' UNIQUE,\n".
-"  \"GroupID\" INTEGER NOT NULL default '0',\n".
-"  \"LevelID\" INTEGER NOT NULL default '0',\n".
-"  \"Validated\" VARCHAR(20) NOT NULL default '',\n".
-"  \"HiddenMember\" VARCHAR(20) NOT NULL default '',\n".
-"  \"WarnLevel\" INTEGER NOT NULL default '0',\n".
-"  \"Interests\" STRING NOT NULL default '',\n".
-"  \"Title\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Joined\" INTEGER NOT NULL default '0',\n".
-"  \"LastActive\" INTEGER NOT NULL default '0',\n".
-"  \"LastPostTime\" INTEGER NOT NULL default '0',\n".
-"  \"BanTime\" INTEGER NOT NULL default '0',\n".
-"  \"BirthDay\" INTEGER NOT NULL default '0',\n".
-"  \"BirthMonth\" INTEGER NOT NULL default '0',\n".
-"  \"BirthYear\" INTEGER NOT NULL default '0',\n".
-"  \"Signature\" STRING NOT NULL,\n".
-"  \"Notes\" STRING NOT NULL,\n".
-"  \"Avatar\" VARCHAR(150) NOT NULL default '',\n".
-"  \"AvatarSize\" VARCHAR(10) NOT NULL default '',\n".
-"  \"Website\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Gender\" VARCHAR(15) NOT NULL default '',\n".
-"  \"PostCount\" INTEGER NOT NULL default '0',\n".
-"  \"Karma\" INTEGER NOT NULL default '0',\n".
-"  \"KarmaUpdate\" INTEGER NOT NULL default '0',\n".
-"  \"RepliesPerPage\" INTEGER NOT NULL default '0',\n".
-"  \"TopicsPerPage\" INTEGER NOT NULL default '0',\n".
-"  \"MessagesPerPage\" INTEGER NOT NULL default '0',\n".
-"  \"TimeZone\" VARCHAR(256) NOT NULL default '0',\n".
-"  \"DateFormat\" VARCHAR(15) NOT NULL default '0',\n".
-"  \"TimeFormat\" VARCHAR(15) NOT NULL default '0',\n".
-"  \"UseTheme\" VARCHAR(32) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default '',\n".
-"  \"Salt\" VARCHAR(50) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"LevelID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
-"(-1, 'Guest', '%s', 'GuestPassword', '%s', 4, -1, 'no', 'yes', 0, 'Guest Account', 'Guest', %i, %i, '0', '0', '0', '0', '0', '', 'Your Notes', 'http://', '100x100', '%s', 'UnKnow', 1, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '".$GuestLocalIP."', '%s'),\n".
-"(1, '%s', '%s', '".$iDBHashType."', '%s', 1, 1, 'yes', 'no', 0, '%s', 'Admin', %i, %i, '0', '0', '0', '0', '0', '%s', 'Your Notes', '%s', '100x100', '%s', 'UnKnow', 0, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '%s', '%s');", array($GuestPassword,$GEmail,$YourDate,$YourDate,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$GSalt,$_POST['AdminUser'],$NewPassword,$_POST['AdminEmail'],$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$UserIP,$YourSalt));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."mempermissions\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"CanViewBoard\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewOffLine\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditProfile\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanAddEvents\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanPM\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanSearch\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanModForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewIPAddress\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewUserAgent\" VARCHAR(5) NOT NULL default '',\n".
-"  \"FloodControl\" INTEGER NOT NULL default '0',\n".
-"  \"SearchFlood\" INTEGER NOT NULL default '0',\n".
-"  \"HasModCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"HasAdminCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ViewDBInfo\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"(-1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group'),\n".
-"(1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
-//"(-1, 0, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 'no', 'no', 'no'),\n".
-//"(1, 0, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 'yes', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"DiscussionID\" INTEGER NOT NULL default '0',\n".
-"  \"SenderID\" INTEGER NOT NULL default '0',\n".
-"  \"ReciverID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageTitle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageText\" STRING NOT NULL,\n".
-"  \"Description\" STRING NOT NULL,\n".
-"  \"DateSend\" INTEGER NOT NULL default '0',\n".
-"  \"Read\" INTEGER NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"DiscussionID\", \"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
-"(0, -1, 1, '".$iDB_Author."', 'Welcome', 'Welcome to your new Internet Discussion Board! :)', 'Welcome %s', %i, 0, '".$GuestLocalIP."');", array($_POST['AdminUser'],$YourDate));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ForumID\" INTEGER NOT NULL default '0',\n".
-"  \"CanViewForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakePolls\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakeTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakeReplys\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakeReplysCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditTopicsCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditReplys\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditReplysCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteTopicsCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteReplys\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteReplysCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanCloseTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanPinTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanModForum\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
-"(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes'),\n".
-"(3, 'Member', 1, 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no'),\n".
-"(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
-"(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
-"(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."polls\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PollValues\" STRING NOT NULL,\n".
-"  \"Description\" STRING NOT NULL,\n".
-"  \"UsersVoted\" STRING NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"TopicID\" INTEGER NOT NULL default '0',\n".
-"  \"ForumID\" INTEGER NOT NULL default '0',\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"LastUpdate\" INTEGER NOT NULL default '0',\n".
-"  \"EditUser\" INTEGER NOT NULL default '0',\n".
-"  \"EditUserName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Post\" STRING NOT NULL,\n".
-"  \"Description\" STRING NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default '',\n".
-"  \"EditIP\" VARCHAR(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
-"(1, 1, 1, -1, '".$iDB_Author."', %i, %i, 1, '".$_POST['AdminUser']."', 'Welcome to your new Internet Discussion Board! :) ', 'Welcome %s', '".$GuestLocalIP."', '127.0.0.1');", array($YourDate,$YourEditDate,$_POST['AdminUser'])); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"Word\" STRING NOT NULL,\n".
-"  \"RestrictedUserName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"RestrictedTopicName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"RestrictedEventName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"RestrictedMessageName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CaseInsensitive\" VARCHAR(5) NOT NULL default '',\n".
-"  \"WholeWord\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
-"  \"session_id\" VARCHAR(250) NOT NULL default '' PRIMARY KEY,\n".
-"  \"session_data\" STRING NOT NULL,\n".
-"  \"serialized_data\" STRING NOT NULL,\n".
-"  \"user_agent\" STRING NOT NULL,\n".
-"  \"ip_address\" VARCHAR(64) NOT NULL default '',\n".
-"  \"expires\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"FileName\" STRING NOT NULL,\n".
-"  \"SmileName\" STRING NOT NULL,\n".
-"  \"SmileText\" STRING NOT NULL,\n".
-"  \"Directory\" STRING NOT NULL,\n".
-"  \"Display\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ReplaceCI\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes'),\n".
-"('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no'),\n".
-"('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no'),\n".
-"('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes'),\n".
-"('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no'),\n".
-"('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes'),\n".
-"('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes'),\n".
-"('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes'),\n".
-"('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes'),\n".
-"('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes'),\n".
-"('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes'),\n".
-"('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes'),\n".
-"('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes'),\n".
-"('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no'),\n".
-"('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no'),\n".
-"('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no'),\n".
-"('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes'),\n".
-"('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no'),\n".
-"('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes'),\n".
-"('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-/*
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"Post\" STRING NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."tagboard\" VALUES (1,-1,'".$iDB_Author."',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); 
-sql_query($query,$SQLStat);
-*/
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"Name\" VARCHAR(32) NOT NULL default '' UNIQUE,\n".
-"  \"ThemeName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeMaker\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeVersion\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeVersionType\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeSubVersion\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MakerURL\" VARCHAR(150) NOT NULL default '',\n".
-"  \"CopyRight\" VARCHAR(150) NOT NULL default '',\n".
-"  \"WrapperString\" STRING NOT NULL,\n".
-"  \"CSS\" STRING NOT NULL,\n".
-"  \"CSSType\" VARCHAR(150) NOT NULL default '',\n".
-"  \"FavIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TableStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MiniPageAltStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PreLogo\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Logo\" VARCHAR(150) NOT NULL default '',\n".
-"  \"LogoStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"SubLogo\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TopicIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedTopicIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"AnnouncementTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedPinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotPinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotPinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedPinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotPinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotPinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageRead\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageUnread\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Profile\" VARCHAR(150) NOT NULL default '',\n".
-"  \"WWW\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PM\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TopicLayout\" VARCHAR(150) NOT NULL default '',\n".
-"  \"AddReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"FastReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NewTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"QuoteReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"EditReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"DeleteReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Report\" VARCHAR(150) NOT NULL default '',\n".
-"  \"LineDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ButtonDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"LineDividerTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TitleDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ForumStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ForumIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"SubForumIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"RedirectIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TitleIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NavLinkIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NavLinkDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"StatsIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NoAvatar\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NoAvatarSize\" VARCHAR(150) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"PollID\" INTEGER NOT NULL default '0',\n".
-"  \"ForumID\" INTEGER NOT NULL default '0',\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"OldForumID\" INTEGER NOT NULL default '0',\n".
-"  \"OldCategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"LastUpdate\" INTEGER NOT NULL default '0',\n".
-"  \"TopicName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Description\" STRING NOT NULL,\n".
-"  \"NumReply\" INTEGER NOT NULL default '0',\n".
-"  \"NumViews\" INTEGER NOT NULL default '0',\n".
-"  \"Pinned\" INTEGER NOT NULL default '0',\n".
-"  \"Closed\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."topics\" (\"PollID\", \"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
-"(0, 1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
-"  \"id\" INTEGER AUTO_INCREMENT PRIMARY KEY,\n".
-"  \"FilterWord\" STRING NOT NULL,\n".
-"  \"Replacement\" STRING NOT NULL,\n".
-"  \"CaseInsensitive\" VARCHAR(5) NOT NULL default '',\n".
-"  \"WholeWord\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TablePreFix = $_POST['tableprefix'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array_map("add_prefix",$TableChCk);
-$tcount = count($TableChCk); $ti = 0;
-while ($ti < $tcount) {
-$OptimizeTea = sql_query(sql_pre_query("UPDATE STATISTICS ON \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
-++$ti; }
-?>
diff --git a/setup/sql/index.php.bak b/setup/sql/index.php.bak
deleted file mode 100644 (file)
index 59f1ba7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
index 7dd2491..b1a3f7a 100644 (file)
@@ -43,7 +43,7 @@ if($Settings['sql_storage_engine']=="Aria") {
 if($Settings['sql_storage_engine']=="MyISAM") {
        $SQLStorageEngine = "MyISAM"; }
 $parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
+if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host']) || $parsestr['host'] == "localhost") {
        $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
 $query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."categories\" (\n".
 "  \"id\" int(15) NOT NULL auto_increment,\n".
diff --git a/setup/sql/mysql.php.bak b/setup/sql/mysql.php.bak
deleted file mode 100644 (file)
index 83b1502..0000000
+++ /dev/null
@@ -1,520 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: mysql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="mysql.php"||$File3Name=="/mysql.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-$query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$Settings['sql_charset']." COLLATE ".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-if(isset($Settings['sql_storage_engine'])) {
-$result = sql_query(sql_pre_query("SHOW ENGINES;", array(null)),$SQLStat);
-$num = sql_num_rows($result);
-$i = 0; $SQLEngines = null;
-while ($i < $num) {
-$SQLEngines[$i] = sql_result($result,$i,"Engine");
-++$i; }
-if (!in_array($Settings['sql_storage_engine'], $SQLEngines)) {
-    $Settings['sql_storage_engine'] = "MyISAM"; } }
-if(!isset($Settings['sql_storage_engine'])) {
-       $Settings['sql_storage_engine'] = "MyISAM"; }
-// You can set this to MyISAM or Maria/Aria
-if($Settings['sql_storage_engine']=="CSV") {
-       $SQLStorageEngine = "CSV"; }
-if($Settings['sql_storage_engine']=="Maria") {
-       $SQLStorageEngine = "Maria"; }
-if($Settings['sql_storage_engine']=="Aria") {
-       $SQLStorageEngine = "Aria"; }
-if($Settings['sql_storage_engine']=="MyISAM") {
-       $SQLStorageEngine = "MyISAM"; }
-$parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
-       $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."categories\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"OrderID\" int(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ShowCategory\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CategoryType\" varchar(15) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"SubShowForums\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"InSubCategory\" int(15) NOT NULL default '0',\n".
-"  \"PostCountView\" int(15) NOT NULL default '0',\n".
-"  \"KarmaCountView\" int(15) NOT NULL default '0',\n".
-"  \"Description\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."categories\" (\"OrderID\", \"Name\", \"ShowCategory\", \"CategoryType\", \"SubShowForums\", \"InSubCategory\", \"PostCountView\", \"KarmaCountView\", \"Description\")\n". 
-"VALUES (1, 'A Test Category', 'yes', 'category', 'yes', 0, 0, 0, 'A test category that may be removed at any time.');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."catpermissions\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"PermissionID\" int(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CategoryID\" int(15) NOT NULL default '0',\n".
-"  \"CanViewCategory\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(1, 'Admin', 1, 'yes'),\n".
-"(2, 'Moderator', 1, 'yes'),\n".
-"(3, 'Member', 1, 'yes'),\n".
-"(4, 'Guest', 1, 'yes'),\n".
-"(5, 'Banned', 1, 'no'),\n".
-"(6, 'Validate', 1, 'yes');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."events\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"UserID\" int(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"EventName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"EventText\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"TimeStamp\" int(15) NOT NULL default '0',\n".
-"  \"TimeStampEnd\" int(15) NOT NULL default '0',\n".
-"  \"EventMonth\" int(5) NOT NULL default '0',\n".
-"  \"EventMonthEnd\" int(5) NOT NULL default '0',\n".
-"  \"EventDay\" int(5) NOT NULL default '0',\n".
-"  \"EventDayEnd\" int(5) NOT NULL default '0',\n".
-"  \"EventYear\" int(5) NOT NULL default '0',\n".
-"  \"EventYearEnd\" int(5) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."events\" (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
-"(-1, '".$iDB_Author."', 'iDB Install', 'This is the start date of your board. ^_^', %i, %i, %i, %i, %i, %i, %i, %i, '".$GuestLocalIP."');", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."forums\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"CategoryID\" int(15) NOT NULL default '0',\n".
-"  \"OrderID\" int(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ShowForum\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ForumType\" varchar(15) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"InSubForum\" int(15) NOT NULL default '0',\n".
-"  \"RedirectURL\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Redirects\" int(15) NOT NULL default '0',\n".
-"  \"NumViews\" int(15) NOT NULL default '0',\n".
-"  \"Description\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"PostCountAdd\" varchar(15) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PostCountView\" int(15) NOT NULL default '0',\n".
-"  \"KarmaCountView\" int(15) NOT NULL default '0',\n".
-"  \"CanHaveTopics\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HotTopicPosts\" int(15) NOT NULL default '0',\n".
-"  \"NumPosts\" int(15) NOT NULL default '0',\n".
-"  \"NumTopics\" int(15) NOT NULL default '0',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."forums\" (\"CategoryID\", \"OrderID\", \"Name\", \"ShowForum\", \"ForumType\", \"InSubForum\", \"RedirectURL\", \"Redirects\", \"NumViews\", \"Description\", \"PostCountAdd\", \"PostCountView\", \"KarmaCountView\", \"CanHaveTopics\", \"HotTopicPosts\", \"NumPosts\", \"NumTopics\") VALUES\n".
-"(1, 1, 'A Test Forum', 'yes', 'forum', 0, 'http://', 0, 0, 'A test forum that may be removed at any time.', 'off', 0, 0, 'yes', 15, 1, 1);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."groups\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PermissionID\" int(15) NOT NULL default '0',\n".
-"  \"NamePrefix\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"NameSuffix\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewBoard\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewOffLine\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanEditProfile\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanAddEvents\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanPM\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanSearch\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanExecPHP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDoHTML\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanUseBBTags\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanModForum\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewIPAddress\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewUserAgent\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"FloodControl\" int(5) NOT NULL default '0',\n".
-"  \"SearchFlood\" int(5) NOT NULL default '0',\n".
-"  \"PromoteTo\" int(15) NOT NULL default '0',\n".
-"  \"PromotePosts\" int(15) NOT NULL default '0',\n".
-"  \"PromoteKarma\" int(15) NOT NULL default '0',\n".
-"  \"HasModCP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HasAdminCP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ViewDBInfo\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\"),\n".
-"  UNIQUE KEY \"Name\" (\"Name\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes'),\n".
-"('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no'),\n".
-"('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."levels\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PromoteTo\" int(15) NOT NULL default '0',\n".
-"  \"PromotePosts\" int(15) NOT NULL default '0',\n".
-"  \"PromoteKarma\" int(15) NOT NULL default '0',\n".
-"  PRIMARY KEY  (\"id\"),\n".
-"  UNIQUE KEY \"Name\" (\"Name\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."levels\" (\"id\", \"Name\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\") VALUES\n".
-"(-1, 'Guest', 0, 0, 0),\n".
-"(1, 'Member', 0, 0, 0);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."members\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"UserPassword\" varchar(256) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HashType\" varchar(50) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Email\" varchar(256) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"GroupID\" int(15) NOT NULL default '0',\n".
-"  \"LevelID\" int(15) NOT NULL default '0',\n".
-"  \"Validated\" varchar(20) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HiddenMember\" varchar(20) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"WarnLevel\" int(15) NOT NULL default '0',\n".
-"  \"Interests\" text COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Title\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Joined\" int(15) NOT NULL default '0',\n".
-"  \"LastActive\" int(15) NOT NULL default '0',\n".
-"  \"LastPostTime\" int(15) NOT NULL default '0',\n".
-"  \"BanTime\" int(15) NOT NULL default '0',\n".
-"  \"BirthDay\" int(5) NOT NULL default '0',\n".
-"  \"BirthMonth\" int(5) NOT NULL default '0',\n".
-"  \"BirthYear\" int(5) NOT NULL default '0',\n".
-"  \"Signature\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Notes\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Avatar\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"AvatarSize\" varchar(10) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Website\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Gender\" varchar(15) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PostCount\" int(15) NOT NULL default '0',\n".
-"  \"Karma\" int(15) NOT NULL default '0',\n".
-"  \"KarmaUpdate\" int(15) NOT NULL default '0',\n".
-"  \"RepliesPerPage\" int(5) NOT NULL default '0',\n".
-"  \"TopicsPerPage\" int(5) NOT NULL default '0',\n".
-"  \"MessagesPerPage\" int(5) NOT NULL default '0',\n".
-"  \"TimeZone\" varchar(256) COLLATE ".$Settings['sql_collate']." NOT NULL default '0',\n".
-"  \"DateFormat\" varchar(15) COLLATE ".$Settings['sql_collate']." NOT NULL default '0',\n".
-"  \"TimeFormat\" varchar(15) COLLATE ".$Settings['sql_collate']." NOT NULL default '0',\n".
-"  \"UseTheme\" varchar(32) COLLATE ".$Settings['sql_collate']." NOT NULL default '0',\n".
-"  \"IP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Salt\" varchar(50) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\"),\n".
-"  UNIQUE KEY \"Name\" (\"Name\"),\n".
-"  UNIQUE KEY \"Email\" (\"Email\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"LevelID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
-"(-1, 'Guest', '%s', 'GuestPassword', '%s', 4, -1, 'no', 'yes', 0, 'Guest Account', 'Guest', %i, %i, '0', '0', '0', '0', '0', '', 'Your Notes', 'http://', '100x100', '%s', 'UnKnow', 1, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '".$GuestLocalIP."', '%s'),\n".
-"(1, '%s', '%s', '".$iDBHashType."', '%s', 1, 1, 'yes', 'no', 0, '%s', 'Admin', %i, %i, '0', '0', '0', '0', '0', '%s', 'Your Notes', '%s', '100x100', '%s', 'UnKnow', 0, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '%s', '%s');", array($GuestPassword,$GEmail,$YourDate,$YourDate,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$GSalt,$_POST['AdminUser'],$NewPassword,$_POST['AdminEmail'],$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$UserIP,$YourSalt));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."mempermissions\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"PermissionID\" int(15) NOT NULL default '0',\n".
-"  \"CanViewBoard\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewOffLine\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanEditProfile\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanAddEvents\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanPM\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanSearch\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanExecPHP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDoHTML\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanUseBBTags\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanModForum\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewIPAddress\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanViewUserAgent\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"FloodControl\" int(5) NOT NULL default '0',\n".
-"  \"SearchFlood\" int(5) NOT NULL default '0',\n".
-"  \"HasModCP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HasAdminCP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ViewDBInfo\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"(-1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group'),\n".
-"(1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
-//"(-1, 0, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 'no', 'no', 'no'),\n".
-//"(1, 0, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 'yes', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."messenger\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"DiscussionID\" int(15) NOT NULL default '0',\n".
-"  \"SenderID\" int(15) NOT NULL default '0',\n".
-"  \"ReciverID\" int(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MessageTitle\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MessageText\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Description\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"DateSend\" int(15) NOT NULL default '0',\n".
-"  \"Read\" int(5) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"DiscussionID\", \"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
-"(0, -1, 1, '".$iDB_Author."', 'Welcome', 'Welcome to your new Internet Discussion Board! :)', 'Welcome %s', %i, 0, '".$GuestLocalIP."');", array($_POST['AdminUser'],$YourDate));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."permissions\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"PermissionID\" int(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ForumID\" int(15) NOT NULL default '0',\n".
-"  \"CanViewForum\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanMakePolls\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanMakeTopics\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanMakeReplys\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanMakeReplysCT\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanEditTopics\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanEditTopicsCT\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanEditReplys\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanEditReplysCT\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDeleteTopics\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDeleteTopicsCT\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDeleteReplys\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDeleteReplysCT\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanCloseTopics\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanPinTopics\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanExecPHP\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanDoHTML\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanUseBBTags\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CanModForum\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
-"(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes'),\n".
-"(3, 'Member', 1, 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no'),\n".
-"(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
-"(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
-"(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."polls\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"UserID\" int(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PollValues\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Description\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"UsersVoted\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"IP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."posts\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"TopicID\" int(15) NOT NULL default '0',\n".
-"  \"ForumID\" int(15) NOT NULL default '0',\n".
-"  \"CategoryID\" int(15) NOT NULL default '0',\n".
-"  \"UserID\" int(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TimeStamp\" int(15) NOT NULL default '0',\n".
-"  \"LastUpdate\" int(15) NOT NULL default '0',\n".
-"  \"EditUser\" int(15) NOT NULL default '0',\n".
-"  \"EditUserName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Post\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Description\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"IP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"EditIP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
-"(1, 1, 1, -1, '".$iDB_Author."', %i, %i, 1, '".$_POST['AdminUser']."', 'Welcome to your new Internet Discussion Board! :) ', 'Welcome %s', '".$GuestLocalIP."', '127.0.0.1');", array($YourDate,$YourEditDate,$_POST['AdminUser'])); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."restrictedwords\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"Word\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"RestrictedUserName\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"RestrictedTopicName\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"RestrictedEventName\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"RestrictedMessageName\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CaseInsensitive\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"WholeWord\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."sessions\" (\n".
-"  \"session_id\" VARCHAR(250) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"session_data\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"serialized_data\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"user_agent\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"ip_address\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"expires\" int(15) NOT NULL default '0',\n".
-"  PRIMARY KEY  (\"session_id\")\n".
-") ENGINE=".$SQLStorageEngine." DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."smileys\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"FileName\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"SmileName\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"SmileText\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Directory\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Display\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ReplaceCI\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes'),\n".
-"('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no'),\n".
-"('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no'),\n".
-"('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes'),\n".
-"('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no'),\n".
-"('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes'),\n".
-"('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes'),\n".
-"('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes'),\n".
-"('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes'),\n".
-"('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes'),\n".
-"('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes'),\n".
-"('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes'),\n".
-"('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes'),\n".
-"('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no'),\n".
-"('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no'),\n".
-"('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no'),\n".
-"('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes'),\n".
-"('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no'),\n".
-"('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes'),\n".
-"('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-/*
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."tagboard\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"UserID\" int(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TimeStamp\" int(15) NOT NULL default '0',\n".
-"  \"Post\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"IP\" varchar(64) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."tagboard\" VALUES (1,-1,'".$iDB_Author."',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); 
-sql_query($query,$SQLStat);
-*/
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."themes\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"Name\" varchar(32) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ThemeName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ThemeMaker\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ThemeVersion\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ThemeVersionType\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ThemeSubVersion\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MakerURL\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"CopyRight\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"WrapperString\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"CSS\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"CSSType\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"FavIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TableStyle\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MiniPageAltStyle\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PreLogo\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Logo\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"LogoStyle\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"SubLogo\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TopicIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedTopicIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HotTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedHotTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PinTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"AnnouncementTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedPinTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HotPinTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedHotPinTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HotClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedHotClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PinClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedPinClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"HotPinClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MovedHotPinClosedTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MessageRead\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"MessageUnread\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Profile\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"WWW\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"PM\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TopicLayout\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"AddReply\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"FastReply\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"NewTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"QuoteReply\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"EditReply\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"DeleteReply\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Report\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"LineDivider\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ButtonDivider\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"LineDividerTopic\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TitleDivider\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ForumStyle\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"ForumIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"SubForumIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"RedirectIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TitleIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"NavLinkIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"NavLinkDivider\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"StatsIcon\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"NoAvatar\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"NoAvatarSize\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\"),\n".
-"  UNIQUE KEY \"Name\" (\"Name\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."topics\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"PollID\" int(15) NOT NULL default '0',\n".
-"  \"ForumID\" int(15) NOT NULL default '0',\n".
-"  \"CategoryID\" int(15) NOT NULL default '0',\n".
-"  \"OldForumID\" int(15) NOT NULL default '0',\n".
-"  \"OldCategoryID\" int(15) NOT NULL default '0',\n".
-"  \"UserID\" int(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"TimeStamp\" int(15) NOT NULL default '0',\n".
-"  \"LastUpdate\" int(15) NOT NULL default '0',\n".
-"  \"TopicName\" varchar(150) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"Description\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"NumReply\" int(15) NOT NULL default '0',\n".
-"  \"NumViews\" int(15) NOT NULL default '0',\n".
-"  \"Pinned\" int(5) NOT NULL default '0',\n".
-"  \"Closed\" int(5) NOT NULL default '0',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."topics\" (\"PollID\", \"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
-"(0, 1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE IF NOT EXISTS \"".$_POST['tableprefix']."wordfilter\" (\n".
-"  \"id\" int(15) NOT NULL auto_increment,\n".
-"  \"FilterWord\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"Replacement\" text COLLATE ".$Settings['sql_collate']." NOT NULL,\n".
-"  \"CaseInsensitive\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  \"WholeWord\" varchar(5) COLLATE ".$Settings['sql_collate']." NOT NULL default '',\n".
-"  PRIMARY KEY  (\"id\")\n".
-") ENGINE=".$SQLStorageEngine."  DEFAULT CHARSET=".$Settings['sql_charset']." COLLATE=".$Settings['sql_collate'].";", array(null));
-sql_query($query,$SQLStat);
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TablePreFix = $_POST['tableprefix'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array_map("add_prefix",$TableChCk);
-$tcount = count($TableChCk); $ti = 0;
-while ($ti < $tcount) {
-$OptimizeTea = sql_query(sql_pre_query("OPTIMIZE TABLE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
-++$ti; }
-?>
index dad1b6e..5e60067 100644 (file)
@@ -25,7 +25,7 @@ $query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHAR
 sql_query($query,$SQLStat);
 */
 $parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
+if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host']) || $parsestr['host'] == "localhost") {
        $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
 "  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
diff --git a/setup/sql/pgsql.php.bak b/setup/sql/pgsql.php.bak
deleted file mode 100644 (file)
index 0ad164d..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: pgsql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="pgsql.php"||$File3Name=="/pgsql.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-/*
-$query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$SQLCharset." COLLATE ".$SQLCollate.";", array(null));
-sql_query($query,$SQLStat);
-*/
-$parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
-       $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"OrderID\" numeric(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"ShowCategory\" varchar(5) NOT NULL default '',\n".
-"  \"CategoryType\" varchar(15) NOT NULL default '',\n".
-"  \"SubShowForums\" varchar(5) NOT NULL default '',\n".
-"  \"InSubCategory\" numeric(15) NOT NULL default '0',\n".
-"  \"PostCountView\" numeric(15) NOT NULL default '0',\n".
-"  \"KarmaCountView\" numeric(15) NOT NULL default '0',\n".
-"  \"Description\" text NOT NULL\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."categories\" (\"OrderID\", \"Name\", \"ShowCategory\", \"CategoryType\", \"SubShowForums\", \"InSubCategory\", \"PostCountView\", \"KarmaCountView\", \"Description\")\n". 
-"VALUES (1, 'A Test Category', 'yes', 'category', 'yes', 0, 0, 0, 'A test category that may be removed at any time.');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."catpermissions\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
-"  \"CanViewCategory\" varchar(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(1, 'Admin', 1, 'yes'),\n".
-"(2, 'Moderator', 1, 'yes'),\n".
-"(3, 'Member', 1, 'yes'),\n".
-"(4, 'Guest', 1, 'yes'),\n".
-"(5, 'Banned', 1, 'no'),\n".
-"(6, 'Validate', 1, 'yes');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."events\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"UserID\" numeric(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) NOT NULL default '',\n".
-"  \"EventName\" varchar(150) NOT NULL default '',\n".
-"  \"EventText\" text NOT NULL,\n".
-"  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
-"  \"TimeStampEnd\" numeric(15) NOT NULL default '0',\n".
-"  \"EventMonth\" numeric(5) NOT NULL default '0',\n".
-"  \"EventMonthEnd\" numeric(5) NOT NULL default '0',\n".
-"  \"EventDay\" numeric(5) NOT NULL default '0',\n".
-"  \"EventDayEnd\" numeric(5) NOT NULL default '0',\n".
-"  \"EventYear\" numeric(5) NOT NULL default '0',\n".
-"  \"EventYearEnd\" numeric(5) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."events\" (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
-"(-1, '".$iDB_Author."', 'iDB Install', 'This is the start date of your board. ^_^', %i, %i, %i, %i, %i, %i, %i, %i, '".$GuestLocalIP."');", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."forums\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
-"  \"OrderID\" numeric(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"ShowForum\" varchar(5) NOT NULL default '',\n".
-"  \"ForumType\" varchar(15) NOT NULL default '',\n".
-"  \"InSubForum\" numeric(15) NOT NULL default '0',\n".
-"  \"RedirectURL\" text NOT NULL,\n".
-"  \"Redirects\" numeric(15) NOT NULL default '0',\n".
-"  \"NumViews\" numeric(15) NOT NULL default '0',\n".
-"  \"Description\" text NOT NULL,\n".
-"  \"PostCountAdd\" varchar(15) NOT NULL default '',\n".
-"  \"PostCountView\" numeric(15) NOT NULL default '0',\n".
-"  \"KarmaCountView\" numeric(15) NOT NULL default '0',\n".
-"  \"CanHaveTopics\" varchar(5) NOT NULL default '',\n".
-"  \"HotTopicPosts\" numeric(15) NOT NULL default '0',\n".
-"  \"NumPosts\" numeric(15) NOT NULL default '0',\n".
-"  \"NumTopics\" numeric(15) NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."forums\" (\"CategoryID\", \"OrderID\", \"Name\", \"ShowForum\", \"ForumType\", \"InSubForum\", \"RedirectURL\", \"Redirects\", \"NumViews\", \"Description\", \"PostCountAdd\", \"PostCountView\", \"KarmaCountView\", \"CanHaveTopics\", \"HotTopicPosts\", \"NumPosts\", \"NumTopics\") VALUES\n".
-"(1, 1, 'A Test Forum', 'yes', 'forum', 0, 'http://', 0, 0, 'A test forum that may be removed at any time.', 'off', 0, 0, 'yes', 15, 1, 1);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."groups\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
-"  \"NamePrefix\" varchar(150) NOT NULL default '',\n".
-"  \"NameSuffix\" varchar(150) NOT NULL default '',\n".
-"  \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
-"  \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
-"  \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
-"  \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
-"  \"CanPM\" varchar(5) NOT NULL default '',\n".
-"  \"CanSearch\" varchar(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" varchar(5) NOT NULL default '',\n".
-"  \"CanModForum\" varchar(5) NOT NULL default '',\n".
-"  \"CanViewIPAddress\" varchar(5) NOT NULL default '',\n".
-"  \"CanViewUserAgent\" varchar(5) NOT NULL default '',\n".
-"  \"FloodControl\" numeric(5) NOT NULL default '0',\n".
-"  \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
-"  \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
-"  \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
-"  \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
-"  \"HasModCP\" varchar(5) NOT NULL default '',\n".
-"  \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
-"  \"ViewDBInfo\" varchar(5) NOT NULL default '',\n".
-"  UNIQUE (\"Name\")\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes'),\n".
-"('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no'),\n".
-"('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no'),\n".
-"('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."levels\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"PromoteTo\" numeric(15) NOT NULL default '0',\n".
-"  \"PromotePosts\" numeric(15) NOT NULL default '0',\n".
-"  \"PromoteKarma\" numeric(15) NOT NULL default '0',\n".
-"  UNIQUE (\"Name\")\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."levels\" (\"id\", \"Name\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\") VALUES\n".
-"(-1, 'Guest', 0, 0, 0),\n".
-"(1, 'Member', 0, 0, 0);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"UserPassword\" varchar(256) NOT NULL default '',\n".
-"  \"HashType\" varchar(50) NOT NULL default '',\n".
-"  \"Email\" varchar(256) NOT NULL default '',\n".
-"  \"GroupID\" numeric(15) NOT NULL default '0',\n".
-"  \"LevelID\" numeric(15) NOT NULL default '0',\n".
-"  \"Validated\" varchar(20) NOT NULL default '',\n".
-"  \"HiddenMember\" varchar(20) NOT NULL default '',\n".
-"  \"WarnLevel\" numeric(15) NOT NULL default '0',\n".
-"  \"Interests\" text NOT NULL default '',\n".
-"  \"Title\" varchar(150) NOT NULL default '',\n".
-"  \"Joined\" numeric(15) NOT NULL default '0',\n".
-"  \"LastActive\" numeric(15) NOT NULL default '0',\n".
-"  \"LastPostTime\" numeric(15) NOT NULL default '0',\n".
-"  \"BanTime\" numeric(15) NOT NULL default '0',\n".
-"  \"BirthDay\" numeric(5) NOT NULL default '0',\n".
-"  \"BirthMonth\" numeric(5) NOT NULL default '0',\n".
-"  \"BirthYear\" numeric(5) NOT NULL default '0',\n".
-"  \"Signature\" text NOT NULL,\n".
-"  \"Notes\" text NOT NULL,\n".
-"  \"Avatar\" varchar(150) NOT NULL default '',\n".
-"  \"AvatarSize\" varchar(10) NOT NULL default '',\n".
-"  \"Website\" varchar(150) NOT NULL default '',\n".
-"  \"Gender\" varchar(15) NOT NULL default '',\n".
-"  \"PostCount\" numeric(15) NOT NULL default '0',\n".
-"  \"Karma\" numeric(15) NOT NULL default '0',\n".
-"  \"KarmaUpdate\" numeric(15) NOT NULL default '0',\n".
-"  \"RepliesPerPage\" numeric(5) NOT NULL default '0',\n".
-"  \"TopicsPerPage\" numeric(5) NOT NULL default '0',\n".
-"  \"MessagesPerPage\" numeric(5) NOT NULL default '0',\n".
-"  \"TimeZone\" varchar(256) NOT NULL default '0',\n".
-"  \"DateFormat\" VARCHAR(15) NOT NULL default '0',\n".
-"  \"TimeFormat\" VARCHAR(15) NOT NULL default '0',\n".
-"  \"UseTheme\" varchar(32) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default '',\n".
-"  \"Salt\" varchar(50) NOT NULL default '',\n".
-"  UNIQUE (\"Name\"),\n".
-"  UNIQUE (\"Email\")\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"LevelID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
-"(-1, 'Guest', '%s', 'GuestPassword', '%s', 4, -1, 'no', 'yes', 0, 'Guest Account', 'Guest', %i, %i, '0', '0', '0', '0', '0', '', 'Your Notes', 'http://', '100x100', '%s', 'UnKnow', 1, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '".$GuestLocalIP."', '%s'),\n".
-"(1, '%s', '%s', '".$iDBHashType."', '%s', 1, 1, 'yes', 'no', 0, '%s', 'Admin', %i, %i, '0', '0', '0', '0', '0', '%s', 'Your Notes', '%s', '100x100', '%s', 'UnKnow', 0, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '%s', '%s');", array($GuestPassword,$GEmail,$YourDate,$YourDate,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$GSalt,$_POST['AdminUser'],$NewPassword,$_POST['AdminEmail'],$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$UserIP,$YourSalt));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."mempermissions\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
-"  \"CanViewBoard\" varchar(5) NOT NULL default '',\n".
-"  \"CanViewOffLine\" varchar(5) NOT NULL default '',\n".
-"  \"CanEditProfile\" varchar(5) NOT NULL default '',\n".
-"  \"CanAddEvents\" varchar(5) NOT NULL default '',\n".
-"  \"CanPM\" varchar(5) NOT NULL default '',\n".
-"  \"CanSearch\" varchar(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" varchar(5) NOT NULL default '',\n".
-"  \"CanModForum\" varchar(5) NOT NULL default '',\n".
-"  \"CanViewIPAddress\" varchar(5) NOT NULL default '',\n".
-"  \"CanViewUserAgent\" varchar(5) NOT NULL default '',\n".
-"  \"FloodControl\" numeric(5) NOT NULL default '0',\n".
-"  \"SearchFlood\" numeric(5) NOT NULL default '0',\n".
-"  \"HasModCP\" varchar(5) NOT NULL default '',\n".
-"  \"HasAdminCP\" varchar(5) NOT NULL default '',\n".
-"  \"ViewDBInfo\" varchar(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"(-1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group'),\n".
-"(1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
-//"(-1, 0, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 'no', 'no', 'no'),\n".
-//"(1, 0, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 'yes', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"DiscussionID\" numeric(15) NOT NULL default '0',\n".
-"  \"SenderID\" numeric(15) NOT NULL default '0',\n".
-"  \"ReciverID\" numeric(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) NOT NULL default '',\n".
-"  \"MessageTitle\" varchar(150) NOT NULL default '',\n".
-"  \"MessageText\" text NOT NULL,\n".
-"  \"Description\" text NOT NULL,\n".
-"  \"DateSend\" numeric(15) NOT NULL default '0',\n".
-"  \"Read\" numeric(5) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"DiscussionID\", \"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
-"(0, -1, 1, '".$iDB_Author."', 'Welcome', 'Welcome to your new Internet Discussion Board! :)', 'Welcome %s', %i, 0, '".$GuestLocalIP."');", array($_POST['AdminUser'],$YourDate));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"PermissionID\" numeric(15) NOT NULL default '0',\n".
-"  \"Name\" varchar(150) NOT NULL default '',\n".
-"  \"ForumID\" numeric(15) NOT NULL default '0',\n".
-"  \"CanViewForum\" varchar(5) NOT NULL default '',\n".
-"  \"CanMakePolls\" varchar(5) NOT NULL default '',\n".
-"  \"CanMakeTopics\" varchar(5) NOT NULL default '',\n".
-"  \"CanMakeReplys\" varchar(5) NOT NULL default '',\n".
-"  \"CanMakeReplysCT\" varchar(5) NOT NULL default '',\n".
-"  \"CanEditTopics\" varchar(5) NOT NULL default '',\n".
-"  \"CanEditTopicsCT\" varchar(5) NOT NULL default '',\n".
-"  \"CanEditReplys\" varchar(5) NOT NULL default '',\n".
-"  \"CanEditReplysCT\" varchar(5) NOT NULL default '',\n".
-"  \"CanDeleteTopics\" varchar(5) NOT NULL default '',\n".
-"  \"CanDeleteTopicsCT\" varchar(5) NOT NULL default '',\n".
-"  \"CanDeleteReplys\" varchar(5) NOT NULL default '',\n".
-"  \"CanDeleteReplysCT\" varchar(5) NOT NULL default '',\n".
-"  \"CanCloseTopics\" varchar(5) NOT NULL default '',\n".
-"  \"CanPinTopics\" varchar(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" varchar(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" varchar(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" varchar(5) NOT NULL default '',\n".
-"  \"CanModForum\" varchar(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),\n".
-"(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes'),\n".
-"(3, 'Member', 1, 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no'),\n".
-"(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
-"(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),\n".
-"(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."polls\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"UserID\" numeric(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) NOT NULL default '',\n".
-"  \"PollValues\" text NOT NULL,\n".
-"  \"Description\" text NOT NULL,\n".
-"  \"UsersVoted\" text NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"TopicID\" numeric(15) NOT NULL default '0',\n".
-"  \"ForumID\" numeric(15) NOT NULL default '0',\n".
-"  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
-"  \"UserID\" numeric(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) NOT NULL default '',\n".
-"  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
-"  \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
-"  \"EditUser\" numeric(15) NOT NULL default '0',\n".
-"  \"EditUserName\" varchar(150) NOT NULL default '',\n".
-"  \"Post\" text NOT NULL,\n".
-"  \"Description\" text NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default '',\n".
-"  \"EditIP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
-"(1, 1, 1, -1, '".$iDB_Author."', %i, %i, 1, '".$_POST['AdminUser']."', 'Welcome to your new Internet Discussion Board! :) ', 'Welcome %s', '".$GuestLocalIP."', '127.0.0.1');", array($YourDate,$YourEditDate,$_POST['AdminUser'])); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"Word\" text NOT NULL,\n".
-"  \"RestrictedUserName\" varchar(5) NOT NULL default '',\n".
-"  \"RestrictedTopicName\" varchar(5) NOT NULL default '',\n".
-"  \"RestrictedEventName\" varchar(5) NOT NULL default '',\n".
-"  \"RestrictedMessageName\" varchar(5) NOT NULL default '',\n".
-"  \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
-"  \"WholeWord\" varchar(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
-"  \"session_id\" VARCHAR(250) PRIMARY KEY NOT NULL default '',\n".
-"  \"session_data\" text NOT NULL,\n".
-"  \"serialized_data\" text NOT NULL,\n".
-"  \"user_agent\" text NOT NULL,\n".
-"  \"ip_address\" varchar(64) NOT NULL default '',\n".
-"  \"expires\" numeric(15) NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"FileName\" text NOT NULL,\n".
-"  \"SmileName\" text NOT NULL,\n".
-"  \"SmileText\" text NOT NULL,\n".
-"  \"Directory\" text NOT NULL,\n".
-"  \"Display\" varchar(5) NOT NULL default '',\n".
-"  \"ReplaceCI\" varchar(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes'),\n".
-"('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no'),\n".
-"('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no'),\n".
-"('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes'),\n".
-"('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no'),\n".
-"('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes'),\n".
-"('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes'),\n".
-"('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes'),\n".
-"('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes'),\n".
-"('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes'),\n".
-"('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes'),\n".
-"('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes'),\n".
-"('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes'),\n".
-"('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no'),\n".
-"('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no'),\n".
-"('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no'),\n".
-"('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes'),\n".
-"('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no'),\n".
-"('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes'),\n".
-"('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-/*
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"UserID\" numeric(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) NOT NULL default '',\n".
-"  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
-"  \"Post\" text NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default ''
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."tagboard\" VALUES (1,-1,'".$iDB_Author."',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); 
-sql_query($query,$SQLStat);
-*/
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"Name\" varchar(32) NOT NULL default '',\n".
-"  \"ThemeName\" varchar(32) NOT NULL default '',\n".
-"  \"ThemeMaker\" varchar(150) NOT NULL default '',\n".
-"  \"ThemeVersion\" varchar(150) NOT NULL default '',\n".
-"  \"ThemeVersionType\" varchar(150) NOT NULL default '',\n".
-"  \"ThemeSubVersion\" varchar(150) NOT NULL default '',\n".
-"  \"MakerURL\" varchar(150) NOT NULL default '',\n".
-"  \"CopyRight\" varchar(150) NOT NULL default '',\n".
-"  \"WrapperString\" text NOT NULL,\n".
-"  \"CSS\" text NOT NULL,\n".
-"  \"CSSType\" varchar(150) NOT NULL default '',\n".
-"  \"FavIcon\" varchar(150) NOT NULL default '',\n".
-"  \"TableStyle\" varchar(150) NOT NULL default '',\n".
-"  \"MiniPageAltStyle\" varchar(150) NOT NULL default '',\n".
-"  \"PreLogo\" varchar(150) NOT NULL default '',\n".
-"  \"Logo\" varchar(150) NOT NULL default '',\n".
-"  \"LogoStyle\" varchar(150) NOT NULL default '',\n".
-"  \"SubLogo\" varchar(150) NOT NULL default '',\n".
-"  \"TopicIcon\" varchar(150) NOT NULL default '',\n".
-"  \"MovedTopicIcon\" varchar(150) NOT NULL default '',\n".
-"  \"HotTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedHotTopic\" varchar(150) NOT NULL default '',\n".
-"  \"PinTopic\" varchar(150) NOT NULL default '',\n".
-"  \"AnnouncementTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedPinTopic\" varchar(150) NOT NULL default '',\n".
-"  \"HotPinTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedHotPinTopic\" varchar(150) NOT NULL default '',\n".
-"  \"ClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"HotClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedHotClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"PinClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedPinClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"HotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MovedHotPinClosedTopic\" varchar(150) NOT NULL default '',\n".
-"  \"MessageRead\" varchar(150) NOT NULL default '',\n".
-"  \"MessageUnread\" varchar(150) NOT NULL default '',\n".
-"  \"Profile\" varchar(150) NOT NULL default '',\n".
-"  \"WWW\" varchar(150) NOT NULL default '',\n".
-"  \"PM\" varchar(150) NOT NULL default '',\n".
-"  \"TopicLayout\" varchar(150) NOT NULL default '',\n".
-"  \"AddReply\" varchar(150) NOT NULL default '',\n".
-"  \"FastReply\" varchar(150) NOT NULL default '',\n".
-"  \"NewTopic\" varchar(150) NOT NULL default '',\n".
-"  \"QuoteReply\" varchar(150) NOT NULL default '',\n".
-"  \"EditReply\" varchar(150) NOT NULL default '',\n".
-"  \"DeleteReply\" varchar(150) NOT NULL default '',\n".
-"  \"Report\" varchar(150) NOT NULL default '',\n".
-"  \"LineDivider\" varchar(150) NOT NULL default '',\n".
-"  \"ButtonDivider\" varchar(150) NOT NULL default '',\n".
-"  \"LineDividerTopic\" varchar(150) NOT NULL default '',\n".
-"  \"TitleDivider\" varchar(150) NOT NULL default '',\n".
-"  \"ForumStyle\" varchar(150) NOT NULL default '',\n".
-"  \"ForumIcon\" varchar(150) NOT NULL default '',\n".
-"  \"SubForumIcon\" varchar(150) NOT NULL default '',\n".
-"  \"RedirectIcon\" varchar(150) NOT NULL default '',\n".
-"  \"TitleIcon\" varchar(150) NOT NULL default '',\n".
-"  \"NavLinkIcon\" varchar(150) NOT NULL default '',\n".
-"  \"NavLinkDivider\" varchar(150) NOT NULL default '',\n".
-"  \"StatsIcon\" varchar(150) NOT NULL default '',\n".
-"  \"NoAvatar\" varchar(150) NOT NULL default '',\n".
-"  \"NoAvatarSize\" varchar(150) NOT NULL default '',\n".
-"  UNIQUE (\"Name\")\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"PollID\" numeric(15) NOT NULL default '0',\n".
-"  \"ForumID\" numeric(15) NOT NULL default '0',\n".
-"  \"CategoryID\" numeric(15) NOT NULL default '0',\n".
-"  \"OldForumID\" numeric(15) NOT NULL default '0',\n".
-"  \"OldCategoryID\" numeric(15) NOT NULL default '0',\n".
-"  \"UserID\" numeric(15) NOT NULL default '0',\n".
-"  \"GuestName\" varchar(150) NOT NULL default '',\n".
-"  \"TimeStamp\" numeric(15) NOT NULL default '0',\n".
-"  \"LastUpdate\" numeric(15) NOT NULL default '0',\n".
-"  \"TopicName\" varchar(150) NOT NULL default '',\n".
-"  \"Description\" text NOT NULL,\n".
-"  \"NumReply\" numeric(15) NOT NULL default '0',\n".
-"  \"NumViews\" numeric(15) NOT NULL default '0',\n".
-"  \"Pinned\" numeric(5) NOT NULL default '0',\n".
-"  \"Closed\" numeric(5) NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."topics\" (\"PollID\", \"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
-"(0, 1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
-"  \"id\" SERIAL PRIMARY KEY NOT NULL,\n".
-"  \"FilterWord\" text NOT NULL,\n".
-"  \"Replacement\" text NOT NULL,\n".
-"  \"CaseInsensitive\" varchar(5) NOT NULL default '',\n".
-"  \"WholeWord\" varchar(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "levels", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TablePreFix = $_POST['tableprefix'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array_map("add_prefix",$TableChCk);
-$tcount = count($TableChCk); $ti = 0;
-while ($ti < $tcount) {
-$OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
-++$ti; }
-?>
index 15b6552..b698db0 100644 (file)
@@ -25,7 +25,7 @@ $query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHAR
 sql_query($query,$SQLStat);
 */
 $parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
+if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host']) || $parsestr['host'] == "localhost") {
        $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
 $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
 "  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
diff --git a/setup/sql/sqlite.php.bak b/setup/sql/sqlite.php.bak
deleted file mode 100644 (file)
index 52024a2..0000000
+++ /dev/null
@@ -1,543 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-    iDB Installer made by Game Maker 2k - http://idb.berlios.net/
-
-    $FileInfo: sqlite.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="sqlite.php"||$File3Name=="/sqlite.php") {
-       require('index.php');
-       exit(); }
-if(!isset($SetupDir['setup'])) { $SetupDir['setup'] = "setup/"; }
-if(!isset($SetupDir['convert'])) { $SetupDir['convert'] = "setup/convert/"; }
-/*
-$query=sql_pre_query("ALTER DATABASE \"".$_POST['DatabaseName']."\" DEFAULT CHARACTER SET ".$SQLCharset." COLLATE ".$SQLCollate.";", array(null));
-sql_query($query,$SQLStat);
-*/
-$parsestr = parse_url($YourWebsite);
-if (preg_match("^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$", $parsestr['host'])) {
-       $GuestLocalIP = gethostbyname($parsestr['host']); } else { $GuestLocalIP = $parsestr['host']; }
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."categories\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"OrderID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ShowCategory\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CategoryType\" VARCHAR(15) NOT NULL default '',\n".
-"  \"SubShowForums\" VARCHAR(5) NOT NULL default '',\n".
-"  \"InSubCategory\" INTEGER NOT NULL default '0',\n".
-"  \"PostCountView\" INTEGER NOT NULL default '0',\n".
-"  \"KarmaCountView\" INTEGER NOT NULL default '0',\n".
-"  \"Description\" TEXT NOT NULL\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."categories\" (\"OrderID\", \"Name\", \"ShowCategory\", \"CategoryType\", \"SubShowForums\", \"InSubCategory\", \"PostCountView\", \"KarmaCountView\", \"Description\")\n". 
-"VALUES (1, 'A Test Category', 'yes', 'category', 'yes', 0, 0, 0, 'A test category that may be removed at any time.')", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."catpermissions\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"CanViewCategory\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(1, 'Admin', 1, 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(2, 'Moderator', 1, 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(3, 'Member', 1, 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(4, 'Guest', 1, 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(5, 'Banned', 1, 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."catpermissions\" (\"PermissionID\", \"Name\", \"CategoryID\", \"CanViewCategory\") VALUES\n".
-"(6, 'Validate', 1, 'yes');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."events\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"EventName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"EventText\" TEXT NOT NULL,\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"TimeStampEnd\" INTEGER NOT NULL default '0',\n".
-"  \"EventMonth\" INTEGER NOT NULL default '0',\n".
-"  \"EventMonthEnd\" INTEGER NOT NULL default '0',\n".
-"  \"EventDay\" INTEGER NOT NULL default '0',\n".
-"  \"EventDayEnd\" INTEGER NOT NULL default '0',\n".
-"  \"EventYear\" INTEGER NOT NULL default '0',\n".
-"  \"EventYearEnd\" INTEGER NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."events\" (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
-"(-1, '".$iDB_Author."', 'iDB Install', 'This is the start date of your board. ^_^', %i, %i, %i, %i, %i, %i, %i, %i, '".$GuestLocalIP."');", array($YourDate,$YourDateEnd,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."forums\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"OrderID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ShowForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ForumType\" VARCHAR(15) NOT NULL default '',\n".
-"  \"InSubForum\" INTEGER NOT NULL default '0',\n".
-"  \"RedirectURL\" TEXT NOT NULL,\n".
-"  \"Redirects\" INTEGER NOT NULL default '0',\n".
-"  \"NumViews\" INTEGER NOT NULL default '0',\n".
-"  \"Description\" TEXT NOT NULL,\n".
-"  \"PostCountAdd\" VARCHAR(15) NOT NULL default '',\n".
-"  \"PostCountView\" INTEGER NOT NULL default '0',\n".
-"  \"KarmaCountView\" INTEGER NOT NULL default '0',\n".
-"  \"CanHaveTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"HotTopicPosts\" INTEGER NOT NULL default '0',\n".
-"  \"NumPosts\" INTEGER NOT NULL default '0',\n".
-"  \"NumTopics\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."forums\" (\"CategoryID\", \"OrderID\", \"Name\", \"ShowForum\", \"ForumType\", \"InSubForum\", \"RedirectURL\", \"Redirects\", \"NumViews\", \"Description\", \"PostCountAdd\", \"PostCountView\", \"KarmaCountView\", \"CanHaveTopics\", \"HotTopicPosts\", \"NumPosts\", \"NumTopics\") VALUES\n".
-"(1, 1, 'A Test Forum', 'yes', 'forum', 0, 'http://', 0, 0, 'A test forum that may be removed at any time.', 'off', 0, 0, 'yes', 15, 1, 1);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."groups\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"Name\" VARCHAR(150) UNIQUE NOT NULL default '',\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"NamePrefix\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NameSuffix\" VARCHAR(150) NOT NULL default '',\n".
-"  \"CanViewBoard\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewOffLine\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditProfile\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanAddEvents\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanPM\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanSearch\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanModForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewIPAddress\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewUserAgent\" VARCHAR(5) NOT NULL default '',\n".
-"  \"FloodControl\" INTEGER NOT NULL default '0',\n".
-"  \"SearchFlood\" INTEGER NOT NULL default '0',\n".
-"  \"PromoteTo\" INTEGER NOT NULL default '0',\n".
-"  \"PromotePosts\" INTEGER NOT NULL default '0',\n".
-"  \"PromoteKarma\" INTEGER NOT NULL default '0',\n".
-"  \"HasModCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"HasAdminCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ViewDBInfo\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Admin', 1, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Moderator', 2, '', '', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 30, 30, 0, 0, 0, 'yes', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Member', 3, '', '', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Guest', 4, '', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Banned', 5, '', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."groups\" (\"Name\", \"PermissionID\", \"NamePrefix\", \"NameSuffix\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"('Validate', 6, '', '', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 'yes', 'no', 'no', 30, 30, 0, 0, 0, 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."levels\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"Name\" VARCHAR(150) UNIQUE NOT NULL default '',\n".
-"  \"PromoteTo\" INTEGER NOT NULL default '0',\n".
-"  \"PromotePosts\" INTEGER NOT NULL default '0',\n".
-"  \"PromoteKarma\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."levels\" (\"id\", \"Name\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\") VALUES\n".
-"(-1, 'Guest', 0, 0, 0);", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."levels\" (\"id\", \"Name\", \"PromoteTo\", \"PromotePosts\", \"PromoteKarma\") VALUES\n".
-"(1, 'Member', 0, 0, 0);", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."members\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"Name\" VARCHAR(150) UNIQUE NOT NULL default '',\n".
-"  \"UserPassword\" VARCHAR(256) NOT NULL default '',\n".
-"  \"HashType\" VARCHAR(50) NOT NULL default '',\n".
-"  \"Email\" VARCHAR(256) UNIQUE NOT NULL default '',\n".
-"  \"GroupID\" INTEGER NOT NULL default '0',\n".
-"  \"LevelID\" INTEGER NOT NULL default '0',\n".
-"  \"Validated\" VARCHAR(20) NOT NULL default '',\n".
-"  \"HiddenMember\" VARCHAR(20) NOT NULL default '',\n".
-"  \"WarnLevel\" INTEGER NOT NULL default '0',\n".
-"  \"Interests\" TEXT NOT NULL default '',\n".
-"  \"Title\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Joined\" INTEGER NOT NULL default '0',\n".
-"  \"LastActive\" INTEGER NOT NULL default '0',\n".
-"  \"LastPostTime\" INTEGER NOT NULL default '0',\n".
-"  \"BanTime\" INTEGER NOT NULL default '0',\n".
-"  \"BirthDay\" INTEGER NOT NULL default '0',\n".
-"  \"BirthMonth\" INTEGER NOT NULL default '0',\n".
-"  \"BirthYear\" INTEGER NOT NULL default '0',\n".
-"  \"Signature\" TEXT NOT NULL,\n".
-"  \"Notes\" TEXT NOT NULL,\n".
-"  \"Avatar\" VARCHAR(150) NOT NULL default '',\n".
-"  \"AvatarSize\" VARCHAR(10) NOT NULL default '',\n".
-"  \"Website\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Gender\" VARCHAR(15) NOT NULL default '',\n".
-"  \"PostCount\" INTEGER NOT NULL default '0',\n".
-"  \"Karma\" INTEGER NOT NULL default '0',\n".
-"  \"KarmaUpdate\" INTEGER NOT NULL default '0',\n".
-"  \"RepliesPerPage\" INTEGER NOT NULL default '0',\n".
-"  \"TopicsPerPage\" INTEGER NOT NULL default '0',\n".
-"  \"MessagesPerPage\" INTEGER NOT NULL default '0',\n".
-"  \"TimeZone\" VARCHAR(256) NOT NULL default '0',\n".
-"  \"DateFormat\" VARCHAR(15) NOT NULL default '0',\n".
-"  \"TimeFormat\" VARCHAR(15) NOT NULL default '0',\n".
-"  \"UseTheme\" VARCHAR(32) NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default '',\n".
-"  \"Salt\" VARCHAR(50) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"LevelID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
-"(-1, 'Guest', '%s', 'GuestPassword', '%s', 4, -1, 'no', 'yes', 0, 'Guest Account', 'Guest', %i, %i, '0', '0', '0', '0', '0', '', 'Your Notes', 'http://', '100x100', '%s', 'UnKnow', 1, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '".$GuestLocalIP."', '%s');", array($GuestPassword,$GEmail,$YourDate,$YourDate,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$GSalt));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."members\" (\"id\", \"Name\", \"UserPassword\", \"HashType\", \"Email\", \"GroupID\", \"Validated\", \"HiddenMember\", \"WarnLevel\", \"Interests\", \"Title\", \"Joined\", \"LastActive\", \"LastPostTime\", \"BanTime\", \"BirthDay\", \"BirthMonth\", \"BirthYear\", \"Signature\", \"Notes\", \"Avatar\", \"AvatarSize\", \"Website\", \"Gender\", \"PostCount\", \"Karma\", \"KarmaUpdate\", \"RepliesPerPage\", \"TopicsPerPage\", \"MessagesPerPage\", \"TimeZone\", \"DateFormat\", \"TimeFormat\", \"UseTheme\", \"IP\", \"Salt\") VALUES\n".
-"(1, '%s', '%s', '".$iDBHashType."', '%s', 1, 1, 'yes', 'no', 0, '%s', 'Admin', %i, %i, '0', '0', '0', '0', '0', '%s', 'Your Notes', '%s', '100x100', '%s', 'UnKnow', 0, 0, 0, 10, 10, 10, '%s', '%s', '%s', '%s', '%s', '%s');", array($_POST['AdminUser'],$NewPassword,$_POST['AdminEmail'],$Interests,$YourDate,$YourDate,$NewSignature,$Avatar,$YourWebsite,$_POST['YourOffSet'],$_POST['iDBDateFormat'],$_POST['iDBTimeFormat'],$_POST['DefaultTheme'],$UserIP,$YourSalt));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."mempermissions\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"CanViewBoard\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewOffLine\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditProfile\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanAddEvents\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanPM\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanSearch\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanModForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewIPAddress\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanViewUserAgent\" VARCHAR(5) NOT NULL default '',\n".
-"  \"FloodControl\" INTEGER NOT NULL default '0',\n".
-"  \"SearchFlood\" INTEGER NOT NULL default '0',\n".
-"  \"HasModCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"HasAdminCP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ViewDBInfo\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"(-1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
-//"(-1, 0, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 30, 30, 'no', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."mempermissions\" (\"id\", \"PermissionID\", \"CanViewBoard\", \"CanViewOffLine\", \"CanEditProfile\", \"CanAddEvents\", \"CanPM\", \"CanSearch\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\", \"CanViewIPAddress\", \"CanViewUserAgent\", \"FloodControl\", \"SearchFlood\", \"HasModCP\", \"HasAdminCP\", \"ViewDBInfo\") VALUES\n".
-"(1, 0, 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', 'group', -1, -1, 'group', 'group', 'group');", array(null));
-//"(1, 0, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 30, 30, 'yes', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."messenger\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"DiscussionID\" INTEGER NOT NULL default '0',\n".
-"  \"SenderID\" INTEGER NOT NULL default '0',\n".
-"  \"ReciverID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageTitle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageText\" TEXT NOT NULL,\n".
-"  \"Description\" TEXT NOT NULL,\n".
-"  \"DateSend\" INTEGER NOT NULL default '0',\n".
-"  \"Read\" INTEGER NOT NULL default '0',\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."messenger\" (\"DiscussionID\", \"SenderID\", \"ReciverID\", \"GuestName\", \"MessageTitle\", \"MessageText\", \"Description\", \"DateSend\", \"Read\", \"IP\") VALUES\n".
-"(0, -1, 1, '".$iDB_Author."', 'Welcome', 'Welcome to your new Internet Discussion Board! :)', 'Welcome %s', %i, 0, '".$GuestLocalIP."');", array($_POST['AdminUser'],$YourDate));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."permissions\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"PermissionID\" INTEGER NOT NULL default '0',\n".
-"  \"Name\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ForumID\" INTEGER NOT NULL default '0',\n".
-"  \"CanViewForum\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakePolls\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakeTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakeReplys\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanMakeReplysCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditTopicsCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditReplys\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanEditReplysCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteTopicsCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteReplys\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDeleteReplysCT\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanCloseTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanPinTopics\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanExecPHP\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanDoHTML\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanUseBBTags\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CanModForum\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(1, 'Admin', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(2, 'Moderator', 1, 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(3, 'Member', 1, 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(4, 'Guest', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(5, 'Banned', 1, 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."permissions\" (\"PermissionID\", \"Name\", \"ForumID\", \"CanViewForum\", \"CanMakePolls\", \"CanMakeTopics\", \"CanMakeReplys\", \"CanMakeReplysCT\", \"CanEditTopics\", \"CanEditTopicsCT\", \"CanEditReplys\", \"CanEditReplysCT\", \"CanDeleteTopics\", \"CanDeleteTopicsCT\", \"CanDeleteReplys\", \"CanDeleteReplysCT\", \"CanCloseTopics\", \"CanPinTopics\", \"CanExecPHP\", \"CanDoHTML\", \"CanUseBBTags\", \"CanModForum\") VALUES\n".
-"(6, 'Validate', 1, 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no');", array(null)); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."polls\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PollValues\" TEXT NOT NULL,\n".
-"  \"Description\" TEXT NOT NULL,\n".
-"  \"UsersVoted\" TEXT NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."posts\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"TopicID\" INTEGER NOT NULL default '0',\n".
-"  \"ForumID\" INTEGER NOT NULL default '0',\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"LastUpdate\" INTEGER NOT NULL default '0',\n".
-"  \"EditUser\" INTEGER NOT NULL default '0',\n".
-"  \"EditUserName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Post\" TEXT NOT NULL,\n".
-"  \"Description\" TEXT NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default '',\n".
-"  \"EditIP\" VARCHAR(64) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
-"(1, 1, 1, -1, '".$iDB_Author."', %i, %i, 1, '".$_POST['AdminUser']."', 'Welcome to your new Internet Discussion Board! :) ', 'Welcome %s', '".$GuestLocalIP."', '127.0.0.1');", array($YourDate,$YourEditDate,$_POST['AdminUser'])); 
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."restrictedwords\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"Word\" TEXT NOT NULL,\n".
-"  \"RestrictedUserName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"RestrictedTopicName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"RestrictedEventName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"RestrictedMessageName\" VARCHAR(5) NOT NULL default '',\n".
-"  \"CaseInsensitive\" VARCHAR(5) NOT NULL default '',\n".
-"  \"WholeWord\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."sessions\" (\n".
-"  \"session_id\" VARCHAR(250) PRIMARY KEY NOT NULL default '',\n".
-"  \"session_data\" TEXT NOT NULL,\n".
-"  \"serialized_data\" TEXT NOT NULL,\n".
-"  \"user_agent\" TEXT NOT NULL,\n".
-"  \"ip_address\" VARCHAR(64) NOT NULL default '',\n".
-"  \"expires\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."smileys\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"FileName\" TEXT NOT NULL,\n".
-"  \"SmileName\" TEXT NOT NULL,\n".
-"  \"SmileText\" TEXT NOT NULL,\n".
-"  \"Directory\" TEXT NOT NULL,\n".
-"  \"Display\" VARCHAR(5) NOT NULL default '',\n".
-"  \"ReplaceCI\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('angry.png', 'Angry', ':angry:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('closedeyes.png', 'Sleep', 'v_v', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('cool.png', 'Cool', 'B)', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('glare.png', 'Hmph', ':hmph:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('happy.png', 'Happy', '^_^', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('hmm.png', 'Hmm', ':unsure:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('huh.png', 'Huh', ':huh:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('laugh.png', 'lol', ':laugh:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('lol.png', 'lol', ':lol:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('mad.png', 'Mad', ':mad:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('ninja.png', 'Ninja', ':ninja:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('ohno.png', 'ohno', ':ohno:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('ohmy.png', 'ohmy', ':o', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('sad.png', 'Sad', ':(', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('sleep.png', 'Sleep', '-_-', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('smile.png', 'Happy', ':)', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('sweat.png', 'Sweat', ':sweat:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('tongue.png', 'Tongue', ':P', 'smileys/', 'yes', 'no');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('wub.png', 'Wub', ':wub:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."smileys\" (\"FileName\", \"SmileName\", \"SmileText\", \"Directory\", \"Display\", \"ReplaceCI\") VALUES\n".
-"('x.png', 'X', ':x:', 'smileys/', 'yes', 'yes');", array(null));
-sql_query($query,$SQLStat);
-/*
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."tagboard\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"Post\" TEXT NOT NULL,\n".
-"  \"IP\" varchar(64) NOT NULL default ''
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."tagboard\" VALUES (1,-1,'".$iDB_Author."',".$YourDate.",'Welcome to Your New Tag Board. ^_^','127.0.0.1'), array(null)); 
-sql_query($query,$SQLStat);
-*/
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."themes\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"Name\" VARCHAR(32) UNIQUE NOT NULL default '',\n".
-"  \"ThemeName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeMaker\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeVersion\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeVersionType\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ThemeSubVersion\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MakerURL\" VARCHAR(150) NOT NULL default '',\n".
-"  \"CopyRight\" VARCHAR(150) NOT NULL default '',\n".
-"  \"WrapperString\" TEXT NOT NULL default '',\n".
-"  \"CSS\" TEXT NOT NULL,\n".
-"  \"CSSType\" VARCHAR(150) NOT NULL default '',\n".
-"  \"FavIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TableStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MiniPageAltStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PreLogo\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Logo\" VARCHAR(150) NOT NULL default '',\n".
-"  \"LogoStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"SubLogo\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TopicIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedTopicIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"AnnouncementTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedPinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotPinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotPinTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedPinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"HotPinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MovedHotPinClosedTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageRead\" VARCHAR(150) NOT NULL default '',\n".
-"  \"MessageUnread\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Profile\" VARCHAR(150) NOT NULL default '',\n".
-"  \"WWW\" VARCHAR(150) NOT NULL default '',\n".
-"  \"PM\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TopicLayout\" VARCHAR(150) NOT NULL default '',\n".
-"  \"AddReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"FastReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NewTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"QuoteReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"EditReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"DeleteReply\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Report\" VARCHAR(150) NOT NULL default '',\n".
-"  \"LineDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ButtonDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"LineDividerTopic\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TitleDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ForumStyle\" VARCHAR(150) NOT NULL default '',\n".
-"  \"ForumIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"SubForumIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"RedirectIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TitleIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NavLinkIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NavLinkDivider\" VARCHAR(150) NOT NULL default '',\n".
-"  \"StatsIcon\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NoAvatar\" VARCHAR(150) NOT NULL default '',\n".
-"  \"NoAvatarSize\" VARCHAR(150) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."topics\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"PollID\" INTEGER NOT NULL default '0',\n".
-"  \"ForumID\" INTEGER NOT NULL default '0',\n".
-"  \"CategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"OldForumID\" INTEGER NOT NULL default '0',\n".
-"  \"OldCategoryID\" INTEGER NOT NULL default '0',\n".
-"  \"UserID\" INTEGER NOT NULL default '0',\n".
-"  \"GuestName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"TimeStamp\" INTEGER NOT NULL default '0',\n".
-"  \"LastUpdate\" INTEGER NOT NULL default '0',\n".
-"  \"TopicName\" VARCHAR(150) NOT NULL default '',\n".
-"  \"Description\" TEXT NOT NULL,\n".
-"  \"NumReply\" INTEGER NOT NULL default '0',\n".
-"  \"NumViews\" INTEGER NOT NULL default '0',\n".
-"  \"Pinned\" INTEGER NOT NULL default '0',\n".
-"  \"Closed\" INTEGER NOT NULL default '0'\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$query = sql_pre_query("INSERT INTO \"".$_POST['tableprefix']."topics\" (\"PollID\", \"ForumID\", \"CategoryID\", \"OldForumID\", \"OldCategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"TopicName\", \"Description\", \"NumReply\", \"NumViews\", \"Pinned\", \"Closed\") VALUES\n".
-"(0, 1, 1, 1, 1, -1, '".$iDB_Author."', %i, %i, 'Welcome', 'Welcome %s', 0, 0, 1, 1);", array($YourDate,$YourDate,$_POST['AdminUser']));
-sql_query($query,$SQLStat);
-$query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
-"  \"id\" INTEGER PRIMARY KEY NOT NULL,\n".
-"  \"FilterWord\" TEXT NOT NULL,\n".
-"  \"Replacement\" TEXT NOT NULL,\n".
-"  \"CaseInsensitive\" VARCHAR(5) NOT NULL default '',\n".
-"  \"WholeWord\" VARCHAR(5) NOT NULL default ''\n".
-");", array(null));
-sql_query($query,$SQLStat);
-$OptimizeTea = sql_query(sql_pre_query("VACUUM", array(null)),$SQLStat);
-?>
diff --git a/sql.php.bak b/sql.php.bak
deleted file mode 100644 (file)
index e5e469b..0000000
+++ /dev/null
@@ -1,757 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: sql.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-/* Some ini setting changes uncomment if you need them. 
-   Display PHP Errors */
-$disfunc = @ini_get("disable_functions");
-$disfunc = @trim($disfunc);
-$disfunc = @preg_replace("/([\\s+|\\t+|\\n+|\\r+|\\0+|\\x0B+])/i", "", $disfunc);
-if($disfunc!="ini_set") { $disfunc = explode(",",$disfunc); }
-if($disfunc=="ini_set") { $disfunc = array("ini_set"); }
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("html_errors", false);
-@ini_set("track_errors", false);
-@ini_set("display_errors", false);
-@ini_set("report_memleaks", false);
-@ini_set("display_startup_errors", false);
-//@ini_set("error_log","logs/error.log"); 
-//@ini_set("log_errors","On"); 
-@ini_set("docref_ext", "");
-@ini_set("docref_root", "http://php.net/"); }
-if(!defined("E_DEPRECATED")) { define("E_DEPRECATED", 0); }
-@error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
-/* Get rid of session id in urls */
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("default_mimetype","text/html"); 
-@ini_set("zlib.output_compression", false);
-@ini_set("zlib.output_compression_level", -1);
-@ini_set("session.use_trans_sid", false);
-@ini_set("session.use_cookies", true);
-@ini_set("session.use_only_cookies", true);
-@ini_set("url_rewriter.tags",""); 
-@ini_set('zend.ze1_compatibility_mode', 0);
-@ini_set("ignore_user_abort", 1); }
-@set_time_limit(30); @ignore_user_abort(true);
-/* Change session garbage collection settings */
-if(!in_array("ini_set", $disfunc)) {
-@ini_set("session.gc_probability", 1);
-@ini_set("session.gc_divisor", 100);
-@ini_set("session.gc_maxlifetime", 1440);
-/* Change session hash type here */
-@ini_set("session.hash_function", 1);
-@ini_set("session.hash_bits_per_character", 6); }
-/* Do not change anything below this line unless you know what you are doing */
-$File3Name = basename($_SERVER['SCRIPT_NAME']);
-if ($File3Name=="sql.php"||$File3Name=="/sql.php") {
-       header('Location: index.php');
-       exit(); }
-if(file_exists('settings.php')) {
-       require_once('settings.php'); 
-       if(file_exists('extrasettings.php')) {
-               require_once('extrasettings.php'); }
-       if(file_exists('extendsettings.php')) {
-               require_once('extendsettings.php'); }
-if(!in_array("ini_set", $disfunc)&&$Settings['qstr']!="/"&&$Settings['qstr']!="&") {
-ini_set("arg_separator.output",htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']));
-ini_set("arg_separator.input",$Settings['qstr']); } }
-if(!isset($Settings['idburl'])) { $Settings['idburl'] = null; }
-if(isset($Settings['BoardUUID'])) { $Settings['BoardUUID'] = base64_decode($Settings['BoardUUID']); 
-header("Board-Unique-ID: ".$Settings['BoardUUID']); }
-if(!isset($Settings['fixbasedir'])) { $Settings['fixbasedir'] = null; }
-if(!isset($Settings['fixpathinfo'])) { $Settings['fixpathinfo'] = null; }
-if(!isset($Settings['fixcookiedir'])) { $Settings['fixcookiedir'] = null; }
-if(!isset($Settings['fixredirectdir'])) { $Settings['fixcookiedir'] = null; }
-if(!isset($Settings['idb_time_format'])) { $Settings['idb_time_format'] = "g:i A"; }
-if(!isset($Settings['idb_date_format'])) { $Settings['idb_date_format'] = "F j Y"; }
-if(!isset($Settings['showverinfo'])) { 
-       $Settings['showverinfo'] = "on"; }
-if(!isset($Settings['sqldb'])) {
-header("Content-Type: text/plain; charset=UTF-8");
-header('Location: install.php'); }
-if(!isset($Settings['fixpathinfo'])) {
-       $Settings['fixpathinfo'] = "off"; }
-if($Settings['fixpathinfo']=="off") {
-       $Settings['fixpathinfo'] = null; }
-if(!isset($Settings['fixbasedir'])) {
-       $Settings['fixbasedir'] = "off"; }
-if($Settings['fixbasedir']=="off") {
-       $Settings['fixbasedir'] = null; }
-if(!isset($Settings['fixcookiedir'])) {
-       $Settings['fixcookiedir'] = "off"; }
-if($Settings['fixcookiedir']=="off") {
-       $Settings['fixcookiedir'] = null; }
-if(!isset($Settings['fixredirectdir'])) {
-       $Settings['fixredirectdir'] = "off"; }
-if($Settings['fixredirectdir']=="off") {
-       $Settings['fixredirectdir'] = null; }
-$OldSettings['fixpathinfo'] = $Settings['fixpathinfo'];
-$OldSettings['fixbasedir'] = $Settings['fixbasedir'];
-$OldSettings['fixcookiedir'] = $Settings['fixcookiedir'];
-$OldSettings['fixredirectdir'] = $Settings['fixredirectdir'];
-if($Settings['idburl']=="localhost") { 
-header("Content-Type: text/plain; charset=UTF-8");
-echo "500 Error: URL is malformed. Try reinstalling iDB."; die(); }
-if($Settings['fixbasedir']=="on") {
-if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
-$PathsTest = parse_url($Settings['idburl']);
-$Settings['fixbasedir'] = $PathsTest['path']."/"; 
-$Settings['fixbasedir'] = str_replace("//", "/", $Settings['fixbasedir']); } }
-if($Settings['fixcookiedir']=="on") {
-if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
-$PathsTest = parse_url($Settings['idburl']);
-$Settings['fixcookiedir'] = $PathsTest['path']."/"; 
-$Settings['fixcookiedir'] = str_replace("//", "/", $Settings['fixcookiedir']); } }
-if($Settings['fixredirectdir']=="on") {
-if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
-$PathsTest = parse_url($Settings['idburl']);
-$Settings['fixredirectdir'] = $PathsTest['path']."/"; 
-$Settings['fixredirectdir'] = str_replace("//", "/", $Settings['fixredirectdir']); } }
-if(!isset($Settings['charset'])) {
-       $Settings['charset'] = "ISO-8859-15"; }
-if(isset($Settings['charset'])) {
-if($Settings['charset']!="ISO-8859-15"&&$Settings['charset']!="ISO-8859-1"&&
-       $Settings['charset']!="UTF-8"&&$Settings['charset']!="CP866"&&
-       $Settings['charset']!="Windows-1251"&&$Settings['charset']!="Windows-1252"&&
-       $Settings['charset']!="KOI8-R"&&$Settings['charset']!="BIG5"&&
-       $Settings['charset']!="GB2312"&&$Settings['charset']!="BIG5-HKSCS"&&
-       $Settings['charset']!="Shift_JIS"&&$Settings['charset']!="EUC-JP") {
-       $Settings['charset'] = "ISO-8859-15"; } }
-       $chkcharset = $Settings['charset'];
-if(!in_array("ini_set", $disfunc)) {
-@ini_set('default_charset', $Settings['charset']); }
-//session_save_path($SettDir['inc']."temp/");
-if(!isset($Settings['sqldb'])) { 
-if(file_exists("install.php")) { header('Location: install.php'); die(); } 
-if(!file_exists("install.php")) { header("Content-Type: text/plain; charset=UTF-8");
-echo "403 Error: Sorry could not find install.php\nTry uploading files again and if that dose not work try download iDB again."; die(); } }
-if(isset($Settings['sqldb'])) { 
-       $deftz = new DateTimeZone(date_default_timezone_get());
-       $defcurtime = new DateTime();
-       $defcurtime->setTimezone($deftz);
-       $utctz = new DateTimeZone("UTC");
-       $utccurtime = new DateTime();
-       $utccurtime->setTimestamp($defcurtime->getTimestamp());
-       $utccurtime->setTimezone($utctz);
-       $servtz = new DateTimeZone($Settings['DefaultTimeZone']);
-       $servcurtime = new DateTime();
-       $servcurtime->setTimestamp($defcurtime->getTimestamp());
-       $servcurtime->setTimezone($servtz);
-       $usercurtime = new DateTime();
-       $usercurtime->setTimestamp($defcurtime->getTimestamp()); }
-if(!isset($Settings['sqlhost'])) { $Settings['sqlhost'] = "localhost"; }
-if($Settings['fixpathinfo']=="on") {
-       $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
-       putenv("PATH_INFO=".$_SERVER['ORIG_PATH_INFO']); }
-// Check to see if variables are set
-if(!isset($SettDir['inc'])) { $SettDir['inc'] = "inc/"; }
-if(!isset($SettDir['archive'])) { $SettDir['archive'] = "archive/"; }
-if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; }
-if(!isset($SettDir['sql'])) { $SettDir['sql'] = "inc/misc/sql/"; }
-if(!isset($SettDir['admin'])) { $SettDir['admin'] = "inc/admin/"; }
-if(!isset($SettDir['sqldumper'])) { $SettDir['sqldumper'] = "inc/admin/sqldumper/"; }
-if(!isset($SettDir['mod'])) { $SettDir['mod'] = "inc/mod/"; }
-if(!isset($SettDir['mplayer'])) { $SettDir['mplayer'] = "inc/mplayer/"; }
-if(!isset($SettDir['themes'])) { $SettDir['themes'] = "themes/"; }
-if(!isset($SettDir['maindir'])||!file_exists($SettDir['maindir'])||!is_dir($SettDir['maindir'])) { 
-       $SettDir['maindir'] = addslashes(str_replace("\\","/",dirname(__FILE__)."/")); }
-if(isset($SettDir['maindir'])) { @chdir($SettDir['maindir']); }
-if(!isset($Settings['use_iniset'])) { $Settings['use_iniset'] = null; }
-if(!isset($Settings['clean_ob'])) { $Settings['clean_ob'] = "off"; }
-if(!isset($_SERVER['PATH_INFO'])) { $_SERVER['PATH_INFO'] = null; }
-if(!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { 
-       $_SERVER['HTTP_ACCEPT_ENCODING'] = null; }
-if(!isset($_SERVER["HTTP_ACCEPT"])) { $_SERVER["HTTP_ACCEPT"] = null; }
-if(!isset($_SERVER['HTTP_REFERER'])) { $_SERVER['HTTP_REFERER'] = null; }
-if(!isset($_GET['page'])) { $_GET['page'] = null; }
-if(!isset($_GET['act'])) { $_GET['act'] = null; }
-if(!isset($_POST['act'])) { $_POST['act'] = null; }
-if(!isset($_GET['modact'])) { $_GET['modact'] = null; }
-if(!isset($_POST['modact'])) { $_POST['modact'] = null; }
-if(!isset($_GET['id'])) { $_GET['id'] = null; }
-if(!isset($_GET['debug'])) { $_GET['debug'] = "off"; }
-if(!isset($_GET['post'])) { $_GET['post'] = null; }
-if(!isset($_POST['License'])) { $_POST['License'] = null; }
-if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = "off"; }
-if(!isset($Settings['SQLThemes'])) { $Settings['SQLThemes'] = "off"; }
-if($Settings['SQLThemes']!="on"&&$Settings['SQLThemes']!="off") { 
-       $Settings['SQLThemes'] = "off"; }
-require_once($SettDir['misc'].'utf8.php');
-require_once($SettDir['inc'].'filename.php');
-if(!isset($Settings['use_hashtype'])) {
-       $Settings['use_hashtype'] = "sha1"; }
-if(!function_exists('hash')||!function_exists('hash_algos')) {
-if($Settings['use_hashtype']!="md5"&&
-   $Settings['use_hashtype']!="sha1") {
-       $Settings['use_hashtype'] = "sha1"; } }
-if(function_exists('hash')&&function_exists('hash_algos')) {
-if(!in_array($Settings['use_hashtype'],hash_algos())) {
-       $Settings['use_hashtype'] = "sha1"; }
-if($Settings['use_hashtype']!="md2"&&
-   $Settings['use_hashtype']!="md4"&&
-   $Settings['use_hashtype']!="md5"&&
-   $Settings['use_hashtype']!="sha1"&&
-   $Settings['use_hashtype']!="sha224"&&
-   $Settings['use_hashtype']!="sha256"&&
-   $Settings['use_hashtype']!="sha384"&&
-   $Settings['use_hashtype']!="sha512"&&
-   $Settings['use_hashtype']!="ripemd128"&&
-   $Settings['use_hashtype']!="ripemd160"&&
-   $Settings['use_hashtype']!="ripemd256"&&
-   $Settings['use_hashtype']!="ripemd320") {
-       $Settings['use_hashtype'] = "sha1"; } }
-// Check to see if variables are set
-require_once($SettDir['misc'].'setcheck.php');
-$dayconv = array("year" => 29030400, "month" => 2419200, "week" => 604800, "day" => 86400, "hour" => 3600, "minute" => 60, "second" => 1);
-require_once($SettDir['inc'].'function.php');
-$Settings['bid'] = base64_encode(urlencode($Settings['idburl'].url_maker($exfile['index'],$Settings['file_ext'],"act=versioninfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)));
-$Settings['ubid'] = base64_encode(urlencode($Settings['idburl'].url_maker($exfile['index'],$Settings['file_ext'],"act=versioninfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)));
-if($Settings['enable_pathinfo']=="on") { 
-       mrstring(); /* Change Path info to Get Vars :P */ }
-// Check to see if variables are set
-$qstrhtml = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']);
-if($Settings['enable_https']=="on"&&$_SERVER['HTTPS']=="on") {
-if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
-$HTTPsTest = parse_url($Settings['idburl']); if($HTTPsTest['scheme']=="http") {
-$Settings['idburl'] = preg_replace("/http\:\/\//i", "https://", $Settings['idburl']); } } }
-$cookieDomain = null; $cookieSecure = false;
-if($Settings['idburl']!=null&&$Settings['idburl']!="localhost") {
-$URLsTest = parse_url($Settings['idburl']); 
-$cookieDomain = $URLsTest['host'];
-if($cookieDomain=="localhost") { $cookieDomain = false; }
-if($Settings['enable_https']=="on") {
- if($URLsTest['scheme']=="https") { $cookieSecure = true; }
- if($URLsTest['scheme']!="https") { $cookieSecure = false; } } }
-if(!in_array("ini_set", $disfunc)) {
-@ini_set('default_charset', $Settings['charset']); }
-$File1Name = dirname($_SERVER['SCRIPT_NAME'])."/";
-$File2Name = $_SERVER['SCRIPT_NAME'];
-$File3Name=str_replace($File1Name, null, $File2Name);
-if ($File3Name=="sql.php"||$File3Name=="/sql.php") {
-       header('Location: index.php');
-       exit(); }
-//error_reporting(E_ERROR);
-// Check if gzip is on and if user's browser can accept gzip pages
-if($_GET['act']=="MkCaptcha"||$_GET['act']=="Captcha") {
-       $Settings['use_gzip'] = 'off'; }
-if($Settings['use_gzip']=="on") {
-if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")) { 
-       $GZipEncode['Type'] = "gzip"; } else { 
-       if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "deflate")) { 
-       $GZipEncode['Type'] = "deflate"; } else { 
-               $Settings['use_gzip'] = "off"; $GZipEncode['Type'] = "none"; } } }
-if($Settings['use_gzip']=="gzip") {
-if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")) { $Settings['use_gzip'] = "on";
-       $GZipEncode['Type'] = "gzip"; } else { $Settings['use_gzip'] = "off"; } }
-if($Settings['use_gzip']=="deflate") {
-if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "deflate")) { $Settings['use_gzip'] = "on";
-       $GZipEncode['Type'] = "deflate"; } else { $Settings['use_gzip'] = "off"; } }
-$iWrappers = array(null);
-function idb_output_handler($buffer) { return $buffer; }
-function idb_suboutput_handler($buffer) { return $buffer; }
-if($Settings['clean_ob']=="on") {
-/* Check for other output handlers/buffers are open
-   and close and get the contents in an array */
-$numob = count(ob_list_handlers()); $iob = 0; 
-while ($iob < $numob) { 
-       $old_ob_var[$iob] = ob_get_clean(); 
-       ++$iob; } } ob_start("idb_output_handler");
-if($Settings['use_gzip']=="on") { 
-if($GZipEncode['Type']!="gzip") { if($GZipEncode['Type']!="deflate") { $GZipEncode['Type'] = "gzip"; } }
-       if($GZipEncode['Type']=="gzip") {
-       header("Content-Encoding: gzip"); }
-       if($GZipEncode['Type']=="deflate") {
-       header("Content-Encoding: deflate"); } }
-/* if(eregi("msie",$browser) && !eregi("opera",$browser)){
-header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); } */
-// Some http stuff
-$SQLStat = sql_connect_db($Settings['sqlhost'],$Settings['sqluser'],$Settings['sqlpass'],$Settings['sqldb']);
-if(isset($Settings['sql_collate'])&&!isset($Settings['sql_charset'])) {
-       if($Settings['sql_collate']=="ascii_bin"||
-               $Settings['sql_collate']=="ascii_generel_ci") {
-               $Settings['sql_charset'] = "ascii"; }
-       if($Settings['sql_collate']=="latin1_bin"||
-               $Settings['sql_collate']=="latin1_general_ci"||
-               $Settings['sql_collate']=="latin1_general_cs") {
-               $Settings['sql_charset'] = "latin1"; }
-       if($Settings['sql_collate']=="utf8_bin"||
-               $Settings['sql_collate']=="utf8_general_ci"||
-               $Settings['sql_collate']=="utf8_unicode_ci"||
-               $Settings['sql_collate']=="utf8mb4_bin"||
-               $Settings['sql_collate']=="utf8mb4_general_ci"||
-               $Settings['sql_collate']=="utf8mb4_unicode_ci") {
-               $Settings['sql_charset'] = "utf8"; } }
-if(isset($Settings['sql_collate'])&&isset($Settings['sql_charset'])) {
-       if($Settings['sql_charset']=="ascii") {
-       if($Settings['sql_collate']!="ascii_bin"&&
-               $Settings['sql_collate']!="ascii_generel_ci") {
-               $Settings['sql_collate'] = "ascii_generel_ci"; } }
-       if($Settings['sql_charset']=="latin1") {
-       if($Settings['sql_collate']!="latin1_bin"&&
-               $Settings['sql_collate']!="latin1_general_ci"&&
-               $Settings['sql_collate']!="latin1_general_cs") {
-               $Settings['sql_collate'] = "latin1_general_ci"; } }
-       if($Settings['sql_charset']=="utf8" || $Settings['sql_charset']=="utf8mb4") {
-       if($Settings['sql_collate']!="utf8_bin"&&
-               $Settings['sql_collate']!="utf8_general_ci"&&
-               $Settings['sql_collate']!="utf8_unicode_ci"&&
-               $Settings['sql_collate']!="utf8mb4_bin"&&
-               $Settings['sql_collate']!="utf8mb4_general_ci"&&
-               $Settings['sql_collate']!="utf8mb4_unicode_ci") {
-               $Settings['sql_collate'] = "utf8mb4_unicode_ci"; } }
-       if($Settings['sql_collate']=="utf8_bin"||
-               $Settings['sql_collate']=="utf8_general_ci"||
-               $Settings['sql_collate']=="utf8_unicode_ci") {
-               $Settings['sql_charset'] = "utf8"; }
-       if($Settings['sql_collate']=="utf8mb4_bin"||
-               $Settings['sql_collate']=="utf8mb4_general_ci"||
-               $Settings['sql_collate']=="utf8mb4_unicode_ci") {
-               $Settings['sql_charset'] = "utf8mb4"; }
-       $SQLCollate = $Settings['sql_collate'];
-       $SQLCharset = $Settings['sql_charset']; }
-if(!isset($Settings['sql_collate'])||!isset($Settings['sql_charset'])) {
-$SQLCollate = "latin1_general_ci";
-$SQLCharset = "latin1"; 
-if($Settings['charset']=="ISO-8859-1") {
-       $SQLCollate = "latin1_general_ci";
-       $SQLCharset = "latin1"; }
-if($Settings['charset']=="ISO-8859-15") {
-       $SQLCollate = "latin1_general_ci";
-       $SQLCharset = "latin1"; }
-if($Settings['charset']=="UTF-8") {
-       $SQLCollate = "utf8mb4_unicode_ci";
-       $SQLCharset = "utf8mb4"; } 
-$Settings['sql_collate'] = $SQLCollate;
-$Settings['sql_charset'] = $SQLCharset; }
-sql_set_charset($SQLCharset,$SQLStat);
-if($SQLStat===false) {
-header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($peresult);
-ob_clean(); echo "Sorry could not connect to sql database.\nContact the board admin about error. Error log below.";
-echo "\n".sql_errorno($SQLStat); $urlstatus = 503;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$sqltable = $Settings['sqltable'];
-$temp_user_ip = $_SERVER['REMOTE_ADDR'];
-if(!isset($_SERVER['HTTP_USER_AGENT'])) {
-       $_SERVER['HTTP_USER_AGENT'] = ""; }
-if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
-       !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){
-       header("X-UA-Compatible: IE=Edge"); }
-if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) {
-       header("X-UA-Compatible: IE=Edge,chrome=1"); }
-$temp_user_agent = $_SERVER['HTTP_USER_AGENT'];
-if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
-$MkIndexFile = $exfile['index'].$Settings['file_ext']; }
-if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
-$MkIndexFile = $exfile['index']; }
-$temp_session_data = "ViewingPage|s:9:\"?act=view\";ViewingFile|s:".strlen($MkIndexFile).":\"".$MkIndexFile."\";PreViewingTitle|s:7:\"Viewing\";ViewingTitle|s:11:\"Board index\";UserID|s:1:\"0\";UserIP|s:".strlen($_SERVER['REMOTE_ADDR']).":\"".$_SERVER['REMOTE_ADDR']."\";UserGroup|s:".strlen($Settings['GuestGroup']).":\"".$Settings['GuestGroup']."\";UserGroupID|s:1:\"4\";UserTimeZone|s:".strlen($Settings['DefaultTimeZone']).":\"".$Settings['DefaultTimeZone']."\";";
-$alt_temp_session_data['ViewingPage'] = "?act=view";
-$alt_temp_session_data['ViewingFile'] = $MkIndexFile;
-$alt_temp_session_data['PreViewingTitle'] = "Viewing";
-$alt_temp_session_data['ViewingTitle'] = "Board index";
-$alt_temp_session_data['UserID'] = "0";
-$alt_temp_session_data['UserIP'] = $_SERVER['REMOTE_ADDR'];
-$alt_temp_session_data['UserGroupID'] = "4";
-$alt_temp_session_data['UserTimeZone'] = $Settings['DefaultTimeZone'];
-$alttemp_session_data = serialize($alt_temp_session_data);
-$alt_temp_session_data = $alttemp_session_data;
-$alttemp_session_data = null;
-$SQLSType = $Settings['sqltype'];
-//Session Open Function
-function sql_session_open($save_path, $session_name ) {
-global $sess_save_path;
-$sess_save_path = $save_path;
-return true; }
-//Session Close Function
-$iDBSessCloseDB = true;
-function sql_session_close() {
-global $SQLStat,$iDBSessCloseDB;
-if($iDBSessCloseDB===true) {
-sql_disconnect_db($SQLStat); }
-return true; }
-//Session Read Function
-function sql_session_read($id) {
-global $sqltable,$SQLStat,$SQLSType,$temp_user_ip,$temp_user_agent,$temp_session_data,$alt_temp_session_data;
-$result = sql_query(sql_pre_query("SELECT * FROM \"".$sqltable."sessions\" WHERE \"session_id\" = '%s'", array($id)),$SQLStat);
-if (!sql_num_rows($result)) {
-sql_query(sql_pre_query("DELETE FROM \"".$sqltable."sessions\" WHERE \"session_id\"<>'%s' AND \"ip_address\"='%s' AND \"user_agent\"='%s'", array($id,$temp_user_ip,$temp_user_agent)),$SQLStat);
-$utctz = new DateTimeZone("UTC");
-$utccurtime = new DateTime();
-$utccurtime->setTimezone($utctz);
-$time = $utccurtime->getTimestamp();
-sql_query(sql_pre_query("INSERT INTO \"".$sqltable."sessions\" (\"session_id\", \"session_data\", \"serialized_data\", \"user_agent\", \"ip_address\", \"expires\") VALUES\n".
-"('%s', '%s', '%s', '%s', '%s', %i)", array($id,$temp_session_data,$alt_temp_session_data,$temp_user_agent,$temp_user_ip,$time)),$SQLStat);
-return '';
-} else {
-$utctz = new DateTimeZone("UTC");
-$utccurtime = new DateTime();
-$utccurtime->setTimezone($utctz);
-$time = $utccurtime->getTimestamp();
-$predata = sql_num_rows($result);
-$data = "";
-if($predata > 0) {
-$row = sql_fetch_assoc($result);
-$data = $row['session_data']; }
-/*sql_query(sql_pre_query("UPDATE \"".$sqltable."sessions\" SET \"session_data\"='%s',\"expires\"=%i WHERE \"session_id\"='%s'", array($data,$time,$id)),$SQLStat);*/
-return $data; } }
-//Session Write Function
-function sql_session_write($id,$data) {
-global $sqltable,$SQLStat,$SQLSType,$temp_user_ip,$temp_user_agent;
-$utctz = new DateTimeZone("UTC");
-$utccurtime = new DateTime();
-$utccurtime->setTimezone($utctz);
-$time = $utccurtime->getTimestamp();
-$rs = sql_query(sql_pre_query("UPDATE \"".$sqltable."sessions\" SET \"session_data\"='%s',\"serialized_data\"='%s',\"user_agent\"='%s',\"ip_address\"='%s',\"expires\"=%i WHERE \"session_id\"='%s'", array($data,serialize($_SESSION),$temp_user_agent,$temp_user_ip,$time,$id)),$SQLStat);
-return true; }
-//Session Destroy Function
-function sql_session_destroy($id) {
-global $sqltable,$SQLStat;
-sql_query(sql_pre_query("DELETE FROM \"".$sqltable."sessions\" WHERE \"session_id\" = '$id'", array($id)),$SQLStat);
-return true; }
-//Session Garbage Collection Function
-function sql_session_gc($maxlifetime) {
-global $sqltable,$SQLStat;
-$utctz = new DateTimeZone("UTC");
-$utccurtime = new DateTime();
-$utccurtime->setTimezone($utctz);
-$time = $utccurtime->getTimestamp() - $maxlifetime;
-//sql_query(sql_pre_query('DELETE FROM \"'.$sqltable.'sessions\" WHERE \"expires\" < UNIX_TIMESTAMP();', array(null)),$SQLStat);
-sql_query(sql_pre_query("DELETE FROM \"".$sqltable."sessions\" WHERE \"expires\" < %i", array($time)),$SQLStat);
-return true; }
-if (session_id()) { session_destroy(); }
-session_set_save_handler("sql_session_open", "sql_session_close", "sql_session_read", "sql_session_write", "sql_session_destroy", "sql_session_gc");
-if($cookieDomain==null) {
-session_set_cookie_params(0, $cbasedir); }
-if($cookieDomain!=null) {
-if($cookieSecure===true) {
-session_set_cookie_params(0, $cbasedir, $cookieDomain, 1); }
-if($cookieSecure===false) {
-session_set_cookie_params(0, $cbasedir, $cookieDomain); } }
-session_cache_limiter("private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Cache-Control: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("Pragma: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
-header("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
-header("Date: ".gmdate("D, d M Y H:i:s")." GMT");
-header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
-header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
-if(!isset($_COOKIE[$Settings['sqltable']."sess"])) {
-$exptime = $utccurtime->getTimestamp() - ini_get("session.gc_maxlifetime");
-sql_query(sql_pre_query("DELETE FROM \"".$Settings['sqltable']."sessions\" WHERE \"expires\" < %i OR \"ip_address\"='%s' AND \"user_agent\"='%s'", array($exptime,$temp_user_ip,$temp_user_agent)),$SQLStat); }
-if(!isset($_SESSION['CheckCookie'])) {
-if(isset($_COOKIE['SessPass'])&&isset($_COOKIE['MemberName'])) {
-session_set_save_handler("sql_session_open", "sql_session_close", "sql_session_read", "sql_session_write", "sql_session_destroy", "sql_session_gc");
-session_name($Settings['sqltable']."sess");
-session_start();
-if(!isset($_SESSION['UserFormID'])) { $_SESSION['UserFormID'] = null; }
-$iDBSessCloseDB = false;
-$_SESSION['ShowActHidden'] = "no";
-output_reset_rewrite_vars();
-require($SettDir['inc'].'prelogin.php'); 
-session_write_close(); } }
-session_set_save_handler("sql_session_open", "sql_session_close", "sql_session_read", "sql_session_write", "sql_session_destroy", "sql_session_gc");
-session_name($Settings['sqltable']."sess");
-session_start();
-if(!isset($_SESSION['UserFormID'])) { $_SESSION['UserFormID'] = null; }
-$iDBSessCloseDB = true;
-output_reset_rewrite_vars();
-//@register_shutdown_function("session_write_close");
-//header("Set-Cookie: PHPSESSID=" . session_id() . "; path=".$cbasedir);
-if(!in_array("ini_set", $disfunc)) {
-// Set user agent if we can use ini_set and have to do any http requests. :P 
-$iverstring = "FR 0.0.0 ".$VER2[2]." 0";
-if($Settings['hideverinfohttp']=="off") {
-       $iverstring = $VER2[1]." ".$VER1[0].".".$VER1[1].".".$VER1[2]." ".$VER2[2]." ".$SubVerN; }
-if($Settings['hideverinfohttp']=="on") {
-       $iverstring = "FR 0.0.0 ".$VER2[2]." 0"; }
-$qstrtest = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']);
-$qseptest = htmlentities($Settings['qsep'], ENT_QUOTES, $Settings['charset']);
-$isiteurl = $Settings['idburl'].url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']);
-@ini_set("user_agent", "Mozilla/5.0 (compatible; ".$UserAgentName."/".$iverstring."; +".$isiteurl.")"); 
-if (function_exists("stream_context_create")) {
-$iopts = array(
-  'http' => array(
-    'method' => "GET",
-    'header' => "Accept-Language: *\r\n".
-                "User-Agent: Mozilla/5.0 (compatible; ".$UserAgentName."/".$iverstring."; +".$isiteurl.")\r\n".
-                "Accept: */*\r\n".
-                "Connection: keep-alive\r\n".
-                "Referer: ".$isiteurl."\r\n".
-                "From: ".$isiteurl."\r\n".
-                "Via: ".$_SERVER['REMOTE_ADDR']."\r\n".
-                "Forwarded: ".$_SERVER['REMOTE_ADDR']."\r\n".
-                "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR']."\r\n".
-                "Client-IP: ".$_SERVER['REMOTE_ADDR']."\r\n"
-  )
-);
-$icontext = stream_context_create($iopts); 
-function file_get_contents_alt($filename,$use_include_path=null,$offset=-1,$maxlen=null) {
-global $icontext;
-if($maxlen!==null) {
-return file_get_contents($filename,$use_include_path,$icontext,$offset,$maxlen); }
-if($maxlen===null) {
-return file_get_contents($filename,$use_include_path,$icontext,$offset); } } } }
-$iDBVerName = $VerCheckName."|".$VER2[1]."|".$VER1[0].".".$VER1[1].".".$VER1[2]."|".$VER2[2]."|".$SubVerN;
-/* 
-This way checks iDB version by sending the iDBVerName to the iDB Version Checker.
-$Settings['vercheck'] = 1; 
-This way checks iDB version by sending the board url to the iDB Version Checker.
-$Settings['vercheck'] = 2;
-*/
-if(!isset($Settings['vercheck'])) { 
-       $Settings['vercheck'] = 2; }
-if($Settings['vercheck']!=1&&
-       $Settings['vercheck']!=2) {
-       $Settings['vercheck'] = 2; }
-if($Settings['vercheck']===2) {
-if($_GET['act']=="vercheckxsl") {
-if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
-header("Content-Type: application/xml; charset=".$Settings['charset']); }
-else { header("Content-Type: text/xml; charset=".$Settings['charset']); }
-xml_doc_start("1.0",$Settings['charset']);
-echo "\n"; ?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:template match="/">
- <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
-  <body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
-   <xsl:for-each select="versioninfo/version">
-    <div style="background-color:teal;color:white;padding:4px">
-     <span style="font-weight:bold"><xsl:value-of select="vname"/></span>
-    </div>
-    <div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
-     <span style="font-style:italic">
-          Board Name: <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><xsl:value-of select="title"/></a></span>
-    </div>
-   </xsl:for-each>
-  </body>
- </html>
-</xsl:template>
-
-</xsl:stylesheet>
-<?php gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } 
-if($_GET['act']=="versioninfo") {
-if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
-header("Content-Type: application/xml; charset=".$Settings['charset']); }
-else { header("Content-Type: text/xml; charset=".$Settings['charset']); }
-xml_doc_start("1.0",$Settings['charset']);
-echo '<?xml-stylesheet type="text/xsl" href="'.url_maker($exfile['index'],$Settings['file_ext'],"act=vercheckxsl",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']).'"?>'."\n"; ?>
-
-<!DOCTYPE versioninfo [
-<!ELEMENT versioninfo (version*)>
-<!ELEMENT version (charset,title,name,vname)>
-<!ELEMENT charset (#PCDATA)>
-<!ELEMENT title (#PCDATA)>
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT vname (#PCDATA)>
-]>
-
-<versioninfo>
-
-<version>
- <charset><?php echo $Settings['charset']; ?></charset> 
-  <title><?php echo $Settings['board_name']; ?></title> 
-  <?php echo "<name>".$iDBVerName."</name>\n"; ?>
-  <vname><?php echo $VerCheckName; ?> Version Checker</vname>
-</version>
-
-</versioninfo>
-<?php gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } } 
-if($Settings['vercheck']===1) {
-if($_GET['act']=="versioninfo") { header("Content-Type: text/plain; charset=UTF-8");
-header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName)); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
-if($_GET['act']=="homepage") { header("Content-Type: text/plain; charset=UTF-8");
-header("Location: ".$Settings['weburl']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($_GET['act']=="bsdl"||$_GET['act']=="BSDL"||$_GET['act']=="license"||
-       $_GET['act']=="LICENSE"||$_GET['act']=="License") { $_GET['act']="bsd"; }
-if($_GET['act']=="bsd") {
-header("Content-Type: text/plain; charset=".$Settings['charset']);
-require("LICENSE"); gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
-if($_GET['act']=="README"||$_GET['act']=="ReadME") { $_GET['act']="readme"; }
-if($_GET['act']=="readme"||$_GET['act']=="ReadMe") {
-header("Content-Type: text/plain; charset=".$Settings['charset']);
-require("README"); gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
-if($_GET['act']=="js"||$_GET['act']=="javascript") {
-header("Content-Script-Type: text/javascript");
-if(stristr($_SERVER["HTTP_ACCEPT"],"application/x-javascript") ) {
-header("Content-Type: application/x-javascript; charset=".$Settings['charset']); } else {
-if(stristr($_SERVER["HTTP_ACCEPT"],"application/javascript") ) {
-header("Content-Type: application/javascript; charset=".$Settings['charset']); } else {
-header("Content-Type: text/javascript; charset=".$Settings['charset']); } }
-require($SettDir['inc'].'javascript.php');
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); die(); }
-if($Settings['use_captcha']=="on") {
-if($_GET['act']=="MkCaptcha"||$_GET['act']=="Captcha") {
-       if($Settings['captcha_clean']=="on") { ob_clean(); }
-       require($SettDir['inc']."captcha.php");
-       $aFonts = array('inc/fonts/VeraBd.ttf', 'inc/fonts/VeraBI.ttf', 'inc/fonts/VeraIt.ttf', 'inc/fonts/Vera.ttf');
-       $oPhpCaptcha = new PhpCaptcha($aFonts, 200, 60);
-       $RNumSize = rand(7,17); $i=0; $RandNum = null;
-       while ($i <= $RNumSize) {
-       $RandNum=$RandNum.dechex(rand(1,15)); ++$i; }
-       $RandNum=strtoupper($RandNum);
-       $oPhpCaptcha->SetOwnerText("Fake Code: ".$RandNum);
-       $oPhpCaptcha->UseColour(true);
-       $oPhpCaptcha->Create(); session_write_close(); die(); } }
-require($SettDir['inc'].'groupsetup.php');
-if($Settings['board_offline']=="on"&&$GroupInfo['CanViewOffLine']!="yes") {
-header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($peresult);
-ob_clean(); if(!isset($Settings['offline_text'])) {
-echo "Sorry the board is off line.\nIf you are a admin you can login by the admin cp."; }
-if(isset($Settings['offline_text'])) { echo $Settings['offline_text']; } $urlstatus = 503;
-//echo "\n".sql_errorno($SQLStat);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-//Time Format Set
-if(!isset($_SESSION['iDBDateFormat'])) { 
-       if(isset($Settings['idb_date_format'])) { 
-       $_SESSION['iDBDateFormat'] = $Settings['idb_date_format'];
-       if(!isset($Settings['idb_date_format'])) { 
-       $_SESSION['iDBDateFormat'] = "g:i A"; } } }
-if(!isset($_SESSION['iDBTimeFormat'])) { 
-       if(isset($Settings['idb_time_format'])) { 
-       $_SESSION['iDBTimeFormat'] = $Settings['idb_time_format'];
-       if(!isset($Settings['idb_time_format'])) { 
-       $_SESSION['iDBTimeFormat'] = "F j Y"; } } }
-//Time Zone Set
-if(!isset($_SESSION['UserTimeZone'])) { 
-       if(isset($Settings['DefaultTimeZone'])) { 
-       $_SESSION['UserTimeZone'] = $Settings['DefaultTimeZone'];
-       if(!isset($Settings['DefaultTimeZone'])) { 
-       $_SESSION['UserTimeZone'] = date_default_timezone_get(); } } }
-$usertz = new DateTimeZone($_SESSION['UserTimeZone']);
-$usercurtime->setTimestamp($defcurtime->getTimestamp());
-$usercurtime->setTimezone($usertz);
-// Guest Stuff
-if(isset($_SESSION['MemberName'])||
-   isset($_COOKIE['MemberName'])) {
-       $_SESSION['GuestName'] = null;
-       $_COOKIE['GuestName'] = null; }
-if(!isset($_SESSION['MemberName'])&&!isset($_COOKIE['MemberName'])) {
-if(!isset($_SESSION['GuestName'])&&isset($_COOKIE['GuestName'])) {
-       $_SESSION['GuestName'] = $_COOKIE['GuestName']; } }
-if(!isset($_SESSION['LastPostTime'])) { $_SESSION['LastPostTime'] = "0"; }
-// Skin Stuff
-if(!isset($_SESSION['Theme'])) { $_SESSION['Theme'] = null; }
-if(!isset($_GET['theme'])) { $_GET['theme'] = null; }
-if(!isset($_POST['theme'])) { $_POST['theme'] = null; }
-if(!isset($_GET['skin'])) { $_GET['skin'] = null; }
-if(!isset($_POST['skin'])) { $_POST['skin'] = null; }
-if(!isset($_GET['style'])) { $_GET['style'] = null; }
-if(!isset($_POST['style'])) { $_POST['style'] = null; }
-if(!isset($_GET['css'])) { $_GET['css'] = null; }
-if(!isset($_POST['css'])) { $_POST['css'] = null; }
-if($_GET['theme']==null) {
-       if($_POST['theme']!=null) {
-               $_GET['theme'] = $_POST['theme']; }
-       if($_POST['skin']!=null) {
-               $_GET['theme'] = $_POST['skin']; }
-       if($_POST['style']!=null) {
-               $_GET['theme'] = $_POST['style']; }
-       if($_POST['css']!=null) {
-               $_GET['theme'] = $_POST['css']; }
-       if($_GET['skin']!=null) {
-               $_GET['theme'] = $_GET['skin']; }
-       if($_GET['style']!=null) {
-               $_GET['theme'] = $_GET['style']; }
-       if($_GET['css']!=null) {
-               $_GET['theme'] = $_GET['css']; } }
-if($Settings['SQLThemes']=="off") {
-if($_GET['theme']!=null) {
-$_GET['theme'] = chack_themes($_GET['theme']);
-if($_GET['theme']=="../"||$_GET['theme']=="./") {
-$_GET['theme']=$Settings['DefaultTheme']; $_SESSION['Theme']=$Settings['DefaultTheme']; }
-if (file_exists($SettDir['themes'].$_GET['theme']."/settings.php")) {
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-$NewDay=$utccurtime->getTimestamp();
-$qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_GET['theme'],$NewDay,$_SESSION['UserID']));
-sql_query($qnewskin,$SQLStat); }
-/* The file Theme Exists */ }
-else { $_GET['theme'] = $Settings['DefaultTheme']; 
-$_SESSION['Theme'] = $Settings['DefaultTheme'];
-/* The file Theme Dose Not Exists */ } }
-if($_GET['theme']==null) { 
-if($_SESSION['Theme']!=null) {
-$OldTheme = $_SESSION['Theme'];
-$_SESSION['Theme'] = chack_themes($_SESSION['Theme']);
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-if($OldTheme!=$_SESSION['Theme']) { 
-$NewDay=$utccurtime->getTimestamp();
-$qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_SESSION['Theme'],$NewDay,$_SESSION['UserID']));
-sql_query($qnewskin,$SQLStat); } }
-$_GET['theme']=$_SESSION['Theme']; }
-if($_SESSION['Theme']==null) {
-$_SESSION['Theme']=$Settings['DefaultTheme'];
-$_GET['theme']=$Settings['DefaultTheme']; } }
-$PreSkin['skindir1'] = $_SESSION['Theme'];
-$PreSkin['skindir2'] = $SettDir['themes'].$_SESSION['Theme'];
-require($SettDir['themes'].$_GET['theme']."/settings.php"); }
-if($Settings['SQLThemes']=="on") {
-if($_GET['theme']==null&&$_SESSION['Theme']==null) { 
-       $_GET['theme'] = $Settings['DefaultTheme']; 
-       $_SESSION['Theme'] = $Settings['DefaultTheme']; }
-if($_GET['theme']!=null) {
-$themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_GET['theme'])); }
-if($_GET['theme']==null) { 
-if($_SESSION['Theme']!=null) {
-$themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_SESSION['Theme'])); } }
-$themeresult=sql_query($themequery,$SQLStat);
-$themenum=sql_num_rows($themeresult);
-if($themenum<=0) {
-$_GET['theme'] = $Settings['DefaultTheme']; 
-$_SESSION['Theme'] = $Settings['DefaultTheme']; 
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-$NewDay=$utccurtime->getTimestamp();
-$qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_SESSION['Theme'],$NewDay,$_SESSION['UserID']));
-sql_query($qnewskin,$SQLStat); }
-$themequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."themes\" WHERE \"Name\"='%s'", array($_GET['theme']));
-$themeresult=sql_query($themequery,$SQLStat);
-$themenum=sql_num_rows($themeresult); } 
-else {
-if($_GET['theme']==null) { 
-if($_SESSION['Theme']!=null) {
-$_GET['theme'] = $_SESSION['Theme']; } }
-if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-$NewDay=$utccurtime->getTimestamp();
-$qnewskin = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"UseTheme\"='%s',\"LastActive\"='%s' WHERE \"id\"=%i", array($_GET['theme'],$NewDay,$_SESSION['UserID']));
-sql_query($qnewskin,$SQLStat); } } 
-require($SettDir['inc'].'sqlthemes.php');
-sql_free_result($themeresult); }
-$_SESSION['Theme'] = $_GET['theme'];
-function get_theme_values($matches) {
-       global $ThemeSet;
-       $return_text = null;
-       if(isset($ThemeSet[$matches[1]])) { $return_text = $ThemeSet[$matches[1]]; }
-       if(!isset($ThemeSet[$matches[1]])) { $return_text = null; }
-       return $return_text; }
-foreach($ThemeSet AS $key => $value) {
-       $ThemeSet[$key] = preg_replace("/%%/s", "{percent}p", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}T/s", "get_theme_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}e/s", "get_env_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}i/s", "get_server_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}s/s", "get_setting_values", $ThemeSet[$key]);
-       $ThemeSet[$key] = preg_replace_callback("/%\{([^\}]*)\}t/s", "get_time", $ThemeSet[$key]); 
-       $ThemeSet[$key] = preg_replace("/\{percent\}p/s", "%", $ThemeSet[$key]); }
-if(!isset($ThemeSet['TableStyle'])) {
-       $ThemeSet['TableStyle'] = "table"; }
-if(isset($ThemeSet['TableStyle'])) {
-if($ThemeSet['TableStyle']!="div"&&
-       $ThemeSet['TableStyle']!="table") {
-       $ThemeSet['TableStyle'] = "table"; } }
-if(!isset($_SESSION['DBName'])) { $_SESSION['DBName'] = null; }
-if($_SESSION['DBName']==null) {
-       $_SESSION['DBName'] = $Settings['sqldb']; }
-if($_SESSION['DBName']!=null) {
-       if($_SESSION['DBName']!=$Settings['sqldb']) {
-redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false)); } }
-?>
diff --git a/subcategory.php.bak b/subcategory.php.bak
deleted file mode 100644 (file)
index faa6e10..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: subcategory.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$checklowview = true;
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['category'].$usefileext.$_SERVER['PATH_INFO'];
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-$idbactcheck = array("view", "lowview", "stats");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']!="lowview") {
-require($SettDir['inc'].'navbar.php'); }
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-$CatCheck = null;
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-if($_GET['act']=="view")
-{ require($SettDir['inc'].'subcategories.php'); }
-if($_GET['act']=="lowview")
-{ require($SettDir['inc'].'lowsubcategories.php'); }
-if($_GET['act']=="view"||$_GET['act']=="stats")
-{ require($SettDir['inc'].'stats.php'); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($CategoryName)) { $CategoryName = null; }
-?>
-</body>
-</html>
-<?php
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$CategoryName,$Settings['use_gzip'],$GZipEncode['Type']);
-?>
diff --git a/subforum.php.bak b/subforum.php.bak
deleted file mode 100644 (file)
index 846164e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: subforum.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$checklowview = true;
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['subforum'].$usefileext.$_SERVER['PATH_INFO'];
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-$idbactcheck = array("view", "lowview", "oldrss", "rss", "atom", "opml");
-$iWrappers['EXTRALINKS'] = null;
-if($Settings['enable_rss']=="on") {
-ob_start("idb_suboutput_handler");
-?>
-<link rel="alternate" type="application/xml" title="SubForum Topics RSS 1.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<link rel="alternate" type="application/rss+xml" title="SubForum Topics RSS 2.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<link rel="alternate" type="application/atom+xml" title="SubForum Topics Atom Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=atom&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
-<?php $iWrappers['EXTRALINKS'] = ob_get_clean(); } ?>
-<?php ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']!="lowview") {
-require($SettDir['inc'].'navbar.php'); }
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-$ForumCheck = null;
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id'])) { $_GET['id']="1"; }
-if($_GET['act']=="view")
-{ require($SettDir['inc'].'subforums.php'); }
-if($_GET['act']=="lowview")
-{ require($SettDir['inc'].'lowsubforums.php'); }
-if($_GET['act']=="oldrss"||$_GET['act']=="rss"||$_GET['act']=="atom"||$_GET['act']=="opml") {
-redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($ForumName)) { $ForumName = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$ForumName,$Settings['use_gzip'],$GZipEncode['Type']); 
-?>
diff --git a/themes/Gray/index.php.bak b/themes/Gray/index.php.bak
deleted file mode 100644 (file)
index ef6804d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-    $ThemeInfo - Name: iDB Gray - Author: cooldude2k $
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/themes/Gray/info.php.bak b/themes/Gray/info.php.bak
deleted file mode 100644 (file)
index 4c96044..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-    $ThemeInfo - Name: iDB Gray - Author: cooldude2k $
-    $FileInfo: info.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$ThemeInfo = array();
-$ThemeInfo['ThemeName'] = "iDB Gray Theme";
-$ThemeInfo['ThemeMaker'] = "Kazuki";
-$ThemeInfo['ThemeVersion'] = "0.4.8";
-$ThemeInfo['ThemeVersionType'] = "Alpha";
-$ThemeInfo['ThemeSubVersion'] = "SVN 788";
-$ThemeInfo['MakerURL'] = "http://upload.idb.s1.jcink.com/";
-$ThemeInfo['CopyRight'] = "%{ThemeName}T was made by <a href=\"%{MakerURL}T\" title=\"%{ThemeMaker}T\">%{ThemeMaker}T</a>";
-?>
\ No newline at end of file
diff --git a/themes/Gray/settings.php.bak b/themes/Gray/settings.php.bak
deleted file mode 100644 (file)
index bef9ecb..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-    $ThemeInfo - Name: iDB Gray - Author: cooldude2k $
-    $FileInfo: settings.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$ThemeSet = array();
-$ThemeSet['ThemeName'] = "iDB Gray Theme";
-$ThemeSet['ThemeMaker'] = "Kazuki";
-$ThemeSet['ThemeVersion'] = "0.4.8";
-$ThemeSet['ThemeVersionType'] = "Alpha";
-$ThemeSet['ThemeSubVersion'] = "SVN 788";
-$ThemeSet['MakerURL'] = "http://upload.idb.s1.jcink.com/";
-$ThemeSet['CopyRight'] = "%{ThemeName}T was made by <a href=\"%{MakerURL}T\" title=\"%{ThemeMaker}T\">%{ThemeMaker}T</a>";
-$ThemeSet['WrapperString'] = "<% HTMLSTART %>\n<% HTTPEQUIV %>\n<% METATAGS %>\n<% JAVASCRIPT %>\n<% LINKTAGS %>\n<% CSSTHEME %>\n<% FAVICON %>\n<% EXTRALINKS %>\n<% TITLETAG %>\n<% BODYTAG %>\n<% NAVBAR %>\n<% CONTENT %>\n<% COPYRIGHT %>\n<% HTMLEND %>";
-$ThemeSet['CSS'] = "themes/Gray/css.css";
-$ThemeSet['CSSType'] = "include";
-$ThemeSet['FavIcon'] = "themes/Gray/favicon.ico";
-$ThemeSet['TableStyle'] = "table";
-$ThemeSet['MiniPageAltStyle'] = "off";
-$ThemeSet['PreLogo'] = "<div style=\"text-align: center;\">";
-$ThemeSet['Logo'] = "%{board_name}s";
-$ThemeSet['LogoStyle'] = "font-size: 40px; font-family: verdana, arial, sans-serif; color: black;";
-$ThemeSet['SubLogo'] = "</div>";
-$ThemeSet['TopicIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Topic!\"> (T) </div>";
-$ThemeSet['HotTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Topic!\"> (T) </div>";
-$ThemeSet['PinTopic'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Pinned Topic!\"> {P} </div>";
-$ThemeSet['AnnouncementTopic'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Pinned Topic!\"> {A} </div>";
-$ThemeSet['HotPinTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Pinned Topic!\"> {P} </div>";
-$ThemeSet['ClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Topic!\"> [T] </div>";
-$ThemeSet['HotClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Topic!\"> [T] </div>";
-$ThemeSet['PinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Pinned Topic!\"> [P] </div>";
-$ThemeSet['HotPinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Pinned Topic!\"> [P] </div>";
-$ThemeSet['MovedTopicIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Topic!\"> (~T) </div>";
-$ThemeSet['MovedHotTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Topic!\"> (~T) </div>";
-$ThemeSet['MovedPinTopic'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Pinned Topic!\"> {~P} </div>";
-$ThemeSet['MovedHotPinTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Pinned Topic!\"> {~P} </div>";
-$ThemeSet['MovedClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Topic!\"> [~T] </div>";
-$ThemeSet['MovedHotClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Topic!\"> [~T] </div>";
-$ThemeSet['MovedPinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Pinned Topic!\"> [~P] </div>";
-$ThemeSet['MovedHotPinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Pinned Topic!\"> [~P] </div>";
-$ThemeSet['MessageRead'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Message!\"> [M] </div>";
-$ThemeSet['MessageUnread'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"New Message!\"> (M) </div>";
-$ThemeSet['Profile'] = "Profile";
-$ThemeSet['WWW'] = "WWW";
-$ThemeSet['PM'] = "PM";
-$ThemeSet['TopicLayout'] = "Type 1";
-$ThemeSet['AddReply'] = "<span style=\"color: white; font-size: 25px;\" title=\"Add Reply\">Add Reply</span>";
-$ThemeSet['FastReply'] = "<span style=\"color: white; font-size: 25px;\" title=\"Fast Reply\">Fast Reply</span>";
-$ThemeSet['NewTopic'] = "<span style=\"color: white; font-size: 25px;\" title=\"New Topic\">New Topic</span>";
-$ThemeSet['QuoteReply'] = "Quote";
-$ThemeSet['EditReply'] = "Edit";
-$ThemeSet['DeleteReply'] = "Delete";
-$ThemeSet['Report'] = "Report";
-$ThemeSet['LineDivider'] = "&nbsp;|&nbsp;";
-$ThemeSet['ButtonDivider'] = "&nbsp;";
-$ThemeSet['LineDividerTopic'] = "&nbsp;|&nbsp;";
-$ThemeSet['TitleDivider'] = "-&gt;";
-$ThemeSet['ForumStyle'] = 1;
-$ThemeSet['ForumIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Forum\"> (F) </div>";
-$ThemeSet['SubForumIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"SubForum\"> {SF} </div>";
-$ThemeSet['RedirectIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Redirect Forum\"> [RF] </div>";
-$ThemeSet['TitleIcon'] = null;
-$ThemeSet['NavLinkIcon'] = null;
-$ThemeSet['NavLinkDivider'] = "&nbsp;-&gt;&nbsp;";
-$ThemeSet['StatsIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Board Stats\">(S)</div> ";
-$ThemeSet['NoAvatar'] = "themes/Gray/noavatar.png";
-$ThemeSet['NoAvatarSize'] = "100x100";
-?>
\ No newline at end of file
diff --git a/themes/iDB/index.php.bak b/themes/iDB/index.php.bak
deleted file mode 100644 (file)
index ccdca84..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-    $ThemeInfo - Name: iDB Theme - Author: cooldude2k $
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../../index.php');
-?>
\ No newline at end of file
diff --git a/themes/iDB/info.php.bak b/themes/iDB/info.php.bak
deleted file mode 100644 (file)
index 69a1824..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-    $ThemeInfo - Name: iDB Theme - Author: cooldude2k $
-    $FileInfo: info.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$ThemeInfo = array();
-$ThemeInfo['ThemeName'] = "iDB Theme";
-$ThemeInfo['ThemeMaker'] = "Kazuki";
-$ThemeInfo['ThemeVersion'] = "0.4.8";
-$ThemeInfo['ThemeVersionType'] = "Alpha";
-$ThemeInfo['ThemeSubVersion'] = "SVN 788";
-$ThemeInfo['MakerURL'] = "http://upload.idb.s1.jcink.com/";
-$ThemeInfo['CopyRight'] = "%{ThemeName}T was made by <a href=\"%{MakerURL}T\" title=\"%{ThemeMaker}T\">%{ThemeMaker}T</a>";
-?>
\ No newline at end of file
diff --git a/themes/iDB/settings.php.bak b/themes/iDB/settings.php.bak
deleted file mode 100644 (file)
index 20d2637..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-    $ThemeInfo - Name: iDB Theme - Author: cooldude2k $
-    $FileInfo: settings.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-$ThemeSet = array();
-$ThemeSet['ThemeName'] = "iDB Theme";
-$ThemeSet['ThemeMaker'] = "Kazuki";
-$ThemeSet['ThemeVersion'] = "0.4.8";
-$ThemeSet['ThemeVersionType'] = "Alpha";
-$ThemeSet['ThemeSubVersion'] = "SVN 788";
-$ThemeSet['MakerURL'] = "http://upload.idb.s1.jcink.com/";
-$ThemeSet['CopyRight'] = "%{ThemeName}T was made by <a href=\"%{MakerURL}T\" title=\"%{ThemeMaker}T\">%{ThemeMaker}T</a>";
-$ThemeSet['WrapperString'] = "<% HTMLSTART %>\n<% HTTPEQUIV %>\n<% METATAGS %>\n<% JAVASCRIPT %>\n<% LINKTAGS %>\n<% CSSTHEME %>\n<% FAVICON %>\n<% EXTRALINKS %>\n<% TITLETAG %>\n<% BODYTAG %>\n<% NAVBAR %>\n<% CONTENT %>\n<% COPYRIGHT %>\n<% HTMLEND %>";
-$ThemeSet['CSS'] = "themes/iDB/css.css";
-$ThemeSet['CSSType'] = "include";
-$ThemeSet['FavIcon'] = "themes/iDB/favicon.ico";
-$ThemeSet['TableStyle'] = "table";
-$ThemeSet['MiniPageAltStyle'] = "off";
-$ThemeSet['PreLogo'] = "<div style=\"text-align: center;\">";
-$ThemeSet['Logo'] = "%{board_name}s";
-$ThemeSet['LogoStyle'] = "font-size: 40px; font-family: verdana, arial, sans-serif; color: black;";
-$ThemeSet['SubLogo'] = "</div>";
-$ThemeSet['TopicIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Topic!\"> (T) </div>";
-$ThemeSet['HotTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Topic!\"> (T) </div>";
-$ThemeSet['PinTopic'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Pinned Topic!\"> {P} </div>";
-$ThemeSet['AnnouncementTopic'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Pinned Topic!\"> {A} </div>";
-$ThemeSet['HotPinTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Pinned Topic!\"> {P} </div>";
-$ThemeSet['ClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Topic!\"> [T] </div>";
-$ThemeSet['HotClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Topic!\"> [T] </div>";
-$ThemeSet['PinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Pinned Topic!\"> [P] </div>";
-$ThemeSet['HotPinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Pinned Topic!\"> [P] </div>";
-$ThemeSet['MovedTopicIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Topic!\"> (~T) </div>";
-$ThemeSet['MovedHotTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Topic!\"> (~T) </div>";
-$ThemeSet['MovedPinTopic'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Pinned Topic!\"> {~P} </div>";
-$ThemeSet['MovedHotPinTopic'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"Hot Pinned Topic!\"> {~P} </div>";
-$ThemeSet['MovedClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Topic!\"> [~T] </div>";
-$ThemeSet['MovedHotClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Topic!\"> [~T] </div>";
-$ThemeSet['MovedPinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through;\" title=\"Closed Pinned Topic!\"> [~P] </div>";
-$ThemeSet['MovedHotPinClosedTopic'] = "<div style=\"text-align: center; font-size: 11px; text-decoration: line-through; font-weight: bold;\" title=\"Hot Closed Pinned Topic!\"> [~P] </div>";
-$ThemeSet['MessageRead'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Message!\"> [M] </div>";
-$ThemeSet['MessageUnread'] = "<div style=\"text-align: center; font-size: 11px; font-weight: bold;\" title=\"New Message!\"> (M) </div>";
-$ThemeSet['Profile'] = "Profile";
-$ThemeSet['WWW'] = "WWW";
-$ThemeSet['PM'] = "PM";
-$ThemeSet['TopicLayout'] = "Type 1";
-$ThemeSet['AddReply'] = "<span style=\"color: white; font-size: 25px;\" title=\"Add Reply\">Add Reply</span>";
-$ThemeSet['FastReply'] = "<span style=\"color: white; font-size: 25px;\" title=\"Fast Reply\">Fast Reply</span>";
-$ThemeSet['NewTopic'] = "<span style=\"color: white; font-size: 25px;\" title=\"New Topic\">New Topic</span>";
-$ThemeSet['QuoteReply'] = "Quote";
-$ThemeSet['EditReply'] = "Edit";
-$ThemeSet['DeleteReply'] = "Delete";
-$ThemeSet['Report'] = "Report";
-$ThemeSet['LineDivider'] = "&nbsp;|&nbsp;";
-$ThemeSet['ButtonDivider'] = "&nbsp;";
-$ThemeSet['LineDividerTopic'] = "&nbsp;|&nbsp;";
-$ThemeSet['TitleDivider'] = "-&gt;";
-$ThemeSet['ForumStyle'] = 1;
-$ThemeSet['ForumIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Forum\"> (F) </div>";
-$ThemeSet['SubForumIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"SubForum\"> {SF} </div>";
-$ThemeSet['RedirectIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Redirect Forum\"> [RF] </div>";
-$ThemeSet['TitleIcon'] = null;
-$ThemeSet['NavLinkIcon'] = null;
-$ThemeSet['NavLinkDivider'] = "&nbsp;-&gt;&nbsp;";
-$ThemeSet['StatsIcon'] = "<div style=\"text-align: center; font-size: 11px;\" title=\"Board Stats\">(S)</div> ";
-$ThemeSet['NoAvatar'] = "themes/iDB/noavatar.png";
-$ThemeSet['NoAvatarSize'] = "100x100";
-?>
\ No newline at end of file
diff --git a/themes/index.php.bak b/themes/index.php.bak
deleted file mode 100644 (file)
index 14fef40..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2011 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: index.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-header('Location: ../index.php');
-?>
\ No newline at end of file
diff --git a/topic.php.bak b/topic.php.bak
deleted file mode 100644 (file)
index f64951e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/*
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Revised BSD License.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    Revised BSD License for more details.
-
-    Copyright 2004-2015 iDB Support - http://idb.berlios.de/
-    Copyright 2004-2015 Game Maker 2k - http://gamemaker2k.org/
-
-    $FileInfo: topic.php - Last Update: 01/26/2017 SVN 810 - Author: cooldude2k $
-*/
-if(ini_get("register_globals")) {
-require_once('inc/misc/killglobals.php'); }
-$checklowview = true;
-require('preindex.php');
-$usefileext = $Settings['file_ext'];
-if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
-$filewpath = $exfile['topic'].$usefileext.$_SERVER['PATH_INFO'];
-$idbactcheck = array("view", "create", "delete", "pin", "unpin", "move", "open", "close", "announce", "edit", "makereply", "editreply", "lowview");
-?>
-<?php $iWrappers['EXTRALINKS'] = null;
-ob_start("idb_suboutput_handler"); ?>
-<title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
-<?php $iWrappers['TITLETAG'] = ob_get_clean(); 
-ob_start("idb_suboutput_handler"); ?>
-</head>
-<body>
-<?php $iWrappers['BODYTAG'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if($_GET['act']!="lowview") {
-require($SettDir['inc'].'navbar.php'); }
-$iWrappers['NAVBAR'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-$ForumCheck = null;
-if($_GET['act']==null)
-{ $_GET['act']="view"; }
-if(!in_array($_GET['act'], $idbactcheck))
-{ $_GET['act']="view"; }
-if(!is_numeric($_GET['id']))
-{ $_GET['id']="1"; }
-if($_GET['act']=="view"||$_GET['act']=="create"||$_GET['act']=="delete"||
-       $_GET['act']=="pin"||$_GET['act']=="unpin"||$_GET['act']=="move"||
-       $_GET['act']=="open"||$_GET['act']=="close"||$_GET['act']=="announce")
-{ require($SettDir['inc'].'replies.php'); }
-if($_GET['act']=="edit"||$_GET['act']=="makereply"||$_POST['act']=="makereplies"||
-       $_GET['act']=="editreply"||$_POST['act']=="editreplies")
-{ require($SettDir['inc'].'replies.php'); }
-if($_GET['act']=="lowview")
-{ require($SettDir['inc'].'lowreplies.php'); }
-$iWrappers['CONTENT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-require($SettDir['inc'].'endpage.php');
-$iWrappers['COPYRIGHT'] = ob_get_clean();
-ob_start("idb_suboutput_handler");
-if(!isset($TopicName)) { $TopicName = null; }
-?>
-</body>
-</html>
-<?php 
-$iWrappers['HTMLEND'] = ob_get_clean();
-require($SettDir['inc'].'iwrapper.php');
-if($_GET['act']=="view") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); } 
-if($_GET['act']=="lowview") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="create") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Replying to ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="delete") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Deleting a Post",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="edit") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Editing a Post",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="editreply"&&$_POST['act']=="editreplies") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Editing a Post",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="pin") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Pinning a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="unpin") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Unpinning a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="open") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Opening a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="close") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Closing a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="move") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Moving a Topic",$Settings['use_gzip'],$GZipEncode['Type']); }
-if($_GET['act']=="makereply"&&$_POST['act']=="makereplies") {
-change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Replying to ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); }
-?>