- if($$usernamelen < 3) {
- showmessage(‘profile_username_tooshort’);
- } elseif($$usernamelen > 15) {
复制代码,
- if($$usernamelen < 3) {
- showmessage(‘profile_username_tooshort’, ”, array(), array(‘handle’ => false));
- } elseif($$usernamelen > 15) {
复制代码,
- ALTER TABLE `pre_common_member` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_home_blog` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_ucenter_members` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_ucenter_mergemembers` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_ucenter_feeds` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_post` CHANGE `author` `author` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_thread` CHANGE `author` `author` CHAR( 40 ) ;
- ALTER TABLE `pre_home_album` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_announcement` CHANGE `author` `author` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_groupuser` CHANGE `username` `username` CHAR( 40 ) ;
复制代码,以下代码中的数值3改成自己想要的最小长度如1,15改成自己想要的最大长度如40
1、uc_client\model\user.php
if($$$$len > 15 || $$$$len < 3 || preg_match(“/\s+|^c:\\con\\con|[%,\*\”\s\<\>\&]|$$$$guestexp/is”, $$$$username))
2、template\default\member\register.htm
<input type=”text” id=”{$$$$this->setting[‘reginput’][‘username’]}” name=”” class=”px” tabindex=”1″ autocomplete=”off” size=”25″ maxlength=”15″ required />
3、source\language\member\lang_template.php
‘register_username_tips’ => ‘用户名由 3 到 15 个字符组成’,
4、static\js\register.js
if(unlen < 3 || unlen > 15) {
errormessage(id, unlen < 3 ? ‘用户名不得小于 3 个字符’ : ‘用户名不得超过 15 个字符’);
5、source\class\class_member.php
- if($$usernamelen < 3) {
- showmessage(‘profile_username_tooshort’);
- } elseif($$usernamelen > 15) {
复制代码
6、source/module/forum/forum_ajax.php
- if($$usernamelen < 3) {
- showmessage(‘profile_username_tooshort’, ”, array(), array(‘handle’ => false));
- } elseif($$usernamelen > 15) {
复制代码
7、升级数据库(只对关键字段进行升级,基本满足正常使用了),本例中最大长度修改为40
- ALTER TABLE `pre_common_member` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_home_blog` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_ucenter_members` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_ucenter_mergemembers` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_ucenter_feeds` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_post` CHANGE `author` `author` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_thread` CHANGE `author` `author` CHAR( 40 ) ;
- ALTER TABLE `pre_home_album` CHANGE `username` `username` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_announcement` CHANGE `author` `author` CHAR( 40 ) ;
- ALTER TABLE `pre_forum_groupuser` CHANGE `username` `username` CHAR( 40 ) ;
复制代码