[DEV] Birthday Control

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
wkuzma
Registered User
Posts: 389
Joined: Sun Sep 02, 2007 10:18 pm
Contact:

Re: [DEV] Birthday Control

Post by wkuzma » Wed May 13, 2015 11:26 pm

Lucifer4o wrote:I will take look. I have some stuff to do so - do not expect it earlier then monday morning ... time is not commodity I have.
I am just glad you are still active and will look at it in your own time.

Satanasov
Registered User
Posts: 1187
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: [DEV] Birthday Control

Post by Satanasov » Sun May 17, 2015 10:54 pm

wkuzma wrote:
Lucifer4o wrote:I will take look. I have some stuff to do so - do not expect it earlier then monday morning ... time is not commodity I have.
I am just glad you are still active and will look at it in your own time.
Please update. Should be ok.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.

User avatar
wkuzma
Registered User
Posts: 389
Joined: Sun Sep 02, 2007 10:18 pm
Contact:

Re: [DEV] Birthday Control

Post by wkuzma » Mon May 18, 2015 6:23 am

I updated and it corrected the error I reported.

HOWEVER

you must enter a year in the date of birth or you cannot register
that creates a problem for those that do not wish their age or show.
PROBLEM - Now if you go to the user control panel and update your profile making the year the three ---
it errors and says
Please enter a date of birth. You can not register if you do not add a day of birth.

the same saying when you do not enter a year on registering but this happens when you
try to update your profile.

Satanasov
Registered User
Posts: 1187
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: [DEV] Birthday Control

Post by Satanasov » Mon May 18, 2015 10:50 am

wkuzma wrote:I updated and it corrected the error I reported.

HOWEVER

you must enter a year in the date of birth or you cannot register
that creates a problem for those that do not wish their age or show.
PROBLEM - Now if you go to the user control panel and update your profile making the year the three ---
it errors and says
Please enter a date of birth. You can not register if you do not add a day of birth.

the same saying when you do not enter a year on registering but this happens when you
try to update your profile.

Please set Require birthday to No. This is not a bug, but a feature.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.

everflux
Registered User
Posts: 1
Joined: Tue Jun 03, 2008 4:06 pm

Re: [DEV] Birthday Control

Post by everflux » Wed May 27, 2015 1:30 pm

I configured the date as required.

Is there a way to prevent the user from changeing the birthdate they entered during registration?

If I disable the showing of the birthdate it is not shown anywhere and the user can not change it in the profile - but when he tries to change any other detail in the profile it shows the error that the birthdate is required. He can not change any profile fields therefore.

User avatar
wkuzma
Registered User
Posts: 389
Joined: Sun Sep 02, 2007 10:18 pm
Contact:

Re: [DEV] Birthday Control

Post by wkuzma » Wed May 27, 2015 3:04 pm

Lucifer4o wrote:
wkuzma wrote:I updated and it corrected the error I reported.

HOWEVER

you must enter a year in the date of birth or you cannot register
that creates a problem for those that do not wish their age or show.
PROBLEM - Now if you go to the user control panel and update your profile making the year the three ---
it errors and says
Please enter a date of birth. You can not register if you do not add a day of birth.

the same saying when you do not enter a year on registering but this happens when you
try to update your profile.

Please set Require birthday to No. This is not a bug, but a feature.
I set it to no and tried to register without putting in a year and got this error
The entered birthday is not a valid date.
After I entered the year it registered the account and I was able to remove the year in the accounts profile.

User avatar
Galixte de EzCom
Registered User
Posts: 1028
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Re: [DEV] Birthday Control

Post by Galixte de EzCom » Mon Jun 22, 2015 6:25 pm

Hi,

I have submitted a PR for the FRENCH translation. An other PR for minor update of ENGLISH language.

New issue for “Show age” text on registration page: https://github.com/satanasov/birthdaycontrol/issues/7.
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.
Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.

