5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
10 $prefetch = array('`boardlist_layout`');
13 array_pop($user->userlinks
); // The online users link is in the middle of the page anyway
14 $page->nav
['Stats Page'] = 'stuff';
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();
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
>
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";