| 1 |
=== Timed Content === |
| 2 |
Contributors: kjvtough |
| 3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5F58ELJ9R3PVL&lc=CA&item_name=Timed%20Content%20Wordpress%20Plugin%20Donation¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted |
| 4 |
Tags: marketing, marketing tool, post, page, date, time, timer, timed, show, hide, content, schedule, display |
| 5 |
Requires at least: 2.0.2 |
| 6 |
Tested up to: 4.1 |
| 7 |
Stable tag: 2.5.1 |
| 8 |
License: GPL2 |
| 9 |
|
| 10 |
Plugin to show or hide portions of a Page or Post based on specific date/time characteristics. |
| 11 |
|
| 12 |
== Description == |
| 13 |
The Timed Content plugin allows users to specify that a portion of a Page or Post should appear/be visible or |
| 14 |
disappear/be invisible based on given time characteristics. Suppose, for example, you embed a video into a Post; once the viewer has enough information |
| 15 |
from the video, the request to take a specific action can be set to appear. You can also make portions of a Post or Page be visible at certain dates and |
| 16 |
times; you can even set up a schedule! |
| 17 |
|
| 18 |
The plugin adds the following: |
| 19 |
|
| 20 |
* A "client-side" shortcode that allows the marking of content to appear or disappear after a given time interval; a "fade" |
| 21 |
effect is included. This functionality is intended to be used for special effects only, as content marked in this manner |
| 22 |
is still visible in the HTML source and, therefore, not a secure method of hiding content. |
| 23 |
* Two "server-side" shortcodes that allow the marking of content to be visible only during specified date/time intervals. This |
| 24 |
functionality **can** be used as a secure method of hiding content, because the marked content will be included in the Page/Post |
| 25 |
**only** when viewed in the specified date/time intervals. |
| 26 |
|
| 27 |
A TinyMCE dialog is included to help users build the shortcodes. See the Screenshots tab for more info. |
| 28 |
|
| 29 |
== Installation == |
| 30 |
**Note:** `XXX` refers to the current version release. |
| 31 |
= Automatic method = |
| 32 |
1. Click 'Add New' on the 'Plugins' page. |
| 33 |
1. Upload `timed-content-XXX.zip` using the file uploader on the page |
| 34 |
|
| 35 |
= Manual method = |
| 36 |
1. Unzip `timed-content-XXX.zip` and upload the `timed-content` folder to the `/wp-content/plugins/` directory |
| 37 |
1. Activate the plugin through the 'Plugins' menu in WordPress |
| 38 |
|
| 39 |
== Frequently Asked Questions == |
| 40 |
|
| 41 |
No "frequent" questions as of yet, but come ask away in the Support forum. |
| 42 |
|
| 43 |
== Screenshots == |
| 44 |
|
| 45 |
1. An example showing use of the `[timed-content-client]` shortcode. The "alarm clock" button on the editor menubar brings up a |
| 46 |
dialog box to help build the Timed Content shortcodes. All of the Admin-side screenshots are from Wordpress 3.7, but the functionality |
| 47 |
is the same for 3.8. |
| 48 |
2. The "Add Timed Content shortcode" dialog showing the Client tab. Check the attribute you want to add and fill in the textboxes. |
| 49 |
3. The "Add Timed Content shortcode" dialog showing the Server tab. Check the attribute you want to add, then click on the Date and Time textboxes. |
| 50 |
4. The date and time pickers help you format a correct date and time. Here's the jQuery UI Datepicker in action. |
| 51 |
5. The "Add Timed Content shortcode" dialog showing the Timed Content Rules tab. |
| 52 |
6. You can use both shortcodes together and with other shortcodes supported by your Wordpress installation. |
| 53 |
7. The Timed Content Rules overview page. Timed Content Rules allow you to set up a schedule for showing/hiding your content. |
| 54 |
8. Editing a Timed Content Rule. Here, you can see the jQuery UI Timepicker in action. |
| 55 |
9. Check the Scheduled Dates/Times to verify when your rule will be active. |
| 56 |
10. An example showing use of the `[timed-content-server]` shortcode with `debug` set to `true`. You'll only see it if you're logged in and it's on a Page/Post you can edit (Your regular visitors won't see this at all). |
| 57 |
|
| 58 |
== Changelog == |
| 59 |
= 2.5.1 = |
| 60 |
* Fixed `current_time()` bug in __rulesShowHTML() introduced in 2.5. |
| 61 |
|
| 62 |
= 2.5 = |
| 63 |
* Removed dependency on jQuery UI Dialog; now uses Thickbox. |
| 64 |
* Added and modified `fix_date_i18n()` from https://core.trac.wordpress.org/ticket/25768 to better handle DST and timezones with i18n. |
| 65 |
* Added custom filter `timed_content_filter_override` so admins can modify/replace `timed_content_filter` in necessary. |
| 66 |
* Using built-in spinner image now instead of `wpspin.gif` |
| 67 |
|
| 68 |
= 2.4 = |
| 69 |
* Removed `timed-content-admin-tinymce.js` (No need anymore; required JS variables now hooked directly into editor). Fixes incompatibility with OptimizePress. |
| 70 |
|
| 71 |
= 2.3.1 = |
| 72 |
* Fixed minor bugs related to Exception Dates. |
| 73 |
* Optimized rule periods arrays (array only needs 'status' and 'time' when it's meant to be human-readable). |
| 74 |
* Added custom filter `timed_content_filter` to emulate `apply_filter( 'the_content', ... )` functionality for content. |
| 75 |
|
| 76 |
= 2.3 = |
| 77 |
* Fixed bug when setting up weekly recurrence for Timed Content Rules. |
| 78 |
* NEW! Exception Dates (dates on which your Timed Content Rule shouldn't run). |
| 79 |
|
| 80 |
= 2.2 = |
| 81 |
* Much improved i18n |
| 82 |
* New Spanish translation - Many thanks to Andrew Kurtis and Jelena Kovacevic from WebHostingHub (Nueva traducción de español - Muchas gracias a Andrew Kurtis y Jelena Kovacevic desde WebHostingHub). |
| 83 |
|
| 84 |
= 2.1.5 = |
| 85 |
* Unified dashicons among all of my plugins. |
| 86 |
* Minor improvements in TinyMCE dialog UI and Date/Time UI controls. |
| 87 |
|
| 88 |
= 2.1.4 = |
| 89 |
* Fixed TinyMCE editor button for TinyMCE 4.x. |
| 90 |
|
| 91 |
= 2.1.3 = |
| 92 |
* Removed support for PHP4 in `customFieldsInterface.php`. |
| 93 |
* Fixed Wordpress version check for deciding which image to use for TinyMCE button. |
| 94 |
* Fixed "Strict Standards" warning in PHP 5.4 in `__getNextWeek()`. |
| 95 |
|
| 96 |
= 2.1.2 = |
| 97 |
* Dashicons support for WP 3.8 + added. Support for old-style icons in Admin/TinyMCE is deprecated. |
| 98 |
* Added versioning to all `wp_enqueue_style()` calls. |
| 99 |
|
| 100 |
= 2.1.1 = |
| 101 |
* CSS for JQuery UI now loaded locally as required by Wordpress plugin repository rules. |
| 102 |
* Improved UX on TinyMCE dialog and Timed Content Rules detail page. |
| 103 |
|
| 104 |
= 2.1 = |
| 105 |
* Fixed inconsistency in how the days of week to repeat on were being set up between the front and back ends. |
| 106 |
* Fixed variable scope bug that occurred on activation. |
| 107 |
* Improved i18n. |
| 108 |
|
| 109 |
= 2.0 = |
| 110 |
* Added Timed Content Rules. |
| 111 |
* Replaced AnyTime plugin with jQuery UI Timepicker (http://fgelinas.com/code/timepicker) and Wordpress's internal jQuery UI Datepicker. |
| 112 |
* HTML code created by `[timed-content-client]` can now either be enclosed in either `<div>` or `<span>` tags. |
| 113 |
* Debugging statements for `[timed-content-server]` now displayed on Post/Page (only if logged in and have the rights to edit that Post/Page - no more digging into the HTML source). |
| 114 |
* Improved code documentation. |
| 115 |
|
| 116 |
= 1.2 = |
| 117 |
* Upgraded AnyTime jQuery plugin. |
| 118 |
* `timed-content.js` is now always loaded (Size > 1KB, so not a lot of extra overhead); fixes bug when multiple/nested shortcodes are used. |
| 119 |
|
| 120 |
= 1.1 = |
| 121 |
* Fixed some internal filename discrepancies. |
| 122 |
|
| 123 |
= 1.0 = |
| 124 |
* Initial release. |
| 125 |
|
| 126 |
== Upgrade Notice == |
| 127 |
= 2.5.1 = |
| 128 |
Fixed `current_time()` bug in __rulesShowHTML() introduced in 2.5. Upgrade now |
| 129 |
|
| 130 |
= 2.5 = |
| 131 |
Better handling od dates w/ i18n. Upgrade now |
| 132 |
|
| 133 |
= 2.4 = |
| 134 |
New version fixes incompatibility with OptimizePress. Upgrade now |
| 135 |
|
| 136 |
= 2.3 = |
| 137 |
Fixed bug when setting up weekly recurrence for Timed Content Rules. Upgrade now |
| 138 |
|
| 139 |
= 2.1.4 = |
| 140 |
Fixed TinyMCE button issue. Upgrade now |
| 141 |
|
| 142 |
= 2.1.3 = |
| 143 |
Fixed various minor bugs. Upgrade now |
| 144 |
|
| 145 |
= 2.1.2 = |
| 146 |
Dashicons support for WP 3.8 +. Upgrade once you've upgraded Wordpress to >= 3.8. |
| 147 |
|
| 148 |
= 2.1.1 = |
| 149 |
CSS for JQuery UI now loaded locally as required by Wordpress plugin repository rules. Upgrade now |
| 150 |
|
| 151 |
= 2.1 = |
| 152 |
Fixed bug in how the days of week to repeat on were being set up between the front and back ends. Upgrade now |
| 153 |
|
| 154 |
= 2.0 = |
| 155 |
New Timed Content Rules feature; AnyTime replaced due to licensing. Upgrade now. |
| 156 |
|
| 157 |
= 1.2 = |
| 158 |
AnyTime JavaScript library was outdated, breaking the Timed Content dialog box. Upgrade now. |
| 159 |
|
| 160 |
= 1.1 = |
| 161 |
Fixed some internal filename discrepancies, causing visual editor to break. Upgrade now. |
| 162 |
|
| 163 |
== Examples == |
| 164 |
|
| 165 |
`[timed-content-client show="1:00"]Show me after one minute. Since we don't want a fade-in, we can leave it out of the "show" attribute completely.[/timed-content-client]` |
| 166 |
|
| 167 |
`[timed-content-client show="1:00:1000"]Show me after one minute with a 1000 millisecond (1 second) fade-in.[/timed-content-client]` |
| 168 |
|
| 169 |
`[timed-content-client hide="1:00:1000"]Hide me after one minute with a 1000 millisecond (1 second) fade-out.[/timed-content-client]` |
| 170 |
|
| 171 |
`[timed-content-client show="1:00:500" hide="5:00:2000"]Show me after one minute with a 500 millisecond (a half-second) fade-in, then hide me after five minutes with a 2000 millisecond (2 seconds) fade-out.[/timed-content-client]` |
| 172 |
|
| 173 |
`[timed-content-server show="2013-Sep-13 20:30:00 -0600"]Show me starting at 8:30 PM Central Standard Time on September 13th, 2013. I will not be displayed before then.[/timed-content-server]` |
| 174 |
|
| 175 |
`[timed-content-server hide="2013-Sep-13 20:30:00 America/Chicago"]Hide me starting at 8:30 PM Central Daylight Time (i.e., the same timezone as Chicago) on September 13th, 2013. I will not be displayed after then[/timed-content-server]` |
| 176 |
|
| 177 |
`[timed-content-server show="2013-Sep-13 20:30:00 -0600" hide="2013-Sep-13 21:30:00 -0600"]Show me starting at 8:30 PM Central Standard Time on September 13th, 2013, then hide me an hour later. I will not be displayed before or after then.[/timed-content-server]` |
| 178 |
|
| 179 |
`[timed-content-rule id="164"]Display me based on the settings for the Timed Content Rule whoseID is 164.[/timed-content-rule]` |
| 180 |
|
| 181 |
== Usage == |
| 182 |
|
| 183 |
NOTE: All shortcodes can be built using the TinyMCE dialog. When in doubt, use the dialog to create correctly formed shortcodes. |
| 184 |
|
| 185 |
**The timed-content-client shortcode** |
| 186 |
|
| 187 |
`[timed-content-client show="mm:ss:fff" hide="mm:ss:fff"]Example Text[/timed-content-client]` |
| 188 |
|
| 189 |
* `show` - Specifies the time interval after loading the web page when the marked content should be displayed. The attribute consists of three parts, |
| 190 |
separated by colons: `mm` - minutes, `ss` - seconds, and `fff` - if greater than `0`, a fade-in effect lasting `fff` milliseconds is applied. |
| 191 |
* `hide` - Specifies the time interval after loading the web page when the marked content should be hidden. The attribute consists of three parts, |
| 192 |
separated by colons: `mm` - minutes, `ss` - seconds, and `fff` - if greater than `0`, a fade-out effect lasting `fff` milliseconds is applied. |
| 193 |
|
| 194 |
Both attributes are optional, but at least one attribute must be included. Leading zeros (0) are optional. The shortcode's behaviour depends on which attributes are used: |
| 195 |
|
| 196 |
* `show` only - Marked content is initially not visible, then appears `mm` minutes and `ss` seconds after loading with a `fff` millisecond fade-in. |
| 197 |
* `hide` only - Marked content is initially visible, then disappears `mm` minutes and `ss` seconds after loading with a `fff` millisecond fade-out. |
| 198 |
* `show` and `hide` - Marked content is initially not visible, then appears according to the values set in `show`, then disappears according to the values set in `hide`. |
| 199 |
|
| 200 |
Your users must have JavaScript enabled for this shortcode to work. |
| 201 |
|
| 202 |
**The timed-content-server shortcode** |
| 203 |
|
| 204 |
`[timed-content-server show="datetime" hide="datetime" debug="true|false"]Example Text[/timed-content-server]` |
| 205 |
|
| 206 |
* `show` - Specifies the date/time when the marked content should start being included on the web page. The attribute consists of `datetime` - a human-readable date/time description. The plugin uses PHP's <a href="http://www.php.net/manual/en/function.strtotime.php">strtotime</a> function to process dates/times, so anything it can understand can be used. |
| 207 |
* `hide` - Specifies the date/time after which the marked content should stop being included on the web page. The attribute consists of `datetime` - a human-readable date/time description. The plugin uses PHP's <a href="http://www.php.net/manual/en/function.strtotime.php">strtotime</a> function to process dates/times, so anything it can understand can be used. |
| 208 |
* `debug` - If `true`, adds some debugging statements to the web page as HTML comments. Defaults to `false`. |
| 209 |
|
| 210 |
Both `show` and `hide` attributes are optional, but at least one attribute must be included. The shortcode's behaviour depends on which attributes are used: |
| 211 |
|
| 212 |
* `show` only - Marked content is outputted only after the date/time set here. |
| 213 |
* `hide` only - Marked content is outputted only before the date/time set here. |
| 214 |
* `show` and `hide` - Marked content is outputted only during the time period defined by the `show` and `hide` attributes. |
| 215 |
|
| 216 |
**The timed-content-rule shortcode** |
| 217 |
|
| 218 |
`[timed-content-rule id="rule_id"]Example Text[/timed-content-rule]` |
| 219 |
|
| 220 |
You can find the correct shortcode from the Timed Content Rules overview page, or use the TinyMCE dialog. |