decompiled

The life and times of Jonathan Kern

WPListCal

WPListCal

Current Stable Version: 1.3.5
Current Development Version: None
Requires WP Version: 2.7
Tested up to WP Version: 3.0-alpha

Download Stable Release

Installation | Usage | FAQ | Changelog | Comments

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.

Documentation and Bugs

Looking for information on how to install and use WPListCal? Did you find a bug in the plugin? Visit the WPListCal Development Site. Please don’t comment on this page for bug reports or feature requests. I won’t accept them here.

Version Guide

WordPress 2.7 or later → Use WPListCal 1.3.5 (current stable release)
WordPress 2.5-2.6.3 → Use WPListCal 1.0.8.2
WordPress 2.0.3-2.3.3 → Use WPListCal 1.0.2

The Future

Through the comments below, I’ve gotten lots of feature requests and bug reports and I appreciate them. I’ll continue development on WPListCal whenever I have time.

On many occasions, I’ve said that version 1.1 will bring support for categories and some other interesting features. I’ve decided to push those features off to 2.0 since the switch to WordPress 2.7 is becoming more than just a sub-point release. Don’t worry though, you don’t have to wait for 1.3-1.9 before I do 2.0…I’ll probably just skip a bunch. This versioning scheme just made more sense than rev’ing the 1.0 tree over and over

Feature Requests

Here is a list of current feature requests that I’ve gotten (and that I remember). Post comments if you have more.

Contributing

Many people have tried to provide code modifications in the comments section below. Sadly, WordPress doesn’t like this much and generally garbles code in comments. If you have a patch that you’d like to submit, please either upload a zip file of it somewhere and link to it, or use pastie and I’ll try to grab it before it expires. Generally, I won’t approve comments with modifications in them since I don’t want to provide support for mod’d versions of WPListCal. That said, if your modification provides significant value and is complete, I’ll seriously consider putting it into the plugin.

Installation

  1. Upload the wplistcal folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Upgrade

  1. DO NOT DEACTIVATE THE PREVIOUS VERSION OF THE PLUGIN! Doing so could remove all your events.
  2. Upload the wplistcal folder to the /wp-content/plugins/ directory
  3. Deactivate and then activate the plugin in the ‘Plugins’ menu in WordPress

Usage

  1. Change the default settings on the WPListCal options page
  2. 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)
    • 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!"]
  3. If you want to list your events on a page or post, insert the tag <!--wplistcal--> in the body of the page/post
  4. If you want to list your events somewhere in your theme files, insert <?php echo wplc_show_events(); ?>. You can set special parameters to overwrite the default options if you use the PHP function call. All parameters are optional, but you must preserve the ordering by passing in `null` for options that you want to use defaults for.
    • Display Mode (string): 'list' or 'table'
    • 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%, %AUTHOR%, and %EXPORTURL%.
    • Date Format (string): The format to display the start and end date and time. Uses the same date formatting that Wordpress uses.
    • Max. Events (int): The maximum number of events to display, -1 for unlimited.
    • Show Past Events (boolean): true to show all events, false to show only current and future events
    • Maximum Advanced Notice (int): How many days in advance to display events, -1 for unlimited.
    • Event Order (string): ‘asc’ to show the closest event first or ‘desc’ to show the furthest event first.
    • Hide Same Date (boolean): Format the end date with the format string defined in the next parameter if it is on the same day as the start date.
    • Date 2 Time Format (string): If Hide Same Date is enabled, use this format string for the end date.
    • No Events Message (string): If there are no events, show this string instead, leave blank for none.
    • Example: <?php echo wplc_show_events('list', '%LINKEDNAME%: %START% - %END%{
      %DESCRIPTION%} <a href="%EXPORTURL%">(export)</a>', 'M j, Y g:ia', -1, false, 30, 'asc', true, 'g:ia', 'Sorry, no events'); ?>

Dependent Statements (1.2 or later only)

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.

Example 1:

The statement in the curly brackets won’t print if %LOCATION% is empty

%TITLE%{ at %LOCATION%} on %START%

Example 2:

To print a literal curly bracket, escape it with ‘^’

%NAME%{ at %LOCATION} ^{new^}

Example 3:

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.

%NAME%{ hosted by ^%AUTHOR^% at %LOCATION%}

Example 4: (invalid)

This example is invalid. You cannot have nested dependent statements.

%NAME%{ at %LOCATION%{ on %START%}}

Example 5:

However, you can have multiple dependent statements in a format.

%NAME%{ hosted by %AUTHOR%}{ at %LOCATION} on %START%

Example 6:

