注册用户名长度修改方法
以限制用户名长度为2-8字符之间为例:<BR><BR>论坛根目录下的 register.php中查找<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE>if(strlen($username) < <FONT color=red>3</FONT>) {<BR> showmessage(\'profile_username_tooshort\');<BR>}<BR>if(strlen($username) > <FONT color=red>15</FONT>) {<BR> showmessage(\'profile_username_toolong\');<BR>}</BLOCKQUOTE></DIV>改为:
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE>if(strlen($username) < <FONT color=blue>2</FONT>) {<BR> showmessage(\'profile_username_tooshort\');<BR>}<BR>if(strlen($username) > <FONT color=blue>8</FONT>) {<BR> showmessage(\'profile_username_toolong\');<BR>}</BLOCKQUOTE></DIV>修改模版文件 register.htm查找
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE> if(unlen < <FONT color=red>3</FONT> || unlen > <FONT color=red>15</FONT>) {<BR> warning(cu, unlen < <FONT color=red>2</FONT> ? profile_username_tooshort : profile_username_toolong);</BLOCKQUOTE></DIV>改为:
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE> if(unlen < <FONT color=blue>2 </FONT>|| unlen > <FONT color=blue>8</FONT>) {<BR> warning(cu, unlen < <FONT color=blue>2</FONT> ? profile_username_tooshort : profile_username_toolong);</BLOCKQUOTE></DIV>查找:
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE><input type=\"text\" id=\"username\" name=\"username\" size=\"25\" maxlength=\"<FONT color=red>15</FONT>\" onBlur=\"checkusername()\" tabindex=\"3\" /></BLOCKQUOTE></DIV>改为:
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE><input type=\"text\" id=\"username\" name=\"username\" size=\"25\" maxlength=\"<FONT color=blue>8</FONT>\" onBlur=\"checkusername()\" tabindex=\"3\" /></BLOCKQUOTE></DIV>修改模版文件 templates.lang.php 查找
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE>\'register_profile_username_toolong\' => \'对不起,您的用户名超过 <FONT color=red>15</FONT> 个字符,请输入一个较短的用户名。\',<BR> \'register_profile_profile_username_tooshort\' => \'对不起,您输入的用户名小于<FONT color=red>3</FONT>个字符, 请输入一个较长的用户名。\',</BLOCKQUOTE></DIV>改为:
<DIV class=quote>
<H5>引用:</H5>
<BLOCKQUOTE>\'register_profile_username_toolong\' => \'对不起,您的用户名超过 <FONT color=blue>8</FONT> 个字符,请输入一个较短的用户名。\',<BR> \'register_profile_profile_username_tooshort\' => \'对不起,您输入的用户名小于<FONT color=blue>2</FONT>个字符, 请输入一个较长的用户名。\',</BLOCKQUOTE></DIV>
页:
[1]