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
<
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
′
=
>
f
a
l
s
e
)
)
;
e
l
s
e
i
f
(
usernamelen < 3) { showmessage('profile_username_tooshort', '', array(), array('handle' => false)); } elseif(
usernamelen<3)showmessage(′profileusernametooshort′,′′,array(),array(′handle′=>false));elseif(usernamelen > 15) {
showmessage(‘profile_username_toolong’, ‘’, array(), array(‘handle’ => false));
}
把上面的15改成你需要的数字
到这里就全部改完了。