User avatar
Galixte de EzCom
Registered User
Posts: 1028
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Re: [DEV] Birthday Control

Post by Galixte de EzCom » Thu Jun 25, 2015 9:34 am

Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.
Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.

Satanasov
Registered User
Posts: 1187
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: [DEV] Birthday Control

Post by Satanasov » Thu Jun 25, 2015 5:26 pm

Merged.

I don't have time for the moment ... in few days. Thanks for the bug reports, please be patient.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.

Satanasov
Registered User
Posts: 1187
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: [DEV] Birthday Control

Post by Satanasov » Mon Jun 29, 2015 10:38 am

I remeber now about the YES/No. This is hard coded. There is issue in phpBB that CPFs could not use custom language. This is hard coded and can be changed from the ACP. Sorry but this could not be fixed.

Age now shows in miniprofile (some changes made to CPF parsing in recent versions of phpBB)

Bot can now be created freely (I was checking for age on any user creation, but BOT has no age).

Fields are cleand by the extension manager so no need for special treament.
Last edited by Satanasov on Mon Jun 29, 2015 11:56 am, edited 1 time in total.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Birthday Control

Post by javiexin » Mon Jun 29, 2015 11:15 am

Lucifer4o wrote:There is issue in phpBB that CPFs could not use custom language.
This is not exact. CPFs do use custom language. Specifically for a Yes/No value, they do have different strings in multiple languages. Or am I missing the point?

Edit: add picture.
Image

Satanasov
Registered User
Posts: 1187
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: [DEV] Birthday Control

Post by Satanasov » Mon Jun 29, 2015 11:53 am

javiexin wrote:
Lucifer4o wrote:There is issue in phpBB that CPFs could not use custom language.
This is not exact. CPFs do use custom language. Specifically for a Yes/No value, they do have different strings in multiple languages. Or am I missing the point?

Edit: add picture.
Image
You could translate it form ACP, but extension can't create more then one language entry. The migration used is limited.

Sorry for not clearing that up.

The extension creators could use 3 parameter array for language:

Code: Select all

array(
			'option_id'	=> 0,
			'field_type'	=> 'profilefields.type.bool',
			'lang_value'	=> 'Yes',
		),
This is why we can't use langage files for CPFs.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Birthday Control

Post by javiexin » Mon Jun 29, 2015 1:04 pm

So the limitation is in the migrations? I think this is something that could be overcome... If you use Language keys rather than actual strings to populate the CPF, I think those get automatically copied over when a new language is configured, and therefore the language translation of the extension would take care of this.

Maybe something to explore...
-javiexin

PS: Try:

Code: Select all

array(
         'option_id'   => 0,
         'field_type'   => 'profilefields.type.bool',
         'lang_value'   => 'YES_KEY',
      ),
And in language file:

Code: Select all

		'YES_KEY' => 'Yes',

Satanasov
Registered User
Posts: 1187
Joined: Sun Jul 29, 2012 5:48 am
Name: Stanislav Atanasov
Contact:

Re: [DEV] Birthday Control

Post by Satanasov » Mon Jun 29, 2015 3:29 pm

This will not fly.

Language keys are taken from language file while CFP language is taken from databse. You could probably do some magic with db and so on... but I'm not sure how it should be done.
For list of all my extensions go to https://github.com/satanasov
If you want custom functions in some of my products - PM me and we will discuss it.

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: [DEV] Birthday Control

Post by javiexin » Mon Jun 29, 2015 5:43 pm

Lucifer4o wrote:Language keys are taken from language file while CFP language is taken from databse. You could probably do some magic with db and so on... but I'm not sure how it should be done.
Please, test it. The way CPFs work is that there are helper functions that try to use the key in the DB as language key (from language files), and if that fails, they use the key as the language string itself.
This is the way it works for profile_lang table for sure, profile_fields_lang table probably but have not tested it myself. You need it to work on the latter, that is the one that stores the CPF option strings.

Post Reply

Return to “Extensions in Development”