Time Zone field type?

  • cpaschen
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 11 months ago #144248 by cpaschen
Time Zone field type? was created by cpaschen
I'm trying to get MP set-up and we need to make sure we ask the user for their time zone. However, I'm not seeing any field type in MP as a time-zone type.

Do we have to create our own select list and populate with the correct data (so that it can properly be synchronized with Joomla user field)?

Anyone else been able to add a time-zone field for MP and synchronize it with Joomla user field?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
2 years 11 months ago #144256 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Time Zone field type?
Hi

Yes. As of right now, the only way is using List Custom Field to populate list of Timezone manually. We will try to support more custom field types in the future. But for now, using List custom field is the only option

Tuan

Please Log in or Create an account to join the conversation.

  • cpaschen
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 10 months ago #144372 by cpaschen
Replied by cpaschen on topic Time Zone field type?
The problem is that the timezone data within the core Joomla user table is stored within the "params" field as a jason data type (along with other params).
So there is really no way to automatically synchronize the data between a custom timezone field and the user data.

So, it looks like there MIGHT be a few options.

1. Use the Core Joomla User Profile system
Is this possible with MP? I can't find a way to do this. It seems to require the use of the MP user profile system.

2. Create custom MP plugin to update core J! user profile on MP profile save
This should be a rather easy plug-in to create, to just look at the user's new/updated time-zone (in a MP custom field) and use the J! core user profile functionality to save that to the current user's profile.
HOWEVER - I don't see any MP trigger for onProfileSave. Is there such a trigger for MP? If not, can you suggest what trigger might allow this type of plugin to work?
I also don't see any helper methods to override that might be called onAfter the user profile has been saved.
OR - Do I need to work directly with the MP API (and possibly create my own API method?

3. Run custom PHP on field save
It would be much more convinient for this instance (and possibly other future ones) to have the ability for the addition of PHP code to be run on save of the user profile form. This could allow us to process profile data as needed based on user input.


This seems like a very important functioinality that MP is missing (allowing users to set their timezone - or language for that matter).
If it requires creating a custom plugin I'd be happy to share it back with you/community once I have it tested and working.
We just must have the ability to allow users to set their local timezone for proper site functionality, and will likely soon need to have the ability to set language also (which would be a similar issue).

Can you tell me which of the above options might work and which you would recommend as the most reliable (and hopefully simplest) method to be able to have time-zone setting functionality for users when using MP?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
2 years 10 months ago #144391 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Time Zone field type?
Hello

Membership Pro has onProfileUpdate trigger. You can look at plugins/osmembership/userprofile/userprofile.php for an example

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • cpaschen
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 10 months ago #144756 by cpaschen
Replied by cpaschen on topic Time Zone field type?
Well, after looking at this we've decided to NOT do the plugin option but go with something else temporarily.
However, I do think that it would be a good idea to add a timezone field to MP so that it is available just like for core Joomla user profiles.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
2 years 10 months ago #144760 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Time Zone field type?
Yes, agree. I will support more field types in the future

Regards,

Tuan

Please Log in or Create an account to join the conversation.