5 * @author Ant P <p@cpi.merseine.nu>
6 * @license file://COPYING
12 SO2
::$Page->title
= 'Topic List';
13 SO2
::$Page->cacheable
= true;
16 $boardid = isset($_GET['board']) ?
intval($_GET['board']) : intval($_SERVER['QUERY_STRING']);
18 $b = new Board($boardid);
19 $board = $b->get_info();
21 // Or croak if it doesn't exist
23 SO2
::$Page->message(Page
::ERR_NOBOARD
);
26 SO2
::$Page->title
.= ': '.$board['board_name'];
28 if ( ! SO2
::$User->has_access('viewboard', $board) ) { // View restriction
29 SO2
::$Page->message(Page
::ERR_ULEVEL
);
31 if ( SO2
::$User->has_access('posttopic', $board) ) { // Add topic post link if they're allowed to post one
32 SO2
::$Page->usernav
['Post Topic'] = 'post?board='.$boardid;
35 // Set the page last-modified time
36 SO2
::$Page->mtime
= SO2
::$DB->query('SELECT MAX(mtime) FROM messages, topics WHERE messageid = lastpost AND boardid = @boardid')
39 SO2
::$Page->pageheader();
41 // Get current page of topics
42 $start = isset($_GET['page']) ?
intval($_GET['page']) : 0;
44 // Load topiclist module
45 if ( file_exists('lib/Topiclist_'.SO2
::$User->topiclist_layout
.'.php') ) {
46 $tmp = 'Topiclist_'.SO2
::$User->topiclist_layout
;
47 $tlist = new $tmp(SO2
::$User->topics_page
, $start);
49 SO2
::$User->topiclist_layout
= 'Default';
50 $tlist = new Topiclist_Default(SO2
::$User->topics_page
, $start);
54 if ( $l = $tlist->pagelist() ) {
55 echo '<dl id="pagelist-head" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";
57 echo '<div id="topiclist" class="',get_class($tlist),"\">\n";
61 echo '<dl id="pagelist-foot" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";
65 if ( SO2
::$User->has_access('posttopic', $board) && SO2
::$User->getopt('quickpost') ) { ?
>
66 <form action
="post?board=<?php echo $boardid ?>" method
="post" id
="quickpost">
68 <legend
>Quick Topic
</legend
>
71 <input type
="text" name
="topic_title" maxlength
="60" size
="80" tabindex
="1"/>
73 <textarea rows
="5" cols
="60" name
="message_text" tabindex
="1"><?php
74 if ( SO2
::$User->sig
) {
75 echo ( strpos($_SERVER['HTTP_USER_AGENT'], 'KHTML') ?
"\n\n" : "\n" ),htmlspecialchars(SO2
::$User->sig
);
78 <button type
="submit" accesskey
="p" name
="post" tabindex
="1">Post (P
)</button
>
79 <button type
="submit" accesskey
="r" name
="preview" tabindex
="1">Preview (R
)</button
>