diff options
author | Kevin Jardine <kevinjardine@yahoo.com> | 2011-09-28 17:02:51 +0200 |
---|---|---|
committer | Kevin Jardine <kevinjardine@yahoo.com> | 2011-09-28 17:02:51 +0200 |
commit | 8b595e63700e1ebaf0f31b08b0009922acc780e3 (patch) | |
tree | 986f80c2acca023c8734e4758f03e96c1a43cd44 /views/ical/object | |
parent | 1bba961e3cea230e7d6a62a5016c5ea23a5c0e76 (diff) | |
download | elgg-8b595e63700e1ebaf0f31b08b0009922acc780e3.tar.gz elgg-8b595e63700e1ebaf0f31b08b0009922acc780e3.tar.bz2 |
restored RSS feed and added iCal feed
Diffstat (limited to 'views/ical/object')
-rw-r--r-- | views/ical/object/event_calendar.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/views/ical/object/event_calendar.php b/views/ical/object/event_calendar.php new file mode 100644 index 000000000..a6ed889e5 --- /dev/null +++ b/views/ical/object/event_calendar.php @@ -0,0 +1,44 @@ +<?php +$event = $vars['entity']; +if ($event->organizer) { + $organizer = "\nORGANIZER;CN={$event->organizer}\n"; +} else { + $organizer = ''; +} + +if ($event->description) { + // make sure that we are using Unix line endings + $description = str_replace("\r\n","\n",$event->description); + $description = str_replace("\r","\n",$description); + + // now convert to icalendar format + $description = str_replace("\n",'\n',$description); + $description = wordwrap($description,75,"\r\n ",TRUE); +} else { + $description = ''; +} +?> +BEGIN:VEVENT +UID:<?php echo elgg_get_site_url().'event_calendar/view/'.$event->guid; ?> + +URL:<?php echo elgg_get_site_url().'event_calendar/view/'.$event->guid; ?> + +DTSTAMP:<?php echo date("Ymd\THis\Z", $event->getTimeUpdated())?> + +CREATED:<?php echo date("Ymd\THis\Z", $event->getTimeCreated())?> + +LAST-MODIFIED:<?php echo date("Ymd\THis\Z", $event->getTimeUpdated()) ?> + +DTSTART:<?php echo date("Ymd\THis\Z", $event->start_date); ?> + +DTEND:<?php echo date("Ymd\THis\Z", $event->real_end_time); ?> + +SUMMARY:<?php echo $event->title; ?> + +DESCRIPTION:<?php echo $description; ?> + +LOCATION:<?php echo $event->venue; ?><?php echo $organizer; ?> + +CATEGORIES:<?php implode(",",$event->tags); ?> + +END:VEVENT |