View Full Version : Date Of Birth Restrictions....
Joe Page
09-05-2002, 08:29 PM
How about a hack where the user's date of birth can prevent them from entering certain forums? Could be useful for sites where there are adult-related forums or other forums which you would prefer young members not to see. If the member does not enter their date of birth, when they click on a restricted forum, they would be redireced to a message saying: "Please enter you date of birth in your user cp."
Does this sound like a good idea? I'm sorry if this has already been suggested/made etc.
Logician
09-06-2002, 10:01 AM
edit forumdisplay.php, find:
$getperms=getpermissions($forumid,-1,-1,$foruminfo['parentlist']);
if (!$getperms[canview]) {
show_nopermission();
}
After that add:
$usersbirthyear=trim(substr($bbuserinfo[birthday],0,4));
if ((int)$usersbirthyear<1900 OR !$usersbirthyear)
{ eval("standarderror(\"".gettemplate("fill_birthyear")."\");");exit;}
if ((int)$usersbirthyear>1990)
{ eval("standarderror(\"".gettemplate("you_are_young")."\");");exit;
Create a templated named "fill_birthyear" which will be displayed if he didnt fill his birtyear field.
Create a templated named "you_are_young" which will be displayed if he was born after 1990. (Edit "1990" according to your wish)
Enjoy! :)
Joe Page
09-06-2002, 03:48 PM
Thanks, this could prove useful :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.