具体办法写一下,以备后用

修改后屏蔽字符

我用限制字符的方式来限制仅限中文注册。
*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

具体修改办法写下,给懒人站长

  1. <!--{template common/header}-->
  2. <script type="text/javascript" src="{$this->setting[jspath]}register.js?{VERHASH}"></script>
  3. <div id="ct" >
  4. <div id="main_succeed" style="display: none">
  5.   <div >
  6.    <div >
  7.     <p id="succeedmessage"></p>
  8.     <p id="succeedlocation" ></p>
  9.     <p ><a id="succeedmessage_href">{lang message_forward}</a></p>
  10.    </div>
  11.   </div>
  12. </div>
  13. <div >
  14. <div id="main_message">
  15. <div id="main_hnav">
  16.   <span >
  17.    <!--{hook/register_side_top}-->
  18.    <!--{if $_G[gp_action] == 'activation'}-->
  19.     {lang login_inactive}
  20.    <!--{else}-->
  21.     <a
    href="member.php?mod=logging&action=login&referer={echo
    rawurlencode($dreferer)}" >{lang login_now}</a>
  22.    <!--{/if}-->
  23.   </span>
  24.   <h3 id="layer_reginfo_t" >
  25.    <!--{if $_G[gp_action] !=
    'activation'}--> 郓城论坛会员 $this->setting['reglinkname']--为防止恶意注册和垃圾帖子,
    请务必使用<span > 中文用户名</span> 注册,不能包含 0~9
    a~z<!--{else}-->{lang index_activation}<!--{/if}-->
  26.   </h3>
  27. </div>
  28. <p id="returnmessage4"></p>
  29. <!--{if $this->showregisterform}-->
  30. <form method="post" autocomplete="off" name="register"
    id="registerform" enctype="multipart/form-data"
    action="member.php?mod=$regname">
  31.   <div id="layer_reg" >
  32.    <input type="hidden" name="regsubmit" value="yes" />
  33.    <input type="hidden" name="formhash" value="{FORMHASH}" />
  34.    <input type="hidden" name="referer" value="$dreferer" />
  35.    <input type="hidden" name="activationauth" value="{if $_G[gp_action] == 'activation'}$activationauth{/if}" />
  36.    <div >
  37.     <div id="reginfo_a">
  38.      <!--{hook/register_top}-->
  39.      <!--{if $invite}-->
  40.       <!--{if $invite['uid']}-->
  41.       <div >
  42.        <table>
  43.         <tr>
  44.          <th>{lang register_from}:</th>
  45.          <td><a
    href="home.php?mod=space&uid=$invite[uid]"
    target="_blank">$invite[username]</a></td>
  46.         </tr>
  47.        </table>
  48.           </div>
  49.       <!--{else}-->
  50.       <div >
  51.        <table>
  52.         <tr>
  53.          <th><label for="invitecode">{lang invite_code}:</label></th>
  54.          <td>$_G[gp_invitecode]
  55.           <input type="hidden" id="invitecode" name="invitecode" value="$_G[gp_invitecode]" /></td>
  56.         </tr>
  57.        </table>
  58.       </div>
  59.       <!--{eval $invitecode = 1;}-->
  60.       <!--{/if}-->
  61.      <!--{/if}-->
  62.      <!--{if empty($invite) && $this->setting['regstatus'] == 2 && !$invitestatus}-->
  63.      <div >
  64.       <table>
  65.        <tr>
  66.         <th><span
    >*</span><label for="invitecode">{lang
    invite_code}:</label></th>
  67.         <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>
  68.         <td ><i id="tip_invitecode"
    ><!--{if
    $this->setting['inviteconfig']['invitecodeprompt']}-->$this->setting[inviteconfig][invitecodeprompt]<!--{/if}--></i><kbd
    id="chk_invitecode" ></kbd></td>
  69.        </tr>
  70.       </table>
  71.      </div>
  72.      <!--{eval $invitecode = 1;}-->
  73.      <!--{/if}-->
  74.      <!--{if $_G[gp_action] != 'activation'}-->
  75.       <div >
  76.        <table>
  77.         <tr>
  78.          <th><span >
  79.          中文*</span><label
    for="{$this->setting['reginput']['username']}">{lang
    username}:</label></th>
  80.          <td><input type="text"
    id="{$this->setting['reginput']['username']}" name=""
    tabindex="1" autocomplete="off" size="25" maxlength="15" required
    /></td>
  81.          <td ><i
    id="tip_{$this->setting['reginput']['username']}"
    >{lang register_username_tips} 会员名请务必使用<span
    > 中文</span>!不得包含任何数字和字母。</i><kbd
    id="chk_{$this->setting['reginput']['username']}"
    ></kbd></td>
  82.         </tr>
  83.        </table>
  84.       </div>
  85.       <div >
  86.        <table>
  87.         <tr>
  88.          <th><span
    >*</span><label
    for="{$this->setting['reginput']['password']}">{lang
    password}:</label></th>
  89.          <td><input type="password"
    id="{$this->setting['reginput']['password']}" name="" size="25"
    tabindex="1" required /></td>
  90.          <td ><i
    id="tip_{$this->setting['reginput']['password']}"
    >{lang register_password_tips}</i><kbd
    id="chk_{$this->setting['reginput']['password']}"
    ></kbd></td>
  91.         </tr>
  92.        </table>
  93.       </div>
  94.       <div >
  95.        <table>
  96.         <tr>
  97.          <th><span
    >*</span><label
    for="{$this->setting['reginput']['password2']}">{lang
    password_confirm}:</label></th>
  98.          <td><input type="password"
    id="{$this->setting['reginput']['password2']}" name="" size="25"
    tabindex="1" value="" required /></td>
  99.          <td ><i
    id="tip_{$this->setting['reginput']['password2']}"
    >{lang register_repassword_tips}</i><kbd
    id="chk_{$this->setting['reginput']['password2']}"
    ></kbd></td>
  100.         </tr>
  101.        </table>
  102.       </div>
  103.       <div >
  104.        <table>
  105.         <tr>
  106.          <th><span
    >*</span><label
    for="{$this->setting['reginput']['email']}">{lang
    email}:</label></th>
  107.          <td><input type="text"
    id="{$this->setting['reginput']['email']}" name="" autocomplete="off"
    size="25" tabindex="1" required /><br /><em
    id="emailmore"> </em></td>
  108.          <td ><i
    id="tip_{$this->setting['reginput']['email']}" >{lang
    register_email_tips}</i><kbd
    id="chk_{$this->setting['reginput']['email']}"
    ></kbd></td>
  109.         </tr>
  110.        </table>
  111.       </div>
  112.      <!--{/if}-->
  113.      <!--{if $_G[gp_action] == 'activation'}-->
  114.      <div id="activation_user" >
  115.       <table>
  116.        <tr>
  117.         <th>{lang username}:</th>
  118.         <td><strong>$username</strong></td>
  119.        </tr>
  120.       </table>
  121.      </div>
  122.      <!--{/if}-->
  123.      <!--{if $this->setting['regverify'] == 2}-->
  124.      <div >
  125.       <table>
  126.        <tr>
  127.         <th><span
    >*</span><label for="regmessage">{lang
    register_message}:</label></th>
  128.         <td><input id="regmessage" name="regmessage"
    autocomplete="off" size="25" tabindex="1" required
    /></td>
  129.         <td ><i id="tip_regmessage" >{lang register_message1}</i></td>
  130.        </tr>
  131.       </table>
  132.      </div>
  133.      <!--{/if}-->
  134.      <!--{if empty($invite) && $this->setting['regstatus'] == 3}-->
  135.      <div >
  136.       <table>
  137.        <tr>
  138.         <th><label for="invitecode">{lang invite_code}:</label></th>
  139.         <td><input type="text" name="invitecode"
    autocomplete="off" size="25" id="invitecode"{if
    $this->setting['regstatus'] == 2}{/if} tabindex="1"
    /></td>
  140.        </tr>
  141.       </table>
  142.      </div>
  143.      <!--{eval $invitecode = 1;}-->
  144.      <!--{/if}-->
  145.      <!--{loop $_G['cache']['fields_register'] $field}-->
  146.       <!--{if $htmls[$field['fieldid']]}-->
  147.       <div >
  148.        <table>
  149.         <tr>
  150.          <th><!--{if $field['required']}--><span
    >*</span><!--{/if}--><label
    for="$field['fieldid']">$field[title]:</label></th>
  151.          <td>$htmls[$field['fieldid']]</td>
  152.          <td ><i
    id="tip_$field['fieldid']" ><!--{if
    $field['description']}--><!--{echo
    htmlspecialchars($field[description])}--><!--{/if}--></i><kbd
    id="chk_$field['fieldid']" ></kbd></td>
  153.         </tr>
  154.        </table>
  155.       </div>
  156.       <!--{/if}-->
  157.      <!--{/loop}-->
  158.      <!--{hook/register_input}-->
  159.      <!--{if $secqaacheck || $seccodecheck}-->
  160.       <!--{block sectpl}--><div
    ><table><tr><th><span
    >*</span><sec>:
    </th><td><sec><br
    /><sec></td></tr></table></div><!--{/block}-->
  161.       <!--{subtemplate common/seccheck}-->
  162.      <!--{/if}-->
  163.     </div>
  164.    </div>
  165.   </div>
  166.   <div id="layer_reginfo_b">
  167.    <div >
  168.     <table width="100%">
  169.      <tr>
  170.       <th> </th>
  171.       <td>
  172.        <span id="reginfo_a_btn">
  173.         <!--{if $_G[gp_action] != 'activation'}--><em> </em><!--{/if}-->
  174.          <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>
  175.         <!--{if $bbrules}-->
  176.          <input type="checkbox"
    name="agreebbrule" value="$bbrulehash" id="agreebbrule"
    checked="checked" /> <label for="agreebbrule">{lang agree}<a
    href="javascript:;">{lang rulemessage}</a></label>
  177.         <!--{/if}-->
  178.        </span>
  179.       </td>
  180.       <td><!--{if
    $this->setting['sitemessage'][register]}--><a
    href="javascript:;" id="custominfo_register" ><img
    src="{IMGDIR}/info_small.gif" alt="{lang faq}"
    /></a><!--{/if}--></td>
  181.      </tr>
  182.     </table>
  183.    </div>
  184.    <!--{if !empty($_G['setting']['pluginhooks']['register_logging_method'])}-->
  185.     <div gp_infloat'])} mbw{/if}">
  186.      <hr />
  187.      <table>
  188.       <tr>
  189.        <th>{lang login_method}:</th>
  190.        <td><!--{hook/register_logging_method}--></td>
  191.       </tr>
  192.      </table>
  193.     </div>
  194.    <!--{/if}-->
  195.   </div>
  196. </form>
  197. <!--{/if}-->
  198. <!--{hook/register_bottom}-->
  199. </div>
  200. <div id="layer_regmessage" style="display: none">
  201. <div ><div >
  202.   <div id="messageleft1"></div>
  203.   <p id="messageright1"></p>
  204. </div>
  205. </div>
  206. <div id="layer_bbrule" style="display: none">
  207. <div style="width:700px;height:350px;overflow:auto">$bbrulestxt</div>
  208. <p >
  209. <button ><span>{lang agree}</span></button>
  210. <button ><span>{lang disagree}</span></button>
  211. </p>
  212. </div>
  213. <script type="text/javascript">
  214. <!--{if $bbrules && $bbrulesforce}-->
  215. showBBRule();
  216. <!--{/if}-->
  217. <!--{if $this->showregisterform}-->
  218. addFormEvent('registerform', <!--{if $_G[gp_action] !=
    'activation' && !($bbrules && $bbrulesforce) &&
    !empty($invitecode)}-->1<!--{else}-->0<!--{/if}-->);
  219. <!--{if $this->setting['sitemessage'][register]}-->
  220.   function showRegprompt() {
  221.    showPrompt('custominfo_register', 'mouseover', '<!--{echotrim($this->setting['sitemessage'][register][array_rand($this->setting['sitemessage'][register])])}-->',
    $this->setting['sitemessage'][time]);
  222.   }
  223.   <!--{if !($bbrules && $bbrulesforce)}-->
  224.    showRegprompt();
  225.   <!--{/if}-->
  226. <!--{/if}-->
  227. function showBBRule() {
  228.   showDialog($('layer_bbrule').innerHTML, 'info', '{echo addslashes($this->setting['bbname']);} {lang rulemessage}');
  229.   $('fwin_dialog_close').style.display = 'none';
  230. }
  231. <!--{/if}-->
  232. </script>
  233. www.weixiaoduo.com
  234. </div></div>
  235. </div>
  236. <!--{eval updatesession();}-->
  237. <!--{template common/footer}-->