decompiled

The life and times of Jonathan Kern

WPListCal Documentation

WPListCal

Current Stable Version: 1.3.5
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

WPListCal is no longer under active development. Read more here.

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

    Hi!

    I’m helping my father in law with a site for his local Rotary club.

    I’d really like to see a feature where one could limit the events from date to date. Then it would be possible to list the events for the spring season seperatly from the fall season.

    Thanks for å swett plugin!

  2. Pam says:

    Hello Thanks for the plugin. I am using on a client website to create page of the Events. So added the works great. However, a gets add around the ul which cause validation error. I have been trying to figure out how to remove or stop the p tag from being add. I tried the remove_filter('the_content','wpautop') but is does not to it. I am thinking it has to do with the way it is being setup has comment. Any suggestions would be great.
    Pam

  3. Alex Miles says:

    Is there a way to run multiple lists of events at once?

    i.e.
    1.run a list of events within a local area

    2.run a list of events within a state wide range?

  4. Scott Ashby says:

    Great plug-in! I can’t seem to limit the number of displayed events. I’ve set it to maximum 5 events displayed, but it still shows 23 events. :(

    • Scott Ashby says:

      Any solutions for this problem yet?

      • Rick says:

        Are you sure this is a bug in the plugin and not a problem on your end? Are you setting max_events in the shortcode or in the settings?

        If you post this kind of information, others can help you out and/or confirm that there is a bug in the plugin.

  5. patricia says:

    Hi All,
    Can I create a list by month?
    E.g.: jan/2010, feb/2010, …
    And, when I choose one, I want that the function show just the events for the selected month.

  6. Tad says:

    Ouch! I upgraded WP from 2.9 to 3.0.1 and all my events moved forward by 8 hours. It looks like I have a lot of event editing to do.

  7. Hi,

    Thank you for your plugin. I deployed it yesterday, only after some difficulties, because the WordPress page for the plugin wrongly separates the options by “,” instead of ” ” :-( .

    I vote for the feature to enable listing up events for a specific/current year, month etc. My website is for an organization, and I would like to publish a year program. Maybe you could insert a CSS class for past events, to enable different rendering (or reorganization using JQuery).

    Another nice option would be to allow blank end-dates or end-times.

    Nice plugin :-)

  8. Nola Cooper says:

    My client Encore Organizers, is using WPListCal (latest version plus latest version of WP), but the upload buttons are not working. Is there something that I can check or change to make this work?

  9. Matthew says:

    Hi Jonathan,
    I was having the same problem as Nola Cooper mentioned above – the media upload buttons were working but the upload window was showing up as a new section at the bottom of the page instead of in a lightbox. Someone evidently solved this issue about a year ago, which has to do with enqueuing the thickbox stylesheet. It seems add_thickbox() may have been unofficially deprecated:
    http://wordpress.org/support/topic/is-add_thickbox-still-valid

    Anyway, there’s a pretty simple fix, just add this on line 39 of wplistcal/admin.inc.php:
    do_action(‘admin_print_styles’);

    Hope that’s helpful.

    Matthew

  10. Ryan says:

    Hi- is it possible to edit permissions so users other than admins (folks with editor capabilities, for example) can add/edit events? Thanks!

  11. Toni says:

    Awesome plugin! Also I don’t know much PHP but how to I modify the piece to only display the time if it’s on the same year and day? Thnks!

  12. Mohsin says:

    Hi,

    I have used you event calendar and find it very nice. My requirement is to show “Today Events” and “Upcoming Events”. I made two headings and include code to display event calendar under these heading.
    I made update the parameter of advance_days=”0″ But it does not skip future date events under “Today Events”. Also suggest how to hide Today event in upcoming events. Thanks

    I hope you understand what I want to say.

    Regards,
    Mohsin

  13. Jayme says:

    Hi there,
    I currently have WPListCal on one of my sites feeding an events list to the home page sidebar and to the events page. The formatting is the same for both lists, but I need the home page sidebar to only display three events and the events page to display all events. Is there an inherent way to do this, or can anyone offer some tweaking code?

    I’ve been through most of the code within the plugin files and am not finding anything that looks like it could apply to this.

    Thanks so much in advance!

    • Jonathan says:

      The sidebar widget pulls the default settings. You should make the default settings the ones you want for your sidebar and then use the tag or PHP function directly on your events page to customize the display for that list.

  14. gjfo says:

    Hi Jonathan,

    WPListCal is a great plugin.

    I only have a little bug. In WordPress admin I set time at “Use 24 hours”. In the admin section of events hours are define in a 24 hours way to. But using WPListCal widget hours are displayed in 12 hours way.

    Do you have an advice who to fix it in 24 hours anywhere?

    Thank You

    • Jonathan says:

      You need to change the date format string to use “G” instead of “g”. For more info, see the documentation for PHP’s date() function.

  15. Corey says:

    I want to use my default settings for the main page, which I have formatted exactly as I want it, however I want the widget to use just a list of the next 7 events, etc. I can’t figure out how to do this, as when I add the widget, it displays everything about the entire listing, including the image, full text, etc. making the sidebar virtually useless.

    I just want it formatted such as:

    Name of Event
    Date/Time

    Next Event
    Date/Time

    I tried adding different combination of codes in the ‘text’ widget to pull the data:
    or the [[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!"]

    but I can’t get anything to show up…is this possible to use the database for 2 separate listing options?

    • Jonathan says:

      You need to do it the other way around. Use the default settings in the widget and then use custom settings on the tag that you use on your main page.

  16. Kevin says:

    It says in changelog 1.0.3 — 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

    This isn’t working for me. The alternating events have the same format. Where can I go to adjust or edit the CSS/formatting?

  17. I’m really enjoying the WPListCal plugin.

    I’m using it for this Carindale events page

    I guess it’s always easy to suggest things, so if I had to, I’d say breaking it down into months headings would be good for users, but I’m fine without that too.

    Just wanted to say thanks!

    Gen

    • Jonathan says:

      You’re welcome! The split by month thing is definitely on the todo list, though, as you can probably tell, I’m doing far less active development on WPListCal these days. It’s open source though, so someone else is welcome to contribute.

  18. Dan Jackson says:

    Hello,

    Just wondering if it would be possible to allow a separate event format for the widget?

    Thanks,
    Dan Jackson (CSD Computer Technician, LRSFC).

    • Jonathan says:

      The widget gets the format from the main plugin settings, but you can use a separate format for the tag/PHP function. See the documentation for more details.

  19. ako says:

    great plugin!

    I use it now in a list format on my webpage. However, I’d would in addition to this, like to show just the next upcoming event in the sidebar. Thus, I want the same plugin to show differently in two parts of my page..

    Maybe there’s a way that the sidebar can pick just the first post from the calendar?

    Thank you

  20. Stacey says:

    I am having trouble uploading media files and using the hyperlink button. Is there something I am doing wrong??

    Need your help,
    Stacey

  21. Michelle says:

    Hi Jonathan,

    Thanks for providing this plugin! I was wondering how to:

    1. Configure the plugin to add a horizontal line after each event listing to separate events more clearly?
    2. Display a dash between start and finish time?

    Cheers

    • Jonathan says:

      For #1, just use CSS styles. You can put a border-bottom on the event item element.
      For #2, it should already do that. I don’t have code in front of me right now though, so I’m not positive.

  22. Dan says:

    Can anybody tell me what the stock code is for the event format?

  23. Kasper says:

    Great plugin! is it possible to style time different than date? it seems like date and time is “one”?

    • Jonathan says:

      You control the formatting of the whole date/time stamp. You can use the documentation on php’s date() function to choose the format that you want. If you want different CSS styling, just include tags in your date format so you can attach CSS classes or styles to only certain parts of the date/time.

  24. George says:

    Hi,
    Thanks for the plugin.

    Would it be possible to post the default settings for Display mode as if I switch to table mode they are lost?

    George

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> <pre lang="" line="" escaped="">

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