Topic list now has pages
[specialops2.git] / index.php
blob924e387ed72bb7409d6644105e1bc53c0a7c101c
1 <?php
2 // $Id$
4 $prefetch = array('`boardlist_layout`');
5 require 'con.php';
7 $page->title = 'Board List';
9 $user->userheader();
11 switch ( $user->boardlist_layout ) {
12 case 0:
13 new boardlist_default; break;
14 case 1:
15 new boardlist_so1; break;
16 default:
17 throw new OutOfBoundsException('user->boardlist_layout is out of valid range');
20 $list = $DB->query('SELECT `userid`, `alias` FROM `users`
21 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600
22 ORDER BY `last_active_date` ASC LIMIT 30');
24 if ( 30 == $list->num_rows )
25 list($count) = $DB->query('SELECT COUNT(*) FROM `users`
26 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600')->fetch_row();
27 else
28 $count = $list->num_rows;
31 $onlinestring = ( $count == 1 ?
32 'There is <a href="userlist?online">%d user online</a>: ' :
33 'There are <a href="userlist?online">%d users online</a>: ' );
36 <h2 id="boardlist-stats">Statistics</h2>
37 <h3><a href="stuff">(more)</a></h3>
38 <ul class="content" id="boardlist-foot">
39 <li><?php printf($onlinestring, $count);
41 if ( $count > 0 ) {
42 $list = $user->fillnamecache($list);
43 echo implode(', ', $list);
46 echo
47 '</li>
48 <li>Current Time: ',$user->fdate(time()),'</li>
49 </ul>',"\n";
51 $page->pagefooter();