Browse Source

updated ical and deleted old export script

master
n0m1s 10 years ago
parent
commit
5547a4cdd6
2 changed files with 4 additions and 35 deletions
  1. +0
    -33
      calendar.php
  2. +4
    -2
      export.php

+ 0
- 33
calendar.php View File

@ -1,33 +0,0 @@
<?php
# if(!isset($_POST["y"]))
# {
# header("Location:.");
# exit;
# }
# header('Content-type: text/calendar; charset=utf-8');
# header('Content-Disposition: inline; filename=kiwicalendar.ics');
include("./getEvents.php");
$icalheader = "BEGIN:VCALENDAR
VERSION:2.0
PRODID:KiWiCalendar v1.0//EN
";
$icalfooter = "END:VCALENDAR";
$events = getEvents();
echo $icalheader;
foreach($events as $event)
{
echo "BEGIN:VEVENT
SUMMARY:".$event["titre"]."
DTSTART:".date("Ymd\THis",strtotime($event["dtstart"]))."
DTEND:".date("Ymd\THis",strtotime($event["dtend"]))."
LOCATION:".$event["localisation"]."
CATEGORIES:"."<TODO : categorie>"."
DESCRIPTION:".$event["description"]."
END:VEVENT\n";
}
echo $icalfooter;
?>

+ 4
- 2
export.php View File

@ -25,10 +25,12 @@ foreach($events as $event)
{
echo('BEGIN:VEVENT'.$eol);
echo('UID:' . md5($event['id']) . '@kiwi-calendar'.$eol);
echo('DTSTAMP:'.icaldate($event['dtstart']).$eol);
echo('DTSTART:'.icaldate($event['dtstart']).$eol);
echo('DTEND:'.icaldate($event['dtend']).$eol);
echo('SUMMARY:'.$event['description'].$eol);
echo('SUMMARY:'.$event['titre'].$eol);
echo('DESCRIPTION:'.$event['description'].$eol);
echo('LOCATION:'.$event['localisation'].$eol);
echo('CATEGORIES:'/*TODO*/.$eol);
echo('END:VEVENT'.$eol);
}


Loading…
Cancel
Save