User defined time offset

User defined time offset

Postby Sonya* on Sun Jul 27, 2008 6:23 am

Hello,

In a large blog community I would like to let the user to define his own timezone. All dates in all blogs have to be displayed with regard to this time offset. Now I have figured out that I can define default offset in admin panel. It's OK.

There is also the possibility to define time offset in blog settings for each blog. But in this case the time offset is bind to blog and not to the blog reader (registered user). My intention is to consider user time offset whatever in blog settings or default settings defined. It is like in this forum. I define _my_ time offset in my control panel and all dates are displayed accoring to _my_ timezone.

Technically: I am able to define new field for user to save his time offset. But would it be possible to display the dates with this time offset "system-wide" without changing half of core code?

Thank you for you help and sorry for my English,
Sonya
Sonya*
 
Posts: 29
Joined: Fri Oct 19, 2007 8:33 am

Re: User defined time offset

Postby jondaley on Sun Jul 27, 2008 7:34 am

That sounds kind of hard to me, though I don't think you have to change "half" of the core code. You probably need to either find each occurrence of where getDateWithOffset is used, though due to disk based caching, you will probably have problems, since the dates now have to be calculated on every view, so you probably have to turn off caching, which probably makes the load too high.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: User defined time offset

Postby Sonya* on Sun Jul 27, 2008 2:21 pm

jondaley wrote:That sounds kind of hard to me, though I don't think you have to change "half" of the core code. You probably need to either find each occurrence of where getDateWithOffset is used, though due to disk based caching, you will probably have problems, since the dates now have to be calculated on every view, so you probably have to turn off caching, which probably makes the load too high.

Thank you for your quick reply. The function getDateWithOffest is called 24 times in the whole code. I will change the function itself to replace $timeDiff according to SessionInfo where user time offset will be saved. My caching is turned off since I had encountered problems with caching while displaying summary (login fields were displayed even if the user was logged).
Sonya*
 
Posts: 29
Joined: Fri Oct 19, 2007 8:33 am


Return to Localization

cron