4 $prefetch = array('`points`', '`msglist_layout`');
7 $page->title
= _('Message List');
9 if ( isset($_GET['topic']) ) {
10 $topicid = intval($_GET['topic']);
11 $topic = $DB->query('SELECT `board_name`, `boards`.`boardid`, `view_level`, `post_level`, `topic_level`, `topic_title`
12 FROM `boards` NATURAL LEFT JOIN `topics` WHERE `topicid` = '.$topicid)->fetch_row();
15 if ( !is_array($topic) )
16 $page->errorfooter('topicid');
18 if ( $topic[2] > $user->level
)
19 $page->errorfooter('level', $topic[2]);
21 $page->title
.= ': '.$topic[5];
23 $page->nav
[_('Topic List').': '.$topic[0]] = 'topiclist?board='.$topic[1];
24 if ( $user instanceof authuser
&& $user->level
>= $topic[3] )
25 $user->userlinks
[_('Post Message')] = 'post?topic='.$topicid;
29 $start = isset($_GET['page']) ?
intval($_GET['page']) : 0;
30 $posts = isset($_GET['length']) && ($_GET['length'] <= 100) ?
intval($_GET['length']) : $user->msgs_page
;
32 switch ( $user->msglist_layout
) {
34 $mlist = new messagelist_flat($topicid, $posts, $start); break;
36 $mlist = new messagelist_threaded($topicid, $posts, $start); break;
38 $mlist = new messagelist_irc($topicid, $posts, $start); break;
41 $l = $mlist->pagelist();
44 echo '<div id="pagelist-head" class="nl">Pages: <ul>',"\n$l</ul></div>\n";
47 echo '<div id="pagelist-foot" class="nl">Pages: <ul>',"\n$l</ul></div>\n";