註冊必須填性別&生日 For Discuz 6.0 更改方法

所属分类: 实用技巧 / 应用技巧 阅读数: 1261
收藏 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
更多精彩内容其他人还在看

Win XP系统语言栏丢失解决三例

案例一:   问:一台计算机使用Windows XP操作系统,最近任务栏内无法显示语言栏,我通过“区域和语言选项”里的设置找回了语言栏,重新启动计算机后,问题依旧,请问是什么问题造成的?
收藏 0 赞 0 分享

设计软件中的系统字体应用小技巧

大家都知道,在操作系统的安装目录下有字体库,要使用种字体首先需要安装,但是这会造成字体占用系统盘空间过多。设计使用的字体都不少,怎么说也有几个G,很占资源,下面教大家一个稍微节省资源的方法。
收藏 0 赞 0 分享

Access中字段上自动打开的输入法的解决方法

打开Access数据库时,在里面数据表字段输入数值时,总是会跳出输入法来,很是烦人,在网上找了一下,找到了相应的解决办法:
收藏 0 赞 0 分享

“internet explore 无法打开internet站点 已终止操作”的解决方法

在IE下,当页面还没有加载完全时,如果正在执行的JS代码中含有使用了document.createElement的话,很容易引起页面加载失败.导致提示"internet explore 无法打开internet站点 http://www.xxx.com/xxx/xxx.
收藏 0 赞 0 分享

十个习惯让你精通新的开发技术

这篇文章,是从我的《高效开发人员的五个特征》一文中抽出的一个观点。从我自身的事业和习惯中,我考虑了很多方式怎么样才能有效地学习。
收藏 0 赞 0 分享

小谈RADMIN爆破

最近做渗透测试时常碰到RADMIN一类的东西.. 一碰到此类的程序,一般我都会先看下对方把RADMIN的端口配置成什么..以及相应的PASS(加密过的)
收藏 0 赞 0 分享

动易2006序列号破解算法公布

动易2007就快发布了,把2006的算法公开吧,赚点人气,希望动易不要来找我 。
收藏 0 赞 0 分享

联众密码的逆向算法公布

闲来无事,每天上联众,联众的密码经过加密后保存在本地注册表里,看看是怎么加密的。下了个ollydbg,一路跟踪,发现算法极其简单,给出Delphi版本的解密算法(加密部分有兴趣的一起来讨论)。算法比较粗糟,谁帮优化一下:)
收藏 0 赞 0 分享

关于三种主流WEB架构的思考

做WEB好几年了,各种语言和技术都稍有涉猎。今天心血来潮,突然想总结一下。其实不论什么技术,什么需求,通常WEB开发就是通过WEB前端管理一个或大或小或独立或分布式的关系型数据库,很多东西都是相通的。这里说的WEB架构,是指WEB应用开发中每种技术独有的资源组织形式(包括文件,数
收藏 0 赞 0 分享

一篇关于程序员性格的文章第1/3页

软件开发中人们很少注意个人性格问题。自从 1965年Edsger Dijkstra的有里程碑意义的文章“程序开发是一种人类活动”发表以来,程序员性格被认为是合理的和有成效的研究领域,虽然有些题目如“大桥建筑者的心理”和“对律师行为的研究实验”看起来可能是荒唐的,而在计算机领域,“
收藏 0 赞 0 分享
查看更多