具体办法写一下,以备后用
修改后屏蔽字符
我用限制字符的方式来限制仅限中文注册。
*1*
*2*
*3*
*4*
*5*
*6*
*7*
*8*
*9*
*10*
*0*
*a*
*b*
*c*
*d*
*e*
*f*
*g*
*h*
*i*
*j*
*k*
*l*
*m*
*n*
*o*
*p*
*q*
*r*
*s*
*t*
*u*
*v*
*w*
*x*
*y*
*z*
我想在注册页面加一句 「只限使用中文用户名注册!」
修改 Discuz X 模板目录下 template/default/member/register.htm
具体修改办法写下,给懒人站长
- <!--{template common/header}-->
- <script type="text/javascript" src="{$this->setting[jspath]}register.js?{VERHASH}"></script>
- <div id="ct" >
- <div id="main_succeed" style="display: none">
- <div >
- <div >
- <p id="succeedmessage"></p>
- <p id="succeedlocation" ></p>
- <p ><a id="succeedmessage_href">{lang message_forward}</a></p>
- </div>
- </div>
- </div>
- <div >
- <div id="main_message">
- <div id="main_hnav">
- <span >
- <!--{hook/register_side_top}-->
- <!--{if $_G[gp_action] == 'activation'}-->
- {lang login_inactive}
- <!--{else}-->
- <a
href="member.php?mod=logging&action=login&referer={echo
rawurlencode($dreferer)}" >{lang login_now}</a> - <!--{/if}-->
- </span>
- <h3 id="layer_reginfo_t" >
- <!--{if $_G[gp_action] !=
'activation'}--> 郓城论坛会员 $this->setting['reglinkname']--为防止恶意注册和垃圾帖子,
请务必使用<span > 中文用户名</span> 注册,不能包含 0~9
a~z<!--{else}-->{lang index_activation}<!--{/if}--> - </h3>
- </div>
- <p id="returnmessage4"></p>
- <!--{if $this->showregisterform}-->
- <form method="post" autocomplete="off" name="register"
id="registerform" enctype="multipart/form-data"
action="member.php?mod=$regname"> - <div id="layer_reg" >
- <input type="hidden" name="regsubmit" value="yes" />
- <input type="hidden" name="formhash" value="{FORMHASH}" />
- <input type="hidden" name="referer" value="$dreferer" />
- <input type="hidden" name="activationauth" value="{if $_G[gp_action] == 'activation'}$activationauth{/if}" />
- <div >
- <div id="reginfo_a">
- <!--{hook/register_top}-->
- <!--{if $invite}-->
- <!--{if $invite['uid']}-->
- <div >
- <table>
- <tr>
- <th>{lang register_from}:</th>
- <td><a
href="home.php?mod=space&uid=$invite[uid]"
target="_blank">$invite[username]</a></td> - </tr>
- </table>
- </div>
- <!--{else}-->
- <div >
- <table>
- <tr>
- <th><label for="invitecode">{lang invite_code}:</label></th>
- <td>$_G[gp_invitecode]
- <input type="hidden" id="invitecode" name="invitecode" value="$_G[gp_invitecode]" /></td>
- </tr>
- </table>
- </div>
- <!--{eval $invitecode = 1;}-->
- <!--{/if}-->
- <!--{/if}-->
- <!--{if empty($invite) && $this->setting['regstatus'] == 2 && !$invitestatus}-->
- <div >
- <table>
- <tr>
- <th><span
>*</span><label for="invitecode">{lang
invite_code}:</label></th> - <td><input type="text" id="invitecode"
name="invitecode" autocomplete="off" size="25" tabindex="1"
required /><!--{if
$this->setting['inviteconfig']['buyinvitecode'] &&
$this->setting['inviteconfig']['invitecodeprice'] &&
($this->setting[ec_tenpay_bargainor] ||
$this->setting[ec_tenpay_opentrans_chnid] ||
$this->setting[ec_account])}--><p><a
href="misc.php?mod=buyinvitecode" target="_blank" >{lang
register_buyinvitecode}</a></p><!--{/if}--></td> - <td ><i id="tip_invitecode"
><!--{if
$this->setting['inviteconfig']['invitecodeprompt']}-->$this->setting[inviteconfig][invitecodeprompt]<!--{/if}--></i><kbd
id="chk_invitecode" ></kbd></td> - </tr>
- </table>
- </div>
- <!--{eval $invitecode = 1;}-->
- <!--{/if}-->
- <!--{if $_G[gp_action] != 'activation'}-->
- <div >
- <table>
- <tr>
- <th><span >
- 中文*</span><label
for="{$this->setting['reginput']['username']}">{lang
username}:</label></th> - <td><input type="text"
id="{$this->setting['reginput']['username']}" name=""
tabindex="1" autocomplete="off" size="25" maxlength="15" required
/></td> - <td ><i
id="tip_{$this->setting['reginput']['username']}"
>{lang register_username_tips} 会员名请务必使用<span
> 中文</span>!不得包含任何数字和字母。</i><kbd
id="chk_{$this->setting['reginput']['username']}"
></kbd></td> - </tr>
- </table>
- </div>
- <div >
- <table>
- <tr>
- <th><span
>*</span><label
for="{$this->setting['reginput']['password']}">{lang
password}:</label></th> - <td><input type="password"
id="{$this->setting['reginput']['password']}" name="" size="25"
tabindex="1" required /></td> - <td ><i
id="tip_{$this->setting['reginput']['password']}"
>{lang register_password_tips}</i><kbd
id="chk_{$this->setting['reginput']['password']}"
></kbd></td> - </tr>
- </table>
- </div>
- <div >
- <table>
- <tr>
- <th><span
>*</span><label
for="{$this->setting['reginput']['password2']}">{lang
password_confirm}:</label></th> - <td><input type="password"
id="{$this->setting['reginput']['password2']}" name="" size="25"
tabindex="1" value="" required /></td> - <td ><i
id="tip_{$this->setting['reginput']['password2']}"
>{lang register_repassword_tips}</i><kbd
id="chk_{$this->setting['reginput']['password2']}"
></kbd></td> - </tr>
- </table>
- </div>
- <div >
- <table>
- <tr>
- <th><span
>*</span><label
for="{$this->setting['reginput']['email']}">{lang
email}:</label></th> - <td><input type="text"
id="{$this->setting['reginput']['email']}" name="" autocomplete="off"
size="25" tabindex="1" required /><br /><em
id="emailmore"> </em></td> - <td ><i
id="tip_{$this->setting['reginput']['email']}" >{lang
register_email_tips}</i><kbd
id="chk_{$this->setting['reginput']['email']}"
></kbd></td> - </tr>
- </table>
- </div>
- <!--{/if}-->
- <!--{if $_G[gp_action] == 'activation'}-->
- <div id="activation_user" >
- <table>
- <tr>
- <th>{lang username}:</th>
- <td><strong>$username</strong></td>
- </tr>
- </table>
- </div>
- <!--{/if}-->
- <!--{if $this->setting['regverify'] == 2}-->
- <div >
- <table>
- <tr>
- <th><span
>*</span><label for="regmessage">{lang
register_message}:</label></th> - <td><input id="regmessage" name="regmessage"
autocomplete="off" size="25" tabindex="1" required
/></td> - <td ><i id="tip_regmessage" >{lang register_message1}</i></td>
- </tr>
- </table>
- </div>
- <!--{/if}-->
- <!--{if empty($invite) && $this->setting['regstatus'] == 3}-->
- <div >
- <table>
- <tr>
- <th><label for="invitecode">{lang invite_code}:</label></th>
- <td><input type="text" name="invitecode"
autocomplete="off" size="25" id="invitecode"{if
$this->setting['regstatus'] == 2}{/if} tabindex="1"
/></td> - </tr>
- </table>
- </div>
- <!--{eval $invitecode = 1;}-->
- <!--{/if}-->
- <!--{loop $_G['cache']['fields_register'] $field}-->
- <!--{if $htmls[$field['fieldid']]}-->
- <div >
- <table>
- <tr>
- <th><!--{if $field['required']}--><span
>*</span><!--{/if}--><label
for="$field['fieldid']">$field[title]:</label></th> - <td>$htmls[$field['fieldid']]</td>
- <td ><i
id="tip_$field['fieldid']" ><!--{if
$field['description']}--><!--{echo
htmlspecialchars($field[description])}--><!--{/if}--></i><kbd
id="chk_$field['fieldid']" ></kbd></td> - </tr>
- </table>
- </div>
- <!--{/if}-->
- <!--{/loop}-->
- <!--{hook/register_input}-->
- <!--{if $secqaacheck || $seccodecheck}-->
- <!--{block sectpl}--><div
><table><tr><th><span
>*</span><sec>:
</th><td><sec><br
/><sec></td></tr></table></div><!--{/block}--> - <!--{subtemplate common/seccheck}-->
- <!--{/if}-->
- </div>
- </div>
- </div>
- <div id="layer_reginfo_b">
- <div >
- <table width="100%">
- <tr>
- <th> </th>
- <td>
- <span id="reginfo_a_btn">
- <!--{if $_G[gp_action] != 'activation'}--><em> </em><!--{/if}-->
- <button id="registerformsubmit"
type="submit" name="regsubmit" value="true"
tabindex="1"><strong><!--{if $_G[gp_action] ==
'activation'}-->{lang activation}<!--{else}-->{lang
submit}<!--{/if}--></strong></button> - <!--{if $bbrules}-->
- <input type="checkbox"
name="agreebbrule" value="$bbrulehash" id="agreebbrule"
checked="checked" /> <label for="agreebbrule">{lang agree}<a
href="javascript:;">{lang rulemessage}</a></label> - <!--{/if}-->
- </span>
- </td>
- <td><!--{if
$this->setting['sitemessage'][register]}--><a
href="javascript:;" id="custominfo_register" ><img
src="{IMGDIR}/info_small.gif" alt="{lang faq}"
/></a><!--{/if}--></td> - </tr>
- </table>
- </div>
- <!--{if !empty($_G['setting']['pluginhooks']['register_logging_method'])}-->
- <div gp_infloat'])} mbw{/if}">
- <hr />
- <table>
- <tr>
- <th>{lang login_method}:</th>
- <td><!--{hook/register_logging_method}--></td>
- </tr>
- </table>
- </div>
- <!--{/if}-->
- </div>
- </form>
- <!--{/if}-->
- <!--{hook/register_bottom}-->
- </div>
- <div id="layer_regmessage" style="display: none">
- <div ><div >
- <div id="messageleft1"></div>
- <p id="messageright1"></p>
- </div>
- </div>
- <div id="layer_bbrule" style="display: none">
- <div style="width:700px;height:350px;overflow:auto">$bbrulestxt</div>
- <p >
- <button ><span>{lang agree}</span></button>
- <button ><span>{lang disagree}</span></button>
- </p>
- </div>
- <script type="text/javascript">
- <!--{if $bbrules && $bbrulesforce}-->
- showBBRule();
- <!--{/if}-->
- <!--{if $this->showregisterform}-->
- addFormEvent('registerform', <!--{if $_G[gp_action] !=
'activation' && !($bbrules && $bbrulesforce) &&
!empty($invitecode)}-->1<!--{else}-->0<!--{/if}-->); - <!--{if $this->setting['sitemessage'][register]}-->
- function showRegprompt() {
- showPrompt('custominfo_register', 'mouseover', '<!--{echotrim($this->setting['sitemessage'][register][array_rand($this->setting['sitemessage'][register])])}-->',
$this->setting['sitemessage'][time]); - }
- <!--{if !($bbrules && $bbrulesforce)}-->
- showRegprompt();
- <!--{/if}-->
- <!--{/if}-->
- function showBBRule() {
- showDialog($('layer_bbrule').innerHTML, 'info', '{echo addslashes($this->setting['bbname']);} {lang rulemessage}');
- $('fwin_dialog_close').style.display = 'none';
- }
- <!--{/if}-->
- </script>
- www.weixiaoduo.com
- </div></div>
- </div>
- <!--{eval updatesession();}-->
- <!--{template common/footer}-->