Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
pat_timer
pat_timer
Simple scheduler based on date and time ranges. Support <txp:else /> statement for alternative option.
Installation & Usage
Install this plugin as usual and activate it. Surround your callings like this:
<txp:pat_timer start="" end=""> (...) TXP or/and HTML tags to apply for this case <txp:else /> (...) TXP or/and HTML tags for alternative option </txp:pat_timer>
Attributes
start
: String [required] starting date (format YYY-MM-DD H:i) when you wish to apply the statement which follow the current tag. Hour (24-hour format) and minutes can be omitted. Default: empty.end
: String [required] ending date (format YYY-MM-DD H:i) when you wish to end your schedule. Hour (24-hour format) and minutes can be omitted. Default: empty.
Note: date/time can be set in local timezone format (ie. “29/04/2012” for french users). If time is omitted, default “00:00” time will be applying.
Example
<txp:pat_timer start="2012-04-01 00:00" end="2012-04-01 23:59"> <txp:css format="link" name="naked_day" /> <txp:else /> <txp:css format="link" /> </txp:pat_timer>
In the code above, The CSS file named “naked day” will be displayed between 1 hour and midnight on April, 1st. Otherwise, the “default” CSS file will be displayed.
Purpose
Possible purpose: marketing actions, CSS changing layout, posted links, contextual text… all for a few times.
To Do
Add repeat
& each
attributes for recurring schedules.
Changelog
- 29 april 2012: v0.1 first public commit.
Check, test, comment, love or hate.
Last edited by Pat64 (2012-04-30 18:56:13)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#2 2012-04-30 11:31:24
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,313
Re: pat_timer
Patrick, this looks so easy to apply, thanks!
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: pat_timer
Thanks Uli.
Last edited by Pat64 (2012-05-01 07:21:38)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#4 2012-05-10 19:36:14
- phuture303
- Member
- Registered: 2008-09-14
- Posts: 127
Re: pat_timer
Pat, thank you very much… Great & simple! :-)
Last edited by phuture303 (2012-05-10 19:36:29)
Offline
Re: pat_timer
Glad to know that it’s useful to you :)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Pages: 1