Countdown Plugin

countdown plugin by Luis Machuca B.
Countdown to a specific date.

Last updated on 2009-01-24. Provides Syntax.
No compatibility info given!

Tagged with countdown, time, timer.

Under new management since June 11, 2009.

Previously maintained by Ekkart Kleinod (since version 2.x).

Based on even earlier work by Ron Peters (version 1.0).

Which was itself a modified version of the nucleuswiki plugin by Trent Adams and Edmond Hui

Important: version 2.x is not compatible with version 1.0 (syntax change of date)

Attention: new maintainer needed -> found

Due to changes in my homepage backend I no longer develop this plugin. I will host the plugin until a new maintainer is found. Please contact me if a new maintainer takes over the development.

Regards, Ekkart.

Hi, Ekkart. I've already mailed you asking to take over the development. But of course you might want to wait JIC someone else applies too. Kind regards. — Luis Machuca B. 2009/05/26 06:09
Hi Luis, sorry for not answering, I'm afraid, your mail was put into the spam folder. It's ok for me if you develop the plugin further. All files are in the zip archive. Regards, Ekkart.
Thanks, Ekkart. As of June 11, 2009, I'm taking over the development of this plugin. As a first task I've implemented a demo & download page, and I'll start implementing the feature requests soon, starting with the language files. Anyone interested in contributing their language can send me patches as per Internationalisation. Thanks. – — Luis Machuca B. 2009/06/12 06:30

Description

With this plugin you can insert a countdown into your page where it will display the number of days until or since the text that you include. The format is:

<COUNTDOWN:date|description>

This will be replaced with either

XX days until description
XX days since description

Possible formats of date are all GNU date formats that are allowed by strtotime. Examples:

<COUNTDOWN:mm/dd/yyyy|day to remember>
<COUNTDOWN:dd.mm.yyyy|Ereignis>

Download/Installation/Examples

Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.

Examples of use and more information can be found on ekkart.de.

A demo page can be also found on informatica.temuco.udelmar.cl. The site is in Spanish, but usage should be pretty obvious and language is neutral enough that even Google Translator shall do fine. An English demo page will be made available for the next release of the plugin.

The output of the countdown plugin, showing our remainint time to the
Mayan ”End of Days” (2012-12-22).

Configuration

The plugin is configurable in some ways since version 2.0.

First there is a config parameter to switch the visibility of the countdown date in the output. The parameter is a boolean switch, set it to 1 for date output, to 0 otherwise.

The parameter is set in file conf/default.php:

$conf['plugins']['countdown']['include_date'] = 0;

or

$conf['plugins']['countdown']['include_date'] = 1;

results in

XX days until description

resp.

XX days until description (mm/dd/yyyy)

Second there is a config parameter to switch the output if the date is today. The parameter is a boolean switch, set it to 1 for “today is”, to 0 for “0 days to”.

The parameter is set in file conf/default.php:

$conf['plugins']['countdown']['use_today'] = 0;

or

$conf['plugins']['countdown']['use_today'] = 1;

results in

0 days until description

resp.

Today is description

Internationalisation

The output format of the date can be set in file lang/xx/lang.php where xx stands for your preferred language. This file contains the language dependent texts too. Feel free to edit these files or create new ones for your language. If you want your language file to be integrated into the plugin, please send them to me. Please tag your email subject with [countdown].

The following languages are included:

  • German (de), English (en) by Ekkart Kleinod
  • Estonian (et) by Mikk Leini
  • French (fr) by Gaby Armitage
  • Polish (pl) by Malgorzata Markiewicz
  • Swedish (sv) by Peter Hultqvist

Versions

  • version 2.1.3 (2009-01-24) maintained by Ekkart Kleinod: French language file
  • version 2.1.2 (2008-07-20) maintained by Ekkart Kleinod: Estonian language file
  • version 2.1.1 (2008-04-17) maintained by Ekkart Kleinod: Polish language file, Swedish language file correct 'today'
  • version 2.1 (2008-03-04) maintained by Ekkart Kleinod: bugfix header warning, bugfix day computation, new parameter use_today
  • version 2.0.1 (2008-02-20) maintained by Ekkart Kleinod: Swedish language file
  • version 2.0 (2008-02-18) maintained by Ekkart Kleinod: language and configuration options, code rewrite
  • version 1.0 maintained by Ron Peters: basic functionality

Discussion

Does this plugin work properly with leap years?

Yes it does — Geoffrey Roberts 2008-02-02 12:23

There is a small bug with the plugin. Basically it miscounts the number of days as it does not round hours correctly. This can be fixed by replacing:

$the_time = sprintf("%.0f",abs($time));

with:

$the_time = sprintf("%.0f",ceil(abs($time)));
I used floor instead of ceil for the new version 2.0. This works for me, can someone please confirm my results? Thanks, EK.
floor was wrong, ceil does the trick, even without abs()

How about <COUNTDOWN:mm/dd/yyyy&date|day to remember> or <COUNTDOWN:mm/dd/yyyy&nodate|day to remember> that can override the default config option?

Sounds good, depends on how much time I have these days. EK.

Is it possible to change the date input syntax to dd/mm/yyyy (for the UK) rather than mm/dd/yyyy? This would be much appreciated :)

And a french version too ! if you find time for this…
XX jours avant

The ability to display “business days” would be very helpful for those who use this at work. Dumping in a little javascript or something to make it count down by the second would be neat to…

 
plugin/countdown.txt · Last modified: 2009/06/12 06:47 by ryan.chappelle
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsDarcsXRefTranslate