5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://../COPYING
9 class Topiclist_TL
extends Topiclist_Default
implements Topiclist
12 const Name
= 'Twisted Legacy';
14 public function display()
22 ' <th scope="col">Topic Name</th>',"\n",
23 ' <th scope="col">Created By</th>',"\n",
24 ' <th scope="col">Posts</th>',"\n",
25 ' <th scope="col">Last Post</th>',"\n",
30 // flying spaghetti code monster
32 'SELECT `topics`.`topicid`, `topic_title`, `topics`.`userid`, `alias`,
33 `messageid`, `mtime`, `messages`.`userid` AS `lastposterid`,
34 (SELECT COUNT(*) FROM `messages`
35 WHERE `messages`.`topicid` = `topics`.`topicid`) AS `posts`,
36 (SELECT `alias` FROM `users`
37 WHERE `users`.`userid` = `messages`.`userid`) AS `lastposter`
39 LEFT JOIN `messages` ON `lastpost` = `messageid`
40 LEFT JOIN `users` ON `topics`.`userid` = `users`.`userid`
41 WHERE `boardid` = @boardid
44 LIMIT '.($this->page
*$this->tpp
).', '.$this->tpp
, MYSQLI_USE_RESULT
);
48 while ( $topic = $topics->fetch_assoc() ) {
50 '<tr class="content c%d">'."\n".
51 ' <td><a class="topic" href="messagelist?%d">%s</a></td>'."\n".
54 " <td><small>%s<br/>By: %s</small></td>\n".
58 $topic['topic_title'],
59 $user->namelink($topic['userid'], $topic['alias']),
61 $user->fdate($topic['mtime']),
62 $user->namelink($topic['lastposterid'], $topic['lastposter'])
65 echo "</tbody>\n</table>\n";