I’ve been working on some basic integration of webcalendar and wordpress for the Guelph Students for Environmental Change site. It took a tiny bit of hacking, and I couldn’t find an answer anywhere else online, so I thought I’d post how I did it…
The idea I had was fairly simple – to have an online calendar where people in GSEC could login and add events, but that was publicly accessible to anyone visiting the site. Webcalendar seemed an obvious choice, but I also wanted an ‘Upcoming Events’ list on the home page. Webcalendar has some support for this, but the default
upcoming.php spat out a complete html page, so the only way to integrate that to the site home page would have been with an iframe. Not ideal. The solution is quite simple, involving stripping all the superfluous html generation out of upcoming.php, so it just returns the definition list of events.
Here’s my version of upcoming.php
Instructions for use:
- If you’re using WebCalendar v0.9.45 (13 Dec 2004), the same version I customised, you should be able to download that file, rename it to remove the .txt extension, and drop it in as a replacement for upcoming.php. If you’re using a different version, who knows!
On the page where you want the events list, add the following line, with the URI pointing to upcoming.php on your site:
<?php include("http://example.com/webcalendar/upcoming.php"); ?>
This modification to the original Webcalendar file is released under the GNU GPL.