蓝雨 发表于 2012-8-21 15:49:06

DX2.5论坛限制会员名中文注册

一.找到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>
二、在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('出错啦!用户名只能全中文。'); //**** 中文注册修改
页: [1]
查看完整版本: DX2.5论坛限制会员名中文注册