Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 2.5限制中文注册

[复制链接]
hyz1154 发表于 2012-4-12 13:09:07 | 显示全部楼层 |阅读模式
本帖最后由 hyz1154 于 2012-4-27 21:03 编辑

一.找到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('出错啦!用户名只能全中文。'); //**** 中文注册修改
复制代码
三、效果展示:http://www.nn168.net/member.php?mod=register
红尘男子 发表于 2012-4-12 13:19:03 | 显示全部楼层
这个要顶啊。。。。
回复

使用道具 举报

a434539 发表于 2012-4-12 21:34:09 | 显示全部楼层
不可以
回复

使用道具 举报

1314学习网 发表于 2012-4-13 17:44:55 | 显示全部楼层
貌似X2.5后台能直接设置的吧
回复

使用道具 举报

兰方 发表于 2012-4-13 23:09:23 | 显示全部楼层
不错   可以了  欢迎参观 http://www.huitongzuojia.com
回复

使用道具 举报

鹿城在线网- 发表于 2012-4-16 08:58:08 | 显示全部楼层
是不是有毛病!根本不能!日!
回复

使用道具 举报

落叶飘流 发表于 2012-4-18 09:49:41 | 显示全部楼层
楼主辛苦了,鼓励一下
回复

使用道具 举报

米休 发表于 2012-4-20 02:34:30 | 显示全部楼层
可以用···地板上的哥们,不会修改就不要乱喷!会被挨打的····
回复

使用道具 举报

qq308 发表于 2012-4-20 03:23:29 来自手机 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

拒绝习惯 发表于 2012-4-20 08:19:27 | 显示全部楼层
好啊楼主,没想到啊,太好了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-21 22:16 , Processed in 0.111261 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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