| 1 | === WPListCal === |
|---|
| 2 | Contributors: jonkern |
|---|
| 3 | Donate link: http://www.jonathankern.com/code/wplistcal |
|---|
| 4 | Tags: calendar, events |
|---|
| 5 | Requires at least: 2.7 |
|---|
| 6 | Tested up to: 2.8 |
|---|
| 7 | Stable tag: 1.2.2 |
|---|
| 8 | Text Domain: wplistcal |
|---|
| 9 | |
|---|
| 10 | WPListCal allows you to list upcoming events on your blog in a list or table format. |
|---|
| 11 | |
|---|
| 12 | == Description == |
|---|
| 13 | |
|---|
| 14 | WPListCal allows you to list upcoming events on your blog in a list or table format. It plugs straight into the Wordpress admin pages to let you keep track of events just like posts and pages. You can then list events on a page or post using a shortcode, show events in your sidebar with a widget, or incorporate events into your theme files using a PHP function call. |
|---|
| 15 | |
|---|
| 16 | = Version Guide = |
|---|
| 17 | |
|---|
| 18 | * WordPress 2.7 or later → Use WPListCal 1.2.2 (current stable release) |
|---|
| 19 | * WordPress 2.5-2.6.3 → Use WPListCal 1.0.8.2 |
|---|
| 20 | * WordPress 2.0.3-2.3.3 → Use WPListCal 1.0.2 |
|---|
| 21 | |
|---|
| 22 | == Installation == |
|---|
| 23 | |
|---|
| 24 | 1. Upload the `wplistcal` folder to the `/wp-content/plugins/` directory |
|---|
| 25 | 1. Activate the plugin through the 'Plugins' menu in WordPress |
|---|
| 26 | |
|---|
| 27 | = Upgrade = |
|---|
| 28 | |
|---|
| 29 | 1. If you are upgrading from version 1.0.5 or earlier, DO NOT DEACTIVATE THE PREVIOUS VERSION OF THE PLUGIN! Doing so will remove all your events. |
|---|
| 30 | 1. Upload the `wplistcal` folder to the `wp-content/plugins/` directory |
|---|
| 31 | 1. Deactivate and then activate the plugin though the 'Plugins' menu in WordPress |
|---|
| 32 | |
|---|
| 33 | = Usage = |
|---|
| 34 | |
|---|
| 35 | 1. Change the default settings on the WPListCal options page |
|---|
| 36 | 1. If you want to list your events on a page or post, use the [wplistcal] shortcode. Use the parameters in the example below. Leave out parameters to default to the options defined in the WPListCal settings page. (1.2 or later only) |
|---|
| 37 | > _Example:_ `[wplistcal display_mode="list", event_format="%NAME%", date_format="M j, Y g:ia", max_events="-1", show_past_events="false", advance_days="-1", event_order="asc", hide_same_date="true", date2_time_format="g:ia", no_events_msg="No events!"]` |
|---|
| 38 | |
|---|
| 39 | 1. If you want to list your events on a page or post, insert the tag `<!--wplistcal-->` in the body of the page/post |
|---|
| 40 | 1. If you want to list your events in your sidebar, activate the WPListCal widget in the widget admin section |
|---|
| 41 | 1. If you want to list your events somewhere in your theme files, insert `<?php echo wplc_show_events(); ?>` |
|---|
| 42 | > You can set special parameters to overwrite the default options if you use the PHP function call. |
|---|
| 43 | |
|---|
| 44 | > All parameters are optional, but you must preserve the ordering by passing in `null` for options that you want to use defaults for. |
|---|
| 45 | |
|---|
| 46 | > __Display Mode__ (string): `'list'` or `'table'` |
|---|
| 47 | |
|---|
| 48 | > __Event Format__ (string): The format of the list entries if Display Mode is set to `'list'`. You can use the following variables: %NAME%, %LINK%, %LINKEDNAME%, %START%, %END%, %DESCRIPTION%. You can also make statements dependent on a variable by wrapping them in curly brackets (ex. {Date: %START%}). See "Dependent Statements" below for more information. |
|---|
| 49 | |
|---|
| 50 | > __Date Format__ (string): The format to display the start and end date and time. Uses [the same date formatting that Wordpress uses](http://codex.wordpress.org/Formatting_Date_and_Time). |
|---|
| 51 | |
|---|
| 52 | > __Max. Events__ (int): The maximum number of events to display, -1 for unlimited. |
|---|
| 53 | |
|---|
| 54 | > __Show Past Events__ (boolean): true to show all events, false to show only current and future events |
|---|
| 55 | |
|---|
| 56 | > __Maximum Advanced Notice__ (int): How many days in advance to display events, -1 for unlimited. |
|---|
| 57 | |
|---|
| 58 | > __Event Order__ (string): `'asc'` to show the closest event first or `'desc'` to show the furthest event first. |
|---|
| 59 | |
|---|
| 60 | > __Hide Same Date__ (bool): Format the end date with the format string defined in the next parameter if it is on the same day as the start date. |
|---|
| 61 | |
|---|
| 62 | > __Date 2 Time Format__ (string): If Hide Same Date is enabled, use this format string for the end date. |
|---|
| 63 | |
|---|
| 64 | > __No Events Message__ (string): If there are no events, show this string instead, leave blank for none. |
|---|
| 65 | |
|---|
| 66 | > _Example:_ `<?php echo wplc_show_events('list', '%LINKEDNAME%: %START% - %END%{<br />%DESCRIPTION%}', 'M j, Y g:ia', -1, false, 30, 'asc', true, 'g:ia', 'Sorry, no events'); ?>` |
|---|
| 67 | |
|---|
| 68 | = Dependent Statements (1.2 or later only) = |
|---|
| 69 | |
|---|
| 70 | You can make a statement dependent on the existence of a variable by wrapping it in curly brackets. By default, the statement will only print if the first variable in the statement is not empty. You cannot have nested dependent statements. |
|---|
| 71 | |
|---|
| 72 | **Example 1:** |
|---|
| 73 | |
|---|
| 74 | The statement in the curly brackets won't print if %LOCATION% is empty |
|---|
| 75 | |
|---|
| 76 | %TITLE%{ at %LOCATION%} on %START% |
|---|
| 77 | |
|---|
| 78 | **Example 2:** |
|---|
| 79 | |
|---|
| 80 | To print a literal curly bracket, escape it with '^' |
|---|
| 81 | |
|---|
| 82 | %TITLE%{ at %LOCATION} ^{new^} |
|---|
| 83 | |
|---|
| 84 | **Example 3:** |
|---|
| 85 | |
|---|
| 86 | To skip a variable when determining the dependent variable, escape its '%' characters with '^'. This method also works to print a literal '%' inside a dependent statement. In this example, the statement in the curly brackets will print if %LOCATION% is not empty. Note that %AUTHOR% will be properly substituted even though it is escaped. |
|---|
| 87 | |
|---|
| 88 | %TITLE%{ hosted by ^%AUTHOR^% at %LOCATION%} |
|---|
| 89 | |
|---|
| 90 | **Example 4:** (invalid) |
|---|
| 91 | |
|---|
| 92 | This example is invalid. You cannot have nested dependent statements. |
|---|
| 93 | |
|---|
| 94 | %TITLE{ at %LOCATION%{ on %START%}} |
|---|
| 95 | |
|---|
| 96 | **Example 5:** |
|---|
| 97 | |
|---|
| 98 | However, you can have multiple dependent statements in a format. |
|---|
| 99 | |
|---|
| 100 | %TITLE%{ hosted by %AUTHOR%}{ at %LOCATION} on %START% |
|---|
| 101 | |
|---|
| 102 | == Frequently Asked Questions == |
|---|
| 103 | |
|---|
| 104 | = Where does WPListCal store events? = |
|---|
| 105 | |
|---|
| 106 | On activation time, the plugin adds a table called <prefix>_wplistcal that stores all your events. |
|---|
| 107 | |
|---|
| 108 | = What happens to my events when I deactivate the plugin? = |
|---|
| 109 | |
|---|
| 110 | Before version 1.0.6, on deactivation, __the events table is dropped__, so if you want to save your event data, back up the table before deactivating the plugin. |
|---|
| 111 | |
|---|
| 112 | As of 1.0.6, deactivating the plugin has no effect on your data. When upgrading to 1.0.6, DO NOT deactivate the plugin until you have uploaded the new version of `wplistcal.php` |
|---|
| 113 | |
|---|
| 114 | = Why is WPListCal different from other Wordpress calendar plugins? = |
|---|
| 115 | |
|---|
| 116 | WPListCal is specialized to provide clean list or table based output for you to style or reparse any way you'd like. Other calendar plugins force you to use a gregorian calendar view which may be inappropriate for many applications. |
|---|
| 117 | |
|---|
| 118 | = Does WPListCal work on WordPress 2.8? = |
|---|
| 119 | |
|---|
| 120 | WPListCal 1.2.2 and later work on WordPress 2.8 |
|---|
| 121 | |
|---|
| 122 | = When I click settings in the plugins page, I get the error "Cannot load wplc-options." = |
|---|
| 123 | |
|---|
| 124 | WPListCal 1.2 solves this issue |
|---|
| 125 | |
|---|
| 126 | = Why do some of my events show N/A for author and create date? = |
|---|
| 127 | |
|---|
| 128 | Events created before upgrading to version 1.1 did not have those values set, therefore WPListCal marks them as N/A. |
|---|
| 129 | |
|---|
| 130 | = I am unable to make events that start or end past January 19, 2038 at 3:14:08am = |
|---|
| 131 | |
|---|
| 132 | This is a known bug in PHP (id# [44209](http://bugs.php.net/44209)) and was fixed in version 5.2.6. The specific issue was that strtotime() did not support 64-bit timestamps. |
|---|
| 133 | |
|---|
| 134 | = Does WPListCal use any 3rd party libraries? = |
|---|
| 135 | |
|---|
| 136 | Yes, WPListCal is packaged with iCalcreator which is released under the GNU LGPL |
|---|
| 137 | |
|---|
| 138 | = I love WPListCal, but I'd like it to do <blank>. = |
|---|
| 139 | |
|---|
| 140 | Great, I'm glad to hear feature requests. Just post a comment on the [plugin's homepage](http://www.jonathankern.com/code/wplistcal "WPListCal Homepage"). |
|---|
| 141 | |
|---|
| 142 | == Changelog == |
|---|
| 143 | |
|---|
| 144 | = 1.2.2 = |
|---|
| 145 | |
|---|
| 146 | * FIXED: WordPress 2.8 compatibility |
|---|
| 147 | * FIXED: Cursor is no longer 'move' for section headers in the event edit page since you can't drag anyway |
|---|
| 148 | |
|---|
| 149 | = 1.2.1 = |
|---|
| 150 | |
|---|
| 151 | * FIXED: Table view didn't show events |
|---|
| 152 | * NEW: Added POT file for translation |
|---|
| 153 | |
|---|
| 154 | = 1.2 = |
|---|
| 155 | |
|---|
| 156 | * NEW: Event cleanup |
|---|
| 157 | * FIXED: Updated admin menus to use Wordpress Capabilities instead of user levels (fixes settings page bug) |
|---|
| 158 | * NEW: Conditional format strings (i.e. bracketed statements) |
|---|
| 159 | * NEW: Shortcode support |
|---|
| 160 | * FIXED: All timestamps are now based on the WordPress timezone option instead of server time |
|---|
| 161 | |
|---|
| 162 | = 1.1.1 = |
|---|
| 163 | |
|---|
| 164 | * FIXED: Moved the timezone functions into a PHP5-only block for back-compat |
|---|
| 165 | * FIXED: Load scripts only when we're on a WPListCal page |
|---|
| 166 | |
|---|
| 167 | = 1.1 = |
|---|
| 168 | |
|---|
| 169 | * NEW: Updated all styles and elements for WordPress 2.7 |
|---|
| 170 | * NEW: Menus refactored to fit into the new WordPress 2.7 menu structure |
|---|
| 171 | * NEW: Dashboard now shows number of events published |
|---|
| 172 | * NEW: Location field |
|---|
| 173 | * NEW: Widget support |
|---|
| 174 | * FIXED: Refactored code into separate files |
|---|
| 175 | * FIXED: Replaced a non-localizable string literal in the options page |
|---|
| 176 | * NEW: Event export |
|---|
| 177 | * NEW: Added link to the WordPress 2.7 admin favorites menu |
|---|
| 178 | |
|---|
| 179 | = 1.0.8.2 = |
|---|
| 180 | |
|---|
| 181 | * FIXED: Removed a 2.7-only function that caused PHP warnings on 2.6 |
|---|
| 182 | * FIXED: Re-enabled media upload buttons since they now work right |
|---|
| 183 | |
|---|
| 184 | = 1.0.8.1 = |
|---|
| 185 | |
|---|
| 186 | * FIXED: Options page warning |
|---|
| 187 | |
|---|
| 188 | = 1.0.8 = |
|---|
| 189 | |
|---|
| 190 | * FIXED: Visual editor was broken (again) |
|---|
| 191 | |
|---|
| 192 | = 1.0.7 = |
|---|
| 193 | |
|---|
| 194 | * NEW: Option to use a different date format for the end date if the event starts and ends on the same day |
|---|
| 195 | * NEW: Option to display a message if there are no events to show |
|---|
| 196 | * NEW: Option to set rel='nofollow' on links in the event listing |
|---|
| 197 | * NEW: Option to display events in reverse order |
|---|
| 198 | |
|---|
| 199 | = 1.0.6 = |
|---|
| 200 | |
|---|
| 201 | * NEW: Link field on events |
|---|
| 202 | * FIXED: Description box now has the correct tab index on the new & edit pages |
|---|
| 203 | * FIXED: Table view now uses properly cleaned fields |
|---|
| 204 | * FIXED: Past events option now defaults to "Only show current and future events" if it is not set |
|---|
| 205 | * FIXED: Deactivating the plugin no longer deletes all WPListCal settings and data |
|---|
| 206 | * FIXED: Write section tab now named Event instead of Add Event for consistency with WordPress |
|---|
| 207 | |
|---|
| 208 | = 1.0.5 = |
|---|
| 209 | |
|---|
| 210 | * FIXED: Return of the WPListCal options tab |
|---|
| 211 | * FIXED: the visual editor didn't work |
|---|
| 212 | * FIXED: `htmlspecialchars_decode` function threw error |
|---|
| 213 | * FIXED: Plugin now works on servers with `short_open_tag` disabled |
|---|
| 214 | |
|---|
| 215 | = 1.0.4 = |
|---|
| 216 | |
|---|
| 217 | * FIXED: Edit & options links to work when `wplistcal.php` is in a subfolder |
|---|
| 218 | * FIXED: Removed options link from edit & new event pages if the user doesn't have permissions to view it |
|---|
| 219 | * FIXED: Settings tab no longer appears to users who do not have permissions to it |
|---|
| 220 | * FIXED: Visual editor now works properly (also fixes `switcheditors not defined` error) |
|---|
| 221 | |
|---|
| 222 | = 1.0.3 = |
|---|
| 223 | |
|---|
| 224 | * FIXED: Options bug introduced by WordPress 2.5 |
|---|
| 225 | * NEW: Restyled admin menus to look like WordPress 2.5 |
|---|
| 226 | * FIXED: Localized a few hardcoded strings |
|---|
| 227 | * NEW: 24hr time support for the admin area |
|---|
| 228 | * NEW: Advanced notice limit option |
|---|
| 229 | * NEW: Every other event in both the list and table view has the css class `wplc_alt` applied to it to allow alternating row formatting |
|---|
| 230 | * FIXED: Maximum events setting on `wplc_show_events` was broken |
|---|
| 231 | * FIXED: Event titles containing single quotes printed wrong |
|---|
| 232 | |
|---|
| 233 | = 1.0.2 = |
|---|
| 234 | |
|---|
| 235 | * FIXED: Maximum Events option always defaulted to show all events |
|---|
| 236 | |
|---|
| 237 | = 1.0.1 = |
|---|
| 238 | |
|---|
| 239 | * FIXED: Added definition for `str_ireplace()` for servers not running PHP5 |
|---|
| 240 | |
|---|
| 241 | = 1.0 = |
|---|
| 242 | |
|---|
| 243 | * Initial Release |
|---|