我改好了,步骤如下:把index.php中- if($detailstatus) {
- @include language('actions');
- updatesession();
- $onlinenum = $membercount = $invisiblecount = $guestcount = 0;
- $whosonline = array();
- $query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM $table_sessions");
- while($online = $db->fetch_array($query)) {
- if($online['uid']) {
- $membercount++;
- if(!$online['invisible']) {
- $online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
- } else {
- $invisiblecount++;
- if ($adminid == 1 ){
- $online['icon'] = 'online_invisible.gif';
- }else{
- continue;
- }
- }
- $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++;
- }
- }
- $onlinenum = $membercount + $guestcount;
- unset($online);
- } else {
- $query = $db->query("SELECT COUNT(*) FROM $table_sessions");
- $onlinenum = $db->result($query, 0);
- }
复制代码
替换为:
- if($detailstatus) {
- @include language('actions');
- updatesession();
- $onlinenum = $membercount = $guestcount = 0;
- $whosonline = array();
- $guestonlie = array();
- $query = $db->query("SELECT uid, username, groupid, lastactivity, action, fid FROM $table_sessions ORDER BY lastactivity DESC");
- while($online = $db->fetch_array($query)) {
- if($online['uid']) {
- $membercount++;
- switch($online['groupid']) {
- case '1': $online['icon'] = 'online_admin.gif'; break;
- case '2': $online['icon'] = 'online_supermod.gif'; break;
- case '3': $online['icon'] = 'online_moderator.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['icon'] = 'online_invisible.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);
- }
复制代码
修改了一个错误bug
同时也没有什么图标问题了,我用隐身会员图表作为游客的,如果想加入特殊组,在
case '1': $online['icon'] = 'online_admin.gif'; break;
case '2': $online['icon'] = 'online_supermod.gif'; break;
case '3': $online['icon'] = 'online_moderator.gif'; break;
后按照格式加就可以了
原帖由 bighot 于 2005-5-11 10:33 发表
如何查看会员身份与之对应的代码,假设自己添加[贵宾]这一身份,那它对应的数据库代码是什么呢??
数据库代码可以在phpMyAdmin的usergroups里能看到
原帖由 OOQ 于 2005-7-8 17:42 发表
我D2.5的 可以谢谢了 不过能告诉我怎么弄张游客的图,放在哪里呢
如果你找到了图,把图重命名为online_guest.gif,放入images\common里,再把- $online['username'] = "游客";
- $online['icon'] = 'online_invisible.gif';
- $online['fid'] = $online['fid'] ? $forumname[$online[fid]] : 0;
复制代码 中的online_invisible.gif换成online_guest.gif就好了
[ 本帖最后由 mxd-user 于 2005-7-21 16:27 编辑 ] |