TEMPORAL DISPLACEMENT SENSOR
[specialops2.git] / topiclist.php
blobd9f8837dca6a3d16f9b3f246e55e02c7c17c1832
1 <?php
2 /**
3 * Topic List
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
7 * @version $Id$
8 */
10 $prefetch = array('`topiclist_layout`', '`topics_page`');
11 require 'con.php';
12 $page->title = 'Topic List';
14 $boardid = isset($_GET['board']) ? intval($_GET['board']) : intval($_SERVER['QUERY_STRING']);
16 $board = $DB->query('SELECT `board_name`, `view_restrict`, `post_restrict` FROM `boards` WHERE `boardid` = '.$boardid)->fetch_row();
18 if ( !is_array($board) ) {
19 $page->errorfooter('boardid');
22 $page->title .= ': '.$board[0];
25 if ( ! $user->has_priv('viewboard', $board[1]) ) { // View restriction
26 $page->errorfooter('level');
28 if ( $user->has_priv('posttopic', $board[2]) ) { // Add topic post link if they're allowed to post one
29 $user->userlinks['Post Topic'] = 'post?board='.$boardid;
32 $user->userheader();
34 $start = isset($_GET['page']) ? intval($_GET['page']) : 0;
36 $DB->query('SET @boardid = '.$boardid);
38 switch ( $user->topiclist_layout ) {
39 case 1:
40 $tlist = new Topiclist_TL($user->topics_page, $start); break;
41 default:
42 $tlist = new Topiclist_Default($user->topics_page, $start);
45 $l = $tlist->pagelist();
47 echo '<div id="topiclist" class="',get_class($tlist),"\">\n";
48 if ( $l ) {
49 echo '<dl id="pagelist-head" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";
52 $tlist->display();
54 if ( $l ) {
55 echo '<dl id="pagelist-foot" class="nl"><dt>Pages:</dt> '.$l."</dl>\n";
57 echo "</div>\n";
59 $page->pagefooter();