Met with S & L from GRS about the calendar feed display they want on their site. This is what they'd like to see:
- The main page shows five upcoming events (the five closest events).
- The Events page shows all events.
- In both cases, each item is shown as date + title, on one line, and functions as a link which hides and shows more details about the event below it. The further details will include a link to the actual calendar event on events.uvic.ca.
To generate a feed which contains all the info we need, I have to use the Events calendar API, which has a rather arcane GET syntax. The default RSS 2.0 feed doesn't include all the info I need, but a URL like this will get what we want:
http://events.uvic.ca/rss/rss-feed.php?numdays=100&calendar=321
to which we need to add stuff like this:
&titleformat=<DATE>|<TIMES>|<TITLE>
which will put three pieces of info into the title field of the RSS XML, separated by pipes.
My plan is to use PHP5's SimpleXML code to parse out the RSS into PHP arrays, as modelled in this excellent article. I can tweak that to parse out the pipe-delimited bits from the title field. Then we just do some checking and sorting, and spit out the relevant items as XHTML with a JavaScript hideShow() function to make their bodies appear and disappear.
The one flaw in my plan right now is that PHP5 seems not to be working on Deer, at least when invoked through a .htaccess file, as recommended by Dave W and sysadmin. In fact, adding the suggested .htaccess file causes the whole site to disappear completely, in favour of a server error. They're working on that. Meanwhile, I should still be able to write the PHP code even if I can't test it.