=== Countdown Timer ===
Contributors: fergbrain
Donate link: http://www.andrewferguson.net/2007/03/08/general-note/
Tags: countdown, timer, count, date, event, widget, countup, age, fun, time, international, i18n, countdown timer
Requires at least: 2.7
Tested up to: 3.0-alpha
Stable tag: 2.4
This plugin allows you to setup a series of dates to count to or from in terms of years, months, weeks, days, hours, minutes, and/or seconds.
== Description ==
Countdown Timer allows you to setup one or more dates to count down to or away from.
Events can be inserted into the sidebar, either manually or as a widget, or within posts and pages.
== Translations ==
= Using another language =
You'll need to modify your `wp-config.php` file. Open it up and look for the line: `define ('WPLANG', '');`
You'll want 'WPLANG', 'de_DE';`
Of course, you'll replace de_DE with the language extension that you want to use, unless of course you actually did want the German language translation.
* Swedish translation: sv_SE
* Spanish translation: es_ES
* German translation: de_DE
* French translation: fr_FR
* Portuguese [Brazil] translation: pr_BR
* Turkish translation: tr_TR
* Czech translation: cs_CZ
* Dutch translation: nl_NL
* Chinese translation: zh_CN
* Polish translation: pl_PL
* Italian translation: it_IT
* Bosnian translation: bs_BA
* Hungarian translation: hu_HU
* Norwegian translation: nb_NO
* Latvian translation: lv_LV
* Romanian translation: ro_RO
* Russian translation: ru_RU
* Danish translation: da_DK
* Lithuanian translation: lt_LT
* Serbian [Cyrilic] translation: sr_RS
== Installation ==
If you can, use the automatic WordPress installer/upgrader.
Otherwise, delete any previous version of Countdown Timer and associated files.
Download and install the timer into your plugins directory.
Activate the timer and add the widget.
If you don't want to use the widget, you can also add the following code into your sidebar.php file:
`
Countdown:
`
= Inserting countdown timers into a page or post =
If you want to insert the Countdown Timer into a page or post, you can use the following shortcodes to return all or a limited number of Countdown Timers, respectively:
[fergcorp\_cdt]
[fergcorp\_cdt max=##]
Where ## is maximum number of results to be displayed - ordered by date
If you want to insert individual countdown timers, such as in posts or on pages, you can use the following shortcode:
Time until my birthday:
[fergcorp_cdt_single date="ENTER\_DATE\_HERE"]
Where "ENTER_DATE_HERE" uses PHP's strtotime function and will parse about any English textual datetime description.
= Limiting the number of countdown timers displayed =
If you're using the widget, there is an option to set the maximum number of timers shown. If you are using the PHP code, replace
`fergcorp_countdownTimer()`
with
`fergcorp_countdownTimer(##)`
where ## is the maximum number of events you wish to be displayed.
Events are automatically sorted by date of occurrence.
= Changing the font, size, and style using CSS =
Starting with version 2.4, you can makes changes to the apperance of Countdown Timer display using CSS.
The following CSS classes are availible:
* `fergcorp_countdownTimer_event_li` styles each List Item, each item encompases one countdown event
* `fergcorp_countdownTimer_event_title` styles the title of the event
* `fergcorp_countdownTimer_event_linkTitle` styles the title of an event if it is linked
* `fergcorp_countdownTimer_event_time` styles the actual countdown timer
== Frequently Asked Questions ==
= Your program is broken! The count down is off by XX days! =
Well, not quite. As it turns out, determining the number of months between two dates is harder than one might think. As you know, all months don't have the same number of days. Thus, some months have 31 days, others have 30 days, and then there's February. It's pretty trivial to figure out the number of complete months between two days (if complete months exist).
However, how many months exist between January 15 and February 20? There are 36 days, which is obviously more than the number of days in any given month we have, so the timer should display 1 month and how many days? Six days (30 days/month)? Five days (31 days/month)? Eight days (28 days/month since the date does end in February)?
I happened to mention my problem to a friend who said that the US military decided that there were 30 days in every month and to prorate the the addition day (or less day(s)) for all the months that have more (or less) than 30 days.
= Wait, so how /do/ you count months? =
Using the above example of January 15 to February 20, there would be one month and five days. February 15 to March 20 would also be one month and five days. Why? January 15 to February 15 is one month. February 15 to February 20 is 5 days. Put them together and you get one month and five days.
= Where I am supposed to set the count down time? =
Log into your WordPress Dashboard. Expand the Tools menu, click on Countdown Timer. Scroll down to One Time Events. In the dates field, type the date you want to count down to. Fill in the event title field with what text you want displayed. Click Update Events.
= There's a foreign (non-English) word that's wrong, what do I do? =
There are two ways to fix this. First, you can always contact me via email, blog comment, support forum, etc and let me know about the error. I don't usually issue bug fix updates just for language errors, but it will make it into the next update cycle.
Second, if you're handy with poEdit or something of the like, you can make the changes yourself and email me the .po and .mo files (although I really only need the .po file).
= How come there are long periods of time when you don't respond or update the plugin? =
I'm an engineer and have to retreat to my cave from time to time. Also, I do this for fun. That means work must come first (unless you want to pay be, then we can talk).
== Screenshots ==
1. Administration Interface
2. Example on Blog
== Changelog ==
= 2.4 =
Release Date: 4/2/2010:
* Updated file structure, moving language files to the /lang directory and javascript files to the /js directory, also updated associated links
* Added latches for CSS
* Rewrote parts of fergcorp_countdownTimer_format to make it less repetitive. Also removed last three variables: displayFormatPrefix, displayFormatSuffix, and displayStyle
* Completely moved namespace from afdn to fergcorp
* Changed the way dates are removed. Made it based on the lack of a date, instead of the lack of a title.
* Reduced the user access level to Options Manager instead of Administrator
* Moved the options page from tools to settings in the admin menu
* Implemented the register_setting function, incidently changing the way options are stored
* Added option to parse shortcodes in the_excerpt
* Updated all the lanuages files using Google Translate and http://pepipopum.dixo.net/index.php
* Use the get_option directly instead of by variable
* Removed checkUpdate variable because we don't use it anymore.
* Updated to use _n i18n function
* Updated depreciated get_settings to get_option
= 2.3.5 =
Release Date: 2/17/2009:
* Updated calculation routine to ensure that dates are accurate when “Months” are not displayed.
* Updated languages and added Latvian, Romanian, Russian, Danish, Lithuanian, and Serbian.
* Updated readme.txt file
* Fixed small display issue in the administration menu
= 2.3.1 =
Release Date: 11/20/2008:
* Fixes a bug. Sorry to everyone who has to redownload.
= 2.3 =
Release Date: 11/19/2008:
* Made meta boxes into WP-based functions with AJAX support
* Renamed $dates to $fergcorp_countdownTimer_dates and made it global
* Reversed order of afdn_countdownTimer parameters. See documentation for usage
* Updated meta boxes to work in WP 2.7
* Removed the option to disable enableTheLoop (i.e. always enabled now)
* Added shortcodes. See documentation for usage
* Updated some of the text so that links are not part of the translation. Not that this has been an issue, but it assures that links aren’t tampered with in language translations
* Updated the widget to use the latest WP functions
* Widget now has a description
* Internal versioning is now done automatically
* Fixed a bug where “No Dates Present” would not display, even though there were no dates present
* Fixed a bug where an empty array would cause plugin to crash
* Fixed a problem that caused the timer to only display “in ” if “strip zeros” is enabled
* Updated a couple function checks to check for the functions that we’re actually using
* Updated the plugins_dir function call to properly reference the countdown-timer directory (this fixes issues with IIS and Windows)
* Added a helper function for afdn_countdownTimer so that users can use fergcorp_countdownTimer instead
* Fixed a potential bug (aka The Furton Fix) for systems running Windows where PHP may barf and give a warning:
Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in afdn_countdownTimer.php on line 612
* Various bug and security fixes
* Paypal link doesn’t use a form anymore
* Added a test to ensure cal_days_in_month function exists. If not, use a drop in replacement.
= 2.2.5 =
Release Date: 9/23/2008:
* Added Hungarian and Norwegian translations
* Fixed small bug on line 426 regarding stripslashes
= 2.2.4 =
Release Date: 9/4/2008:
* Added Bosnian language translation
* Fixed mistranslations in German language
* Output of displayFormatPrefix/displayFormatSuffix are now escaped
* Fixed a fatal error that was sometimes caused when there were no dates to countdown to
* Updated the FAQ
= 2.2.3 =
Release Date: 7/9/2008:
* Fixes language issue with commas
* Updated internal rev version number
= 2.2.2 =
Release Date: 6/30/2008:
* Resolves #876 which had instead of