Finished options.php stuff, gave everything in ./ the correctness fixes
[specialops2.git] / index.php
blob76da5bd1db1798e244a1ee5a46e06728201a5a3e
1 <?php
2 // $Id$
4 $prefetch = array('`boardlist_layout`');
5 require 'con.php';
7 $user->userheader();
10 $onlinelist = $DB->query('SELECT `userid`, `alias` FROM `users` FORCE INDEX(`last_active_date`)
11 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600
12 ORDER BY `last_active_date` ASC LIMIT 30');
13 $onlineusers = $user->fillnamecache($onlinelist);
16 switch ( $user->boardlist_layout ) {
17 case boardlist_default::ID:
18 new boardlist_default; break;
19 case boardlist_so1::ID:
20 new boardlist_so1;
24 if ( 30 === $onlinelist->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 = $onlinelist->num_rows;
30 $onlines = ( 1 === $count ?
31 'There is <a href="userlist?online">one user active</a>: ' :
32 'There are <a href="userlist?online">%d users active</a>: ' );
35 <h2 id="boardlist-stats">Statistics</h2>
36 <p><?php printf($onlines, $count);
38 if ( 0 < $count ) {
39 echo implode(', ', $onlineusers);
42 echo '</p>
43 <p>Current Time: ',$user->fdate(time()),'</p>
44 <p><a href="stuff">More stats</a></p>';
46 $page->pagefooter();