4 $classes['topiclist']['default'] = array('name' => 'SO2', 'ID' => 0);
6 class topiclist_default
implements iface_topiclist
12 function __construct($boardid, $tpp = 35, $page = 0)
17 list($this->topicsum
) = $DB->query('SELECT COUNT(*) FROM `topics` WHERE `boardid` = @boardid')->fetch_row();
22 'SELECT `topics`.`topicid`, `topic_title`, `topics`.`userid`, `alias`, `messageid`, `mtime`,
23 (SELECT COUNT(*) FROM `messages` WHERE `messages`.`topicid` = `topics`.`topicid`) AS `posts`
25 LEFT JOIN `messages` ON `lastpost` = `messageid`
26 LEFT JOIN `users` ON `topics`.`userid` = `users`.`userid`
27 WHERE `boardid` = @boardid
28 AND `topics`.`visibility` IN(\'normal\', \'sticky\')
31 LIMIT '.($this->page
*$this->tpp
).', '.$this->tpp
);
34 '<table id="topiclist"><thead>',"\n",
36 ' <th scope="col">Topic Name</th>',"\n",
37 ' <th scope="col">Creator</th>',"\n",
38 ' <th scope="col">Posts</th>',"\n",
39 ' <th scope="col">Last Post</th>',"\n",
45 while ( $topic = $topics->fetch_assoc() ) {
47 '<tr class="content c',(++
$a&1),"\">\n",
48 ' <td><a class="topic" href="messagelist?',$topic['topicid'],'">',$topic['topic_title'],"</a></td>\n",
49 ' <td>',$user->namelink($topic['userid']),"</td>\n",
50 ' <td>',$topic['posts'],"</td>\n",
51 ' <td>',$user->fdate($topic['mtime']),"</td>\n",
54 echo "</tbody>\n</table>\n";
61 public function pagelist()
63 if ( $this->topicsum
< $this->tpp
)
67 for ( $i = 0; $i < $this->topicsum
; $i +
= $this->tpp
)
68 if ( $i/$this->tpp
== $this->page
)
69 $tmp .= '<dd>['.($i/$this->tpp+
1)."]</dd>\n";
71 $tmp .= '<dd><a href="topiclist?board='.$boardid.';page='.($i/$this->tpp
).
72 ';length='.$this->tpp
.'">'.($i/$this->tpp+
1)."</a></dd>\n";