admin管理员组文章数量:1326461
After a lengthy break from WP i'm getting my hands dirty with quite a complex plugin which is coming along nicely, but right now i am at the point of needing some advice on quite a complex issue:
Project Outline Plugin is multi-functional with the core element being that it is a members based system focused on online rpg gaming, member signs up (members country is set on registration from a select option dropdown field), creates his/her profile and sets timezone within their profile, once profile is completed then the member has the option to join an existing group based on Country, Gaming Platform etc, or they can go ahead and create their own group and become group manager.
Being part of a group a member can then post a "mission, quest" etc, upon posting all group members are emailed with the details and a link to the post where they can join if interested.
The problem This is where i need some advice, the time of the "mission/quest" needs to be relevant to the group that its posted from, but timezones being timezones are not exactly country specific (ie one country can have many timezones), an example being the US both the user post and the email would need to show the time as in the coming example as 3.00pm EST or 3.00pm PST so that interested parties have a clear and concise information to the time the "mission/quest" commences.
The Question Is it possible to hook into the Wordpress timezones function (the one you see on wp install) or would you suggest going the laborious route and building my own?, if the WP option is recommended then where can i find info (im thinking codex but im finding nothing in there regarding the WP function) to put me on the right track, timezones are not my strong point and i've known from the outset that this part of the plugin would be my stumbling block, however its of the highest importance that it is integrated so that it is easier on the enduser and removes confusion.
After a lengthy break from WP i'm getting my hands dirty with quite a complex plugin which is coming along nicely, but right now i am at the point of needing some advice on quite a complex issue:
Project Outline Plugin is multi-functional with the core element being that it is a members based system focused on online rpg gaming, member signs up (members country is set on registration from a select option dropdown field), creates his/her profile and sets timezone within their profile, once profile is completed then the member has the option to join an existing group based on Country, Gaming Platform etc, or they can go ahead and create their own group and become group manager.
Being part of a group a member can then post a "mission, quest" etc, upon posting all group members are emailed with the details and a link to the post where they can join if interested.
The problem This is where i need some advice, the time of the "mission/quest" needs to be relevant to the group that its posted from, but timezones being timezones are not exactly country specific (ie one country can have many timezones), an example being the US both the user post and the email would need to show the time as in the coming example as 3.00pm EST or 3.00pm PST so that interested parties have a clear and concise information to the time the "mission/quest" commences.
The Question Is it possible to hook into the Wordpress timezones function (the one you see on wp install) or would you suggest going the laborious route and building my own?, if the WP option is recommended then where can i find info (im thinking codex but im finding nothing in there regarding the WP function) to put me on the right track, timezones are not my strong point and i've known from the outset that this part of the plugin would be my stumbling block, however its of the highest importance that it is integrated so that it is easier on the enduser and removes confusion.
Share Improve this question edited Feb 16, 2016 at 13:17 Mark Kaplun 23.8k7 gold badges43 silver badges65 bronze badges asked Feb 16, 2016 at 12:52 MartinJJMartinJJ 1,9942 gold badges21 silver badges29 bronze badges2 Answers
Reset to default 1This mission is almost impossible. Players do not stay at one timezone therefor associating a timezone with a player can result in misleading and confusing output.
What you can do is move all time to be expressed at a specific time base, lets say UTC, and write some JS that will translate the UTC time into the user's local time based on its browser/os settings by using the relevant JS APIs.
You can see this kind of system in action in the wordpress "make core" site https://make.wordpress/core/tag/agenda/ where they use a shortcode to express times that should be localized.
Obviously this will not work where you can not run JS like emails, so maybe for this you can ask users to set their "normal" timezone.
sidenote: players are usually actually very good in taking TZ into account, and while you can localize time to make it more convenient, people still need to know if it is work time, night or other significant time in the day. Therefor if you go with this kind of localization you need to be careful and leave the users some ability to express their local times when needed.
I this is an old thread but I too need user specific timezone setting. Here is a plugin that "WP User Level Timezone" will hopefully fit the needs of some looking for a user specific setting.
https://wordpress/plugins/wp-utz/
本文标签: localizationUser specified Timezone
版权声明:本文标题:localization - User specified Timezone 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742211993a2433881.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论