====== Countdown Plugin ====== ---- plugin ---- description: Countdown to a specific date. author : Luis Machuca B. email : luis.machuca [at] gulix.cl type : syntax lastupdate : 2009-12-19 compatible : depends : conflicts : similar : tags : counter, date ---- The **Countdown Plugin** shows a countdown to a specific (target) date. **Under new management since June 11, 2009**. Previously maintained by [[ekkart@ekkart.de|Ekkart Kleinod]] (since version 2.x). Based on even earlier work by [[rbpeters@peterro.com|Ron Peters]] (version 1.0). Which was itself a modified version of the [[http://wakka.xiffy.nl/countdown|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@gulix.cl|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 okay 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 and 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@gulix.cl|Luis Machuca B.]] 2009/06/12 06:30// ===== Description ===== With this [[:Plugins|plugin]] you can insert a countdown into your page where it will display the number of days, and optionally hours and minutes, until or since the text that you include. The format is: This will be replaced with either XX days [HH:MM] until description XX days [HH:MM] since description (where the ''[HH:MM]'' part is optional) Possible formats of //date// are all [[http://www.gnu.org/software/tar/manual/html_node/tar_115.html#SEC115|GNU date formats]] that are allowed by [[http://www.php.net/strtotime|strtotime]]. Examples: ===== Download/Installation/Examples ===== Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL: {{http://informatica.temuco.udelmar.cl/~lmachuca/dokuwiki-lucho/_media/desarrollo/dokuwiki/dw-plugin-countdown-latest.zip|Download URL for Plugin Manager}} The above link always points to the **latest version**. As of the date of December 2009, that is the version ''2.5rc''. :!: If you are using a previous version of the plugin, it is recommended that you **uninstall** the previous version before installing the RC. **Download links for previous version**: * [[http://www.ekkart.de/wp-content/plugins/download-monitor/download.php?id=6]]. * [[http://200.11.76.165/~lmachuca/dokuwiki-lucho/_media/desarrollo/informatica/dokuwiki/dw-plugin-countdown-213.zip|dw-plugin-countdown-213.zip at new maintainer's demo page]] Refer to [[:Plugins]] on how to install plugins manually. :!: **Demo Page**: [[http://informatica.temuco.udelmar.cl/~lmachuca/dokuwiki-lucho/desarrollo/informatica/dokuwiki/plugin-countdown|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. Examples of use and more information can be found on [[http://www.ekkart.de/?page_id=76|ekkart.de]]. ^ {{http://informatica.temuco.udelmar.cl/~lmachuca/files/dokuwiki/scr-plugin-countdown-01.png?nolink}} ^ | The output of the ''countdown'' plugin, showing our remaining time to the\\ Mayan "//End of Days//" (''2012-12-22''). | ===== Configuration ===== The plugin is configurable in some ways since version 2.0. There are three parameters that are configurable, via either ''local.php'' or the Configuration Manager: **Visibility of Countdown Date**: The parameter ''include_date'' is a Boolean that determines whether to show (''true'') or not (''false'') the target date in the output. Example: $conf['include_date'] = false; results in XX days until description $conf['include_date'] = true; results in XX days until description (mm/dd/yyyy) **Short for for Today**: The parameter ''use_today'' is a Boolean that determines whether to switch the output of the countdown to the short, simple form "Today" if the countdown date is today (''true''). Example: $conf['use_today'] = true; results in Today is description **Display hours and minutes**: The parameter ''with_hours'' is a Boolean that determines whether to show hours and minutes as well as days in the output (''true''). It defaults to **''false''** to maintain output compatibility with previous versions of the plugin. Example: $conf['with_hours'] = true; results in XX days HH:MM until description (mm/dd/yyyy) ===== 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 * Spanish (es) by Luis Machuca Bezzaza * Czech (cs) by Roman Šilar * Brazilian Portuguese (pt-br) by Adirson Maguila ===== Versions ===== * version 2.5rc (2009-12-19) maintained by Luis Machuca Bezzaza: Czech, Spanish and Br-Portuguese language files, ability to display hours, general code rewrite to use getLang(), [[xref>getConf]] capabilities, added README, CHANGELOG and VERSION. * 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@geoffroberts.net|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 or 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... ---- :!: Just wanted people above to know that I have received two language packs for internationalization, and I'm working on a third of my own. With this and an attempt I'll make to incorporate the "business days" suggestion above, a new release will be ready by end of December 2009. --- //[[luis.machuca@gulix.cl|ryan.chappelle]] 2009/11/29 01:13// > Done: version 2.5rc is now available. --- //[[luis.machuca@gulix.cl|ryan.chappelle]] 2009/12/21 19:56//