注册时昵称为必填项for6.0
因为自己需要,查询了很多贴子也没有人回答,所以只好自己琢磨。其实也不算太复杂,提供出来,给需要的朋友。首先后台要打开用户组定义昵称的选项。
一:打开…/register.htm,进行下面操作。
查找并删除
<!--{if $groupinfo['allownickname']}-->
<tr>
<th>{lang nickname}</th>
<td><input type="text" name="nickname" size="25"
tabindex="16" />
</tr>
<!--{/if}-->
查找
<td>
<input type="text" id="username" name="username" size="25"
maxlength="15"tabindex="3" />
<span id="checkusername"> </span>
</td>
</tr>
在下面增加以下代码
<!--{if $groupinfo['allownickname']}-->
<tr>
<th>{lang nickname} *</th>
<td><input type="text" name="nickname" size="25"
tabindex="16" />
</tr>
<!--{/if}-->
二:打开…/register.php,进行下面操作。
查找
if(!isemail($email) || $invalidemail) {
showmessage('profile_email_illegal');
}
在其后面加上以下代码:
if($qq == '') {
showmessage('profile_nickname_illegal');
}
三:打开\templates\default\messages.lang.php,进行下面操作
查找
'profile_email_illegal' => 'Email 地址无效或包含不可使用的邮箱域名,请返回重新填写。
',
在其后面加上以下代码:
'profile_nickname_illegal' => '昵称未填写,请返回重新填写。',
OK,大功告成。还有很多需要改进的地方,比如如何让昵称只能填写中文或者昵称不重复,希望和大家一切切磋
QQ为必填项
1、修改register.php(主目录下文件)①查找:if($password != $password2) {
showmessage('profile_passwd_notmatch');
}下面加:if($qq = preg_match("/^(+)$/", $qq) && strlen($qq) >= 5 && strlen($qq) <= 12 && intval($qq) > 0 ? $qq : '') {
} else {
showmessage('请填写QQ号码,返回重新填写','javascript:history.back()');
}2、templates/default/register.htm(模块文件)
①查找:<tr>
<th><label for="password2">{lang password_confirm} *</label></th>
<td>
<input type="password" name="password2" size="25" id="password2" onBlur="checkpassword2()" tabindex="5" />
<span id="checkpassword2"> </span>
</td>
</tr>下面加:<tr>
<th><label for="qq">QQ *</label></th>
<td><input type="text" id="qq" name="qq" size="25" tabindex="23" /></td>
</tr>②再查找<tr>
<th><label for="qq">QQ</label></th>
<td><input type="text" id="qq" name="qq" size="25" tabindex="23" /></td>
</tr>把以上代码删掉!!(删除高级选项里的)
页:
[1]