Page 2 of 10

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:13 am
by bob_raid
May I know how can I change this "Setting a year will list your age when it is your birthday."

As I would like to insert more words.

Thank in advance.

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:26 am
by DavidIQ
Look for the following in language/en/ucp.php:

Code: Select all

	'BIRTHDAY_EXPLAIN'			=> 'Setting a year will list your age when it is your birthday.',
Change to your heart's content.

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:30 am
by bob_raid
DavidIQ wrote:Well...it's a little unconventional but you can try this in the instructions:

In includes/ucp/ucp_register.php

Find:

Code: Select all

				'lang'				=> array('match', false, '#^[a-z_\-]{2,}$#i'),
Add after:

Code: Select all

				'bday_day'				=> array('num', false),
				'bday_month'			=> array('num', false),
You'll need to remove this line added by the mod:

Code: Select all

				'user_birthday' 	=> array('date', false),
Let me know if it works as I have not tested this...
No changes after the above amendment.

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:34 am
by bob_raid
Or is there anyway to leave the year blank during registration? For example
in UCP profile if user leave the year entry blank it will not show their age.

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:37 am
by DavidIQ
What does your ucp_register.php file look like? Use the code tags.

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:39 am
by bob_raid

Code: Select all

// Check and initialize some variables if needed
		if ($submit)
		{
			$error = validate_data($data, array(
				'username'			=> array(
					array('string', false, $config['min_name_chars'], $config['max_name_chars']),
					array('username', '')),
				'new_password'		=> array(
					array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
					array('password')),
				'password_confirm'	=> array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
				'email'				=> array(
					array('string', false, 6, 60),
					array('email')),
				'email_confirm'		=> array('string', false, 6, 60),
				'confirm_code'		=> array('string', !$config['enable_confirm'], 5, 8),
				'tz'				=> array('num', false, -14, 14),
				'lang'				=> array('match', false, '#^[a-z_\-]{2,}$#i'),
				'bday_day'            => array('num', false),
				'bday_month'         => array('num', false),
			));
			if (!check_form_key('ucp_register'))
			{
				$error[] = $user->lang['FORM_INVALID'];
			}

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 2:55 am
by DavidIQ
Try purging your cache.

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 5:33 am
by bob_raid
Thank you, oic the year still will be there but can be ignore during registration.

At 1st I thought the mod will not show the year during registration. Therefore I didn't
try to register it myself. Only after I test after the mod that is when I realise it can be
ignore. :lol:

Thanks for your effort :)

Re: Birthday on Registration

Posted: Sun Jan 11, 2009 5:43 am
by bob_raid
I try to register by leaving the birthday field empty & it still can proceed for register.

Is there anyway to make the date & month a require field before user allow to register?

Re: Birthday on Registration

Posted: Mon Jan 19, 2009 1:26 pm
by Petter89
I love this mod, but it's just not working for me.
I've installed everything, it looks like it works 100%, no errors or anything. But when I register with a user and enter the birthday it simply won't add the birthday to the database. I have to go into the UCP and enter it there manually, so I'm basically back to square 1.

Any help?

Re: Birthday on Registration

Posted: Mon Jan 19, 2009 2:26 pm
by DavidIQ
The edit to includes/functions_user.php is what takes care of that namely:
Find:

Code: Select all

	// These are the additional vars able to be specified
	$additional_vars = array(
Add before:

Code: Select all

	if ($config['allow_birthdays'] && !empty($user_row['user_birthday']))
	{
		$sql_ary['user_birthday'] = $user_row['user_birthday'];
	}
However if $data['user_birthday'] is empty here in includes/ucp/ucp_register.php:

Code: Select all

				if ($config['allow_birthdays'])
				{
					$user_row['user_birthday'] = $data['user_birthday'];
				}
then the birthdate will not be stored.

Re: Birthday on Registration

Posted: Mon Jan 19, 2009 9:55 pm
by Richazey
The mod is there and working great but how do i get it to work so its a required field as some members have registered and not filled it in??

Re: Birthday on Registration

Posted: Mon Jan 19, 2009 10:27 pm
by DavidIQ
This part makes it required during registration:

Code: Select all

'user_birthday' 	=> array('date', false),
However...users can then go in and remove it from their profile. If this is what you want to prevent then change this in includes/ucp/ucp_profile.php:

Code: Select all

'user_birthday' => array('date', true),
to this:

Code: Select all

'user_birthday' => array('date', false),
Whenever a user tries to edit their profile they will be required to have their birthday. Remember to purge your cache after doing this change.

Re: Birthday on Registration

Posted: Tue Jan 20, 2009 1:33 am
by bob_raid
I had tried but user are still able to register without entering the birthday?

Or was it because I miss something on the registration part?

Re: Birthday on Registration

Posted: Tue Jan 20, 2009 5:56 am
by DavidIQ
You might have missed this edit to includes/ucp/ucp_register.php:
Find:

Code: Select all

				'lang'				=> array('match', false, '#^[a-z_\-]{2,}$#i'),
Add after:

Code: Select all

				'user_birthday' 	=> array('date', false),
Remember to purge your cache.