主页 > 网络知识 > 修改Discuz用户名字段长度【原创】

修改Discuz用户名字段长度【原创】

2013年3月5日 发表评论 查看评论

明月公司要做DISCUZ的单点登录,想从GLEASY这个WEB DESKTOP里面登录到DISCUZE。明月用了最简单的方法,就是通过一个页面做中转,没有注册,就用WEB DESKTOP这边的帐号注册一个DISCUZ帐号,有帐号就直接登录。

但发现一个问题就是DISCUZ的用户名只有15个字符,WEB DESKTOP这边的用户名有的20多个字符。所以需要修改DISCUZ的字段长度。

先修改数据库相关字段长度,明月简单写了个代码,把字段转换成SQL,在mysql命令行下跑就可以了:

#!/usr/bin/perl
 
while(<DATA>){
s/^(.*?):(.*?)\[(.*?)\]/alter table $1 modify column $2 $3;/;
print ;
 
}
 
 
__DATA__
pre_ucenter_admins:username[char(50)]
pre_ucenter_feeds:username[varchar(50)]
pre_ucenter_members:username[char(50)]
pre_ucenter_mergemembers:username[char(50)]
pre_ucenter_protectedmembers:username[char(50)]
pre_common_adminnote:admin[varchar(50)]
pre_common_banned:admin[varchar(50)]
pre_common_card_log:username[varchar(50)]
pre_common_diy_data:username[varchar(50)]
pre_common_failedlogin:username[char(50)]
pre_common_grouppm:author[varchar(50)]
pre_common_invite:fusername[varchar(50)]
pre_common_member:username[char(50)]
pre_common_member_validate:admin[varchar(50)]
pre_common_member_verify_info:username[varchar(50)]
pre_common_mytask:username[char(50)]
pre_common_report:username[varchar(50)]
pre_common_report:opname[varchar(50)]
pre_common_session:username[char(50)]
pre_common_word:admin[varchar(50)]
pre_forum_announcement:author[varchar(50)]
pre_forum_forumrecommend:author[varchar(50)]
pre_forum_groupuser:username[char(50)]
pre_forum_order:admin[varchar(50)]
pre_forum_pollvoter:username[char(50)]
pre_forum_promotion:username[char(50)]
pre_forum_post:author[varchar(50)]
pre_forum_postcomment:author[varchar(50)]
pre_forum_ratelog:username[char(50)]
pre_forum_rsscache:author[varchar(50)]
pre_forum_thread:author[varchar(50)]
pre_forum_threadmod:username[char(50)]
pre_forum_trade:seller[varchar(50)]
pre_forum_tradecomment:rater[varchar(50)]
pre_forum_tradelog:seller[varchar(50)]
pre_forum_tradelog:buyer[varchar(50)]
pre_forum_warning:operator[varchar(50)]
pre_forum_warning:author[varchar(50)]
pre_home_album:username[varchar(50)]
pre_home_blog:username[varchar(50)]
pre_home_clickuser:username[varchar(50)]
pre_home_comment:author[varchar(50)]
pre_home_docomment:username[varchar(50)]
pre_home_doing:username[varchar(50)]
pre_home_feed:username[varchar(50)]
pre_home_feed_app:username[varchar(50)]
pre_home_friend:fusername[varchar(50)]
pre_home_friend_request:fusername[char(50)]
pre_home_notification:author[varchar(50)]
pre_home_pic:username[varchar(50)]
pre_home_poke:fromusername[varchar(50)]
pre_home_share:username[varchar(50)]
pre_home_show:username[varchar(50)]
pre_home_specialuser:username[varchar(50)]
pre_home_specialuser:opusername[varchar(50)]
pre_home_visitor:vusername[varchar(50)]
pre_myrepeats:username[varchar(50)]
pre_portal_rsscache:author[varchar(50)]
pre_portal_topic_pic:username[varchar(50)]
修改完数据库修改程序,主要做以下修改:

vi ./source/class/class_member.php
?profile_username_toolong 找到$usernamelen > 15 修改为32
vi ./source/language/lang_message.php
?profile_username_toolong 修改提示语句
vi ./source/language/member/lang_template.php
?register_username_tips  修改tips
vi ./source/language/mobile/lang_template.php
?reg_username 修改手机客户端的提示语句
vi ./template/default/member/register.htm
?maxlength="15"  修改注册页面的字段限制
vi ./template/default/mobile/member/register.htm
?15 修改手机端注册页面的字段限制
vi ./static/js/register.js
?15 修改js页面限制
vi ./source/class/class_member.php
?15 修改注册文件
/source/module/forum/forum_ajax.php
?15 修改用户名检测的ajax判断
/uc_client/model/user.php 
?15 修改uc_center的用户名注册长度检验
 

这样就可以了

 

原创文章,转载请注明: 转载自肚腩照明月'blog

本文链接地址: 修改Discuz用户名字段长度【原创】

文章的脚注信息由WordPress的wp-posturl插件自动生成


  1. 本文目前尚无任何评论.

SEO Powered by Platinum SEO from Techblissonline