[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.1.0) Require on Registration

Post by Sylwia »

It seems I have one more problem. I made two fake users who just turned 18, but their situation didn't change much. One of them entered the registered users group, but still didn't leave the coppa one, and the program treats coppa as his default, so even though he's in both groups now his permissions didn't change.

The other one turned 18 today, but is still not added to 'registered users' group. I think the program waits one more day. Is it possible to make them leave the coppa group on their birthday?

ETA: I think it works now. I'll make one more test to be sure.

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 »

azzurri wrote:Alright, should I use contrib update 0.1.1 to 0.1.2 then? Seems to be a lot of code changes.
If you have 0.1.1 installed, then yeah.
Sylwia wrote:It seems I have one more problem. I made two fake users who just turned 18, but their situation didn't change much. One of them entered the registered users group, but still didn't leave the coppa one, and the program treats coppa as his default, so even though he's in both groups now his permissions didn't change.

The other one turned 18 today, but is still not added to 'registered users' group. I think the program waits one more day. Is it possible to make them leave the coppa group on their birthday?

ETA: I think it works now. I'll make one more test to be sure.
That option was removed from this MOD and made into its own MOD: http://www.phpbb.com/community/viewtopi ... 0&t=573919

It checks the user's age once each time they log in, and if their age is greater than or equal to 13 and if they are a member of the Registered COPPA users group and not a member of the Registered users group then it removes them from the Registered COPPA users group and adds them to the Registered users group.
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.2) Require on Registration

Post by azzurri »

How can I set "yes" on both options in UCP in php code?

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.2) Require on Registration

Post by primehalo »

azzurri wrote:How can I set "yes" on both options in UCP in php code?
I'm not sure what you're asking exactly. The UCP options should be set by the user using the UCP page.

In the php code, the values are retrieved with these lines:

Code: Select all

	$data['show_age']      = (request_var('show_age',      $user->data['user_show_age'] & 0x01)     ) != 1 ? 0 : 1;
$data['show_congrats'] = request_var('show_congrats', ($user->data['user_show_age'] & 0x02) >> 1) != 1 ? 0 : 1;
The "$user->data['user_show_age']" is taken from the database, and then split up into the two options. The first bit is for displaying age, the second bit is for displaying congrats.

This line is what puts it back into the database:

Code: Select all

$sql_ary['user_show_age'] = ($data['show_congrats'] << 1) | $data['show_age'];
The two options are combined back together and put into the SQL query so it can be stored.

If you're trying to make them both default to YES, then instead of executing the following SQL statement when you installed:

Code: Select all

INSERT INTO phpbb_users (user_show_age) VALUES (0)
You would have needed to execute the SQL:

Code: Select all

INSERT INTO phpbb_users (user_show_age) VALUES (3)
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.2) Require on Registration

Post by azzurri »

Thank you for the reply!Im not sure if I understood which changes to do. I simply wish for the settings in UCP to be "Yes" by default, otherwise no one will show age. As it is not, default is set to "No". Exactly what command should I run to change this to yes for all users?

Also:

In the ACP users profile, the admin cannot change settings for "display age" and "display birthday".

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.2) Require on Registration

Post by primehalo »

azzurri wrote:Thank you for the reply!Im not sure if I understood which changes to do. I simply wish for the settings in UCP to be "Yes" by default, otherwise no one will show age. As it is not, default is set to "No". Exactly what command should I run to change this to yes for all users?

Also:

In the ACP users profile, the admin cannot change settings for "display age" and "display birthday".
The defaults are stored in the database, you cannot set the defaults in the PHP code. If you execute this SQL statement, it will turn everybody's options to ON:

Code: Select all

UPDATE phpbb_users SET user_show_age=3
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.2) Require on Registration

Post by azzurri »

Thank you! Also...
azzurri wrote:In the ACP users profile, the admin cannot change settings for "display age" and "display birthday".

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.2) Require on Registration

Post by primehalo »

azzurri wrote:Thank you! Also...
azzurri wrote:In the ACP users profile, the admin cannot change settings for "display age" and "display birthday".
Version 0.1.3 contains this fix. Update instructions are provided 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.3) Require on Registration

Post by azzurri »

Wonderful. Appreciate it.

One more thing and this is not very important but there is a tiny, tiny cosmetic issue. In viewtopic it says: Age:25 without a space in between like Age: 25. :?

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

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

Post by playerfr »

Prime is there any way to indicate an image instead of the digit for age ? Is it possible to do so ? offcorse it will be a combiantaion of 2 images.

Thanks :)
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
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

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

Post by primehalo »

azzurri wrote:Wonderful. Appreciate it.

One more thing and this is not very important but there is a tiny, tiny cosmetic issue. In viewtopic it says: Age:25 without a space in between like Age: 25. :?
This MOD does not even touch the viewtopic.html template. By default (in the prosilver template), the poster's age is not shown in viewtopic, you have to manually add it in. Since yours is showing an age, you must have added it in or you are using a different template style which had it in there by default. Either way, to fix it you just have to go to the template and add in the space.
playerfr wrote:Prime is there any way to indicate an image instead of the digit for age ? Is it possible to do so ? offcorse it will be a combiantaion of 2 images.

Thanks :)
I'm sure a MOD can be written to do this (if one does not already exist) but that is beyond the scope of this MOD.
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 »

primehalo wrote: 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 -->
Actually, I got the code from you... :D

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 »

azzurri wrote:
primehalo wrote: 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?
Actually, I got the code from you... :D
That was just example code, so you can change it however you like, but it appears to already have a space after the "</strong>".
Last edited by primehalo on Wed Aug 15, 2007 7:56 pm, edited 1 time in total.
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.3) Require on Registration

Post by azzurri »

Yeah, works great. Thanks a lot man!

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

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

Post by playerfr »

I am confused here in install file you say :

Code: Select all

Open: index.php
Find

Tip: This may be a partial find and not the whole line.
Code: Select All

if ($config['load_birthdays'] && $config['allow_birthdays'])

Find

Tip: This may be a partial find and not the whole line.
Code: Select All

$result = $db->sql_query($sql);

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All

//-- mod: Prime Birthdate Require -------------------------------------------//
	$sql = str_replace('SELECT user_id', 'SELECT user_show_age, user_id', $sql);
//-- end: Prime Birthdate Require -------------------------------------------//
What should i do with first find ? :?
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

Locked

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