Return of the All-HTML post
[specialops2.git] / index.php
blob858e4b74968a26a2de7606c0c13a9b250878ca73
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 $user->userheader();
15 $onlinelist = $DB->query('SELECT `userid`, `alias` FROM `users` FORCE INDEX(`last_active_date`)
16 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600
17 ORDER BY `last_active_date` ASC LIMIT 30');
18 $onlineusers = $user->fillnamecache($onlinelist);
20 switch ( $user->boardlist_layout ) {
21 case Boardlist_Default::ID:
22 $bl = new Boardlist_Default; break;
23 case Boardlist_SO1::ID:
24 $bl = new Boardlist_SO1;
27 echo '<div id="boardlist" class="',get_class($bl),"\">\n";
28 $bl->display();
29 echo "</div>\n";
31 if ( 30 === $onlinelist->num_rows )
32 list($count) = $DB->query('SELECT COUNT(*) FROM `users`
33 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600')->fetch_row();
34 else
35 $count = $onlinelist->num_rows;
37 $onlines = ( 1 === $count ?
38 'There is <a href="userlist?online">one user online</a>' :
39 'There are <a href="userlist?online">%d users online</a>' );
42 <div id="boardlist-stats">
43 <h2>Info</h2>
44 <p><?php printf($onlines, $count);
45 echo ( 0 < $count ) ? ': '.implode(', ', $onlineusers) : '.';
46 ?></p>
47 <p><a href="stuff">Stats Page</a></p>
48 <p>Page load time: <?php echo $user->fdate(time()) ?></p>
49 </div>
51 <?php
52 $page->pagefooter();