5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
10 $prefetch = array('`topiclist_layout`', '`topics_page`');
13 $page->title
= 'Topic List';
14 $page->cacheable
= true;
16 $boardid = isset($_GET['board']) ?
intval($_GET['board']) : intval($_SERVER['QUERY_STRING']);
18 $board = $DB->query('SELECT `board_name`, `view_restrict`, `post_restrict` FROM `boards` WHERE `boardid` = '.$boardid)->fetch_row();
20 if ( !is_array($board) ) {
21 $page->errorfooter('boardid');
24 $page->title
.= ': '.$board[0];
27 if ( ! $user->has_priv('viewboard', $board[1]) ) { // View restriction
28 $page->errorfooter('level');
30 if ( $user->has_priv('posttopic', $board[2]) ) { // Add topic post link if they're allowed to post one
31 $user->userlinks
['Post Topic'] = 'post?board='.$boardid;
34 list($page->mtime
) = $DB->query('SELECT MAX(`mtime`) FROM `messages` NATURAL LEFT JOIN `topics` WHERE `boardid` = '.$boardid)->fetch_row();
38 $start = isset($_GET['page']) ?
intval($_GET['page']) : 0;
40 $DB->query('SET @boardid = '.$boardid);
42 switch ( $user->topiclist_layout
) {
44 $tlist = new Topiclist_TL($user->topics_page
, $start); break;
46 $tlist = new Topiclist_Default($user->topics_page
, $start);
49 $l = $tlist->pagelist();
51 echo '<div id="topiclist" class="',get_class($tlist),"\">\n";
53 echo '<dl id="pagelist-head" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";
59 echo '<dl id="pagelist-foot" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";