admin 发表于 2018-3-22 12:54:37

DISCUZX3.2 修改注册用户名长度解决方案

#——请一定要备份!!
1./source/class/目录下的class_member.php文件中, 找到如下代码:
      if($usernamelen < 3) {
                                        showmessage('profile_username_tooshort');
                              } elseif($usernamelen > 15) {
                                        showmessage('profile_username_toolong');
                              }
修改为:
if($usernamelen < 3) {
                                        showmessage('profile_username_tooshort');
                              } elseif($usernamelen > 20) {
                                        showmessage('profile_username_toolong');
                              }
2./source/language/目录下的lang_message.php文件中, 找到如下代码:
'profile_username_toolong' => '抱歉,您的用户名超过 15 个字符,请输入一个较短的用户名',修改为:
'profile_username_toolong' => '抱歉,您的用户名超过 20个字符,请输入一个较短的用户名',
3./source/language/mobile/目录下的lang_template.php文件中, 找到如下代码:
'reg_username' => '用户名必须为大于3位小于15位',
修改为:
'reg_username' => '用户名必须为大于3位小于20位',
4.站/source/module/forum/Forum_ajax.php 文件中, 找到如下代码:if($usernamelen < 3) {
                showmessage('profile_username_tooshort', '', array(), array('handle' => false));
      } elseif($usernamelen > 15) {
                showmessage('profile_username_toolong', '', array(), array('handle' => false));
      }
修改为:
if($usernamelen < 3) {
                showmessage('profile_username_tooshort', '', array(), array('handle' => false));
      } elseif($usernamelen > 20) {
                showmessage('profile_username_toolong', '', array(), array('handle' => false));
      }
5.替换同名文件,更新缓存,注册用户名最大 就是10个中文 20个字符了


请一定要备份!!
页: [1]
查看完整版本: DISCUZX3.2 修改注册用户名长度解决方案