Friendly Time Plugin
5 January 2005, the wee hours
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 August 16 2004, 2:56 am #
Thanks again for implementing this :)
Jay
by trip on August 16 2004, 3:08 am #
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 September 28 2004, 8:29 pm #
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 October 20 2004, 5:51 am #
I do add the
timeoffset
when 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 October 20 2004, 12:35 pm #
Yes I can see it in the code. Thanks for looking. I’ll check back later.
by Stuart on October 20 2004, 2:09 pm #
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 April 16 2005, 11:40 am #
Multiverso, if you could try changing the name of the variable
timeoffset
togmtoffset
, 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 April 16 2005, 1:37 pm #
Yes, I changed the variable and it’s working now. Thanks!
by multiverso on April 16 2005, 8:38 pm #