Page 5 of 8

Re: [DEV] Birthday Control

Posted: Wed May 13, 2015 11:26 pm
by wkuzma
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.

Re: [DEV] Birthday Control

Posted: Sun May 17, 2015 10:54 pm
by Satanasov
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.

Re: [DEV] Birthday Control

Posted: Mon May 18, 2015 6:23 am
by wkuzma
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.

Re: [DEV] Birthday Control

Posted: Mon May 18, 2015 10:50 am
by Satanasov
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.

Re: [DEV] Birthday Control

Posted: Wed May 27, 2015 1:30 pm
by everflux
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.

Re: [DEV] Birthday Control

Posted: Wed May 27, 2015 3:04 pm
by wkuzma
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.

Re: [DEV] Birthday Control

Posted: Mon Jun 22, 2015 6:25 pm
by Galixte de EzCom
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.

Re: [DEV] Birthday Control

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

Re: [DEV] Birthday Control

Posted: Thu Jun 25, 2015 5:26 pm
by Satanasov
Merged.

I don't have time for the moment ... in few days. Thanks for the bug reports, please be patient.

Re: [DEV] Birthday Control

Posted: Mon Jun 29, 2015 10:38 am
by Satanasov
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.

Re: [DEV] Birthday Control

Posted: Mon Jun 29, 2015 11:15 am
by javiexin
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

Re: [DEV] Birthday Control

Posted: Mon Jun 29, 2015 11:53 am
by Satanasov
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.

Re: [DEV] Birthday Control

Posted: Mon Jun 29, 2015 1:04 pm
by javiexin
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',

Re: [DEV] Birthday Control

Posted: Mon Jun 29, 2015 3:29 pm
by Satanasov
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.

Re: [DEV] Birthday Control

Posted: Mon Jun 29, 2015 5:43 pm
by javiexin
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.