Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-08-16 03:07:34

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

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

#2 2004-08-16 04:07:46

schussat
Plugin Author
Registered: 2004-02-24
Posts: 101
Website

Re: rsx_time_of_day (ala Duntan's Blog)

Nice plugin, Ramanan — thanks to you and Dunstan both!


-Alan

Offline

#3 2004-08-16 04:50:01

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

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

#5 2004-08-16 17:46:56

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

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

#7 2004-11-02 03:12:12

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

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

#8 2005-01-05 14:39:53

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_time_of_day (ala Duntan's Blog)

I forgot to declare $timeoffset as a global variable. This has been fixed.

Offline

#9 2009-08-13 02:27:16

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_time_of_day (ala Duntan's Blog)

Offline

#10 2009-08-13 04:38:09

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: rsx_time_of_day (ala Duntan's Blog)

This is fun, that’s a good thing. Thank you very much.

Offline

Board footer

Powered by FluxBB