You can also make a statement dependent on a variable without printing the variable. To do so, wrap the variable name in square brackets “[]“. You can escape the square brackets with ‘^’. In this example, the “more” link will only print if there is a description:

%NAME%{[%DESCRIPTION%] <a href="#">more</a>}

Frequently Asked Questions

Where does WPListCal store events?
On activation time, the plugin adds a table called <prefix>_wplistcal that stores all your events.
What happens to my events when I deactivate the plugin?
On deactivation, the events table is dropped, so if you want to save your event data, back up the table before deactivating the plugin.
As of version 1.0.6, deactivation does nothing to your settings and events.
Why is WPListCal different from other Wordpress calendar plugins?
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.
Why do some of my events show N/A for author and create date?
Events created before upgrading to version 1.1 did not have those values set, therefore WPListCal marks them as N/A.
I am unable to make events that start or end past January 19, 2038 at 3:14:08am
This is a known bug in PHP (id# 44209) and was fixed in version 5.2.6. The specific issue was that strtotime() did not support 64-bit timestamps.
Does WPListCal use any 3rd party libraries?
Yes, WPListCal is packaged with iCalcreator which is released under the GNU LGPL
My event times are all wrong after upgrading to WordPress 2.9.
Go to WordPress General settings and reset your timezone to a city rather than a manual UTC offset.
I love WPListCal, but I’d like it to do _______.
Great, I’m glad to hear feature requests. Just post a comment below.
I love WPListCal and I’d like to buy you a beer to thank you.
Awesome, thanks. Just click the big orange Donate button above

Changelog

1.3.5

1.3.4

1.3.3

1.3.2

1.3.1

1.3

1.2.2

1.2.1

1.2

1.1.1

1.1

1.0.8.2

1.0.8.1

1.0.8

1.0.7

1.0.6

1.0.5

1.0.4

1.0.3

1.0.2

1.0.1

1.0

  1. Scott says:

    Is there a way to change the wplc_event_list style for the list view? I’d like something other than a double chevron in there. Actually, I’ll probably modify it to have a list-style-type of none.

  2. Any Chance that I can do something like…

    if (%LOCATION%==’Sydney’) {
    echo wplc_show_events(‘list’, …
    }

    ThanX

  3. Gary says:

    Dear Jonathan,

    I recently upgraded Wordpress to 2.8 and updated your help WPlistcal plug-in but now when I add a new event or seek to edit an existing event there is no way to save the information added or changed. Am I missing something? Do you know of any issue since the 2.8 upgrade?

    Thanks Jonathan.

    Gary

  4. Ralph says:

    Are you working on a new version? In Wordpress 2.8 there is no more possibility to save a new event :-( Thank you!

    • Jonathan says:

      Please download WPListCal 1.2.2 (released today). It fixes compatibility issues with WordPress 2.8. The update is safe for use with 2.7 as well.

  5. Daniele says:

    Little problem… After upgrade to wp 2.8 control sidebar has gone… No more “save” or “save and new”.
    Code seems to appear into HTML but something is scrambled.

  6. Gary says:

    Dear Jonathan,

    Thanks for fixing compatibility with 2.8.

    Gary

  7. Amy says:

    Hi, when I add events on a page using either the shortcode [wplistcal] or the tag , I see this at the top of my page, followed by events I’ve added:

    Add events to WPListCal Jun 17, 2009 12:39pm
    Congratulations, you’ve just installed WPListCal! Now you just need to add your events into the system via the event tab in the Write area of the admin panel.

    How do I get rid of that?

    Thanks.

  8. David Decker says:

    the plugin wplistcal is generally working under wp 2.8 – but when i am editing an event it doesn’t show the description in the editor field any longer. also the buttons of the html editor are not showing – when i load an event to edit it just shows all for a moment and then the buttons are gone and the description is showing in blank/ white color – but it’s still there when i mark the content…

    strange!

    i work on some projects with wplistcal and any help is strongly welcomed!

    thanx, dave from germany :)

  9. Amy says:

    Ahh – I see, it was the first event as a default. Sorry about that! :-) Thanks for the plugin, it’s exactly what I was looking for.

  10. qik says:

    You made a good plugin. But there are a couple of comments
    1. After saving a new event in the Russian character becomes question marks (?????). I am not sure but in my case to the plugin.
    2. It would be like to be able to plan events that occur once a year, like birthdays.
    3. And also have the opportunity for users to publish the entire list of events.

  11. qik says:

    I would also like to be able to optionally show the last event for a period of time or in quantity.

  12. Martijn de Munnik says:

    Could you consider replacing the date function with strftime. The date function doesn’t support localization and strftime does.

    Great wp plugin!

  13. Mike says:

    WPListCal is excellent, but It’s not working form me in WP2.8. It causes several items from the dashboard to disappear, and it causes the expand/contract arrows on the WP navigation to not function.

    Maybe WP2.8.1 will help.

    Thank you for the great plugin.

  14. Mike says:

    I upgraded from PHP 4.4.9 to PHP 5.2.1 and now everything seems to work fine.

  15. Trisha says:

    Hi Jonathan

    I had been searching for a long time for a plugin like yours – a way to list upcoming events that was very simple to enter. After testing and discarding numerous event/calendar plugins I’ve decided yours is the best for my particular needs, however, I need one more custom field to work with in addition to the Title, Location, and Start/End dates (I don’t need the Link and Author field won’t work since it is keyed to the logged in user that is entering events)…..How can I add another custom field?

    I am in the process of a total site overhaul for a non-profit wilderness organization, and the Event plugin is to create their (guided) hikes list – you can see their current list here:
    http://www.scotchmanpeaks.org/Hikes/Hiking_Schedule_Current.html

    I’ve used the “Title” field for the Hike Name, and the Location Field for the Hike Leader, the Description field is self explanatory as is the Start Date (and some hikes are overnight to the End Date is appreciated), but I need a field for the Hike’s difficulty Rating. I’ve recreated that page with just a few of the hikes here if you want to take a look:
    http://stage.scotchmanpeaks.org/current-hiking-schedule/

    Please let me know if there is a way I can add a custom field to the plugin, or if there is a way to disassociate the Author field from the logged in user so I can use that field for the Hike Leader, allowing me to then use the Location field for the difficulty rating…..

    Any advice would be much appreciated!

  16. Barisko says:

    Hi,

    As stated here: http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=781

    the qTranslate plugin (http://www.qianqin.de/qtranslate/) and this plugin don’t work together. When the qTranlate plugin in activated the add event writing field disappears…!

    Could you please please look into this?

    kind regards,
    Barisko

  17. John Quarto says:

    We just upgraded to WP 2.8 and upgraded your excellent plugin as well. But we can’t Activate it, it generates this error:

    Fatal error: Call to undefined function timezone_abbreviations_list() in /var/www/wp-blog/htdocs/wp-content/plugins/wplistcal/importexport.inc.php on line 31

    Any ideas?

  18. ohey says:

    how do i make the table lines a certain color?
    i have it set up in table format, the words are correct but i don’t see the boxes of the table….

  19. Lena Shore says:

    Hey! I sent you a question about php area not working for me. I discovered I am an idiot. I realized that I only needed to put in the variables, not the script. Once I looked at what the source code generated, I expressed a “big duh”. Told you I wasn’t a coder. LOL.

    Anyway, this is a GREAT plugin. Where is that “buy you a beer” link?

    (:

  20. Doug says:

    Please disregard my previous comment. It works! so sorry.

  21. Rogier says:

    Activating this plugin on a clean install Wordpress 2.8.2 on a Linux CentOS 5 environment results in a fatal error:

    Fatal error: Call to undefined function timezone_abbreviations_list() in /home/wordpress/test_html/wp-content/plugins/wplistcal/importexport.inc.php on line 31

    This is a function which is only available from PHP version 5.2 and up (available in 5.1 as experimental)

    In sort this plug-in is not compatible with most PHP4/5.0/5.1 set-ups (like for example redhat enterprise 5/CentOS 5)

  22. Doug says:

    just a quick note that no commas are needed in parameters in the quickcode. was not sure why it wasn’t working, then stumbled upon solution. Thanks.

  23. Miguel says:

    I am using a table on my website but I do wonder if I can change the order of the columns – I would like the date column to be the first column… is that possible?

    thanks

  24. Jo says:

    We’re having an entirely different problem: the events can be edited, it’s just that the markup doesn’t show anything anymore.
    The alternate [wplistcal] syntax does work though.

    We’re on WP 2.8.2 and PHP 5.2.4.

  25. Scott says:

    Help – I am getting this error in the edit events section. What does it mean?

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1]

    SELECT id, event_name, event_loc, event_start_time, event_end_time, event_allday FROM wp_wplistcal ORDER BY event_start_time DESC, event_end_time DESC LIMIT 0, -1

    • Scott says:

      OK, I got the database error mentioned above fixed.

      I love this plug-in…it is great! Two suggestions to make it better:

      1) Allow the widget to be installed in multiple sidebars. Currently it can only be installed in one sidebar.

      2) Add a recurring events option. If you have recurring events, you have to add them one-by-one.

Have your say



XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

If you want literal < and/or >, use &lt; and &gt; instead.