|
To use the Events Calendar RSS feed on your HTML page, you'll need to convert it to a php page. Step one:Save the file with the file extension .php instead. Step two:You will need to edit the code of your page to make sure it still looks right. Change any virtual includes to php requires. Old Virtual Include: New PHP Require: Note: The URL in the PHP Require should be the relative URL to the file from the main directory of the web server so it may need to be adjusted from what is used in the virtual include.
Step three:Add the following snippet of php code where you want the events to appear on your page. You will need to replace the blue part with the RSS URL you get from the generator. If the URL has any spaces in it, you will need to replace those with This sample will create an unordered list with each event as a list item. <!-- RSS feed Starts -->
<?php require_once('/web/base/rss/rss_fetch.inc'); ?>
<?php $rss = fetch_rss($url='GENERATED_RSS_URL_HERE'); ?>
<?php
echo "<ul>\n";
foreach ($rss->items as $item) {
$url = $item['link']; /* URL to the full listing in events.d.umn.edu */
$title = $item['event']['title']; /* Title */
$date = $item['event']['startdate']; /* Start Date */
$time = $item['event']['starttime']; /* Start Time */
$where = $item['event']['location']; /* Location */
$spons = $item['event']['sponsors']; /* Sponsor */
$teaser = $item['event']['teaser']; /* Teaser text */
echo "<li>$date @ $time - <a href=\"$url\">$title</a> - $teaser; $where; Sponsored by $spons</li>\n";
}
echo "</ul>\n"; ?>
<!-- Feed Ends and text below feed follows -->
You do not need to adjust any other parts of the code but you can change parts of the generated HTML or use other parts of the RSS feed if you decide to. See more advanced options for the RSS feed formatting. Don't forget to change your links to the page now that it has a new file extension. |