1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
|
/** threads **/
if($wbbuserdata['umaxposts']) $postsperpage=$wbbuserdata['umaxposts'];
elseif($board['postsperpage']) $postsperpage=$board['postsperpage'];
else $postsperpage=$default_postsperpage;
if($board['hotthread_reply']==0) $board['hotthread_reply']=$default_hotthread_reply;
if($board['hotthread_view']==0) $board['hotthread_view']=$default_hotthread_view;
$ownuserid="";
$ownjoin="";
$threadids="";
$result = $db->query("SELECT t.threadid FROM bb".$n."_subscribethreads s LEFT JOIN bb".$n."_threads t USING(threadid) WHERE s.userid='$wbbuserdata[userid]' AND t.visible = 1 ORDER BY t.lastposttime DESC");
while($row=$db->fetch_array($result)) $threadids .= ",".$row['threadid'];
$result = $db->query("SELECT
t.*,
i.*
FROM bb".$n."_threads t
LEFT JOIN bb".$n."_icons i USING (iconid)
WHERE t.threadid IN (0$threadids)
ORDER BY t.lastposttime DESC Limit 6");
$threadbit="";
while($threads=$db->fetch_array($result)) {
$firstnew="";
$multipages="";
$prefix="";
if(strlen($threads[topic])>27) $threads[topic] = "".substr($threads[topic], 0, 24)."...";
if($threads['pollid']!=0) eval ("\$prefix .= \"".$tpl->get("board_thread_poll")."\";");
if($threads['pollid']!=0) $foldericon="poll";
else $foldericon=ifelse($threads['userid'],"dot").ifelse($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime'],"new").ifelse($threads['replycount']>=$board['hotthread_reply'] || $threads['views']>=$board['hotthread_view'],"hot").ifelse($threads['closed']!=0,"lock")."folder";
if($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime']) eval ("\$firstnew = \"".$tpl->get("board_threadbit_firstnew")."\";");
if($threads['iconid']) $threadicon=makeimgtag($threads['iconpath'],$threads['icontitle']);
else $threadicon=" ";
if($threads['starterid']!=0) eval ("\$threads['starter'] = \"".$tpl->get("board_threadbit_starter")."\";");
if($threads['lastposterid']!=0) eval ("\$threads['lastposter'] = \"".$tpl->get("board_threadbit_lastposter")."\";");
$lastpostdate=formatdate($dateformat,$threads['lastposttime'],1);
$lastposttime=formatdate($timeformat,$threads['lastposttime']);
if($threads['replycount']+1>$postsperpage && $showmultipages!=0) {
unset($multipage);
unset($multipages_lastpage);
$xpages=ceil(($threads['replycount']+1)/$postsperpage);
if($xpages>$showmultipages) {
eval ("\$multipages_lastpage = \"".$tpl->get("board_threadbit_multipages_lastpage")."\";");
$xpages=$showmultipages;
}
for($i=1;$i<=$xpages;$i++) $multipage.=" ".makehreftag("thread.php?threadid=$threads[threadid]&page=$i&sid=$session[hash]",$i);
eval ("\$multipages = \"".$tpl->get("board_threadbit_multipages")."\";");
}
if(!$wbbuserdata['userid']) {
eval ("\$profil_favorites = \"".$tpl->get("")."\";");
}
else {
eval ("\$profil_favorites = \"".$tpl->get("profil_favorites")."\";");
eval ("\$threadbit .= \"".$tpl->get("overview_threadbit")."\";");
}
if($threadbit) eval ("\$threadheader = \"".$tpl->get("overview_threadheader")."\";");
else eval ("\$threadheader = \"".$tpl->get("overview_nothreads")."\";");
} |