Upcoming Events Plugin

Upcoming Events is a plugin that can receive iCalendar feeds from third party sites and display aggregated upcoming events from multiple feeds. As of this time, it has received very little testing, but it is working on the author’s site using two feeds from Google, one from Yahoo! and one from ical.mac.com. This alpha release provides the ability to add a virtually unlimited number of feeds, but does not contain the ability to delete any (feeds can be hidden so they don’t show up in the sidebar).

ICS files are locally cached and will be automatically updated when they reach a certain age. This age is configurable both as a global default and individually for each feed. The options range from 1 Hour to 1 Year with many available options in between.

See it in Action

This plugin is installed on my site. To see it in action, simply visit my blog. You can also browse just the upcoming-events category and see the latest plugin related news. And to get updates, don’t forget to subscribe using either RSS or email.

Latest Version

The latest version of Upcoming Events is 0.5. Updated in this version are:

  • Allow multiple widgets that can display different feeds
  • Fix a PHP 4 compatibility issue
  • Make the popups with event details fade in and out
  • code_name can no longer start with an underscore

Download Links

NOTE: The .zip file comes from a third party download site that I have no control over.

WordPress Info Page

Install Instructions

Untar/unzip the downloaded file into your wp-content/plugins directory then visit the Plugin Manager in your WordPress admin interface and active the plugin. A new subpage will appear on the Options tab for Upcoming Events where you can configure your iCal feed(s). Once you have feeds configured, you can add the event list to your sidebar. If you use widgets, simply visit the Widget subpage on the Presentation tab to add the Upcoming Events widgets. If you don’t use widgets, you’ll need to edit your sidebar.php in your theme directory (the default theme is in wp-content/themes/default) and add the appropriate code from the Upcoming Events options page.

Upgrade Instructions

Simply untar/unzip the file into your wp-content/plugins directory in place of the current upcoming-events contents.

Release Notes

For a full revision log, see http://dev.wp-plugins.org/log/upcoming-events.

v0.5 – 26-Sep-2007

  • Allow multiple widgets that can display different feeds
  • Fix a PHP 4 compatibility issue
  • Make the popups with event details fade in and out
  • code_name can no longer start with an underscore

v0.4 – 11-Sep-2007

  • Use $wpdb->prefix for forward compatibility with WordPress
  • Provide limited support for recurring events
  • Specify that the background should be White in the CSS file
  • Display newly added feeds by default

v0.3 – 6-Dec-2006

  • Removed a debugging statement that caused days/weeks to display incorrectly
  • Individual iCal feeds can be immediately updated from the admin page
  • The events list is now valid XHTML 1.0 Transitional
  • The admin page now produces valid XHTML 1.0 Transitional
  • CSS styles are in their own seperate file for easier modification
  • More information is provided in a tooltip-like popup for each event
  • Basic error checking is done when making changes on the admin page

v0.2 – 29-Nov-2006

  • Now runs on PHP 4 (used to have PHP 5 specific code)
  • Can now be loaded as a sidebar widget

v0.1 – 22-Nov-2006

  • Initial release

