IITT网络服务中心

标题: DISCUZX3.2 修改注册用户名长度解决方案 [打印本页]

作者: admin    时间: 2018-3-22 12:54
标题: DISCUZX3.2 修改注册用户名长度解决方案
#——请一定要备份!!
1./source/class/目录下的class_member.php文件中, 找到如下代码:
  1.         if($usernamelen < 3) {
  2.                                         showmessage('profile_username_tooshort');
  3.                                 } elseif($usernamelen > 15) {
  4.                                         showmessage('profile_username_toolong');
  5.                                 }
复制代码

修改为:
  1.   if($usernamelen < 3) {
  2.                                         showmessage('profile_username_tooshort');
  3.                                 } elseif($usernamelen > 20) {
  4.                                         showmessage('profile_username_toolong');
  5.                                 }
复制代码

2./source/language/目录下的lang_message.php文件中, 找到如下代码:
  1. 'profile_username_toolong' => '抱歉,您的用户名超过 15 个字符,请输入一个较短的用户名',
复制代码
修改为:

  1. 'profile_username_toolong' => '抱歉,您的用户名超过 20个字符,请输入一个较短的用户名',
复制代码

3./source/language/mobile/目录下的lang_template.php文件中, 找到如下代码:
  1. 'reg_username' => '用户名必须为大于3位小于15位',
复制代码

修改为:

  1. 'reg_username' => '用户名必须为大于3位小于20位',
复制代码

4.站/source/module/forum/Forum_ajax.php 文件中, 找到如下代码:
  1. if($usernamelen < 3) {
  2.                 showmessage('profile_username_tooshort', '', array(), array('handle' => false));
  3.         } elseif($usernamelen > 15) {
  4.                 showmessage('profile_username_toolong', '', array(), array('handle' => false));
  5.         }
复制代码

修改为:
  1. if($usernamelen < 3) {
  2.                 showmessage('profile_username_tooshort', '', array(), array('handle' => false));
  3.         } elseif($usernamelen > 20) {
  4.                 showmessage('profile_username_toolong', '', array(), array('handle' => false));
  5.         }
复制代码

5.替换同名文件,更新缓存,注册用户名最大 就是10个中文 20个字符了


请一定要备份!!





欢迎光临 IITT网络服务中心 (http://service.iitt.cc/) Powered by Discuz! X3