|
提示修改前 请备份
1.找到template\default\member里的register.htm文件,
找到
<div class="rfm">
<table>
<tr>
<th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
<td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15" required /></td>
<td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang register_username_tips}</i><kbd id="chk_{$this->setting['reginput']['username']}" class="p_chk"></kbd></td>
</tr>
</table>
</div>
替换为
<div class="rfm">
<label>温馨提示语:本论坛 『 <font color=red>只接受中文注册</font> 』的用户名,大家请注意了*</label>
</tr>
</table>
</div>
<div class="rfm">
<table>
<tr>
<th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
<td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15"
onpropertychange="with(this)if(/[^\u3447-\uFA29]/ig.test(value))value=value.replace(/[^\u3447-\uFA29]/ig,'')" required /></td>
<td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang register_username_tips}</i><kbd id="chk_{$this->setting
['reginput']['username']}" class="p_chk"></kbd></td>
</tr>
</table>
</div>
2.在source\class中找到class_member.php文件,
找到- list($username, $password, $questionexist) = explode("\t", authcode($_GET['auth'], 'DECODE'));
- $username = dhtmlspecialchars($username);
复制代码
在其下方添加- if(!preg_match("/^[\x7f-\xff]+$/", $username)) showmessage('出错啦!用户名只能全中文。'); //**** 中文注册修改
复制代码
做好后更新缓存即可
DiscuzX 2.5只允许中文用户名注册教程
http://www.studylc.com/thread-783-1-1.html
(出处: 奋斗吧论坛)
|
|