找回密码
 注册
查看: 6131|回复: 0
收起左侧

[分享] DX2.5论坛限制会员名中文注册

[复制链接]

5341

主题

8361

帖子

1万

积分

管理员

出售国内外虚拟空间

Rank: 10Rank: 10Rank: 10

积分
14733
帖子
8361
精华
67
体力
14733 点
蓝豆
2391 点
注册时间
2007-6-8

终身成就奖LY官方团队会员身份ID卡

发表于 2012-8-21 15:49:06 | 显示全部楼层 |阅读模式
一.找到template\default\member里的register.htm文件,找到代码
  1. <div class="rfm">
  2. <table>
  3. <tr>
  4. <th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
  5. <td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15" required /></td>
  6. <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>
  7. </tr>
  8. </table>
  9. </div>
复制代码
替换为
  1. <div class="rfm">
  2. <label>提示语:本论坛 『 <font color=red>只接受中文注册</font> 』用户名*</label>
  3. </tr>
  4. </table>
  5. </div>
  6. <div class="rfm">
  7. <table>
  8. <tr>
  9. <th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
  10. <td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15"
  11. onpropertychange="with(this)if(/[^\u3447-\uFA29]/ig.test(value))value=value.replace(/[^\u3447-\uFA29]/ig,'')" required /></td>
  12. <td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang register_username_tips}</i><kbd id="chk_{$this->setting
  13. ['reginput']['username']}" class="p_chk"></kbd></td>
  14. </tr>
  15. </table>
  16. </div>
复制代码
二、在source\class中找到class_member.php文件,并找到代码
  1. list($username, $password, $questionexist) = explode("\t", authcode($_GET['auth'], 'DECODE'));
  2. $username = dhtmlspecialchars($username);
复制代码
在下面添加代码
  1. if(!preg_match("/^[\x7f-\xff]+$/", $username)) showmessage('出错啦!用户名只能全中文。'); //**** 中文注册修改
复制代码
出售国内或美国高性能虚拟空间,高速VPS以及服务器! 同时承接各种类型的网站制作,网站维护,支付宝交易安全放心!    联系QQ:6102031
懒得打字嘛,点击右侧快捷回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

网站公告上一条 /2 下一条

GMT+8, 2025-2-5 20:59 , Processed in 0.116960 second(s), 28 queries , Gzip On.

© 2006-2022 Powered by Discuz! X3.4

快速回复 返回顶部 返回列表