最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
discuz x2.5增加IP地址端口号修改图文教程
时间:2022-06-25 16:30:49 编辑:袖梨 来源:一聚教程网
应市公安局网监要求,discuz等交互类站点在用户日志保存时需添加ip端口号的记录。以下为discuz X2.5版本添加ip端口号修改记录:
1. 修改用户状态表`pre_common_member_status`,添加注册ip端口、最后访问ip端口字段。(类型 char 长度6)
ALTER TABLE `pre_common_member_status` ADD `regipport` CHAR( 6 ) NOT NULL DEFAULT '0' AFTER `lastip` ,
ADD `lastipport` CHAR( 6 ) NOT NULL DEFAULT '0' AFTER `regipport`
2. 修改帖子表`pre_forum_post`,添加发帖时用户ip端口。
ALTER TABLE `pre_forum_post` ADD `useport` CHAR( 6 ) NOT NULL DEFAULT '0' AFTER `useip`
3. 修改程序文件,注册、访问、发帖时记录访客端口号。
①在sourceclasstabletable_common_member.php 292行
查找 'lastip' => (string)$ip, 下面增加两行:
②在sourceclassclass_member.php 121行
查找C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'lastvisit' =>TIMESTAMP, 'lastactivity' => TIMESTAMP));
改为:
C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'lastipport' => (int) $_SERVER['REMOTE_PORT'], 'lastvisit' =>TIMESTAMP, 'lastactivity' => TIMESTAMP));
③在sourceincludepostpost_newreply.php 415行
查找'useip' => $_G['clientip'], 下面增加一行
'useport' => (int) $_SERVER['REMOTE_PORT'],
④在sourceincludepostpost_newthread.php 580行
查找'useip' => $_G['clientip'], 下面增加一行
'useport' => (int) $_SERVER['REMOTE_PORT'],
4. 修改对应需显示端口号得模板文件
①templatedefaulthomespace_profile_body.htm 154行
$space[regip] 后面增加:$space[regipport]
$space[lastip] 后面增加:$space[lastipport]
②templatedefaultforumtopicadmin_getip.htm
$member[useip] 后面增加:
$member[useport]
5. 修改后效果如下图:
相关文章
- 《弓箭传说2》新手玩法介绍 01-16
- 《地下城与勇士:起源》断桥烟雨多买多送活动内容一览 01-16
- 《差不多高手》醉拳龙技能特点分享 01-16
- 《鬼谷八荒》毕方尾羽解除限制道具推荐 01-16
- 《地下城与勇士:起源》阿拉德首次迎新春活动内容一览 01-16
- 《差不多高手》情圣技能特点分享 01-16