Discuz   发布时间:2022-05-06  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Discuz!X2.0限制中文、英文和数字注册的方法大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

Discuz!论坛程序是我们非常喜欢的论坛社区程序,而最近推出的Discuz! X2.0正式版更是功能丰富的不得了,但是在一些小的细节上来说,处理的还不是太好,毕竟一个产品的完美程度是有限的,今天学院小编就来跟大家讨论一下如何实现Discuz!X2.0限制中文、英文和数字注册的问题。 一。只允许输入使…

Discuz!论坛程序是我们非常喜欢的论坛社区程序,而最近推出的Discuz! X2.0正式版更是功能丰富的不得了,但是在一些小的细节上来说,处理的还不是太好,毕竟一个产品的完美程度是有限的,今天学院小编就来跟大家讨论一下如何实现Discuz!X2.0限制中文、英文和数字注册的问题。

一。只允许输入使用中文注册方法

打开: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">
<table width="50%">
<tr>
<th>友情提示:本论坛 『 <font color=red>只接受中文注册</font> 』用户名*</th>
</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>

二。只允许输入英文注册方法

上面代码中的红色部分,替换为:

onkeyup="this.value=this.value.replace(/[^a-z|A-Z]/g,'')" onblur="this.value=this.value.replace(/[^a-z|A-Z]/g,'')"

三。只允许输入数字注册方法

上面代码中的红色部分,替换为:

onkeyup="value=value.replace(/[^d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^d]/g,''))"

大佬总结

以上是大佬教程为你收集整理的Discuz!X2.0限制中文、英文和数字注册的方法全部内容,希望文章能够帮你解决Discuz!X2.0限制中文、英文和数字注册的方法所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: