註冊必須填性別&生日 For Discuz 6.0 更改方法
所属分类:
实用技巧 / 应用技巧
阅读数:
1305
收藏 0赞 0分享
註:本人在自己的論壇做了多次的測試都沒有發現問題,所以如果其他使用者安裝這插件時有任何問題,本人不會付任何責任,請其他使用者自己考慮是否使用‧
如有任何問題都歡迎提出^^"(我第一次發插件= =做得不好,別見怪‧)
修改者: sum1022
版本: Discuz! 6.0
演示: http://sum1022.no-ip.biz/register.php
如果只安裝其中一樣,請自行省略步驟!
1、打開 register.php 找:
if($password != $password2) {
showmessage('profile_passwd_notmatch');
}
下面加:
//性別判斷
if($gendernew == '') {
showmessage('profile_gendernew_invalid');
}
//出生日期判斷
if($bday > $timenow['year'] - 5 || $bday < $timenow['year'] - 95) {
showmessage('profile_year_invalid');
}
if ( datecheck($bday) )
{
$bday = $bday;
}
else
{
showmessage('profile_year_invalid');
}
2、打開 /templates/default/register.htm
2.1 找:
<tr>
<th><label for="email">{lang email} *</label></td>
在上面加:
//性別
<tr>
<th>{lang gender} *</th>
<td>
<label><input type="radio" name="gendernew" value="1" tabindex="17" /> {lang male}<img src="images/common/male.gif" alt="我是帥哥"></label>
<label><input type="radio" name="gendernew" value="2" tabindex="18" /> {lang female}<img src="images/common/female.gif" alt="我是美女"></label> <font color=red>請選擇好性別,才可註冊</font>
</td>
</tr>
//出生日期
<tr>
<td class="altbg1"><span class="bold">{lang birthday} *</span></td>
<td class="altbg2"><input type="text" name="bday" size="25" onclick="showcalendar(event, this)"
onfocus="showcalendar(event, this);if(this.value=='0000-00-00')this.value=''" value="0000-00-00"></td>
</tr>
下載附件,將附件解壓縮後,上傳到 images/common/ <-----安裝【必須填性別】的才要下載‧
2.2 找以下代碼,並將刪除(防止在 高級設置 那裡重複出現 )。
<tr>
<th>{lang gender}</th>
<td>
<label><input type="radio" name="gendernew" value="1" tabindex="17" /> {lang male}</label>
<label><input type="radio" name="gendernew" value="2" tabindex="18" /> {lang female}</label>
<label><input type="radio" name="gendernew" value="0" tabindex="19" checked="checked"> {lang secret}</label>
</td>
</tr>
<tr>
<th><label for="bday">{lang birthday}</label></th>
<td><input type="text" id="bday" name="bday" size="25" onclick="showcalendar(event, this)" onfocus="showcalendar(event, this);if(this.value=='0000-00-00')this.value=''" value="0000-00-00" tabindex="20" /></td>
</tr>
3、取消【控制面板>編輯個人資料>基本資料】性別中的{保密}
打開 /templates/default/memcp_profile.htm 找:
<label><input class="radio" type="radio" name="gendernew" value="0" $gendercheck[0] /> {lang secret}</label>
把上面這段刪除或是屏蔽掉。
4、打開 include/common.inc.php 找:(如果不安裝【必須填生日】可以不用修改)
$timenow = array('time' => gmdate("$dateformat $timeformat", $timestamp + 3600 * $timeoffset),
在下面加入
'year' => date("Y"),
5、打開 memcp.php 找:(如果不安裝【必須填生日】可以不用修改)
$sitenew = dhtmlspecialchars(trim(preg_match("/^https?:\/\/.+/i", $sitenew) ? $sitenew : ($sitenew ? 'http://'.$sitenew : '')));
$icqnew = preg_match ("/^([0-9]+)$/", $icqnew) && strlen($icqnew) >= 5 && strlen($icqnew) <= 12 ? $icqnew : '';
$qqnew = preg_match ("/^([0-9]+)$/", $qqnew) && strlen($qqnew) >= 5 && strlen($qqnew) <= 12 ? $qqnew : '';
$bdaynew = datecheck($bdaynew) ? $bdaynew : '0000-00-00';
在下面加入
//出生日期判斷
if($bdaynew > $timenow['year'] - 5 || $bdaynew < $timenow['year'] - 95) {
showmessage('profile_year_invalid');
}
if ( datecheck($bdaynew) )
{
$bday = $bday;
}
else
{
showmessage('profile_year_invalid');
}
6、打開 /templates/default/messages.lang.php 找:
'profile_passwd_illegal' => '密碼空或包含非法字符,請返回重新填寫。',
下面加:
'profile_gendernew_invalid' => '您沒有選擇性別,請返回選擇。',
'profile_year_invalid' => '您設置的出生年月日無效,請返回修改。',
完成!
本文来自: 脚本之家(www.jb51.net) 详细出处参考:https://www.jb51.net/article/14472.htm
如何设置一个严格30分钟过期的Session示例介绍
SESSION和COOKIE是每个面试官必问的知识点,下面为大家介绍下如何设置一个严格30分钟过期的Session,具体示例如下,感兴趣的朋友可以参考下哈,希望对大家有所帮助
收藏 0赞 0分享
禁用Cookie三种方法(保护你的隐私)
cookie的作用很多人都知道——cookie里面保存着我们所浏览过的网页的记录,为了安全起见下面为大家介绍禁用Cookie的三种方法,感兴趣的朋友可以参考下哈
收藏 0赞 0分享
URL中井号的作用介绍
URL中的井号(#)是比较常见的,下面就为大家介绍一些有关井号的故事,感兴趣的朋友可以了解下
收藏 0赞 0分享
访问Excel的几种方式介绍
本文将为大家介绍下访问Excel的几种方式:通过OLEDB方式、通过Microsoft.Office.Interop.Excel访问及其他相关等等,感兴趣的朋友可以参考下,希望对大家有所帮助
收藏 0赞 0分享
HttpClient抓取网页的两种方式
可以利用NodeFilter对网页进行分析及利用Visitor对网页进行分析实现抓取网页,具体如下感兴趣的朋友可以参考下,希望对大家有所帮助
收藏 0赞 0分享
GHOST删除分区和修复硬盘坏扇区不仅仅是备份还原
如果你只是用GHOST来备份和还原数据的话,那你可委屈了这款“功能强大”的软件了。其实GHOST还有一些比较另类的功能,接下来为大家介绍下GHOST删除分区和修复硬盘坏扇区
收藏 0赞 0分享
sharepoint 2010版本图文安装教程
这篇文章主要为大家详细介绍了Microsoft Share Point2010中文版图文安装的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0赞 0分享
Chrome开发者工具9个调试技巧详解
对于我们前端开发者来说,Chrome自带的开发者工具绝对是不可或缺的调试工具,我们常用的调试方法包含一些console等,而Chrome自带的开发者工具其实很强大,下面我们来聊聊一些你可能不知道的使用方法。
收藏 0赞 0分享
查看更多