OSDN Git Service

Added ForumIgnoreList.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sat, 11 Sep 2010 04:54:33 +0000 (04:54 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sat, 11 Sep 2010 04:54:33 +0000 (04:54 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@536 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/groupsetup.php
inc/searchs.php
inc/versioninfo.php

index 87870e6..594c240 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: groupsetup.php - Last Update: 06/07/2010 SVN 520 - Author: cooldude2k $
+    $FileInfo: groupsetup.php - Last Update: 09/10/2010 SVN 536 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="groupsetup.php"||$File3Name=="/groupsetup.php") {
@@ -247,6 +247,10 @@ if($pernum<0) { $PerError = true; sql_free_result($peresult);
 header("Content-Type: text/plain; charset=".$Settings['charset']); 
 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;
+$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; }
@@ -260,6 +264,15 @@ 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 = " \"ForumID\"<>".$PerForumID; }
+if(strlen($ForumIgnoreList4)>1) { $ForumIgnoreList4 .= " AND \"ForumID\"<>".$PerForumID; }
+if(strlen($ForumIgnoreList4)<1) { $ForumIgnoreList4 = " AND \"ForumID\"<>".$PerForumID; } }
 $PermissionInfo['CanMakeTopics'][$PerForumID]=sql_result($peresult,$peri,"CanMakeTopics");
 if($PermissionInfo['CanMakeTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeTopics'][$PerForumID]!="no") {
                $PerError = true; }
@@ -308,6 +321,15 @@ if($PermissionInfo['CanUseBBags'][$PerForumID]!="yes"&&$PermissionInfo['CanUseBB
 $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 = " \"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);
@@ -322,6 +344,8 @@ if($per2num<=0) { $Per2Error = true; sql_free_result($per2esult);
 header("Content-Type: text/plain; charset=".$Settings['charset']); 
 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;
 if($per2num>=1) { while ($per2i < $per2num) {
 $PerCatID=sql_result($per2esult,$per2i,"CategoryID");
 if(!is_numeric($PerCatID)) { $Per2Error = true; }
@@ -334,6 +358,15 @@ $CatPermissionInfo['CategoryID'][$PerCatID]=sql_result($per2esult,$per2i,"Catego
 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 = " \"CategoryID\"<>".$PerCatID; }
+if(strlen($CatIgnoreList4)>1) { $CatIgnoreList4 .= " AND \"CategoryID\"<>".$PerCatID; }
+if(strlen($CatIgnoreList4)<1) { $CatIgnoreList4 = " AND \"CategoryID\"<>".$PerCatID; } }
 if($Per2Error===true) { $per2i = $per2num; }
 ++$per2i; } if($Per2Error===true) {
 header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($per2esult);
index 6eb1f62..9278259 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: searchs.php - Last Update: 09/10/2010 SVN 535 - Author: cooldude2k $
+    $FileInfo: searchs.php - Last Update: 09/10/2010 SVN 536 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="searchs.php"||$File3Name=="/searchs.php") {
@@ -102,24 +102,24 @@ $PageLimit = $nums - $Settings['max_topics'];
 if($PageLimit<0) { $PageLimit = 0; }
 if($_GET['msearch']==null) {
 if($_GET['type']!="wildcard") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' 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'", array($_GET['search'])); }
+$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s'".$ForumIgnoreList2." 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'".$ForumIgnoreList2."", array($_GET['search'])); }
 if($_GET['type']=="wildcard") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' 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'", array($_GET['search'])); } }
+$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s'".$ForumIgnoreList2." 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'".$ForumIgnoreList2."", array($_GET['search'])); } }
 if($_GET['msearch']!=null) {
 if($_GET['type']!="wildcard") {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"UserID\"=%i 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", array($_GET['search']));
+$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"UserID\"=%i".$ForumIgnoreList2." 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".$ForumIgnoreList2."", array($_GET['search']));
 if($memsid==-1) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"GuestName\"='%s' 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'", array($_GET['search'],$_GET['msearch'])); } }
+$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\"='%s' AND \"GuestName\"='%s'".$ForumIgnoreList2." 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'".$ForumIgnoreList2."", 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 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", array($_GET['search'],$_GET['msearch']));
+$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"UserID\"=%i".$ForumIgnoreList2." 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".$ForumIgnoreList2."", array($_GET['search'],$_GET['msearch']));
 if($memsid==-1) {
-$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"GuestName\"='%s' 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'", array($_GET['search'],$_GET['msearch'])); } } }
+$query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"TopicName\" LIKE '%s' AND \"GuestName\"='%s'".$ForumIgnoreList2." 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'".$ForumIgnoreList2."", array($_GET['search'],$_GET['msearch'])); } } }
 $result=sql_query($query,$SQLStat);
 $rnresult=sql_query($rnquery,$SQLStat);
 $NumberTopics = sql_result($rnresult,0);
@@ -360,7 +360,13 @@ if($NumberPages>=2) {
 $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); }
@@ -368,10 +374,12 @@ $UsersName = $PreUsersName['Name'];
 $UsersHidden = $PreUsersName['Hidden'];
 if($UsersName=="Guest") { $UsersName=$GuestsName;
 if($UsersName==null) { $UsersName="Guest"; } }
-if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
-       $PermissionInfo['CanViewForum'][$ForumID]=="yes"&&
-       isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
-       $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
+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);
@@ -412,12 +420,6 @@ $LastReply = "Time: <a href=\"".$luln."\">".$TimeStamp1."</a><br />\n".$UserPre.
 sql_free_result($glrresult);
 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 ($PinnedTopic>0&&$PinnedTopic<3&&$TopicStat==0) {
        if($NumReply>=$Settings['hot_topic_num']) {
                $PreTopic=$ThemeSet['HotPinTopic']; }
index 519b160..e0fe423 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 09/10/2010 SVN 535 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 09/10/2010 SVN 536 - 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] = 0; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 535; $RName = "iDB"; $SFName = "IntDB";
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 536; $RName = "iDB"; $SFName = "IntDB";
 $SVNDay[0] = 09; $SVNDay[1] = 10; $SVNDay[2] = 2010; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $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,true);