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. Torbjorn says:

    Is it possible to have different display modes in a list on a page/post and in the widget? For me description is too long in the widget on a narrow sidebar.

    Localized dates works fine in version 1.3.5!

    • Paul says:

      I would also be very interested in this as a feature. The content of the events is much too long for the sidebar in most cases.

      Otherwise, great plugin! And it works fine in 2.9.

  2. Jocelyn says:

    Nice plugin …

    But I can ask a question … And I wish that somebody answer this.

    If I have a long description. How can I put a short description and have a (read more …) that link to the full description?

    I’m looking for the answer.

    Thanks …

  3. Manne says:

    Is there anyway to check if there is any upcoming events the nearest week?

    I would like to have a nice header for the pulgin, but if there is no events i dont need the heading…..

    • Manne says:

      Resolved, just didn’t have my head with me when i wrote…

      Thank you for this plug! it’s just what i need!

      /Manne

  4. Hernan says:

    it is posiblle to group the events by month.

    Sorry for my bad english.
    Thanks for the great work

  5. maxx says:

    curly brackets don’t work in my wp 2.9.1 installation!?

  6. Rlyeh says:

    I’m testing your plugin. For now,
    1) it’s nice and clear
    2) it doesn’t support ąęśćżź and probably other symbols – displays “?”. The case is charset in blog is set to UTF-8.

  7. Sheryll says:

    Hi, when I implemented your plugin directly into a themes file it works great. However, I’m also trying to list the events on a page and I used the short code provided above. It is telling me that I have no events listed. Any idea on what I’m doing wrong? I pasted the code in the html view.

  8. I like this calendar, but would love to use recurring events. (i.e. I am currently working on a website for a church and would prefer no to enter worship services each week, just once.)

  9. datacode says:

    For me the “Hide Same Date (boolean)” setting is not working using the php code (I am using your exact example code). It does work using the shortcode but I need it in my theme so I can’t use the shortcode. This is on WP 2.9.2

  10. Hi Jonathan,

    I’ve activated the plug in and added events. I wanted it to show up in a sidebar widget but the only thing I see is the title of the list. How can I get it to show the events in the widget?

    Thanks,
    Kimberly

  11. Kimberly says:

    How can I list the events calendar in a widget? I created the events in the admin section and then moved the wplistcal widget into the right sidebar but it is not showing the events I put in.

    Thanks in advance for you help.

  12. Peter says:

    Making a “gigs” page and a “gig log” page for my band site (under construction).

    In “gigs” I just use [wplistcal] in the body and it works great!
    In “gig log” I am using
    [wplistcal display_mode="list", event_format="%NAME%", date_format="n.j.y", max_events="-1", show_past_events="true", advance_days="0", event_order="desc", hide_same_date="false", no_events_msg="Where's the gigs?"]
    in the hopes that it will override the defaults and show all past gigs in descending order. It doesn’t. The page seems to use the defaults like the “gigs” page.

    Any advice?

  13. alex says:

    Hi,

    Nice plugin,

    A couple of questions:
    is it possible to add a field event-category so i can make a selection.

    Like business events vs leisure events???

    Is it possible to add an image/thumb??

    Tx

  14. perry says:

    I think this is a great and clean plugin but I am desperate for something that supports repeated events.

    Do you have any idea when you will release a version that supports repeated events?

    Thank you so much for your time and effort!

    /perry

  15. Rod says:

    Hello!

    I cant translate this plugin using the wplistcal.pot file.

    When I’m trying to do it using Poedit, I got this error:

    21:21:30: C:\php\apache\htdocs\wp-content\plugins\wplistcal\wplistcal.pot:7: invalid nplurals value
    21:21:30: C:\php\apache\htdocs\wp-content\plugins\wplistcal\wplistcal.pot:7: some header fields still have the initial default value
    21:21:30: msgfmt: found 2 fatal errors

    Can somebody help?

  16. Hugo says:

    Hi Jonathan.
    Congratulations on this plugin! I’m trying to use the shortcode and i’m having different results. If i use [wplistcal], everything is OK. If i use this same shortcode with the parameters inside And withou the commas (as many people advise), it doesn’t work. It reverts to the parameters configures on the plugin settings. Any ideas about this? I’m using the latest version of WP.

    • Hugo says:

      Hi again.
      Nevermind about this problem, it’s solved. I was making a mistake.
      But now i have another questions: is it possible to output a list only with the events that already occurred?

  17. Joe says:

    Can the END datetime be hidden (not displayed) if the end datetime is equal to the start datetime?

    In other words, we have monthly recurring events that have only a start time. And we want to display only that start time.

    Thank you. Great plugin!

  18. Tad says:

    Jonathan,
    Thanks for the great plugin. I don’t see this on requested features list, so I thought I’d ask. Would it be possible to add in creating events as an action as controlled by Roles and Capabilities?
    Thanks so much!

  19. Tad says:

    Jonathan,
    Another feature I’d love to see is support for multiple event lists, where a list, for example 8, would be included with something like
    [wplistcal.8]
    This would be great for separating different categories of events to be included in different posts.
    Thanks again!

  20. alex says:

    Hi,

    Still looking for the ability to add an image. Do you have a quick fix or maybe you could point me to an upload file function which i add to your plugin???

    Is there a way to embedded WP native image upload function/??

    regards<<

  21. trevor says:

    any chance of adding to the wishlist the ability to categorize events, and then list events within those categories?

    thanks

  22. mh says:

    Is it possible to get it to display only past events? I’d like to have a page with two sections, upcoming events and past events.

  23. Gene says:

    The location of the event is not showing up on my page for some reason.

  24. Greg says:

    Does anyone know what capabilities a user needs to add new events?

    The only thing I saw in the code was edit_posts, but there must be something else.

    Other than that, it is working exactly like I need it to.

  25. LMM says:

    The parameter for “hide same date” in the wplc_show_events call doesn’t seem to be behaving properly. The full date is still being displayed even with the boolean set to true and the format declared to be different after.

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.