News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Require Birthday at Sign-Up?

Started by lorrcarter, June 13, 2006, 11:19:25 PM

Previous topic - Next topic

lorrcarter

SMF Version: SMF 1.1 RC2
is there a way so I can require people put in a birthday when they sign up? I'm asking cause lately we've been getting people requesting adult access and we don't rightly believe they are adults...but we've got no reason to say them no aside from speculation.

jerm

Admin > Registration > Settings

Put an age in the box and it will do what you want

lorrcarter

no that just says they have to be this age or higher...I want an actual  birthday. See my forum isn't all adult, my age is 11 and up because of what the forum is about.

Oldiesmann

It's relatively easy to add the birthday to the registration form. However, it won't stop people from changing their birthday at some point to say they're older than they really are...

Sources/Reigster.php (so we don't have to hard-code the birthdate text)

Find
loadLanguage('Login');

Add after that
loadLanguage('Profile');

Themes/default/Register.template.php
Find
if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
{
alert("', $txt['register_passwords_differ_js'], '");
return false;
}';


Replace
if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
{
alert("', $txt['register_passwords_differ_js'], '");
return false;
}
else
{
// A few shortcuts so we don't have to keep typing stuff
var bday1 = document.forms.creator.bday1;
var bday2 = document.forms.creator.bday2;
var bday3 = document.forms.creator.bday3;

// Did they actually enter something?
if(bday1.value == \'\' || bday2.value == \'\' || bday3 == \'\')
{
alert("Birthday is required!");
return false;
}
elseif(parseInt(bday1.value) == NaN || parseInt(bday2.value) == NaN || parseInt(bday3.value) == NaN || bday1.value.length < 2 || bday2.value.length < 2 || bday4.value.length < 4)
{
// At least one of the values is not a number or is not the correct length
alert("Invalid birthday!");
return false;
}
}';


Find
</table>
</td>
</tr>
</table>';


Add before that
<tr>
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">
<input type="text" name="bday3" size="4" maxlength="4" /> -
<input type="text" name="bday1" size="2" maxlength="2" /> -
<input type="text" name="bday2" size="2" maxlength="2" />
</td>
</tr>


That should do it.
Michael Eshom
Christian Metal Fans

lorrcarter

well I know it wouldn't stop them from changing it later...but it was give us some leverage to know they were lying cause we check ips and stuff when new accounts register..it would be noted and if they changed it later once finding out we had an adult section, we would know ^^

thanks I'll try that now :)

lorrcarter

alright, I'm getting this error now:

http://moonie-central.com/index.php?action=register

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

sawz

#6
hopefully you backed up the pages that you edited.
i would re-upload the backups and start again.
keep smiling, they'll always wonder what your up too.....

lorrcarter

well its not hurting anything to leave it as it is at the moment....I'd rather leave it and wait for oldiesmann to see it and to go from there.

And trust me...I'm not stupid about backing up my files lmao...I've been doing this sort of thing for a while now ;-)

Oldiesmann

Find
// A few shortcuts so we don't have to keep typing stuff

Replace
// A few shortcuts so we don\'t have to keep typing stuff
Michael Eshom
Christian Metal Fans

lorrcarter


lorrcarter

oh is there a way to not allow 0000-00-00 as an input? Cause I could still do that and it goes through...or can I just hope that my members aren't smart enough to know that haha

khurrum

hello,

i updated my forum to final edition 1.1 but when tried to insert these codes as mentioned above, the same error occurs:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page

even i tried to change don't to don\'t but it did not worked. please help me as it was working fine when it was 1.1RC3

SleePy

khurrum,

Where you able to resolve this issue?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!


Advertisement: