改良自pk0909 For 2.5的那个,但是pk0909那个已经删去了,所以没有连接
适用版本:Discuz! 4.0
HACK作者:HKLCF
原版作者:pk0909
最后更新:2005.12.12
修改文件:admin/misc.inc.php、index.php
修改模版:index
安装难易:易
技术支持:discuz.dismall.com
功能简述:4.0原始版本只能定制部分用户组(系统组、特殊组,且不包含游客)的在线列表显示,此hack可让你自定义所有可显示的用户组,甚至不同级别的普通会员也可以以不同的图标在在线列表中显示
修改步骤
1. 打开 admin/misc.inc.php 找
- $query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE groupid<>'7' AND type<>'member'");
复制代码
改为
- $query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups ORDER BY type");
复制代码
2. 打开 index.php 找
- $whosonline[] = $online;
- } else {
- break;
复制代码
更改为
- $whosonline[] = $online;
- } else {
- if (isset($_DCACHE['onlinelist'][7])) {
- $online['icon'] = $_DCACHE['onlinelist'][7];
- $online['username'] = 'Guest';
- $online['fid'] = $online['fid'] ? $forumname[$online['fid']] : 0;
- $online['action'] = $actioncode[$online['action']];
- $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
- $whosonline[] = $online;
- }
复制代码
3. 打开 index 模板找(最后有空格的)
- <a href="viewpro.php?uid=$online[uid]"
复制代码
改为
- <!--{if $online[uid]}-->
- <a href="viewpro.php?uid=$online[uid]"
- <!--{else}-->
- <a href="###"
- <!--{/if}-->
复制代码
注:必须在后台的 “在线列表定制” 中设置了游客的图片,游客才会显示
~完成~
13/12日前安装的请按下面更新
#解决只显示一位游客问题
打开 index.php 找
- $whosonline[] = $online;
- } else {
- if (isset($_DCACHE['onlinelist'][7])) {
- $online['icon'] = $_DCACHE['onlinelist'][7];
- $online['username'] = 'Guest';
- $online['fid'] = $online['fid'] ? $forumname[$online['fid']] : 0;
- $online['action'] = $actioncode[$online['action']];
- $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
- $whosonline[] = $online;
- }
- break;
复制代码
更改为- $whosonline[] = $online;
- } else {
- if (isset($_DCACHE['onlinelist'][7])) {
- $online['icon'] = $_DCACHE['onlinelist'][7];
- $online['username'] = 'Guest';
- $online['fid'] = $online['fid'] ? $forumname[$online['fid']] : 0;
- $online['action'] = $actioncode[$online['action']];
- $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
- $whosonline[] = $online;
- }
复制代码
[ 本帖最后由 hklcf 于 2005-12-13 07:27 编辑 ] |