Small update
[iDB.git] / inc / lowtopics.php
bloba31bf2ccd015858efac9ea6586fc3a95b18450a4
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: lowtopics.php - Last Update: 08/02/2019 SVN 905 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="lowtopics.php"||$File3Name=="/lowtopics.php") {
18 require('index.php');
19 exit(); }
20 $pstring = null; $pagenum = null;
21 if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
22 if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
23 if(!isset($_GET['st'])) { $_GET['st'] = 0; }
24 if(!is_numeric($_GET['st'])) { $_GET['st'] = 0; }
25 $prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['id']));
26 $preresult=sql_query($prequery,$SQLStat);
27 $prenum=sql_num_rows($preresult);
28 if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
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($prenum>=1) {
32 $ForumID=sql_result($preresult,0,"id");
33 $ForumCatID=sql_result($preresult,0,"CategoryID");
34 $ForumName=sql_result($preresult,0,"Name");
35 $ForumType=sql_result($preresult,0,"ForumType");
36 $ForumShow=sql_result($preresult,0,"ShowForum");
37 if($ForumShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
38 $InSubForum=sql_result($preresult,0,"InSubForum");
39 $RedirectURL=sql_result($preresult,0,"RedirectURL");
40 $RedirectTimes=sql_result($preresult,0,"Redirects");
41 $NumberViews=sql_result($preresult,0,"NumViews");
42 $NumberPosts=sql_result($preresult,0,"NumPosts");
43 $NumberTopics=sql_result($preresult,0,"NumTopics");
44 $PostCountAdd=sql_result($preresult,0,"PostCountAdd");
45 $CanHaveTopics=sql_result($preresult,0,"CanHaveTopics");
46 $HotTopicPosts=sql_result($preresult,0,"HotTopicPosts");
47 if($HotTopicPosts!=0&&is_numeric($HotTopicPosts)) {
48 $Settings['hot_topic_num'] = $HotTopicPosts; }
49 if(!is_numeric($Settings['hot_topic_num'])) {
50 $Settings['hot_topic_num'] = 15; }
51 $ForumPostCountView=sql_result($preresult,0,"PostCountView");
52 $ForumKarmaCountView=sql_result($preresult,0,"KarmaCountView");
53 sql_free_result($preresult);
54 $ForumType = strtolower($ForumType); $CanHaveTopics = strtolower($CanHaveTopics);
55 $catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($ForumCatID));
56 $catresult=sql_query($catcheck,$SQLStat);
57 $CategoryID=sql_result($catresult,0,"id");
58 $CategoryName=sql_result($catresult,0,"Name");
59 $CategoryShow=sql_result($catresult,0,"ShowCategory");
60 if($CategoryShow=="no") { $_SESSION['ShowActHidden'] = "yes"; }
61 $CategoryType=sql_result($catresult,0,"CategoryType");
62 $InSubCategory=sql_result($catresult,0,"InSubCategory");
63 $CategoryPostCountView=sql_result($catresult,0,"PostCountView");
64 $CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
65 sql_free_result($catresult);
66 if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
67 if($MyPostCountChk==null) { $MyPostCountChk = 0; }
68 if($MyKarmaCount==null) { $MyKarmaCount = 0; }
69 if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
70 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
71 if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
72 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
73 if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
74 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
75 if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
76 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
77 if($InSubForum!="0") {
78 $isfquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($InSubForum));
79 $isfresult=sql_query($isfquery,$SQLStat);
80 $isfnum=sql_num_rows($isfresult);
81 if($isfnum>=1) {
82 $isfForumID=sql_result($isfresult,0,"id");
83 $isfForumCatID=sql_result($isfresult,0,"CategoryID");
84 $isfForumName=sql_result($isfresult,0,"Name");
85 $isfForumType=sql_result($isfresult,0,"ForumType");
86 $isfForumType = strtolower($isfForumType);
87 $isfRedirectURL=sql_result($isfresult,0,"RedirectURL"); }
88 if($isfnum<1) { $InSubForum = "0"; }
89 sql_free_result($isfresult); }
90 if($ForumCheck!="skip") {
91 if(isset($_SESSION['OldViewingPage'])) { $_SESSION['AncientViewingPage'] = $_SESSION['OldViewingPage']; } else { $_SESSION['AncientViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
92 if(isset($_SESSION['OldViewingFile'])) { $_SESSION['AncientViewingFile'] = $_SESSION['OldViewingFile']; } else {
93 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
94 $_SESSION['AncientViewingFile'] = $exfile['index'].$Settings['file_ext']; }
95 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
96 $_SESSION['AncientViewingFile'] = $exfile['index']; } }
97 if(isset($_SESSION['OldPreViewingTitle'])) { $_SESSION['AncientPreViewingTitle'] = $_SESSION['OldPreViewingTitle']; } else { $_SESSION['AncientPreViewingTitle'] = "Viewing"; }
98 if(isset($_SESSION['OldViewingTitle'])) { $_SESSION['AncientViewingTitle'] = $_SESSION['OldViewingTitle']; } else { $_SESSION['AncientViewingTitle'] = "Board index"; }
99 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;"; }
100 if(isset($_SESSION['ViewingPage'])) { $_SESSION['OldViewingPage'] = $_SESSION['ViewingPage']; } else { $_SESSION['OldViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
101 if(isset($_SESSION['ViewingFile'])) { $_SESSION['OldViewingFile'] = $_SESSION['ViewingFile']; } else {
102 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
103 $_SESSION['OldViewingFile'] = $exfile['index'].$Settings['file_ext']; }
104 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
105 $_SESSION['OldViewingFile'] = $exfile['index']; } }
106 if(isset($_SESSION['PreViewingTitle'])) { $_SESSION['OldPreViewingTitle'] = $_SESSION['PreViewingTitle']; } else { $_SESSION['OldPreViewingTitle'] = "Viewing"; }
107 if(isset($_SESSION['ViewingTitle'])) { $_SESSION['OldViewingTitle'] = $_SESSION['ViewingTitle']; } else { $_SESSION['OldViewingTitle'] = "Board index"; }
108 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;"; }
109 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=lowview&id=".$ForumID."&page=".$_GET['page'],"&","=",$prexqstr[$ForumType],$exqstr[$ForumType]);
110 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
111 $_SESSION['ViewingFile'] = $exfile[$ForumType].$Settings['file_ext']; }
112 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
113 $_SESSION['ViewingFile'] = $exfile[$ForumType]; }
114 $_SESSION['PreViewingTitle'] = "Viewing Forum:";
115 $_SESSION['ViewingTitle'] = $ForumName;
116 $_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:".$InSubCategory.",".$CategoryID."; currentforumid:".$InSubForum.",".$ForumID."; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
118 <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['forum'],$Settings['file_ext'],"act=view&id=".$ForumID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ForumName; ?></a></div>
119 <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><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$ForumCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php if($InSubForum!="0") { echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$isfForumType],$Settings['file_ext'],"act=view&id=".$isfForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$isfForumType],$exqstr[$isfForumType]); ?>"><?php echo $isfForumName; ?></a><?php } echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$ForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
120 <div>&nbsp;</div>
121 <?php }
122 if(!isset($CatPermissionInfo['CanViewCategory'][$ForumCatID])) {
123 $CatPermissionInfo['CanViewCategory'][$ForumCatID] = "no"; }
124 if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="no"||
125 $CatPermissionInfo['CanViewCategory'][$ForumCatID]!="yes") {
126 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
127 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
128 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
129 if(!isset($PermissionInfo['CanViewForum'][$ForumID])) {
130 $PermissionInfo['CanViewForum'][$ForumID] = "no"; }
131 if($PermissionInfo['CanViewForum'][$ForumID]=="no"||
132 $PermissionInfo['CanViewForum'][$ForumID]!="yes") {
133 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
134 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
135 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
136 if($CatPermissionInfo['CanViewCategory'][$ForumCatID]=="yes"&&
137 $PermissionInfo['CanViewForum'][$ForumID]=="yes") {
138 if($ForumType!="redirect") {
139 if($NumberViews==0||$NumberViews==null) { $NewNumberViews = 1; }
140 if($NumberViews!=0&&$NumberViews!=null) { $NewNumberViews = $NumberViews + 1; }
141 $viewup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumViews\"=%i WHERE \"id\"=%i", array($NewNumberViews,$_GET['id']));
142 sql_query($viewup,$SQLStat); }
143 if($ForumType=="redirect") {
144 if($RedirectTimes==0||$RedirectTimes==null) { $NewRedirTime = 1; }
145 if($RedirectTimes!=0&&$RedirectTimes!=null) { $NewRedirTime = $RedirectTimes + 1; }
146 $redirup = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"Redirects\"=%i WHERE \"id\"=%i", array($NewRedirTime,$_GET['id']));
147 sql_query($redirup,$SQLStat);
148 if($RedirectURL!="http://"&&$RedirectURL!="") {
149 redirect("location",$RedirectURL,0,null,false); ob_clean();
150 header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
151 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
152 if($RedirectURL=="http://"||$RedirectURL=="") {
153 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
154 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
155 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
156 if($ForumCheck!="skip") {
157 if($ForumType=="subforum") {
158 redirect("location",$rbasedir.url_maker($exfile['subforum'],$Settings['file_ext'],"act=".$_GET['act']."&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['subforum'],$exqstr['subforum'],FALSE));
159 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
160 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
161 if($_GET['act']=="lowview") {
162 if($NumberTopics==null) {
163 $NumberTopics = 0; }
164 $num=$NumberTopics;
165 //Start Topic Page Code
166 if(!isset($Settings['max_topics'])) { $Settings['max_topics'] = 10; }
167 if($_GET['page']==null) { $_GET['page'] = 1; }
168 if($_GET['page']<=0) { $_GET['page'] = 1; }
169 if($_GET['st']<=0||!isset($_GET['st'])) {
170 $nums = $_GET['page'] * $Settings['max_topics']; }
171 if($_GET['st']>0&&isset($_GET['st'])) {
172 $nums = $_GET['st']; }
173 if($nums>$num) { $nums = $num; }
174 $numz = $nums - $Settings['max_topics'];
175 if($numz<=0) { $numz = 0; }
176 //$i=$numz;
177 if($nums<$num) { $nextpage = $_GET['page'] + 1; }
178 if($nums>=$num) { $nextpage = $_GET['page']; }
179 if($numz>=$Settings['max_topics']) { $backpage = $_GET['page'] - 1; }
180 if($_GET['page']<=1) { $backpage = 1; }
181 $pnum = $num; $l = 1; $Pages = null;
182 while ($pnum>0) {
183 if($pnum>=$Settings['max_topics']) {
184 $pnum = $pnum - $Settings['max_topics'];
185 $Pages[$l] = $l; ++$l; }
186 if($pnum<$Settings['max_topics']&&$pnum>0) {
187 $pnum = $pnum - $pnum;
188 $Pages[$l] = $l; ++$l; } }
189 $snumber = $_GET['page'] - 1;
190 if($_GET['st']<=0||!isset($_GET['st'])) {
191 $PageLimit = $Settings['max_topics'] * $snumber; }
192 if($_GET['st']>0&&isset($_GET['st'])) {
193 $PageLimit = $_GET['st']; }
194 if($PageLimit<0) { $PageLimit = 0; }
195 //End Topic Page Code
196 $i=0;
197 $ExtraIgnores = null;
198 if($PermissionInfo['CanModForum'][$_GET['id']]=="no") {
199 $ExtraIgnores = " AND \"Closed\"<>3"; }
200 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"ForumID\"=%i".$ExtraIgnores.$ForumIgnoreList4." ORDER BY \"Pinned\" DESC, \"LastUpdate\" DESC ".$SQLimit, array($_GET['id'],$PageLimit,$Settings['max_topics']));
201 $result=sql_query($query,$SQLStat);
202 $num=sql_num_rows($result);
203 //List Page Number Code Start
204 $pagenum=count($Pages);
205 if($_GET['page']>$pagenum) {
206 $_GET['page'] = $pagenum; }
207 $pagei=0; $pstring = null;
208 if($pagenum>1) {
209 $pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
210 if($_GET['page']<4) { $Pagez[0] = null; }
211 if($_GET['page']>=4) { $Pagez[0] = "First"; }
212 if($_GET['page']>=3) {
213 $Pagez[1] = $_GET['page'] - 2; }
214 if($_GET['page']<3) {
215 $Pagez[1] = null; }
216 if($_GET['page']>=2) {
217 $Pagez[2] = $_GET['page'] - 1; }
218 if($_GET['page']<2) {
219 $Pagez[2] = null; }
220 $Pagez[3] = $_GET['page'];
221 if($_GET['page']<$pagenum) {
222 $Pagez[4] = $_GET['page'] + 1; }
223 if($_GET['page']>=$pagenum) {
224 $Pagez[4] = null; }
225 $pagenext = $_GET['page'] + 1;
226 if($pagenext<$pagenum) {
227 $Pagez[5] = $_GET['page'] + 2; }
228 if($pagenext>=$pagenum) {
229 $Pagez[5] = null; }
230 if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
231 if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
232 $pagenumi=count($Pagez);
233 if($NumberTopics==0) {
234 $pagenumi = 0;
235 $pstring = null; }
236 if($pagenum>1) {
237 while ($pagei < $pagenumi) {
238 if($_GET['page']!=1&&$pagei==1) {
239 $Pback = $_GET['page'] - 1;
240 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&lt;</a></span> "; }
241 if($Pagez[$pagei]!=null&&
242 $Pagez[$pagei]!="First"&&
243 $Pagez[$pagei]!="Last") {
244 if($pagei!=3) {
245 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">".$Pagez[$pagei]."</a></span> "; }
246 if($pagei==3) {
247 $pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">".$Pagez[$pagei]."</a></span> "; } }
248 if($Pagez[$pagei]=="First") {
249 $pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&laquo;</a></span> "; }
250 if($Pagez[$pagei]=="Last") {
251 $ptestnext = $pagenext + 1;
252 $paget = $pagei - 1;
253 $Pnext = $_GET['page'] + 1;
254 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&gt;</a></span> ";
255 if($ptestnext<$pagenum) {
256 $pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType])."\">&raquo;</a></span> "; } }
257 ++$pagei; } $pstring = $pstring."</div>"; }
259 <div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
260 <?php echo $pstring; ?></div>
261 <div>&nbsp;</div>
262 <div style="padding: 10px; border: 1px solid gray;">
263 <?php if($num<=0) { ?>
264 <ul style="list-style-type: none;">
265 <li>&nbsp;</li>
266 <?php } if($num>0) { ?>
267 <ul style="list-style-type: decimal;">
268 <?php }
269 while ($i < $num) {
270 $TopicID=sql_result($result,$i,"id");
271 $TForumID=sql_result($result,$i,"ForumID");
272 $OldForumID=sql_result($result,$i,"OldForumID");
273 $UsersID=sql_result($result,$i,"UserID");
274 $GuestsName=sql_result($result,$i,"GuestName");
275 $TheTime=sql_result($result,$i,"TimeStamp");
276 $tmpusrcurtime = new DateTime();
277 $tmpusrcurtime->setTimestamp($TheTime);
278 $tmpusrcurtime->setTimezone($usertz);
279 $TheTime=$tmpusrcurtime->format($_SESSION['iDBDateFormat'].", ".$_SESSION['iDBTimeFormat']);
280 $NumReply=sql_result($result,$i,"NumReply");
281 $NumberPosts=$NumReply + 1;
282 $prepagelist = null;
283 if(!isset($Settings['max_posts'])) {
284 $Settings['max_posts'] = 10; }
285 $TopicName=sql_result($result,$i,"TopicName");
286 $TopicDescription=sql_result($result,$i,"Description");
287 $PinnedTopic=sql_result($result,$i,"Pinned");
288 $TopicStat=sql_result($result,$i,"Closed");
289 $PreTopic = null;
290 if ($PinnedTopic>2) { $PinnedTopic = 1; }
291 if ($PinnedTopic<0) { $PinnedTopic = 0; }
292 if(!is_numeric($PinnedTopic)) { $PinnedTopic = 0; }
293 if ($TopicStat>3) { $TopicStat = 1; }
294 if ($TopicStat<0) { $TopicStat = 0; }
295 if(!is_numeric($TopicStat)) { $TopicStat = 1; }
296 if ($PinnedTopic>0&&$PinnedTopic<3) { $PreTopic="<span style=\"font-weight: bold;\">Pinned: </span>"; }
297 if ($PinnedTopic==0) { $PreTopic=null; }
298 if ($OldForumID==$ForumID&&$TForumID!=$ForumID) { $PreTopic="<span>Moved: </span>"; }
300 <li><?php echo $PreTopic; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a> <span style="color: gray; font-size: 10px;">(<?php echo $NumReply; ?> replies)</span></li>
301 <?php ++$i; } ?>
302 </ul></div><div>&nbsp;</div>
303 <div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
304 <?php echo $pstring; ?></div>
305 <div>&nbsp;</div>
306 <?php sql_free_result($result); } } } ?>