4 class topiclist_tl
extends topiclist_default
implements topiclist
7 const Name
= 'Twisted Legacy';
9 public function display()
14 '<table id="topiclist" class="',__CLASS__
,"\">\n",
17 ' <th scope="col">Topic Name</th>',"\n",
18 ' <th scope="col">Created By</th>',"\n",
19 ' <th scope="col">Messages</th>',"\n",
20 ' <th scope="col">Last Post</th>',"\n",
25 // flying spaghetti code monster
27 'SELECT `topics`.`topicid`, `topic_title`, `topics`.`userid`, `alias`,
28 `messageid`, `mtime`, `messages`.`userid` AS `lastposterid`,
29 (SELECT COUNT(*) FROM `messages` WHERE `messages`.`topicid` = `topics`.`topicid`) AS `posts`,
30 (SELECT `alias` FROM `users` WHERE `users`.`userid` = `messages`.`userid`) AS `lastposter`
32 LEFT JOIN `messages` ON `lastpost` = `messageid`
33 LEFT JOIN `users` ON `topics`.`userid` = `users`.`userid`
34 WHERE `boardid` = @boardid
37 LIMIT '.($this->page
*$this->tpp
).', '.$this->tpp
, MYSQLI_USE_RESULT
);
41 while ( $topic = $topics->fetch_assoc() ) {
43 '<tr class="content c%d">'."\n".
44 ' <td><a class="topic" href="messagelist?%d">%s</a></td>'."\n".
47 " <td><small>%s<br/>By: %s</small></td>\n".
51 $topic['topic_title'],
52 $user->namelink($topic['userid'], $topic['alias']),
54 $user->fdate($topic['mtime']),
55 $user->namelink($topic['lastposterid'], $topic['lastposter'])
58 echo "</tbody>\n</table>";