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