Small bug fix. :P
[iDB.git] / inc / subcategories.php
blob815966bb9356b0be410aa8de04a417b73d3d5863
1 <?php
2 /*
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: subcategories.php - Last Update: 07/18/2011 SVN 720 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="subcategories.php"||$File3Name=="/subcategories.php") {
18 require('index.php');
19 exit(); }
20 if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
21 if(!isset($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
22 if(!is_numeric($ThemeSet['ForumStyle'])) { $ThemeSet['ForumStyle'] = 1; }
23 if($ThemeSet['ForumStyle']>2||$ThemeSet['ForumStyle']<1) {
24 $ThemeSet['ForumStyle'] = 1; }
25 $checkquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($_GET['id']));
26 $checkresult=sql_query($checkquery,$SQLStat);
27 $checknum=sql_num_rows($checkresult);
28 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);
29 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
30 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
31 if($checknum>=1) {
32 $CategoryID=sql_result($checkresult,0,"id");
33 $CategoryName=sql_result($checkresult,0,"Name");
34 $CategoryShow=sql_result($checkresult,0,"ShowCategory");
35 if($CategoryShow=="yes") { $_SESSION['ShowActHidden'] = "yes"; }
36 $CategoryType=sql_result($checkresult,0,"CategoryType");
37 $InSubCategory=sql_result($checkresult,0,"InSubCategory");
38 $SubShowForums=sql_result($checkresult,0,"SubShowForums");
39 $CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
40 $SCategoryName = $CategoryName;
41 if(!isset($CatPermissionInfo['CanViewCategory'][$CategoryID])) {
42 $CatPermissionInfo['CanViewCategory'][$CategoryID] = "no"; }
43 if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="no"||
44 $CatPermissionInfo['CanViewCategory'][$CategoryID]!="yes") {
45 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
46 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
47 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
48 if($CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
49 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$CategoryID,"&","=",$prexqstr[$CategoryType],$exqstr[$CategoryType]);
50 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
51 $_SESSION['ViewingFile'] = $exfile[$CategoryType].$Settings['file_ext']; }
52 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
53 $_SESSION['ViewingFile'] = $exfile[$CategoryType]; }
54 $_SESSION['PreViewingTitle'] = "Viewing SubCategory:";
55 $_SESSION['ViewingTitle'] = $CategoryName;
56 if($InSubCategory!="0") {
57 $iscquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($InSubCategory));
58 $iscresult=sql_query($iscquery,$SQLStat);
59 $iscnum=sql_num_rows($iscresult);
60 if($iscnum>=1) {
61 $iscCategoryID=sql_result($iscresult,0,"id");
62 $iscCategoryName=sql_result($iscresult,0,"Name");
63 $iscCategoryShow=sql_result($iscresult,0,"ShowCategory");
64 $iscCategoryType=sql_result($iscresult,0,"CategoryType");
65 $iscCategoryType = strtolower($iscCategoryType); }
66 if($iscnum<1) { $InSubCategory = "0"; }
67 sql_free_result($iscresult); }
69 <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>
70 <div class="DivNavLinks">&nbsp;</div>
71 <?php
72 if($CategoryType=="category") {
73 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));
74 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
75 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
76 sql_free_result($checkresult);
77 $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']));
78 $preresult=sql_query($prequery,$SQLStat);
79 $prenum=sql_num_rows($preresult);
80 $prei=0;
81 while ($prei < $prenum) {
82 $CategoryID=sql_result($preresult,$prei,"id");
83 $CategoryName=sql_result($preresult,$prei,"Name");
84 $CategoryShow=sql_result($preresult,$prei,"ShowCategory");
85 $CategoryType=sql_result($preresult,$prei,"CategoryType");
86 $SSubShowForums=sql_result($preresult,$prei,"SubShowForums");
87 $CategoryDescription=sql_result($preresult,$prei,"Description");
88 $CategoryType = strtolower($CategoryType); $SubShowForums = strtolower($SubShowForums);
89 if(isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
90 $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
91 $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));
92 $result=sql_query($query,$SQLStat);
93 $num=sql_num_rows($result);
94 $i=0;
95 if($num>=1) {
97 <div class="Table1Border">
98 <?php if($ThemeSet['TableStyle']=="div") { ?>
99 <div class="TableRow1">
100 <span style="text-align: left;">
101 <?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>
102 <?php } ?>
103 <table class="Table1" id="SubCat<?php echo $CategoryID; ?>">
104 <?php if($ThemeSet['TableStyle']=="table") { ?>
105 <tr id="SubCatStart<?php echo $CategoryID; ?>" class="TableRow1">
106 <td class="TableColumn1" colspan="5"><span style="text-align: left;">
107 <?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>
108 </td>
109 </tr><?php } ?>
110 <tr id="ForumStatRow<?php echo $CategoryID; ?>" class="TableRow2">
111 <th class="TableColumn2" style="width: 4%;">&nbsp;</th>
112 <th class="TableColumn2" style="width: 58%;">Forum</th>
113 <th class="TableColumn2" style="width: 7%;">Topics</th>
114 <th class="TableColumn2" style="width: 7%;">Posts</th>
115 <th class="TableColumn2" style="width: 24%;">Last Topic</th>
116 </tr>
117 <?php }
118 while ($i < $num) {
119 $ForumID=sql_result($result,$i,"id");
120 $ForumName=sql_result($result,$i,"Name");
121 $ForumShow=sql_result($result,$i,"ShowForum");
122 $ForumType=sql_result($result,$i,"ForumType");
123 $ForumShowTopics=sql_result($result,$i,"CanHaveTopics");
124 $ForumShowTopics = strtolower($ForumShowTopics);
125 $NumTopics=sql_result($result,$i,"NumTopics");
126 $NumPosts=sql_result($result,$i,"NumPosts");
127 $NumRedirects=sql_result($result,$i,"Redirects");
128 $ForumDescription=sql_result($result,$i,"Description");
129 $ForumType = strtolower($ForumType); $sflist = null;
130 $gltf = array(null); $gltf[0] = $ForumID;
131 if ($ForumType=="subforum") {
132 $apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
133 $apcresult=sql_query($apcquery,$SQLStat);
134 $apcnum=sql_num_rows($apcresult);
135 $apci=0; $apcl=1; if($apcnum>=1) {
136 while ($apci < $apcnum) {
137 $NumsTopics=sql_result($apcresult,$apci,"NumTopics");
138 $NumTopics = $NumsTopics + $NumTopics;
139 $NumsPosts=sql_result($apcresult,$apci,"NumPosts");
140 $NumPosts = $NumsPosts + $NumPosts;
141 $SubsForumID=sql_result($apcresult,$apci,"id");
142 $SubsForumName=sql_result($apcresult,$apci,"Name");
143 $SubsForumType=sql_result($apcresult,$apci,"ForumType");
144 $SubsForumShowTopics=sql_result($result,$i,"CanHaveTopics");
145 if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
146 $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
147 $ExStr = ""; if ($SubsForumType!="redirect"&&
148 $SubsForumShowTopics!="no") { $ExStr = "&page=1"; }
149 $sfurl = "<a href=\"";
150 $sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
151 $sfurl = "<a href=\"".$sfurl."\">".$SubsForumName."</a>";
152 if($apcl==1) {
153 $sflist = "Subforums:";
154 $sflist = $sflist." ".$sfurl; }
155 if($apcl>1) {
156 $sflist = $sflist.", ".$sfurl; }
157 $gltf[$apcl] = $SubsForumID; ++$apcl; }
158 ++$apci; }
159 sql_free_result($apcresult); } }
160 $gltf = array(null); $gltf[0] = $ForumID;
161 if ($ForumType=="subforum") {
162 $apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
163 $apcresult=sql_query($apcquery,$SQLStat);
164 $apcnum=sql_num_rows($apcresult);
165 $apci=0; $apcl=1; if($apcnum>=1) {
166 while ($apci < $apcnum) {
167 $NumsTopics=sql_result($apcresult,$apci,"NumTopics");
168 $NumTopics = $NumsTopics + $NumTopics;
169 $NumsPosts=sql_result($apcresult,$apci,"NumPosts");
170 $NumPosts = $NumsPosts + $NumPosts;
171 $SubsForumID=sql_result($apcresult,$apci,"id");
172 $SubsForumName=sql_result($apcresult,$apci,"Name");
173 $SubsForumType=sql_result($apcresult,$apci,"ForumType");
174 if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
175 $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
176 $sfurl = "<a href=\"";
177 $sfurl = url_maker($exfile[$SubsForumType],$Settings['file_ext'],"act=view&id=".$SubsForumID.$ExStr,$Settings['qstr'],$Settings['qsep'],$prexqstr[$SubsForumType],$exqstr[$SubsForumType]);
178 $sfurl = "<a href=\"".$sfurl."\">".$SubsForumName."</a>";
179 if($apcl==1) {
180 $sflist = "Subforums:";
181 $sflist = $sflist." ".$sfurl; }
182 if($apcl>1) {
183 $sflist = $sflist.", ".$sfurl; }
184 $gltf[$apcl] = $SubsForumID; ++$apcl; }
185 ++$apci; }
186 sql_free_result($apcresult); } }
187 if ($ForumType=="subforum") {
188 $apcquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"ShowForum\"='yes' AND \"InSubForum\"=%i".$ForumIgnoreList2." ORDER BY \"OrderID\" ASC, \"id\" ASC", array($ForumID));
189 $apcresult=sql_query($apcquery,$SQLStat);
190 $apcnum=sql_num_rows($apcresult);
191 $apci=0; $apcl=1; if($apcnum>=1) {
192 while ($apci < $apcnum) {
193 $NumsTopics=sql_result($apcresult,$apci,"NumTopics");
194 $NumTopics = $NumsTopics + $NumTopics;
195 $NumsPosts=sql_result($apcresult,$apci,"NumPosts");
196 $NumPosts = $NumsPosts + $NumPosts;
197 $SubsForumID=sql_result($apcresult,$apci,"id");
198 if(isset($PermissionInfo['CanViewForum'][$SubsForumID])&&
199 $PermissionInfo['CanViewForum'][$SubsForumID]=="yes") {
200 $gltf[$apcl] = $SubsForumID; ++$apcl; }
201 ++$apci; }
202 sql_free_result($apcresult); } }
203 if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
204 $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
205 $LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;";
206 if(!isset($LastTopic)) { $LastTopic = null; }
207 $gltnum = count($gltf); $glti = 0;
208 $OldUpdateTime = 0; $UseThisFonum = null;
209 if ($ForumType=="subforum") {
210 while ($glti < $gltnum) {
211 $ExtraIgnores = null;
212 if($PermissionInfo['CanModForum'][$gltf[$glti]]=="no") {
213 $ExtraIgnores = " AND \"Closed\"<>3"; }
214 $gltfoquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"LastUpdate\" DESC LIMIT 1", array($gltf[$glti]));
215 $gltforesult=sql_query($gltfoquery,$SQLStat);
216 $gltfonum=sql_num_rows($gltforesult);
217 if($gltfonum>0) {
218 $NewUpdateTime=sql_result($gltforesult,0,"LastUpdate");
219 if($NewUpdateTime>$OldUpdateTime) {
220 $UseThisFonum = $gltf[$glti];
221 $OldUpdateTime = $NewUpdateTime; }
222 sql_free_result($gltforesult); }
223 ++$glti; }
224 if($UseThisFonum==0) {
225 $UseThisFonum = $gltf[0]; } }
226 if ($ForumType!="subforum"&&$ForumType!="redirect") { $UseThisFonum = $gltf[0]; }
227 if ($ForumType!="redirect") {
228 $ExtraIgnores = null;
229 if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
230 $ExtraIgnores = " AND \"Closed\"<>3"; }
231 $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));
232 $gltresult=sql_query($gltquery,$SQLStat);
233 $gltnum=sql_num_rows($gltresult);
234 if($gltnum>0){
235 $TopicID=sql_result($gltresult,0,"id");
236 $TopicName=sql_result($gltresult,0,"TopicName");
237 $NumReplys=sql_result($gltresult,0,"NumReply");
238 $NumPages = null; $NumRPosts = $NumReplys + 1;
239 if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
240 if($NumRPosts>$Settings['max_posts']) {
241 $NumPages = ceil($NumRPosts/$Settings['max_posts']); }
242 if($NumRPosts<=$Settings['max_posts']) { $NumPages = 1; }
243 $TopicName1 = pre_substr($TopicName,0,20);
244 $oldtopicname=$TopicName;
245 if (pre_strlen($TopicName)>20) {
246 $TopicName1 = $TopicName1."..."; $TopicName=$TopicName1; }
247 $glrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" DESC LIMIT 1", array($TopicID));
248 $glrresult=sql_query($glrquery,$SQLStat);
249 $glrnum=sql_num_rows($glrresult);
250 if($glrnum>0){
251 $ReplyID=sql_result($glrresult,0,"id");
252 $UsersID=sql_result($glrresult,0,"UserID");
253 $GuestsName=sql_result($glrresult,0,"GuestName");
254 $TimeStamp=sql_result($glrresult,0,"TimeStamp");
255 $TimeStamp=GMTimeChange("F j Y, ".$Settings['idb_time_format'],$TimeStamp,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
256 sql_free_result($glrresult); }
257 $PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat);
258 if($PreUsersName['Name']===null) { $UsersID = -1;
259 $PreUsersName = GetUserName($UsersID,$Settings['sqltable'],$SQLStat); }
260 $UsersName = $PreUsersName['Name'];
261 $UsersHidden = $PreUsersName['Hidden'];
262 if($UsersName=="Guest") { $UsersName=$GuestsName;
263 if($UsersName==null) { $UsersName="Guest"; } }
264 $UsersName1 = pre_substr($UsersName,0,20);
265 $oldusername=$UsersName;
266 if (pre_strlen($UsersName)>20) {
267 $UsersName1 = $UsersName1."..."; $UsersName=$UsersName1; }
268 $lul = null;
269 if($UsersID>0&&$UsersHidden=="no") {
270 $lul = url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$UsersID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
271 $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>"; }
272 if($UsersID<=0||$UsersHidden=="yes") {
273 if($UsersID==-1) { $UserPre = "Guest:"; }
274 if(($UsersID<-1&&$UsersHidden=="yes")||$UsersID==0||($UsersID>0&&$UsersHidden=="yes")) {
275 $UserPre = "Hidden:"; }
276 $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>"; } }
277 if($LastTopic==null) { $LastTopic = "&nbsp;<br />&nbsp;<br />&nbsp;"; }
278 sql_free_result($gltresult); }
279 if ($ForumType=="redirect") { $LastTopic="&nbsp;<br />Redirects: ".$NumRedirects."<br />&nbsp;"; }
280 $PreForum = $ThemeSet['ForumIcon'];
281 if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
282 if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
283 if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
284 $ExStr = ""; if ($ForumType!="redirect"&&
285 $ForumShowTopics!="no") { $ExStr = "&page=1"; }
286 if($ThemeSet['ForumStyle']==1) {
287 $ForumClass[1] = " class=\"TableColumn3\" ";
288 $ForumClass[2] = " class=\"TableColumn3\" ";
289 $ForumClass[3] = " class=\"TableColumn3\" ";
290 $ForumClass[4] = " class=\"TableColumn3\" ";
291 $ForumClass[5] = " class=\"TableColumn3\" "; }
292 if($ThemeSet['ForumStyle']==2) {
293 $ForumClass[1] = " class=\"TableColumn3\" ";
294 $ForumClass[2] = " class=\"TableColumn3\" ";
295 $ForumClass[3] = " class=\"TableColumn3Alt\" ";
296 $ForumClass[4] = " class=\"TableColumn3Alt\" ";
297 $ForumClass[5] = " class=\"TableColumn3Alt\" "; }
299 <tr class="TableRow3" id="Forum<?php echo $ForumID; ?>">
300 <td<?php echo $ForumClass[1]; ?>><div class="forumicon">
301 <?php echo $PreForum; ?></div></td>
302 <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>
303 <div class="forumdescription"><?php echo $ForumDescription; ?><br />
304 <?php echo $sflist; ?></div></td>
305 <td<?php echo $ForumClass[3]; ?>style="text-align: center;"><?php echo $NumTopics; ?></td>
306 <td<?php echo $ForumClass[4]; ?>style="text-align: center;"><?php echo $NumPosts; ?></td>
307 <td<?php echo $ForumClass[5]; ?>><?php echo $LastTopic; ?></td>
308 </tr>
309 <?php } ++$i; } sql_free_result($result);
310 if($num>=1) {
312 <tr id="SubCatEnd<?php echo $CategoryID; ?>" class="TableRow4">
313 <td class="TableColumn4" colspan="5">&nbsp;</td>
314 </tr>
315 </table></div>
316 <div class="DivSubCategories">&nbsp;</div>
317 <?php } } ++$prei; } }
318 sql_free_result($preresult);
319 $CatCheck = "skip";
320 if($SubShowForums!="yes") {
321 $CategoryName = $SCategoryName; }
322 if($SubShowForums!="no") {
323 require($SettDir['inc'].'categories.php'); } }