sql_qry("SELECT * FROM $threadstable WHERE id=".$id.""); if($result) : while($list=mysql_fetch_array($result)) { $fp=fopen("template.vcs", "r"); $text = ""; while (!feof($fp)){ $zeile = fgets($fp,4096); $text = $text . $zeile; } /* $text = "BEGIN:VCALENDAR BEGIN:VEVENT SUMMARY:##summary## LOCATION:##location## DESCRIPTION:Eine Produktion der Spielgemeinschaft ODYSSEE Theater.\n\nKarte nreservierung:\nOnline: http://tickets.odysseetheater.com\nTel/Fax: +4 3(1)86 59 103\nHotline: +43(676)9 414 616 DTSTART;TZID=Austria/Vienna:19700101T120000Z DTEND;TZID=Austria/Vienna:19700101T120059Z BEGIN:VALARM TRIGGER:PT10080M ACTION:DISPLAY DESCRIPTION:Reminder END:VALARM END:VEVENT END:VCALENDAR"; */ $summary = $list["name"]; $description = "Eine Produktion der Spielgemeinschaft ODYSSEE Theater."; #$dtstart="20070728T170000Z"; #$dtend = "20070728T190000Z"; #$dtstart = gmdate ("Ymd", mktime(19,0,0,07,28,2007))."T".gmdate ("His", mktime(19,0,0,07,28,2007))."Z"; #$dtend = gmdate ("Ymd", mktime(21,0,0,07,28,2007))."T".gmdate ("His", mktime(21,0,0,07,28,2007))."Z"; $filename = "odyssee_" . date ("Y-m-d_Hi", $list["beginn"]); $dtstart = date ("Ymd", $list["beginn"])."T".date ("His", $list["beginn"]).""; if ($list["ende"] <= $list["beginn"]) $list["ende"] = $list["beginn"] + 3600*2; $dtend = date ("Ymd", $list["ende"])."T".date ("His", $list["ende"]).""; $location = $list["event_loc"]; $text = ereg_replace("##summary##",$summary,$text); $text = ereg_replace("##description##",$description,$text); $text = ereg_replace("##location##",$location,$text); $text = ereg_replace("19700101T120000Z",$dtstart,$text); $text = ereg_replace("19700101T120059Z",$dtend,$text); $text = utf8_encode($text); header('Content-Type: text/Calendar'); header('Content-Disposition: attachment; filename=' . $filename . '.vcs'); echo $text; } endif; ?>