| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| [ ! ] Local time in profile | |
|---|---|
| Tweet Topic Started: Jan 10 2015, 05:57 AM (605 Views) | |
| -The- | Jan 10 2015, 05:57 AM Post #1 |
|
#the { display: none; }
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Board Address: http://atriumforum.com Board Software: ZetaBoards Description: Pull the member's local time stat from the main profile and display it in the mini-profile (probably as a custom profile line). Thanks, The |
![]() |
|
| Cory | Jan 10 2015, 10:15 AM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Using AJAX to display any type of content in the mini profile would require too much AJAX. If, for example, 15 different users posts were on one page it would require 15 AJAX requests to grab the data for all 15 users. I can think of one possible way to deter the amount of AJAX it has to use, but it's too complex and would require a lot of coding. |
![]() |
|
| -The- | Jan 10 2015, 10:57 AM Post #3 |
|
#the { display: none; }
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Ok...guess we can manually add it in a custom profile block, but thanks for that anyway
|
![]() |
|
| RedBldSandman | Jan 10 2015, 01:43 PM Post #4 |
![]()
Asante sana Squash banana
![]() ![]() ![]() ![]() ![]() ![]()
|
You could make a custom profile field shown in topics which automatically changes when they change their local time setting (showing GMT+X and DST). It could be converted to a time if wanted (1 ajax request to board settings and use the clock time on the page but this makes every topic page load count as 2 page loads...) or just be left as GMT+X (DST). The code would need to update the profile field on registration and to get the initial settings for currently registered members either (i) the members would need to update their board settings or (ii) the code recognises when they're in a thread which has one of their posts and then checks if it's set -> if it isn't then it updates the profile field. Option (ii) is more intensive as it would scan each thread which is loaded but wouldn't affect performance really (and could be reduced further by only searching every 1/10 threads - this would delay the update of the fields but would later on would reduce the effect on performance, it could even be adjusted later on e.g. at the start it processes every thread but then can be changed to check 1/10 threads later) but would get rid of the need for current members to all update their profile fields. I unfortunately don't have the time to make the code but thought I'd just suggest a possible solution. Edited by RedBldSandman, Jan 10 2015, 01:44 PM.
|
![]() |
|
| Cory | Jan 14 2015, 01:13 AM Post #5 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You totally lost me. Unless you were to convert a timezone to specific time, then wouldn't it require an AJAX request for every member in the topic? I'm sure the OP wants time to display and not a timezone, which is what the default registration/Board Settings option would return if it were to post an AJAX request to update their profile field to display their timezone in topics. |
![]() |
|
| RedBldSandman | Jan 15 2015, 09:33 AM Post #6 |
![]()
Asante sana Squash banana
![]() ![]() ![]() ![]() ![]() ![]()
|
In topic: 1. You would have every members' time zone in topic via the new profile field (via the update part of the code) 2. You would grab the current user's time zone via 1 ajax request to board settings 3, Using some simple logic involving the current user's time zone and the board clock on the topic page you convert all the time zones in the profile fields to times (e.g. I'm GMT and it's 1:22PM on the board clock -> If a profile field timezone is GMT + 1 you add on one hour so it's 2:22PM) |
![]() |
|
| Arrogant | Jan 18 2015, 11:23 PM Post #7 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]()
|
Using an existing library makes it a lot easier. There's a bit of logic involved with doing it yourself, between getting the local time, getting the time zine, setting the time zone, checking whether it's DST or not, etc.. nothing too complicated, but why bother? moment.js does the job just fine. There may also be a jQuery plugin you could use (haven't looked myself). Edited by Arrogant, Jan 18 2015, 11:33 PM.
|
![]() |
|
| Cory | Jan 30 2015, 09:46 PM Post #8 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
-The-, are you still interested in this script? I may attempt it if you are using the JavaScript library that Arrogant posted. |
![]() |
|
| RedBldSandman | Feb 1 2015, 12:06 AM Post #9 |
![]()
Asante sana Squash banana
![]() ![]() ![]() ![]() ![]() ![]()
|
Your post just confuses things I'm afraid as, in that post, I was just giving a rundown on what would happen "in topic" whilst previous posts explained the whole code. moment.js (possibly also moment-timezone) is useful but for one of the simpler parts of the code so just make sure you have the other parts clear in your head Cory
|
![]() |
|
| -The- | Feb 1 2015, 05:03 AM Post #10 |
|
#the { display: none; }
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I am still interested in this script, but I think some of this is slightly above my head. If you could give a simple rundown on how to use the code (as I'm sure you will, knowing you Cory), then it'd be great to have. Thanks, The |
![]() |
|
| Cory | Feb 14 2015, 10:13 PM Post #11 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Unfortunately, it appears I won't be working on this script after all because I do not have the time or patience for it. Sorry for the inconvenience. |
![]() |
|
| -The- | Feb 22 2015, 12:03 PM Post #12 |
|
#the { display: none; }
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Don't worry Cory. My board members quickly forgot about this once I told them it would be a pain
|
![]() |
|
| Roby | Apr 10 2015, 12:35 PM Post #13 |
![]()
#27
![]()
|
This request has gone a lengthy period of time without any new activity, therefore it is being marked as expired. This means that the request was typically too time-consuming or irritating for coders (who provide this service voluntarily in their free time) to complete. Thank you. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Closed Requests · Next Topic » |
| Track Topic · E-mail Topic |
8:30 PM Jul 10
|


![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)





8:30 PM Jul 10