- if($detailstatus) {
- @include language('actions');
- updatesession();
- $onlinenum = $membercount = $guestcount = 0;
- $whosonline = array();
- $guestonlie = array();
- $query = $db->query("SELECT username, status, lastactivity, action, fid FROM $table_sessions ORDER BY lastactivity DESC");
- while($online = $db->fetch_array($query)) {
- if($online['username']) {
- $membercount++;
- $online['usernameenc'] = rawurlencode($online['username']);
- switch($online['status']) {
- case 'Admin': $online['icon'] = 'online_admin.gif'; break;
- case 'SuperMod': $online['icon'] = 'online_supermod.gif'; break;
- case 'Moderator': $online['icon'] = 'online_moderator.gif'; break;
- case 'Guest': $online['icon'] = 'online_guest.gif'; break;
- default: $online['icon'] = 'online_member.gif'; break;
- }
- $online['fid'] = $online['fid'] ? $forumname[$online[fid]] : 0;
- $online['action'] = $actioncode[$online['action']];
- $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
- $whosonline[] = $online;
- } else {
- $guestcount++;
- $online['username'] = "游客";
- $online['usernameenc'] = rawurlencode($online['username']);
- $online['icon'] = 'online_guest.gif';
- $online['fid'] = $online['fid'] ? $forumname[$online[fid]] : 0;
- $online['action'] = $actioncode[$online['action']];
- $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
- $guestonline[] = $online;
- }
- }
- for($i=0; $i<sizeof($guestonline); $i++) {
- $whosonline[] = $guestonline[$i];
- }
- $onlinenum = $membercount + $guestcount;
- unset($online);
- } else {
- $query = $db->query("SELECT COUNT(*) FROM $table_sessions");
- $onlinenum = $db->result($query, 0);
- }
复制代码
[ Last edited by soff on 2003-3-21 at 03:33 PM ] |