OSDN Git Service

Add files via upload
[idb/iDB.git.git] / inc / groupsetup.php
index 1aee9ad..f716272 100644 (file)
@@ -8,16 +8,34 @@
     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/
+    Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
+    Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
 
-    $FileInfo: groupsetup.php - Last Update: 08/12/2011 SVN 748 - Author: cooldude2k $
+    $FileInfo: groupsetup.php - Last Update: 4/6/2022 SVN 946 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="groupsetup.php"||$File3Name=="/groupsetup.php") {
        require('index.php');
        exit(); }
 //Set members temp location
+if(isset($_SESSION['OldViewingPage'])) { $_SESSION['AncientViewingPage'] = $_SESSION['OldViewingPage']; } else { $_SESSION['AncientViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
+if(isset($_SESSION['OldViewingFile'])) { $_SESSION['AncientViewingFile'] = $_SESSION['OldViewingFile']; } else { 
+        if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
+           $_SESSION['AncientViewingFile'] = $exfile['index'].$Settings['file_ext']; }
+        if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
+           $_SESSION['AncientViewingFile'] = $exfile['index']; } }
+if(isset($_SESSION['OldPreViewingTitle'])) { $_SESSION['AncientPreViewingTitle'] = $_SESSION['OldPreViewingTitle']; } else { $_SESSION['AncientPreViewingTitle'] = "Viewing"; }
+if(isset($_SESSION['OldViewingTitle'])) { $_SESSION['AncientViewingTitle'] = $_SESSION['OldViewingTitle']; } else { $_SESSION['AncientViewingTitle'] = "Board index"; }
+if(isset($_SESSION['OldExtraData'])) { $_SESSION['AncientExtraData'] = $_SESSION['OldExtraData']; } else { $_SESSION['AncientExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; }
+if(isset($_SESSION['ViewingPage'])) { $_SESSION['OldViewingPage'] = $_SESSION['ViewingPage']; } else { $_SESSION['OldViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
+if(isset($_SESSION['ViewingFile'])) { $_SESSION['OldViewingFile'] = $_SESSION['ViewingFile']; } else { 
+        if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
+           $_SESSION['OldViewingFile'] = $exfile['index'].$Settings['file_ext']; }
+        if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
+           $_SESSION['OldViewingFile'] = $exfile['index']; } }
+if(isset($_SESSION['PreViewingTitle'])) { $_SESSION['OldPreViewingTitle'] = $_SESSION['PreViewingTitle']; } else { $_SESSION['OldPreViewingTitle'] = "Viewing"; }
+if(isset($_SESSION['ViewingTitle'])) { $_SESSION['OldViewingTitle'] = $_SESSION['ViewingTitle']; } else { $_SESSION['OldViewingTitle'] = "Board index"; }
+if(isset($_SESSION['ExtraData'])) { $_SESSION['OldExtraData'] = $_SESSION['ExtraData']; } else { $_SESSION['OldExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid: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']; }
@@ -25,6 +43,7 @@ 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");*/
@@ -40,6 +59,8 @@ $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");
@@ -56,12 +77,11 @@ $Settings['max_topics'] = $MyTopicsPerPage;
 $MyMessagesPerPage=sql_result($resultchkusr,0,"MessagesPerPage");
 $Settings['max_memlist'] = $MyMessagesPerPage;
 $Settings['max_pmlist'] = $MyMessagesPerPage;
-$ChkUsrDST=sql_result($resultchkusr,0,"DST");
 $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 = GMTimeStamp();
+$ChkUsrGMTime = $utccurtime->getTimestamp();
 if($ChkUsrBanTime!=0&&$ChkUsrBanTime!=null) {
 if($ChkUsrBanTime>=$ChkUsrGMTime) { $BanError = "yes"; }
 if($ChkUsrBanTime<0) { $BanError = "yes"; } }
@@ -71,30 +91,32 @@ $_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['UserDST']=$ChkUsrDST;
 $_SESSION['UserPass']=$ChkUsrPass;
 $_SESSION['LastPostTime'] = $ChkUsrLastPostTime; } }
 if($numchkusr<=0||$numchkusr>1||$BanError=="yes") { session_unset();
 if($cookieDomain==null) {
-setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir);
-setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir);
-setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir);
-setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir); }
+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, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
-setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1); }
+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, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
-setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
-setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir, $cookieDomain); } }
+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);
@@ -116,6 +138,27 @@ $gidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHE
 $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) { 
@@ -209,13 +252,13 @@ if($GroupInfo['CanDoHTML']=="group") {
 $GroupInfo['CanDoHTML']=sql_result($gruresult,0,"CanDoHTML");
 if($GroupInfo['CanDoHTML']!="yes"&&$GroupInfo['CanDoHTML']!="no") {
        $GroupInfo['CanDoHTML'] = "no"; } }
-$GroupInfo['CanUseBBags']=sql_result($mempreresult,0,"CanUseBBags");
-if($GroupInfo['CanUseBBags']!="yes"&&$GroupInfo['CanUseBBags']!="no"&&$GroupInfo['CanUseBBags']!="group") {
-       $GroupInfo['CanUseBBags'] = "no"; }
-if($GroupInfo['CanUseBBags']=="group") {
-$GroupInfo['CanUseBBags']=sql_result($gruresult,0,"CanUseBBags");
-if($GroupInfo['CanUseBBags']!="yes"&&$GroupInfo['CanUseBBags']!="no") {
-       $GroupInfo['CanUseBBags'] = "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'])) { 
@@ -231,7 +274,7 @@ if(!isset($Settings['KBoostPercent'])) {
 //Update karma and group upgrade on post count or karma count.
 if($_SESSION['UserID']!=0) { $BoostTotal = null;
 $KarmaExp = explode("&",$Settings['KarmaBoostDays']);
-$KarmaNow = GMTimeGet("md",$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
+$KarmaNow = $usercurtime->format("md");
 $kupdate = false;
 if(in_array($KarmaNow,$KarmaExp)) {
 $KarmaNum = count($KarmaExp); 
@@ -243,8 +286,8 @@ $kupdate = true; break 1; }
 ++$Karmai; } }
 if($kupdate===false) {
 $Settings['KarmaBoostDays'] = $KarmaExp[0]; }
-$NewKarmaUpdate = GMTimeGet("Ymd",$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
-$ThisYearUpdate = GMTimeGet("Y",$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
+$NewKarmaUpdate = $usercurtime->format("Ymd");
+$ThisYearUpdate = $usercurtime->format("Y");
 if($MyKarmaUpdate<$NewKarmaUpdate&&$MyPostCountChk>0) { 
        $KarmaBoostDay = $Settings['KarmaBoostDays'];
        $KBoostPercent = explode("|",$Settings['KBoostPercent']);
@@ -269,6 +312,20 @@ if($MyKarmaUpdate<$NewKarmaUpdate&&$MyPostCountChk>0) {
        $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);
@@ -297,6 +354,20 @@ 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"; }
@@ -306,10 +377,12 @@ 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($mempreresult); $urlstatus = 503;
+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;
@@ -399,21 +472,25 @@ if($PermissionInfo['CanPinTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanPinT
 $PermissionInfo['CanDoHTML'][$PerForumID]=sql_result($peresult,$peri,"CanDoHTML");
 if($PermissionInfo['CanDoHTML'][$PerForumID]!="yes"&&$PermissionInfo['CanDoHTML'][$PerForumID]!="no") {
        $PermissionInfo['CanDoHTML'][$PerForumID] = "no"; }
-$PermissionInfo['CanUseBBags'][$PerForumID]=sql_result($peresult,$peri,"CanUseBBags");
-if($PermissionInfo['CanUseBBags'][$PerForumID]!="yes"&&$PermissionInfo['CanUseBBags'][$PerForumID]!="no") {
-       $PermissionInfo['CanUseBBags'][$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(isset($ModForumIgnoreList1)) {
 if(strlen($ModForumIgnoreList1)>1) { $ModForumIgnoreList1 .= " AND \"id\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList1)<1) { $ModForumIgnoreList1 = " \"id\"<>".$PerForumID; }
+if(strlen($ModForumIgnoreList1)<1) { $ModForumIgnoreList1 = " \"id\"<>".$PerForumID; } }
+if(isset($ModForumIgnoreList2)) {
 if(strlen($ModForumIgnoreList2)>1) { $ModForumIgnoreList2 .= " AND \"id\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList2)<1) { $ModForumIgnoreList2 = " AND \"id\"<>".$PerForumID; }
+if(strlen($ModForumIgnoreList2)<1) { $ModForumIgnoreList2 = " AND \"id\"<>".$PerForumID; } }
+if(isset($ModForumIgnoreList3)) {
 if(strlen($ModForumIgnoreList3)>1) { $ModForumIgnoreList3 .= " AND \"ForumID\"<>".$PerForumID; }
-if(strlen($ModForumIgnoreList3)<1) { $ModForumIgnoreList3 = " WHERE \"ForumID\"<>".$PerForumID; }
+if(strlen($ModForumIgnoreList3)<1) { $ModForumIgnoreList3 = " WHERE \"ForumID\"<>".$PerForumID; } }
+if(isset($ModForumIgnoreList4)) {
 if(strlen($ModForumIgnoreList4)>1) { $ModForumIgnoreList4 .= " AND \"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;