下面一起来看看discuz x2.5增加IP地址端口号修改图文教程,此文章很详细的介绍操作过程.
应市公安局网监要求,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` //开源软件:Vevb.com
3.修改程序文件,注册、访问、发帖时记录访客端口号.
①在sourceclasstabletable_common_member.php 292行
查找 'lastip' => (string)$ip,下面增加两行:
'regipport' => (int) $_SERVER['REMOTE_PORT'],
'lastipport' => (int) $_SERVER['REMOTE_PORT'],
②在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行.
- </em>$space[regip] 后面增加:<!--{if $space[regipport] != 0}-->$space[regipport]<!--{/if}-->
- </em>$space[lastip] 后面增加:<!--{if $space[lastipport] != 0}-->$space[lastipport]<!--{/if}-->
②templatedefaultforumtopicadmin_getip.htm
<b>$member[useip] 后面增加:
<!--{if $member[useport] != 0}-->$member[useport]<!--{/if}-->
5.修改后效果如下图:
新闻热点
疑难解答