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:guid; ?> URL:guid; ?> DTSTAMP:getTimeUpdated())?> CREATED:getTimeCreated())?> LAST-MODIFIED:getTimeUpdated()) ?> DTSTART;VALUE=DATE:start_date); ?> DTEND;VALUE=DATE:real_end_time); ?> SUMMARY:title; ?> DESCRIPTION: LOCATION:venue; ?> CATEGORIES:tags); ?> END:VEVENT