89 thoughts on “Upcoming Events Plugin”

  1. I just installed the plugin and when i enter my feed address i get this:

    Options not updated. Please correct the following errors

    * Code contains invalid characters. Valid characters are letters, numbers, underscore (_) and dash (-).

    The address from google has slashes and symbols which do not seem to work.

    The help is greatly appreciated. Thanks for a great plugin! =)

  2. Tim,
    The code you entered did not come through. Are you not using widgets? If so, you should not need to add any code to your sidebar, simply visit the widget config area (on the Presentation tab) and add an Upcoming Events sidebar.

  3. Ryan,
    The code_name should be just a simple and short name which can be used to refer to the calendar. Currently it’s not really used anywhere you can see, but the idea in the future is you can use it in CSS rules in order to style calendar events from different calendars. It’s used internally for staring the ICS file in the database in between refreshes. What I’d probably recommend for that calendar’s code name is simply ‘google’.

  4. Eugene,
    The only way to disable the extra info popups completely is to edit the source code. In v0.5, edit upcoming-events.php and go to line 153. Remove the onmouseover and onmouseout attributes. This is probably the cleanest/easiest way. The JavaScript will still be output to the browser, but there won’t be anything to trigger it to run.

  5. Great plugin! I’ve installed it and need your quick favor with the following.

    1- How can i delete iCal feeds i created by chance?
    2- A quick explanation on how to use the plugin would be of great help for me who knows very little about the IT world.

    I can’t wait to hear from you.

  6. Phy,
    Currently there is no way to delete a feed. You can uncheck the “show in default sidebar” box in order to make it inactive (the plugin won’t try to update feeds unless they’re being used).

    A quick explanation of how it works is a great idea… I just need to find the time to write it :).

  7. Thank you for your quick response, Jake! I have subscribed via email and will be all eyes and ears for the option to delete the feed and a quick explanation of how it works to come into play.

  8. Just another suggestion, perhaps there might be a way for each event to link to the google calendar item so that people can read the full description. For our church’s purposes, we like to let people know where to show up, when, how much money to bring, etc. I know that the Google Calendar plugin offers this option, but doesn’t seem to work on our site at all.

  9. Good plugin! Just what I’ve been looking for.

    On my site, the plugin is only showing All-Day events, and isn’t displaying the other events. Is it simply that the plugin is not written to support events within a day, or is there something I am doing wrong? If you look on my blog, Upcoming Events is located in the bottom right.

  10. Good plugin thanks !!

    I want to change the time format to 9p to 9PM or the best way is 09:00 PM can you give a tip where we change this in the file we use google agenda.

    Also we use the default 10 events but nog see 10 but one week. We repeat some events it look like he do not show that.


  11. Not a bad plugin… very useful. However, I believe I’ve found a bug:

    Line 164 of the ical class is $this->end_date = date("Ymd", strtotime($m[1] . " -1 day")); .

    This triggered an error (at least on Windows/IIS): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in...

    After a bit of searching, I ran across this topic – http://forums.devshed.com/php-development-5/date-problem-97095.html .

    Why are you using strtotime() around the timestamp when it’s being fed to date()? It’s already a timestamp… From the manual entry for strtotime:

    “The function expects to be given a string containing an English date format and will try to parse that format into a UNIX timestamp relative to the timestamp given in now, or the current time if none is supplied.”

    I haven’t looked at the code closely enough to determine the effect of the -1 day bit, but changing line 164 to $this->end_date = date("Ymd", $m[1]); at least got rid of the error.

    You may want to check some other projects for a proper (not that yours isn’t) .ics parsing class (drupal, etc.).

  12. Great plugin. Would you know how to change the date format and use days and month in french? Also I can’t get the feed to display special characters that are used in french. I’ve tested the feed, opened it with another program and it’s with all special character and the date is all in french. But when it goes through your plugin, it comes out as english.


  13. HI Jake, this is a great plugin, but the pop up is showing the year 1970. I looked at Robert’s instructions above but I do not understand what I need to do to change it as all code is looking the same to me. Please can you advise?

  14. The events from Google calendar showed up in my sidebar (fine). But there was an event scheduled for 5p and when I checked at 3p, it was no longer listed.

    I thought this was due to time zone settings in google calendar and/ or my blog; but, changed both to check (and changed them back because the google calendar time and the time reported by your script were showing DIFFERENT TIMES).

    I thought it was time offset from my server but checked that also. The problem seems to be with your script: It makes no sense to have an appointment at 5 that disappears two hours before the appointment time.

  15. I seem to have fixed this. Seems when I made a php file to echo the time, it echoed the correct time for my timezone. But when I put the same code into a wordpress widget, it echoed UTC.

    I assume the time difference between WORDPRESS’ UTC and Google calendar made it such that, according to your script, the event had “already passed” (incorrectly).

    I followed the instructions here to prepend all php scripts with my time zone instead of the server time zone:


    I then tested your script by putting a test event on google calendar for 30 minutes into the future and it “still” showed up on my webpage (within 30 minutes of the scheduled time).

    But I don’t really understand what your script is doing, what wordpress is doing, or what I did when I put the timezone code into my .htaccess!?!?! So, I think this solved the problem; but, I’ll have to wait and see.

  16. I have the same issue as Nate … only ‘all day’ events are being displayed. Is that by design? Or is there a modification that needs to be made? Great plugin otherwise.

  17. still having trouble with my installation posting 1969 on all day events but i did have relief with the time difference.

    I spent almost a full day trying to reconfigure this plugin or find a new one and then when i used another google ical calendar the dates showed up correctly.

    the calendar i was using was offset by two hours and my UTC in wordpress was off as well. after i corrected those settings in google and wordpress it all appeared great ( – the 1969)

    hope that helps someone…

  18. Thanks for the plugin.

    Worked great when I exchanged “webcal” with “http”.

    Is there a way to not just have it list the upcoming events, but to also have them appear in the calendar?

    Thanks again for the plugin. it’s pretty.

    Pastor Steve Bauer

  19. Hello,

    Thanks for your plug-in. in your comments, you say that there is “limited support for recurring events”. How limited is limited?

    All of my recurring events don’t show. Is there a way to make some of them show?

    Should I make all of them manual, single entries for now?

    Thanks for the plug-in. It’s a great time-saver.

  20. I have this problem… 🙁

    Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/.donneybrook/merceram/www.bollosferablog.com/wp-content/plugins/upcoming-events/functions.php on line 57

    Warning: file_get_contents(http://www.google.com/calendar/feeds/6vopqesq04rteghoc2frp8g1m4%40group.calendar.google.com/public/basic) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/.donneybrook/merceram/www.bollosferablog.com/wp-content/plugins/upcoming-events/functions.php on line 57

  21. hey man, congratulations for this work but i was curious to know if there’s any ways to subscribe calendars’ events: this could be useful for a project i’m working on with my univeristy, where students could subscribe calendars from their teachers and be updated on their info [lessons, exams and so on..].

    thanks in advance for your help =]


  22. Hey – I like the plugin… Can you give me some clue where the styles are defined… I’d like to get rid of the bullets and tweak it to match my theme but I can’t figure out which file to edit… I see you did that on your site…



  23. Greetings Jacob,

    Thanx for this great plugin. It’s easy, it’s what I want it to be. Except for one small thing. My blog is in Dutch and in the upcoming events, days and months are in English. Is there a way to use the Dutch words. All the other dates I have are in Dutch.

    Thanx for any reply given and please keep up the good work. Offcourse I subscribed.


  24. Jacob, thanks for the great plugin! I too was having the same file_get_contents() error described by Mercedes in Nov 2007. I learned that my host, Dreamhost, has disabled the PHP option allow_url_fopen, breaking file_get_contents().

    Fortunately, I have found and tested an alternative using cURL, and I thought others might like to hear about it. I added the function below to the upcoming_events/functions.php file:

    function file_get_the_contents($url) {
    $ch = curl_init();
    $timeout = 10; // set to zero for no timeout
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $file_contents = curl_exec($ch);
    return $file_contents;

    Then, In the existing function ue1_update_ics($feed_code)

    I changed the line:

    $ics = file_get_contents($feed[“url”])) {


    $ics = file_get_the_contents($feed[“url”])) {

    That did the trick,

  25. Hm, I tried it on one of my blogs and it works very well with Google calendar. Didn’t try it with Yahoo so far .. maybe I’ll try it end of the next week. Thanks a lot for this plugin. Keep it going 😉

  26. Will the plugin only work in the sidebar? I would like to only make it available on the welcome page of my site. I have inserted the code but no events appear. On the sidebar it works fine.
    any info would be greatly appreciated.

Leave a Reply