[RC1] Prime Birthdate - Require on Registration

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Sylwia
Registered User
Posts: 38
Joined: Tue Apr 10, 2007 2:16 am

Re: [BETA] Prime Birthdate (0.0.2) Require on Registration

Post by Sylwia »

I just solved my first problem. It was enough to replace the "coppa_welcome_inactive.txt" file with "user_welcome_inactive.txt". It then sends the same email as to a normal user and they can activate themselves, but still stay in the COPPA group.

Still, if there's any way to make a group that people will leave or enter automatically when they reach certain age I'd be grateful for a tip.

Sylwia

User avatar
playerfr
Registered User
Posts: 851
Joined: Fri Jul 18, 2003 9:50 am
Location: France - Paris

Re: [BETA] Prime Birthdate (0.0.2) Require on Registration

Post by playerfr »

Sorry I am going to ask a question that is out of topic, but as it is same type of logic so i am asking it. I want to force people chose the Gender, I already have field inserted in resgistration, by gender mod. where did you add the function where a field become required ?

Thanks if you can help, may be by PM to not pollute this toipic

Sorry for out of topic question :oops:
All kind of help for your Forums / Sites. Installing for you the forum, the Mods, creating Custom Mods : for small fee http://www.phpbbhelpers.com

User avatar
Freelancetm
Registered User
Posts: 15
Joined: Mon Aug 07, 2006 7:12 pm
Location: West-Vlaanderen, BE, EU
Contact:

Re: [BETA] Prime Birthdate (0.0.2) Require on Registration

Post by Freelancetm »

I sujest asking that in the topic from the gender mod.
The author from the gender mod should be able to help you

User avatar
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Birthdate (0.1.0) Require on Registration

Post by primehalo »

I have just released version 0.1.0. See the initial post in this thread for the change log. I have included upgrade instructions from 0.0.2 with this release.
.:: Chico ::. wrote:Just a Sugestion: a Pack of require option sounds good like localization require, what do you think :?:

Regards,
Chico.
I don't understand the suggestion. What is a pack of require options? Can you give an example?
Sylwia wrote:I have another question though. Would it be possible to use the age option in such a way that people younger than 18 would automatically register to another group. I just need to give different permissions to adults and minors. At this moment I changed the requirements of COPPA, so everyone who is younger than 18 is registered as a COPPA user, but that requires my manual activating of each of them. Would is be possible to change it in such a way that they would register themselves but stay in the COPPA group or some other group defined for them?

Also, would it be then possible for them to automatically leave the restricted group as soon as they're 18?
It's certainly possible to do. In the latest version, I implemented something similar to this, where it gives the option to move the user from the Registered COPPA users group to the Registered users group once the user turns 13 years old. Here are some functions that should do what you want:

Code: Select all

function add_user_to_group($user_data, $to_group)
{
	global $db;
	$return = false;

	// We need to get the group IDs for the groups we're looking at
	$sql = 'SELECT group_id, group_name '
	     . ' FROM ' . GROUPS_TABLE . ' '
	     . ' WHERE group_name="' . $from_group . '"'
	;
	$result = $db->sql_query($sql);
	while ($row = $db->sql_fetchrow($result))
	{
		$group_ids[$row['group_name']] = $row['group_id'];
	}
	$db->sql_freeresult($result);

	// Make sure those groups exist before moving on
	if (isset($group_ids[$to_group]))
	{
		$username_ary = empty($user_data['username']) ? array() : array(0 => $user_data['username']);
		if (($return = group_user_add($group_ids[$to_group], array(0 => $user_data['user_id']), $username_ary, $to_group)) === false)
		{
				$return = true;
		}
	}
	return($return);
}

function add_to_group_at_age($user_data, $age_cutoff, $to_group)
{
	global $db;

	if (isset($user_data['user_birthday']) && get_age($user_data['user_birthday']) >= $age_cutoff && isset($age_cutoff) && !empty($to_group))
	{
		return(add_user_to_group($user_data, $to_group));
	}
	return(false);
}
Then add the following code to "includes/functions.php" right after the line containing "swap_group_at_age($result['user_row']);"

Code: Select all

add_to_group_at_age($result['user_row'], 'Your Group Name');
Note: I have not tested this code. I just copied the functions I used for moving users out of the Registered COPPA users group and modified them so they should do what you want.
playerfr wrote:Sorry I am going to ask a question that is out of topic, but as it is same type of logic so i am asking it. I want to force people chose the Gender, I already have field inserted in resgistration, by gender mod. where did you add the function where a field become required ?

Thanks if you can help, may be by PM to not pollute this toipic

Sorry for out of topic question :oops:
It depends on how you implement the gender. If you're using the custom profile fields then you can just select the "Display at registration screen" or "Required field" options for that field. If it was a MOD, then you need to check for the return value when a form is submitted, and if the value of that field is empty (or invalid) display and error.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

.:: Chico ::.
Registered User
Posts: 463
Joined: Fri Aug 03, 2007 6:35 am
Location: Rio de Janeiro
Contact:

Re: [BETA] Prime Birthdate (0.1.0) Require on Registration

Post by .:: Chico ::. »

