Made the registration process and TOS more appropriate.
[specialops2.git] / index.php
blob5cbaa68a88a3e2376a033020842446749d6575ea
1 <?php
2 /**
3 * Board List
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
7 * @version $Id$
8 */
10 $prefetch = array('`boardlist_layout`');
11 require 'con.php';
13 array_pop($user->userlinks); // The online users link is in the middle of the page anyway
14 $page->nav['Stats Page'] = 'stuff';
16 $user->userheader();
18 $onlinelist = $DB->query('SELECT `userid`, `alias` FROM `users` FORCE INDEX(`last_active_date`)
19 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600
20 ORDER BY `last_active_date` ASC LIMIT 30');
21 $onlineusers = $user->fillnamecache($onlinelist);
23 if ( 30 === $onlinelist->num_rows )
24 list($count) = $DB->query('SELECT COUNT(*) FROM `users`
25 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600')->fetch_row();
26 else
27 $count = $onlinelist->num_rows;
29 $onlines = ( 1 === $count ?
30 'There is <a href="userlist?online">one user online</a>' :
31 'There are <a href="userlist?online">%d users online</a>' );
34 <div id="boardlist-stats">
35 <p>Current time (UTC<?php printf('%+d): %s', $user->timezone, $user->fdate(time())) ?></p>
36 <p><?php printf($onlines, $count); echo ( 0 < $count ) ? ': '.implode(', ', $onlineusers) : '.' ?></p>
37 </div>
39 <?php
41 switch ( $user->boardlist_layout ) {
42 case Boardlist_Default::ID:
43 $bl = new Boardlist_Default; break;
44 case Boardlist_SO1::ID:
45 $bl = new Boardlist_SO1;
48 echo '<div id="boardlist" class="',get_class($bl),"\">\n";
49 $bl->display();
50 echo "</div>\n";
52 $page->pagefooter();