Friendly Time Plugin
5 January 2005, late evening
I’ve written plugin implements the idea discussed by Dunstan on his personal blog about displaying the time a post was published in a friendly manner. Simply place the <txp:rsx_time_of_day /> tag in an article template form and it will print out the time in a friendlier manner. For example, 12:00 will get turned into “lunch time”. I’ve basically copied his code verbatim. You can go and change what is output by editing the switch statement.
Download the plugin: rsx_time_of_day.txt
update: Bug Fix, $timeoffset was not declared as a global variable.
“You da man!”
by valdok on Aug 16, 02:56 #
Thanks again for implementing this :)
Jay
by trip on Aug 16, 03:08 #
I have implemented your plug-in in my website, altough I translated the strings to Spanish. Dates look more “human” now, thank you very much!
by multiverso on Sep 28, 20:29 #
Hi ya. I’m having a slight problem with this plug-in. It doesn’t seem to be picking up the timeoffset figure. I have just made a new post at 7:30am but it is showing “late at night”. I have a +8 hour differential to my host’s timezone. I’m currently running TXP 1.0RC2 changeset 46. Any ideas?
by Stuart on Oct 20, 05:51 #
I do add the
timeoffsetwhen calculating the time. The value/variable may have changed in the latest TXP release. I’ll look into it after work today.by ramanan on Oct 20, 12:35 #
Yes I can see it in the code. Thanks for looking. I’ll check back later.
by Stuart on Oct 20, 14:09 #
Hi again :)
After updating my system to RC3 I also have the same problem as Stuart, but don’t know how to solve it. Any advice?
Thanks!
by multiverso on Apr 16, 11:40 #
Multiverso, if you could try changing the name of the variable
timeoffsettogmtoffset, I think things should work once more. I don’t have an RC3 install I can test with. Please let me know if this solves your problem.by ramanan on Apr 16, 13:37 #
Yes, I changed the variable and it’s working now. Thanks!
by multiverso on Apr 16, 20:38 #