[new plugin] Suntimes

Creating and modifying plugins.
Post Reply
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

Nice plugin RobA, I like it. One thing I noticed though is that it shows the local time as whatever the time is on your host server (I think). My host is in CST (presumably), while I'm PST. Any way to fix this?
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

kavuday, you can change time zone from plugin control panel
My Blog, powered by s9y is http://oxygenws.com/blog/
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

Changing the timezone from the plugin control panel only affects the sunrise and sunset times, not the local time however. The plugin is still going off the servers time (no matter what the timezone offset is), not mine. :( What the plugin needs is a server time offset...like in s9y configuration.
PENorwood
Regular
Posts: 28
Joined: Fri Oct 28, 2005 5:50 pm
Location: Southern California
Contact:

Post by PENorwood »

I fixed the local time problem in mine.

In serendipity_plugin_suntimes.php on line 120 you'll see this

Code: Select all

print ("<tr><td align='right'><b>".PLUGIN_SUNTIMES_TIME."</b></td><td>".date('H:i')."</td></tr>");
Just above it I put

Code: Select all

putenv('TZ=America/Los_Angeles');
This fixed it for my timezone ... I am not entirely sure what all the different timezone/city codes are but it isn't hard to find with a Google search.

This should be easy for the plugin author to add ...
kavuday
Regular
Posts: 12
Joined: Fri Nov 04, 2005 5:24 pm
Location: Post Falls, ID
Contact:

Post by kavuday »

Thanks PENorwood, that worked great. And since we share the same timezone I won't have to go digging for the correct code. :D
PENorwood
Regular
Posts: 28
Joined: Fri Oct 28, 2005 5:50 pm
Location: Southern California
Contact:

Post by PENorwood »

Glad to help ... it is a nice plugin and it is even nicer when it displays the correct time.
PENorwood
Regular
Posts: 28
Joined: Fri Oct 28, 2005 5:50 pm
Location: Southern California
Contact:

Post by PENorwood »

Strange ... no I am showing the time as four hours ahead of the actual time ... this started happening a few hours ago, before I implemented the changes ... maybe the sever time has somehow changed.

UPDATE:

Seems to be working again. I think the people who maintain the server changed the time on the server somehow.
--Paul Norwood

Image
Post Reply