countdown-timer
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:
=== 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, wedding, localization, i18n
Requires at least: 4.0
Tested up to: 4.8
Stable tag: 3.0.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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 using the widget, or within posts and pages using shortcodes.

Currently supports 22 languages.

== Translations ==

= Using another language =

You'll need to modify your wp-config.php file. To do this...

1. Open your `wp-config.php` file in a text editor and search for: `define ('WPLANG', '');`
1. Edit this line according to the language you want to use (and is available). For example, for Deutsch spoken in Germany, you must add: `('WPLANG', 'de_DE');`
1. Once you've added your language code, save the file.
1. Upload the modified wp-config.php file into the WordPress root directory.

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. For more information, consult [Installing WordPress in Your Language](http://codex.wordpress.org/Installing_WordPress_in_Your_Language) on the WordPress Codex

= Languages Available =

 * Bosnian translation: bs_BA
 * Catalan (Spain) translation: ca_CA
 * Czech translation: cs_CZ
 * Danish translation: da_DK
 * German translation: de_DE
 * Spanish translation: es_ES
 * French translation: fr_FR
 * Hungarian translation: hu_HU
 * Italian translation: it_IT
 * Lithuanian translation: lt_LT
 * Latvian translation: lv_LV
 * Dutch translation: nl_NL
 * Norwegian translation: nn_NO
 * Polish translation: pl_PL
 * Portuguese [Brazil] translation: pr_BR
 * Romanian translation: ro_RO
 * Russian translation: ru_RU
 * Serbian [Cyrilic] translation: sr_RS
 * Swedish translation: sv_SE
 * Turkish translation: tr_TR
 * Vietnamese translation: vi_VI
 * Chinese translation: zh_CN

== Installation ==

1. Install the plugin using your preferred method of choice. Using the built-in WordPress installer is the preferred choice, but you can also do things the hard/manual way.

1. Activate the timer.

1. Events can be added and other settings modified in Settings > Countdown Timer in The Dashboard.

= Inserting countdown timers into your blog =

There are three places you can insert a countdown timer:

1. Sidebar (using the widget)
1. A post or page (using shortcodes)
1. PHP (experts only)

= Adding to the sidebar =

Add the widget to the sidebar by going to Appearances > Widget in The Dashboard.

= Adding to a post or page =

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:

`[fergcorp_cdt_single date="ENTER_DATE_HERE"]`

Example:
`Time until our wedding:
[fergcorp_cdt_single date="08 December 2012"]`

Where "ENTER_DATE_HERE" uses PHP's strtotime function and will parse about any English textual date/time description (such as "08 December 2012"). A complete list of valid formats can be found on PHP's [Supported Date and Time Format](http://www.php.net/manual/en/datetime.formats.php) page.

= PHP = 

Countdown Timer also provides a PHP function designed to be accessed publicly so you can include it in elements of your site that may not be in The Loop.
 
`fergcorp_countdownTimer(##)`

Where _##_ is the maximum number of events you wish to be displayed. If _$maxEvents_ is not given, the function will return all timers.

Events are automatically sorted by date of occurrence.

Note: You should also encapsulate calls with "function_exists" to prevent unintentional fatal errors if the plugin is deactivated.

= 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, _$maxEvents_ 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 =

You can makes changes to the appearance of Countdown Timer display using CSS.

The following CSS classes are available:

 * `fergcorp_countdownTimer_event_li` styles each List Item, each item encompasses 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
 * `fergcorp_countdownTimer_timeUnit` styles the units (e.g. "25 days")
 * `fergcorp_countdownTimer_year` styles the year text
 * `fergcorp_countdownTimer_month` styles the month text
 * `fergcorp_countdownTimer_week` styles the week text
 * `fergcorp_countdownTimer_day` styles the day text
 * `fergcorp_countdownTimer_hour` styles the hour text
 * `fergcorp_countdownTimer_minute` styles the minute text
 * `fergcorp_countdownTimer_second` styles the second text

== Frequently Asked Questions ==

= How do I prevent the timer from wrapping my countdown? =

Add the following to your CSS file: .fergcorp_countdownTimer_timeUnit {white-space: nowrap;}

= I have JavaScript countdown enabled and it works on the administration page in the Example Display, but not on my main site! =

This, unfortunately, is a problem with your theme, and not with Countdown Timer. Themes _must_ call wp_footer(), which is a standard hook for WordPress. Without it, many other plugins may not work properly either.

Your best bet to fix the problem is to modify the `footer.php` file and put `` right before ``. Then contact the person you designed the theme and let them know of their coding oversight.

= 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 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 Settings 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 me, then we can talk). Since I work during the week, you may only hear from me during the weekend.


== Screenshots ==
1. Administration Interface
2. Example on Blog


== Upgrade Notice ==
= 3.0.7 =

Bumped WP tested level and minimum WP level. `index.php` is not blank (fixes #34).


== Changelog ==

= 3.0.7 =
Release date: 6/13/2017

* Bumped WP tested level and minimum WP level
* `index.php` is not blank (fixes #34)

= 3.0.6 =
Relase date: 5/4/2014

*	Bug fix: resolved "white screen of death" issue for PHP > 5.2

= 3.0.5 =
Relase date: 1/19/2013

 * Bug fix: Eliminates Fatal error: Using $this when not in object context in...that prevented plugin from activating in certain circumstances
 * Bug fix: Added getTimestamp function needed for PHP < 5.3
 * Bug fix: Properly enclose "No dates present" in 
  • tags = 3.0.4 = Release date: 1/12/2013 * Bug fix: Least Common Unit will now display correctly * Bug fix: Solve issues with admin page not loading * Removed "cal_days_in_month" as everyone should be at the PHP level that supports this now * Wrote unit test suite = 3.0.3 = Release date: 7/3/2012 * Bug fix: Shortcode for events in the past will always display * Bug fix: Don't delete events that have their getTimeSince flag set * Bug fix: Fixed expired timers that didn't show counting against limit of timers displayed * Other minor code cleanup = 3.0.2 = Release date: 6/20/2012 * Bug fix: Settings are updated and loaded properly during both upgrade and activations, thanks to [Beee] and [bonzo01] for playing canary in the coalmine * Bug fix: JS display now respects time unit settings, thanks to [Beee] and [bonzo01] for pointing this out = 3.0.1 = Release date: 6/18/2012 * Bug fix: Will now check to see if the plugin has been updated and update settings as required to avoid problems such as "Call to a member function date() on a non-object...". Thanks to [pixwell] and [bonzo01] for pointing this out; special thanks to fiancée for letting me spend some time to fix it. * Bug fix: Widget settings now properly moved from 2.4.3 to new format * Cosmetic: Spaces after input labels = 3.0 = Release date: 6/15/2012 * Complete code rewrite. Should provide better code readability for users who wish to contribute (yes, that's you if you're reading this) * Future dates respect future saving time events! * Removed ability to use comments tag to insert countdown timer into post, you should use shortcode * On-hover date localization is now completed and will show the correct time/zone. Thanks to [pwesolek] for the patch * date_default_timezone_set will no longer throw an error if the timezone string is not set * Remove the display of the GMT offset in the date box. All data should be displayed in blog time. * JS now passed as JSON, and JS is loaded with the footer * Use JQuery to update * Updated language files, reduced to 69 strings now * Fixed Czech language files with correct plurals with thanks to [Prause] for the patch * Updated readme instructions for installation and usage * Added banner graphic for WordPress directory = 2.4.3 = Release Date: 3/10/2012 * Fixed bug with missing `?>` at end of file * Added additional element to each unit of time to allow for better CSS customization. New CSS hooks include: .fergcorp_countdownTimer_timeUnit .fergcorp_countdownTimer_year .fergcorp_countdownTimer_month .fergcorp_countdownTimer_week .fergcorp_countdownTimer_day .fergcorp_countdownTimer_hour .fergcorp_countdownTimer_minute .fergcorp_countdownTimer_second * Added ability to prevent wrapping by adding following to your CSS file: .fergcorp_countdownTimer_timeUnit {white-space: nowrap;} * Removed unused "vars" and "r" variable = 2.4.2 = Release Date: 4/12/2010 * Fixes bug where using fergcorp_countdownTimer with event limits would limit events incorrectly. * Updating ISO 639-2 code for Norway to "nn" from "no" * Updated all the translations using the POT file generated by WordPress.org because it supports parsing _n correctly * Updated all PO files with plural and locale information, this also fixes bug where translations weren't working 100% correctly = 2.4.1 = Release Date: 4/4/2010 * Standalone mode prevents li-element from being added when used in line. This also restores functionality that was in 2.3.5. * Fixed event insertion bug where events may not be saved if the total number of events is larger than a certain number (I never did figure out what that number was...but it was probably around 4 or 5). * Updated serialized output for the commented out file out serialized function. = 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, incidentally changing the way options are stored * Added option to parse shortcodes in the_excerpt * Updated all the languages 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
  • 本源码包内暂不包含可直接显示的源代码文件,请下载源码包。