Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2014-03-03 15:57:12
- ToK
- Plugin Author
- Registered: 2014-02-18
- Posts: 23
tok_next_weekly
My second plugin which I release to the txp community is a bit special — maybe useful to very few people only.
tok_next_weekly calculates the upcoming occurence of a weekly recurring date. The output is widely configurable through strftime compatibility. A detailed instruction with examples is included on the plugins help page.
If someone has to annouce the date of an on a weekly base recurring event: please try this plugin and tell me if it is helpful and the documentation is understandable.
You find everything you need (hopefully) at github
Offline
Re: tok_next_weekly
While simple plugin, can come useful in some limited cases, indeed. Few small issues:
- locale isn’t reset back to its original value, leading to mixed pages.
- it doesn’t use Textpattern’s (the site’s) timezone, but the server default (so the date is off by SERVER_DST – (TZ + DST). Textpattern doesn’t update server’s global runtime timezone configuration, but does calculation with the ancient
safe_strftime
wrapper function. Not that its that big of an issues, as Textpattern does timezone handling wrong too. For optimal functionality, you could use DateTime so the presentation will be correct too instead of defaulting to UTC.
Offline
Re: tok_next_weekly
Nice to greet a new plugin author, welcome to the club! FYI, <txp:etc_date date="next Friday" />
does it (and more) as well, eventually in combination with etc_if_date
.
Gocom wrote #279428:
For optimal functionality, you could use DateTime
requires php 5.2, fortunately not a big restriction nowadays.
Offline
#4 2014-03-05 15:38:30
- ToK
- Plugin Author
- Registered: 2014-02-18
- Posts: 23
Re: tok_next_weekly
Gocom wrote #279428:
- locale isn’t reset back to its original value, leading to mixed pages.
Corrected. Thank you.
- it doesn’t use Textpattern’s (the site’s) timezone, but the server default (so the date is off by SERVER_DST – (TZ + DST). Textpattern doesn’t update server’s global runtime timezone configuration, but does calculation with the ancient
safe_strftime
wrapper function. Not that its that big of an issues, as Textpattern does timezone handling wrong too. For optimal functionality, you could use DateTime so the presentation will be correct too instead of defaulting to UTC.
I’m not sure about the best solution for this. I don’t want to make this tiny plugin too complicated. I preliminary left a note about timezone handling on the plugin’s help page.
Thanks a lot for your helpful comment.
Offline
#5 2014-03-05 19:16:41
- ToK
- Plugin Author
- Registered: 2014-02-18
- Posts: 23
Re: tok_next_weekly
etc wrote #279434:
FYI,
<txp:etc_date date="next Friday" />
does it (and more) as well, eventually in combination withetc_if_date
.
Thanks a lot for the hint. I’m actually not good in the handling of textpatterns plugin pages. Currently we have to announce the date of an event, that takes place every other week. That is the most important feature we need. And I also have to make usage as simple as possible for »my authors«. It’s hard enough for some of them, that plugin keywords are in english language …
Offline
Pages: 1