转载Discuz!X3.2修改用户名注册长度限制的方法

Discuz!X3.2修改用户名注册长度限制的方法
Discuz!X3.2用户名注册长度限制为15个字符,有些站长朋友觉得太短,需要改的长一点,但是很多人都不知道怎么修改,下面就告诉大家如何修改这个限制。按照以下步骤来就可以了!

1、打开 /source/class/class_member.php 文件
找到

if($usernamelen < 3) { showmessage('profile_username_tooshort'); } elseif($usernamelen > 15) { showmessage('profile_username_toolong'); 将上面的15改成你需要的数字

2、打开 /source/language/lang_message.php 文件
找到

'profile_username_toolong' => '抱歉,您的用户名超过 15 个字符,请输入一个较短的用户名',

把上面的15改成你需要的数字

3、打开 /source/language/mobile/lang_template.php 文件
找到
‘reg_username’ => ‘用户名必须为大于3位小于15位’,

‘registerinputtip’ => ‘用户名:3-15位’,
把上面的15都改成你需要的数字

4、打开 /source/module/forum/Forum_ajax.php 文件
找到
if( u s e r n a m e l e n &lt; 3 ) s h o w m e s s a g e ( ′ p r o f i l e u s e r n a m e t o o s h o r t ′ , ′ ′ , a r r a y ( ) , a r r a y ( ′ h a n d l e ′ = &gt; f a l s e ) ) ; e l s e i f ( usernamelen &lt; 3) { showmessage(&#x27;profile_username_tooshort&#x27;, &#x27;&#x27;, array(), array(&#x27;handle&#x27; =&gt; false)); } elseif( usernamelen<3)showmessage(profileusernametooshort,,array(),array(handle=>false));elseif(usernamelen > 15) {
showmessage(‘profile_username_toolong’, ‘’, array(), array(‘handle’ => false));
}

把上面的15改成你需要的数字

到这里就全部改完了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值