From 5d091c8618de14987c76af665abd9313bb2a8278 Mon Sep 17 00:00:00 2001 From: Kazuki Przyborowski Date: Sun, 3 May 2009 05:46:49 +0000 Subject: [PATCH] Another update to Low View (Lo-Fi). git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@248 2b68903e-0b30-0410-9a39-a2e4f3c5be39 --- category.php | 8 ++- inc/lowcategories.php | 131 ++++++++++++++++++++++++++++++++++++ inc/lowforums.php | 10 +-- inc/lowsubcategories.php | 171 +++++++++++++++++++++++++++++++++++++++++++++++ inc/lowsubforums.php | 14 ++-- inc/lowtopics.php | 10 +-- inc/subcategories.php | 64 ++++++++++++++++-- inc/versioninfo.php | 6 +- subcategory.php | 8 ++- 9 files changed, 393 insertions(+), 29 deletions(-) create mode 100644 inc/lowcategories.php create mode 100644 inc/lowsubcategories.php diff --git a/category.php b/category.php index 8020f59..6a992b2 100644 --- a/category.php +++ b/category.php @@ -11,10 +11,11 @@ Copyright 2004-2009 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2009 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: category.php - Last Update: 5/01/2009 SVN 247 - Author: cooldude2k $ + $FileInfo: category.php - Last Update: 5/03/2009 SVN 248 - 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 = ""; } @@ -26,13 +27,16 @@ if(!is_numeric($_GET['id'])) <?php echo $Settings['board_name'].$idbpowertitle; ?> -=1) { +$CategoryID=mysql_result($preresult,0,"id"); +$CategoryName=mysql_result($preresult,0,"Name"); +$CategoryShow=mysql_result($preresult,0,"ShowCategory"); +$CategoryType=mysql_result($preresult,0,"CategoryType"); +$SubShowForums=mysql_result($preresult,0,"SubShowForums"); +$CategoryDescription=mysql_result($preresult,0,"Description"); +$CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums); +$CategoryPostCountView=mysql_result($preresult,0,"PostCountView"); +$CategoryKarmaCountView=mysql_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",$basedir.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",$basedir.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",$basedir.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']); +gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); } +if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") { +if(!isset($CatCheck)) { $CatCheck = null; } +if($CatCheck!="skip") { +?> +
Full Version: ">
+
">Board index">
+
 
+
+"; +if($apcl==1) { +$sflist = $sflist." ".$sfurl; } +if($apcl>1) { +$sflist = $sflist." ".$sfurl; } +$gltf[$apcl] = $SubsForumID; ++$apcl; } +++$apci; } +@mysql_free_result($apcresult); } } +if(isset($PermissionInfo['CanViewForum'][$ForumID])&& + $PermissionInfo['CanViewForum'][$ForumID]=="yes") { +$LastTopic = " 
 
 "; +if(!isset($LastTopic)) { $LastTopic = null; } +if ($ForumType=="redirect") { $LastTopic="Redirects: ".$NumRedirects; } +$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"; } +?> + +=1) { ?> +
+
 
+ diff --git a/inc/lowforums.php b/inc/lowforums.php index dd0e855..1ed8444 100644 --- a/inc/lowforums.php +++ b/inc/lowforums.php @@ -11,10 +11,10 @@ Copyright 2004-2009 Cool Dude 2k - http://idb.berlios.de/ Copyright 2004-2009 Game Maker 2k - http://intdb.sourceforge.net/ - $FileInfo: forums.php - Last Update: 5/01/2009 SVN 247 - Author: cooldude2k $ + $FileInfo: lowforums.php - Last Update: 5/03/2009 SVN 248 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); -if ($File3Name=="forums.php"||$File3Name=="/forums.php") { +if ($File3Name=="lowforums.php"||$File3Name=="/lowforums.php") { require('index.php'); exit(); } $prequery = query("SELECT * FROM `".$Settings['sqltable']."categories` WHERE `ShowCategory`='yes' AND `InSubCategory`=0 ORDER BY `OrderID` ASC, `id` ASC", array()); @@ -53,7 +53,7 @@ $num=mysql_num_rows($result); $i=0; if($num>=1) { ?> -
  • +
  • ">
  • "; +$sfurl = "
  • "; if($apcl==1) { $sflist = null; $sflist = $sflist." ".$sfurl; } @@ -121,7 +121,7 @@ $ExStr = ""; if ($ForumType!="redirect"&& $ForumShowTopics!="no") { $ExStr = "&page=1"; } ?> =1) { diff --git a/inc/lowsubcategories.php b/inc/lowsubcategories.php new file mode 100644 index 0000000..7543392 --- /dev/null +++ b/inc/lowsubcategories.php @@ -0,0 +1,171 @@ +=1) { +$CategoryID=mysql_result($checkresult,0,"id"); +$CategoryName=mysql_result($checkresult,0,"Name"); +$CategoryShow=mysql_result($checkresult,0,"ShowCategory"); +$CategoryType=mysql_result($checkresult,0,"CategoryType"); +$SubShowForums=mysql_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",$basedir.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']); +gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); } +if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") { +?> +
    Full Version: ">
    +
    ">Board index">
    +
     
    +
    +"; +if($apcl==1) { +$sflist = $sflist." ".$sfurl; } +if($apcl>1) { +$sflist = $sflist." ".$sfurl; } +$gltf[$apcl] = $SubsForumID; ++$apcl; } +++$apci; } +@mysql_free_result($apcresult); } } +if ($ForumType=="subforum") { +$apcquery = query("SELECT * FROM `".$Settings['sqltable']."forums` WHERE `ShowForum`='yes' AND `InSubForum`=%i ORDER BY `OrderID` ASC, `id` ASC", array($ForumID)); +$apcresult=mysql_query($apcquery); +$apcnum=mysql_num_rows($apcresult); +$apci=0; $apcl=1; if($apcnum>=1) { +while ($apci < $apcnum) { +$NumsTopics=mysql_result($apcresult,$apci,"NumTopics"); +$NumTopics = $NumsTopics + $NumTopics; +$NumsPosts=mysql_result($apcresult,$apci,"NumPosts"); +$NumPosts = $NumsPosts + $NumPosts; +$SubsForumID=mysql_result($apcresult,$apci,"id"); +if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&& + $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") { +$gltf[$apcl] = $SubsForumID; ++$apcl; } +++$apci; } +@mysql_free_result($apcresult); } } +if(isset($PermissionInfo['CanViewForum'][$ForumID])&& + $PermissionInfo['CanViewForum'][$ForumID]=="yes") { +$LastTopic = null; +if(!isset($LastTopic)) { $LastTopic = null; } +$gltnum = count($gltf); $glti = 0; +$OldUpdateTime = 0; $UseThisFonum = null; +if ($ForumType=="subforum") { +while ($glti < $gltnum) { +$gltfoquery = query("SELECT * FROM `".$Settings['sqltable']."topics` WHERE `CategoryID`=%i AND `ForumID`=%i ORDER BY `LastUpdate` DESC LIMIT 1", array($CategoryID,$gltf[$glti])); +$gltforesult=mysql_query($gltfoquery); +$gltfonum=mysql_num_rows($gltforesult); +if($gltfonum>0) { +$NewUpdateTime=mysql_result($gltforesult,0,"LastUpdate"); +if($NewUpdateTime>$OldUpdateTime) { + $UseThisFonum = $gltf[$glti]; +$OldUpdateTime = $NewUpdateTime; } } +@mysql_free_result($gltforesult); +++$glti; } } +if ($ForumType=="redirect") { $LastTopic="Redirects: ".$NumRedirects; } +$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"; } +?> + + + +