IP和来自哪里 后台设置管理组允许查看 IP
修改:index.php
找到:
- $query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions ORDER BY uid DESC");
复制代码
在uid, 后面添加
再找到:
在上面填加:
- $online['ip'] = $online['ip1'].'.'.$online['ip2'].'.'.$online['ip3'].'.'.$online['ip4'];
- if($allowviewip && !($adminid == 2 && $member['adminid'] == 1) && !($adminid == 3 && ($member['adminid'] == 1 || $member['adminid'] == 2))) {
- require_once DISCUZ_ROOT.'./include/misc.func.php';
- $online['iplocation'] = convertip($online['ip']);
- } else {
- $allowviewip = 0;
- }
复制代码
5.修改模版 index.htm
找到:
- <a href="viewpro.php?uid=$online[uid]" title="{lang time}: $online[lastactivity]{LF}
- {lang action}: $online[action]
- <!--{if $online['fid']}-->{LF}{lang forum}: $online[fid]<!--{/if}-->">
- $online[username]</a>
复制代码
修改为:
- <a href="viewpro.php?uid=$online[uid]" title="{lang time}: $online[lastactivity]{LF}
- {lang action}: $online[action]
- <!--{if $online['fid']}-->{LF}{lang forum}: $online[fid]<!--{/if}-->
- <!--{if $allowviewip}-->{LF}{lang online_ip}: $online[ip]{LF}来自:$online[iplocation]<!--{/if}-->">
- $online[username]</a>
复制代码
如果装了这个 [首页显示游客 for4.0] 首页显示IP的,也想看看游客IP
应该在 index.php 查找
前面加上
- $guest['ip'] = $online['ip1'].'.'.$online['ip2'].'.'.$online['ip3'].'.'.$online['ip4'];
- if($allowviewip && !($adminid == 2 && $member['adminid'] == 1) && !($adminid == 3 && ($member['adminid'] == 1 || $member['adminid'] == 2))) {
- require_once DISCUZ_ROOT.'./include/misc.func.php';
- $guest['iplocation'] = convertip($guest['ip']);
- } else {
- $allowviewip = 0;
- }
复制代码 |