3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: lowforums.php - Last Update: 07/18/2011 SVN 719 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="lowforums.php"||
$File3Name=="/lowforums.php") {
20 $prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"ShowCategory\"='yes' AND \"InSubCategory\"=0".$CatIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array());
21 $preresult=sql_query($prequery,$SQLStat);
22 $prenum=sql_num_rows($preresult);
24 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview","&","=",$prexqstr['index'],$exqstr['index']);
25 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
26 $_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
27 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
28 $_SESSION['ViewingFile'] = $exfile['index']; }
29 $_SESSION['PreViewingTitle'] = "Viewing";
30 $_SESSION['ViewingTitle'] = "Board index";
32 <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
>
33 <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
>
35 <div style
="padding: 10px; border: 1px solid gray;">
36 <ul style
="list-style-type: none;">
38 while ($prei < $prenum) {
39 $CategoryID=sql_result($preresult,$prei,"id");
40 $CategoryName=sql_result($preresult,$prei,"Name");
41 $CategoryShow=sql_result($preresult,$prei,"ShowCategory");
42 if($CategoryShow=="yes") { $_SESSION['ShowActHidden'] = "yes"; }
43 $CategoryType=sql_result($preresult,$prei,"CategoryType");
44 $SubShowForums=sql_result($preresult,$prei,"SubShowForums");
45 $CategoryDescription=sql_result($preresult,$prei,"Description");
46 $CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
47 $CategoryPostCountView=sql_result($preresult,0,"PostCountView");
48 $CategoryKarmaCountView=sql_result($preresult,0,"KarmaCountView");
49 if($MyPostCountChk==null) { $MyPostCountChk = 0; }
50 if($MyKarmaCount==null) { $MyKarmaCount = 0; }
51 if($GroupInfo['HasAdminCP']!="yes"||
$GroupInfo['HasModCP']!="yes") {
52 if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
53 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
54 if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
55 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
56 if(isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
57 $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
58 $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));
59 $result=sql_query($query,$SQLStat);
60 $num=sql_num_rows($result);
64 <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
>
67 $ForumID=sql_result($result,$i,"id");
68 $ForumName=sql_result($result,$i,"Name");
69 $ForumShow=sql_result($result,$i,"ShowForum");
70 if($ForumShow=="yes") { $_SESSION['ShowActHidden'] = "yes"; }
71 $ForumType=sql_result($result,$i,"ForumType");
72 $ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
73 $ForumShowTopics = strtolower($ForumShowTopics);
74 $NumTopics=sql_result($result,$i,"NumTopics");
75 $NumPosts=sql_result($result,$i,"NumPosts");
76 $NumRedirects=sql_result($result,$i,"Redirects");
77 $ForumDescription=sql_result($result,$i,"Description");
78 $ForumType = strtolower($ForumType); $sflist = null;
79 $gltf = array(null); $gltf[0] = $ForumID;
80 if ($ForumType=="subforum") {
81 $apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
82 $apcresult=sql_query($apcquery,$SQLStat);
83 $apcnum=sql_num_rows($apcresult);
84 $apci=0; $apcl=1; if($apcnum>=1) {
85 while ($apci < $apcnum) {
86 $NumsTopics=sql_result($apcresult,$apci,"NumTopics");
87 $NumTopics = $NumsTopics +
$NumTopics;
88 $NumsPosts=sql_result($apcresult,$apci,"NumPosts");
89 $NumPosts = $NumsPosts +
$NumPosts;
90 $SubsForumID=sql_result($apcresult,$apci,"id");
91 $SubsForumName=sql_result($apcresult,$apci,"Name");
92 $SubsForumType=sql_result($apcresult,$apci,"ForumType");
93 $SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
94 if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
95 $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
96 $ExStr = ""; if ($SubsForumType!="redirect"&&
97 $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
99 if ($SubsForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
100 if ($SubsForumType!="redirect") { $shownum = "(".$NumsPosts." posts)"; }
101 $sfurl = "<a href=\"";
102 $sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=lowview&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
103 $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>";
106 $sflist = $sflist." ".$sfurl; }
108 $sflist = $sflist." ".$sfurl; }
109 $gltf[$apcl] = $SubsForumID; ++
$apcl; }
111 sql_free_result($apcresult); } }
112 if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
113 $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
114 $LastTopic = " <br /> <br /> ";
115 if(!isset($LastTopic)) { $LastTopic = null; }
116 $gltnum = count($gltf); $glti = 0;
117 $OldUpdateTime = 0; $UseThisFonum = null;
118 if ($ForumType=="subforum") {
119 while ($glti < $gltnum) {
120 $ExtraIgnores = null;
121 if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
122 $ExtraIgnores = " AND \"Closed\"<>3"; }
123 $gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($gltf[$glti]));
124 $gltforesult=sql_query($gltfoquery,$SQLStat);
125 $gltfonum=sql_num_rows($gltforesult);
127 $NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
128 if($NewUpdateTime>$OldUpdateTime) {
129 $UseThisFonum = $gltf[$glti];
130 $OldUpdateTime = $NewUpdateTime; } }
131 sql_free_result($gltforesult);
134 if ($ForumType=="redirect") { $shownum = "(".$NumRedirects." redirects)"; }
135 if ($ForumType!="redirect") { $shownum = "(".$NumPosts." posts)"; }
136 $PreForum = $ThemeSet['ForumIcon'];
137 if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
138 if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
139 if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
140 $ExStr = ""; if ($ForumType!="redirect"&&
141 $ForumShowTopics!="no") { $ExStr = "&page=1"; }
143 <ul style
="list-style-type: none;"><li
>
144 <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
>
145 <?php
echo $sflist; ?
></ul
>
146 <?php
} ++
$i; } sql_free_result($result);
152 sql_free_result($preresult); ?
>