diff --git a/calendar.php b/calendar.php index 09e3624..ed9e9a6 100644 --- a/calendar.php +++ b/calendar.php @@ -5,19 +5,14 @@ # exit; # } header('Content-type: text/calendar; charset=utf-8'); - header('Content-Disposition: inline; filename=calendar.ics'); + header('Content-Disposition: inline; filename=kiwicalendar.ics'); include("./getEvents.php"); $icalheader = "BEGIN:VCALENDAR VERSION:2.0 -PRODID:-//hacksw/handcal//NONSGML v1.0//EN" +PRODID:KiWiCalendar v1.0//EN +"; $icalfooter = "END:VCALENDAR"; -#"BEGIN:VEVENT -#UID:" . md5(uniqid(mt_rand(), true)) . "@yourhost.test -#DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z -#DTSTART:19970714T170000Z -#DTEND:19970715T035959Z -#SUMMARY:Bastille Day Party" $events = getEvents(); @@ -27,8 +22,12 @@ PRODID:-//hacksw/handcal//NONSGML v1.0//EN" { echo "BEGIN:VEVENT SUMMARY:".$event["titre"]." -"."END:VEVENT"; +DTSTART:".date("Ymd\THis",strtotime($event["dtstart"]))." +DTEND:".date("Ymd\THis",strtotime($event["dtend"]))." +LOCATION:".$event["localisation"]." +CATEGORIES:".""." +DESCRIPTION:".$event["description"]." +END:VEVENT\n"; } echo $icalfooter; - print_r($events); ?> diff --git a/calendar.php~ b/calendar.php~ index b8b7b77..ad36749 100644 --- a/calendar.php~ +++ b/calendar.php~ @@ -5,19 +5,20 @@ # exit; # } header('Content-type: text/calendar; charset=utf-8'); - header('Content-Disposition: inline; filename=calendar.ics'); + header('Content-Disposition: inline; filename=kiwicalendar.ics'); include("./getEvents.php"); $icalheader = "BEGIN:VCALENDAR VERSION:2.0 -PRODID:-//hacksw/handcal//NONSGML v1.0//EN" +PRODID:KiWiCalendar v1.0//EN +"; $icalfooter = "END:VCALENDAR"; #"BEGIN:VEVENT #UID:" . md5(uniqid(mt_rand(), true)) . "@yourhost.test #DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z #DTSTART:19970714T170000Z #DTEND:19970715T035959Z -SUMMARY:Bastille Day Party" +#SUMMARY:Bastille Day Party" $events = getEvents(); @@ -27,8 +28,12 @@ SUMMARY:Bastille Day Party" { echo "BEGIN:VEVENT SUMMARY:".$event["titre"]." -"."END:VEVENT"; +DTSTART:".date("Ymd\THis",strtotime($event["dtstart"]))." +DTEND:".date("Ymd\THis",strtotime($event["dtend"]))." +LOCATION:".$event["localisation"]." +CATEGORIES:".""." +DESCRIPTION:".$event["description"]." +END:VEVENT\n"; } echo $icalfooter; - print_r($events); ?> diff --git a/testdb.db b/testdb.db index e5a2fb1..dc6b5e1 100644 Binary files a/testdb.db and b/testdb.db differ