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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 必须填写正常出生年份 For 4.1.0(最后更新13/3 07:20am)

[复制链接]
hklcf 发表于 2006-3-11 09:08:35 | 显示全部楼层 |阅读模式
适用版本:Discuz! 4.1.0
插件名称:必须填写正常出生年份
作  者:hklcf / HkDz (HKLCF)
数据升级:无
修改文件:memcp.php, register.php, include/common.inc.php
修改模板:messages.lang.php
安装难度:易
最后更新:13-03-2006 07:20am
技术支持:discuz.dismall.com
功能简述:自4.1.0版开始程序自身已包括了生日显示功能,但发现很多人都以假的出生日期来填写,所以写下这插件来防止乱填出生日期

修改步骤
1. 打开 memcp.php 找
  1. if(!isemail($emailnew = $passport_status ? $member['email'] : $emailnew)) {
  2.         showmessage('profile_email_illegal');
  3. }
复制代码


在下面加上(代码中的5及95是限制的年龄,即是说不得小于5岁及大于95岁,可自行更改)
  1. if($year) {
  2.         if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  3.                 showmessage('profile_year_invalid');
  4.         }
  5. }
复制代码


2. 打开 register.php 找
  1. $censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
  2. if(!isemail($email) || ($censoremail && preg_match($censorexp, $email))) {
  3.         showmessage('profile_email_illegal');
  4. }
复制代码

在下面加上(代码中的5及95是限制的年龄,即是说不得小于5岁及大于95岁,可自行更改)
  1. if($year) {
  2.         if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  3.                 showmessage('profile_year_invalid');
  4.         }
  5. }
复制代码


3. 打开 include/common.inc.php 找
  1. $timenow = array('time' => gmdate("$dateformat $timeformat", $timestamp + 3600 * $timeoffset),
复制代码

在下面加上
  1. 'year' => date("Y"),
复制代码


4. 打开 messages.lang.php 语言包找
  1. 'profile_email_illegal' => 'Email 地址无效或包含不可使用的邮箱域名,请返回重新填写。',
复制代码

在下面加上
  1. 'profile_year_invalid' => '您设置的出生年份无效,请返回修改。',
复制代码


------完成------

===========================================
# 11/3/2006 11:20am 修正了没有在注册时加入判断
请按下方法修正
打开 register.php 找
  1. $censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
  2. if(!isemail($email) || ($censoremail && preg_match($censorexp, $email))) {
  3.         showmessage('profile_email_illegal');
  4. }
复制代码

在下面加上(代码中的5及95是限制的年龄,即是说不得小于5岁及大于95岁,可自行更改)
  1. if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  2.         showmessage('profile_year_invalid');
  3. }
复制代码

===========================================
# 13/3/2006 07:20am 修正了没有填写出生日期时也进行判断
请按下方法修正
1. 打开 memcp.php 找
  1. if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  2.         showmessage('profile_year_invalid');
  3. }
复制代码

更改为
  1. if($year) {
  2.         if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  3.                 showmessage('profile_year_invalid');
  4.         }
  5. }
复制代码

2. 打开 register.php 找
  1. if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  2.         showmessage('profile_year_invalid');
  3. }
复制代码

更改为
  1. if($year) {
  2.         if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
  3.                 showmessage('profile_year_invalid');
  4.         }
  5. }
复制代码


[ 本帖最后由 hklcf 于 2006-3-13 07:24 编辑 ]

评分

1

查看全部评分

军曹 发表于 2006-3-11 09:09:40 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

eghawk 发表于 2006-3-11 09:17:58 | 显示全部楼层
路过
回复

使用道具 举报

 楼主| hklcf 发表于 2006-3-11 09:27:31 | 显示全部楼层
没人来......自己顶/.\
回复

使用道具 举报

M55 发表于 2006-3-11 09:35:30 | 显示全部楼层
原帖由 hklcf 于 2006-3-11 09:27 发表
没人来......自己顶/.\



MJJ 的,本不想顶你的!

回复

使用道具 举报

 楼主| hklcf 发表于 2006-3-11 09:37:09 | 显示全部楼层
原帖由 M55 于 2006-3-11 09:35 发表



MJJ 的,本不想顶你的!


你这个MJJ来了
回复

使用道具 举报

karl907 发表于 2006-3-11 09:39:18 | 显示全部楼层
哦 。。。不错
回复

使用道具 举报

 楼主| hklcf 发表于 2006-3-11 09:39:54 | 显示全部楼层
原帖由 karl907 于 2006-3-11 09:39 发表
哦 。。。不错

有人來了.......
回复

使用道具 举报

 楼主| hklcf 发表于 2006-3-11 09:40:27 | 显示全部楼层
原帖由 karl907 于 2006-3-11 09:39 发表
哦 。。。不错

看来你也是MJJ的......
回复

使用道具 举报

M55 发表于 2006-3-11 09:41:13 | 显示全部楼层
原帖由 hklcf 于 2006-3-11 09:37 发表

你这个MJJ来了


兄弟如此辛苦发布,不来以后怎么在 DZ 混啊!

支持兄弟!所有插件的作者都应该受到尊重……
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-24 20:27 , Processed in 0.104931 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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