5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
10 $prefetch = array('`boardlist_layout`');
13 list($lastpost) = $DB->query('SELECT MAX(`mtime`) FROM `messages`')->fetch_row();
14 list($lastuser) = $DB->query('SELECT MAX(`last_active_date`) FROM `users`')->fetch_row();
15 $page->last_modified
= max($lastpost, $lastuser);
17 array_pop($user->userlinks
); // The online users link is in the middle of the page anyway
18 $page->nav
['Stats Page'] = 'stuff';
22 $onlinelist = $DB->query('SELECT `userid`, `alias` FROM `users`
23 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600
24 ORDER BY `last_active_date` ASC LIMIT 30');
25 $onlineusers = $user->fillnamecache($onlinelist);
27 if ( 30 === $onlinelist->num_rows
)
28 list($count) = $DB->query('SELECT COUNT(*) FROM `users`
29 WHERE `last_active_date` > UNIX_TIMESTAMP() - 600')->fetch_row();
31 $count = $onlinelist->num_rows
;
33 $onlines = ( 1 === $count ?
34 'There is <a href="userlist?online">one user online</a>' :
35 'There are <a href="userlist?online">%d users online</a>' );
38 <div id
="boardlist-stats">
39 <p
>Current
time (UTC
<?php
printf('%+d): %s', $user->timezone
, $user->fdate(time())) ?
></p
>
40 <p
><?php
printf($onlines, $count); echo ( 0 < $count ) ?
': '.implode(', ', $onlineusers) : '.' ?
></p
>
45 switch ( $user->boardlist_layout
) {
46 case Boardlist_SO2
::ID
:
47 $bl = new Boardlist_SO2
; break;
48 case Boardlist_SO1
::ID
:
50 $bl = new Boardlist_SO1
;
53 echo '<div id="boardlist" class="',get_class($bl),"\">\n";