6 switch ( $_SERVER['QUERY_STRING'] ) {
8 $page->title
= 'Online Users';
9 $where = 'WHERE `last_active_date` > UNIX_TIMESTAMP() - 600';
12 $page->title
= 'User List';
20 <col
/><col
/><col
/><col
/>
32 $q = $DB->query('SELECT `users`.`userid`, `alias`, `points`, `last_active_date`, COUNT(`messageid`) AS `msgs`
34 NATURAL LEFT JOIN `messages`
36 GROUP BY `userid` ASC');
41 $idle = time() - $last;
42 $idle -= ($time[2] = $idle %
60); $idle /= 60;
43 $idle -= ($time[1] = $idle %
60); $idle /= 60;
44 $idle -= ($time[0] = $idle %
24); $time[3] = $idle / 24;
48 return ( $time[3] ?
$time[3].' day'.( $time[3] != 1 ?
's ' : ' ' ) : '').vsprintf('%d:%02d:%02d', $time);
51 $a = 1; // CSS class thing on alternating rows
53 while ( $row = $q->fetch_assoc() ) {
54 // This looks much nicer when rendered. Really.
55 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",
57 $user->namelink($row['userid'], $row['alias']),
60 $user->fdate($row['last_active_date']),
61 $user instanceof authuser
&& $row['userid'] == $user->userid ?
'' : idle($row['last_active_date'])