vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Date Of Birth Restrictions.... (https://vborg.vbsupport.ru/showthread.php?t=43205)

Joe Page 09-05-2002 08:29 PM

Date Of Birth Restrictions....
 
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:

PHP Code:

$getperms=getpermissions($forumid,-1,-1,$foruminfo['parentlist']);
if (!
$getperms[canview]) {
  
show_nopermission();


After that add:

PHP Code:

$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 :)


All times are GMT. The time now is 05:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00995 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete