discuz用户名长度限制修改方法

作者:monface 发布时间:December 4, 2009 分类:计算机 No Comments

discuz或者说ucenter默认用户名是3-15位以内,gbk编码一个中文等于2位,即对中文用户名就是2--7个汉字,utf-8编码就是1-5个汉字,UTF-8一个汉字等于三位

要修改三个文件:
uc_server\model\user.php
uc_client\model\user.php
forumdata\templates\1_register.tpl.php

其中uc_server\model\user.php
uc_client\model\user.php这里的搜索


XML/HTML代码

  1. if($len > 15 || $len < 3 || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&]|$guestexp/is", $username))  

将其中的15和3改为你的需要.

forumdata\templates\1_register.tpl.php 


XML/HTML代码

  1. if(unlen <3 || unlen > 15) {   
  2.   
  3. messagehandle_register(1, unlen < 3 ? profile_username_tooshort : profile_username_toolong);   
  4.   
  5. return;   
  6.   
  7. }  

将其中的3和15改为你需要的就可以了

discuz模板下的register.htm也可以修改,不过貌似不修改也能行了

标签: discuz, ucenter, 用户名

添加新评论 »