MyBB Community Forums

Full Version: Age/Birth Dates (error)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Detailed description of your problem, including steps to reproduce if necessary
Unfortunately, I failed repeatedly to search for this as the key words I could think of are all too short for it to recognize. In that, forgive me if this has been pointed out already.

At any rate, it has been brought to my attention that when a new member attempts to register on my forum claiming to be over a certain age (100, maybe, not certain...they tried 1800 for the year first), it gives them an error stating that their birthday is wrong. This would be mostly fine (though it might be possible for someone to be over 100 and register), except it continues to the registration form, lets them fill out everything, THEN gives them the error. Will attach a picture, but I deliberately erased the information typed in the form for the person's privacy.

URL to your forum/URL to specific problematic page
http://forum.helpthislife.com/

New installation or upgrade (from which version of MyBB)?
While-ago upgrade, doesn't matter most likely

Test user account (if a posting/UserCP issue)
N/A

Screenshot or error text, verbatim
[attachment=17578] (warning: large image)
I am not aware of a way to do that without code modification or a plugin, you can add this code:
if($mybb->input['bday3'] < (date("Y")-100)){
error('Your birthdate is invalid');
}
Under:
// Store DOB in cookie so we can save it with the registration
			my_setcookie("coppadob", "{$mybb->input['bday1']}-{$mybb->input['bday2']}-{$mybb->input['bday3']}", -1);
On about line 350 of member.php, or if you would prefer I could probably put this in a plugin for you when I get the chance. Change 100 to whatever age you want.
Plugin would be nice, as I have other sites to do that to as well. Thanks Smile
What's the point in hacking the code to allow that sort of year though?? You're meant to put in your correct birthday so I don't see why they'd need to be putting these sorts of years in, they should be using a sensible date to begin with. I'd pay you $10 if someone who was genuinely 100 or over registered.
I wasn't saying I thought they would, only it is possible. It *is* possible, as well, though not likely. As for hacking the code - I'm not worried about making it possible to register as 100 or more...and from the looks of the above mentioned code it would do no such thing. I'm simply saying that it's kind of odd to have it accept the year when you put it in, then wait around for you to enter all your information, THEN finally tell you you're birthdate is off. Would make more sense to put it right after attempting to input the bad birthdate.
I would like to allow birthday ages like 250 years old and older how/where do I change the years to allow this? (this is for a fantasy rp board, with characters that are really old)