RSS Feeds for UMD Web Calendar of Events

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 %20 or else you'll get an error.

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) {
        $href   = $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 */

        $ext_title  = $item['title'];                   /* $date, $time, and $title combined */
        $desc       = $item['description'];             /* $where, $spons, and $teaser combined */
        $summary    = $item['summary'];                 /* $where, $spons, and $teaser combined */

        $date_end   = $item['event']['enddate'];        /* End Date */
        $time_end   = $item['event']['endtime'];        /* End Time */
        $campus     = $item['event']['campus'];         /* Which Campus */
        $email      = $item['event']['contactemail'];   /* Contact Email */
        $name       = $item['event']['contactname'];    /* Contact Name */
        $cost       = $item['event']['cost'];           /* Cost */
        $audience   = $item['event']['audience'];       /* Audience the event is limited to */
        $info_url   = $item['event']['moreinfo'];       /* URL to another web page with more information */
        $video_url  = $item['event']['videourl'];       /* URL to a video */
        $ticket_url = $item['event']['ticketlink'];     /* URL to buy tickets for event */
        $category   = $item['event']['umcategory'];     /* Which categories this event fits into */

        $allday     = $item['event']['allday'];         /* 1 or 0 */
        $spotlight  = $item['event']['spotlight'];      /* 1 or 0 */

        echo "<li>$date @ $time - <a href=\"$href\">$title</a> - $teaser; $where; Sponsored by $spons</li>\n";
    }
    echo "</ul>\n";
	?>
<!-- Feed Ends and text below feed follows -->

Above you will notice many more variables assigned from the RSS feed. You can modify the HTML and the variables used in the echo statements to change the look of your events.


Did you find what you were looking for? YES NO

Choose appearance:
[ Desktop | Mobile friendly ]