vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Require Age for new members (https://vborg.vbsupport.ru/showthread.php?t=105297)

DjTaz 01-13-2006 10:00 PM

Require Age for new members
 
A few people asked for this in the mod requests and i wanted it myself but couldnt find it , so i did a bit of messing about and came up with this ... pretty easy and seems to have done the job :D

Ive run this on vBulletin 3.0.6 , but i dont see any issues on any other versions - ill give a little support , but im not always on here so it wont be major stuff.

Open register.php and find (roughly line 240) :
Code:

// check for missing fields
if (($_POST['coppauser'] AND empty($_POST['parentemail'])) OR empty($_POST['username']) OR empty($_POST['email'])  OR empty($_POST['emailconfirm']) OR (empty($_POST['password']) AND empty($_POST['password_md5'])) OR (empty($_POST['passwordconfirm']) AND empty($_POST['passwordconfirm_md5'])))
{
        eval('$errors[60] = "' . fetch_phrase('fieldmissing', PHRASETYPEID_ERROR) . '";');
}

under that add in :
Code:


// check for empty year
if (empty($_POST['year'])
{       
        eval('$errors[60] = "' . fetch_phrase('yearmissing', PHRASETYPEID_ERROR) . '";');
}

// check member is under 100 years old (ish) (some people put in 0000 into year)
if (($_POST['year'])<1910)
{
        eval('$errors[60] = "' . fetch_phrase('yearmissing', PHRASETYPEID_ERROR) . '";');
}


Then go to Phrase Manager and add in : Make sure of the phrase type
Code:

Phrase Type : Front End Error Messages       
Varname : yearmissing       
Text : You have ommited the year from the registration process - this field is required on this website and may request verification.


and edit : enter_birth_date_controls
to something like
Code:

Adding your date of birth here will enable other forum visitors
will be able to see your birthday on the forum calendar and for
you to get birthday e-mails. This is a required Field for the site
and must be filled in with correct information.



and thats pretty much it - your done once you upload the register.php - all members will now need to fill in the year section - though they can still lie about their age , but nothing we can do about that !

Snake 01-14-2006 03:49 PM

Thanks!

/me clicks on install

DjTaz 01-14-2006 09:28 PM

Aftermath - i see ur boards version says 3.5 .. can you let me know if it works on 3.5 as well please ? I havent tested it on that.

Also make sure that the REQUIRE BIRTHDAY is ticked in the VB Admin - Vbulletin Options - Registration Options.

*fingers crossed*

DjTaz 02-22-2006 08:21 AM

Ok just added a little bit to make sure sign ups dont put in 0000 into the year

djtheropy 03-27-2006 02:01 PM

i have tried getting this to work on my 3.5.4 but it appears the way the code is written between the 2 versions is set out differently

here is how 3.5.x checks for missing fields
Quote:

// check for missing fields
if (empty($vbulletin->GPC['username'])
OR empty($vbulletin->GPC['email'])
OR empty($vbulletin->GPC['emailconfirm'])
OR ($vbulletin->GPC['coppauser'] AND empty($vbulletin->GPC['parentemail']))
OR (empty($vbulletin->GPC['password']) AND empty($vbulletin->GPC['password_md5']))
OR (empty($vbulletin->GPC['passwordconfirm']) AND empty($vbulletin->GPC['passwordconfirm_md5']))


All times are GMT. The time now is 07:33 AM.

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.01455 seconds
  • Memory Usage 1,725KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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