Prime,
simple: your MOD show a birthdate field on registration, maybe you can extend it for a localization field on registration, and other thinks

:roll:

Do you understand me now :?:

Bye

azzurri
Registered User
Posts: 909
Joined: Fri Jul 21, 2006 7:48 pm

Re: [BETA] Prime Birthdate (0.1.0) Require on Registration

Post by azzurri »

I have some problems with this mod. First of all, in the UCP when I choose not to display age, my birthday is still presented (with age) on the forum index. Another problem is that age doesnt show up in viewtopic.

User avatar
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Birthdate (0.1.0) Require on Registration

Post by primehalo »

.:: Chico ::. wrote:Prime,
simple: your MOD show a birthdate field on registration, maybe you can extend it for a localization field on registration, and other thinks

:roll:

Do you understand me now :?:

Bye
It sounds like you want additional fields added to the registration page. It's easy to do that for custom profile fields, as it's just a setting you choose when creating those. If you want to require existing default profile fields like website and location, that is a bit more work. It's still not too difficult, and a lot easier than doing the birth date since you don't have deal with COPPA or calculate valid dates. So you think I should change this MOD so that you can require all existing profiles fields on registration, not just the birth date? Personally, I think I'd prefer a separate MOD for each field I wanted to require on registration, but I'd like to hear what others think about it.
azzurri wrote:I have some problems with this mod. First of all, in the UCP when I choose not to display age, my birthday is still presented (with age) on the forum index. Another problem is that age doesnt show up in viewtopic.
By default in the prosilver template, age does not show up on viewtopic. You have to add the line:

Code: Select all

		<!-- IF postrow.POSTER_AGE --><dd><strong>{L_AGE}:</strong> {postrow.POSTER_AGE}</dd><!-- ENDIF -->
As for the other issue you mention, I am not seeing that behavior. When I turn off the Display Age option in the User Control Panel, the age stops showing up on my public profile page. I have verified this in both prosilver and subsilver2 templates. Can you point me to your board so I can sign up and test it out?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

azzurri
Registered User
Posts: 909
Joined: Fri Jul 21, 2006 7:48 pm

Re: [BETA] Prime Birthdate (0.1.0) Require on Registration

Post by azzurri »

Even if you disable "display age" in UCP, congratulation (with age) will still show up on forum index. I guess this makes it a bug then?

User avatar
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by primehalo »

azzurri wrote:Even if you disable "display age" in UCP, congratulation (with age) will still show up on forum index. I guess this makes it a bug then?
Yes, you're right, the age still shows up in the birthday list on the index page. I missed this because they obtained the year not by splitting the birthday string into its component parts, but by just taking a substring 4 characters from the end. I've fixed this for version 0.1.1 and it is now available for download. Upgrade instructions are located in the contrib folder.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

azzurri
Registered User
Posts: 909
Joined: Fri Jul 21, 2006 7:48 pm

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by azzurri »

Great job man! Thank you for doing this.

azzurri
Registered User
Posts: 909
Joined: Fri Jul 21, 2006 7:48 pm

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by azzurri »

I was thinking, wouldnt it be better not to congratulate at all if a user wants his birth date to be anonymous? Is this possible?

Sylwia
Registered User
Posts: 38
Joined: Tue Apr 10, 2007 2:16 am

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by Sylwia »

Thanks, I downloaded the new version and just changed 13 to 18, which should work well for me if it moves users out of the coppa group to the normal one automatically.

One small mistake in the mod description: the location of the ucp_profile.php is given as includes/ucp_profile.php instead of includes/ucp/ucp_profile.php.

Otherwise everything works great! Thanks a lot!

Sylwia

User avatar
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by primehalo »

Sylwia wrote:One small mistake in the mod description: the location of the ucp_profile.php is given as includes/ucp_profile.php instead of includes/ucp/ucp_profile.php.
Thanks, I just got that fixed. No version change, since that mistake was in the instructions for updating.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

stopgo
Registered User
Posts: 31
Joined: Wed Jun 06, 2007 2:48 am
Contact:

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by stopgo »

I installed this Mod (twice) but I have a strange problem. Whenever I click on the "I Agree To These Terms" button at the bottom of the registration terms page I'm re-directed right back to that same page. No php or MySQL errors are kicked up... it's as though the link to the actual registration page is somehow ginked up and I can't figure out where that link is so that I can confirm/edit it.

http://tag.dreamhosters.com/public_html ... /index.php

Any ideas where I may have screwed up?

Sylwia
Registered User
Posts: 38
Joined: Tue Apr 10, 2007 2:16 am

Re: [BETA] Prime Birthdate (0.1.1) Require on Registration

Post by Sylwia »

stopgo wrote:I installed this Mod (twice) but I have a strange problem. Whenever I click on the "I Agree To These Terms" button at the bottom of the registration terms page I'm re-directed right back to that same page. No php or MySQL errors are kicked up... it's as though the link to the actual registration page is somehow ginked up and I can't figure out where that link is so that I can confirm/edit it.

http://tag.dreamhosters.com/public_html ... /index.php

Any ideas where I may have screwed up?
You didn't edit styles - the html files in template folder.

Locked

Return to “[3.0.x] MODs in Development”

cron