Forums / Templates, Stylesheets, Page Layout / Changing Verify Date of Birth to What's your age

Changing Verify Date of Birth to What's your age

Started by shunobies on 12 Dec 2011, 11:36 PM · Views: 1,044

Results 1 to 6 of 6
12 Dec 2011, 11:36 PM
#1
shunobies avatar

shunobies

New Zenner

Join Date:
Aug 2011
Posts:
7
Plugin Contributions:
0

Changing Verify Date of Birth to What's your age

I'm attempting to change verify age dob field to just the year instead of the entire dob. I really don't need someone's date of birth and just want to know there age for analysis for advertising campaigns.

I have located the code that checks the form for issues but I can't seem to find this ENTRY_DOB_MIN_LENGTH in the language files. If anyone know's where this array is set so that i can change it to 4 for just year entry that would help greatly.

I found this setting in formcheck.js.php any suggestions I have been looking now for about an hour and to no avail. :frusty:

13 Dec 2011, 1:00 AM
#2
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Changing Verify Date of Birth to What's your age

admin/configuration/minimum values/date of birth

The best way to learn is to try stuff. But, back it up first.

13 Dec 2011, 2:31 AM
#3
shunobies avatar

shunobies

New Zenner

Join Date:
Aug 2011
Posts:
7
Plugin Contributions:
0

Re: Changing Verify Date of Birth to What's your age

I made the change as you suggested but it seems as though the system is still freaking out that the dob is not formatted as mm-dd-yyyy when I just want it as YYYY. Is there something else I should dig around for to find out why this is occurring?

13 Dec 2011, 3:13 AM
#4
shunobies avatar

shunobies

New Zenner

Join Date:
Aug 2011
Posts:
7
Plugin Contributions:
0

Re: Changing Verify Date of Birth to What's your age

Ok i got this figured out you have to change the minimum value as you said and then you also have to make a change to the file /modules/includes/create_account.php on line 109 you have to add a line above that as such $dob = "01/01/".$dob; Otherwise you will pass the javascript check but you will not pass the php check of the form being completed.

I find it incredibly stupid that the designers of these two checks are not using the same checks causing us to have to make modifications to the code rather then a quick modification to the administration panel's minimum value.

This input field should not have a minimum value even listed in the control panel since modifying it does a whole lot of nothing at the end of the day.

13 Dec 2011, 3:23 AM
#5
shunobies avatar

shunobies

New Zenner

Join Date:
Aug 2011
Posts:
7
Plugin Contributions:
0

Re: Changing Verify Date of Birth to What's your age

Update disregard what I said before you need to make the change before line 109 at line 52 you need to change the line to read:

 if (ACCOUNT_DOB == 'true') $dob = zen_db_prepare_input("01/01/".$_POST['dob']);
13 Dec 2011, 3:53 AM
#6
shunobies avatar

shunobies

New Zenner

Join Date:
Aug 2011
Posts:
7
Plugin Contributions:
0

Re: Changing Verify Date of Birth to What's your age

One last update since the designers of this product failed to use the $dob var they set and formatted before updating the customer database in the same file you have to modify line 267

    if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = (empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw("01/01/".$_POST['dob']));

This will allow your database to update properly and actually save just the year for each user that buy's a product from you without being to invasive.

The age factor can be a good indicator to use in advertising your product but we really don't need to know there exact dob unless we plan on sending out birthday cards which is probably little above and beyond us starting out.