Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
rsx_time_of_day (ala Duntan's Blog)
This 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”.
Download the plugin: rsx_time_of_day.txt
Last edited by ramanan (2004-08-16 03:07:55)
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
Nice plugin, Ramanan — thanks to you and Dunstan both!
-Alan
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
really its all dunstan; it’s his idea, and it’s almost all his own code. Anyway, it’s good to be helpful.
Offline
#4 2004-08-16 06:45:39
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: rsx_time_of_day (ala Duntan's Blog)
ramanan, great minds think alike ;-)
You might want to modify part of that code to read something like:
<code>global $thisarticle, $timeoffset;
$posted = $thisarticle[‘posted’];
$hour = date(‘H’,$posted+$timeoffset);</code>
Just so that the hours correspond to your timezone.
Edit:
Oh yeah, (I know this because of implementing the same thing on my site)… I had strange results with certain hours of day with the integer syntax. Strangeness being, if I posted at 7pm or 8pm it wouldn’t output anything. After changing the switch statement to check for strings the strangeness went away (for whatever reason):
<code>case ‘00’:
case ‘01’:
case ‘02’:</code>
Last edited by compooter (2004-08-16 06:52:26)
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
Thanks! I’ll make the changes you suggest and post them now.
Offline
#6 2004-11-01 13:20:44
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: rsx_time_of_day (ala Duntan's Blog)
Thanks for this nice plugin
Translated it in french and made it avalaible for download on my website with full credits and a link to your site :-)
Here it is
Translation of rsx_time_of_day_fr.txt
Is it relevant to make a new post to signal this for french users ?
Last edited by davidm (2004-11-01 13:21:15)
.: Retired :.
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
I think you may as well just make note of it here. This forum is already so cluttered. I’m hoping some day there will be a more organized place to put all the plugins.
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
I forgot to declare $timeoffset
as a global variable. This has been fixed.
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
Offline
Re: rsx_time_of_day (ala Duntan's Blog)
This is fun, that’s a good thing. Thank you very much.
Offline