4 $prefetch = array('`topiclist_layout`', '`topics_page`');
6 $page->title
= 'Topic List';
8 $boardid = isset($_GET['board']) ?
intval($_GET['board']) : intval($_SERVER['QUERY_STRING']);
10 $board = $DB->query('SELECT `board_name`, `restrict` FROM `boards`
11 WHERE `boardid` = '.$boardid)->fetch_row();
13 if ( !is_array($board) )
14 $page->errorfooter('boardid');
16 $DB->query('SET @boardid = '.$boardid);
18 $page->title
.= ': '.$board[0];
20 // Check whether or not users can view this board
21 if ( $board[1] >= 3 && !defined('DEVELOPER') )
22 $page->errorfooter('level', $board[1]);
23 // Check whether they're allowed to post a topic
24 if ( ($board[1] <= 0 ||
defined('DEVELOPER')) && $user instanceof authuser
)
25 $user->userlinks
['Post Topic'] = 'post?board='.$boardid;
29 if ( $user instanceof authuser
) {
30 $start = isset($_GET['page']) ?
intval($_GET['page']) : 0;
35 switch ( $user->topiclist_layout
) {
37 $tlist = new topiclist_default($user->topics_page
, $start); break;
39 $tlist = new topiclist_tl($user->topics_page
, $start); break;
41 throw new OutOfBoundsException('user->topiclist_layout is out of valid range');
44 $l = $tlist->pagelist();
46 if ( $user instanceof authuser
&& $l )
47 echo '<dl id="pagelist-head" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";
49 echo '<div id="',get_class($tlist),"\">\n";
53 if ( $user instanceof authuser
&& $l )
54 echo '<dl id="pagelist-foot" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";