6 switch ( $_SERVER['QUERY_STRING'] ) {
8 $page->title
= 'Online Users';
9 $where = 'WHERE `last_active_date` > UNIX_TIMESTAMP() - 600 GROUP BY `userid` ASC';
12 if ( $DB->query('SELECT COUNT(*) AS `c` FROM `users`')->fetch_object()->c
> 50 ) {
13 $page->title
= 'Top 50 Users';
14 $where = 'GROUP BY `userid` ORDER BY `points` DESC LIMIT 50';
16 $page->title
= 'User List';
17 $where = 'GROUP BY `userid` ASC';
25 <col
/><col
/><col
/><col
/>
37 $q = $DB->query('SELECT `users`.`userid`, `alias`, `points`, `last_active_date`, COUNT(`messageid`) AS `msgs`
39 NATURAL LEFT JOIN `messages`
45 $idle = time() - $last;
46 $idle -= ($time[2] = $idle %
60); $idle /= 60;
47 $idle -= ($time[1] = $idle %
60); $idle /= 60;
48 $idle -= ($time[0] = $idle %
24); $time[3] = $idle / 24;
52 return ( $time[3] ?
$time[3].' day'.( $time[3] != 1 ?
's ' : ' ' ) : '').vsprintf('%d:%02d:%02d', $time);
55 $a = 1; // CSS class thing on alternating rows
57 while ( $row = $q->fetch_assoc() ) {
58 // This looks much nicer when rendered. Really.
59 printf("<tr class=\"content c%d\">\n\t<td>%s</td>\n\t<td>%d</td>\n\t<td>%d</td>\n\t<td>%s</td><td>%s</td>\n</tr>\n",
61 $user->namelink($row['userid'], $row['alias']),
64 $user->fdate($row['last_active_date']),
65 $user instanceof authuser
&& $row['userid'] == $user->userid ?
'' : idle($row['last_active_date'])