\n"; $DatebookIndex=40; $DatebookEntries=ord(substr($DatebookFile,$DatebookIndex,1)); $DatebookIndex += 12; //echo ord(substr($DatebookFile,$DatebookIndex,1)); //echo "There are $DatebookEntries entries
\n"; //This is where we start actually using the DatebookIndex to roll on forward //StringLength to be a bitch variable like $i. $StringLength = ord(substr($DatebookFile,$DatebookIndex,1)); $DatebookIndex += 1; // don't really need to output the location of this file really $DatebookLocation = substr($DatebookFile,$DatebookIndex,$StringLength); $DatebookLocation = str_replace("\\","\\\\",$DatebookLocation); //echo substr($DatebookFile,$DatebookIndex,$StringLength); //echo "
\n"; if (strstr($_SERVER["HTTP_USER_AGENT"],"Firefox")) { print "
Goes through as html on Firefox, force text/calendar with datebook.php/basic.ics or something\n\n";
}
else {
  header('Content-type: text/calendar');
}

?>
BEGIN:VCALENDAR
PRODID:-//Kyle Kienapfel/datebook.php//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Palm
X-WR-TIMEZONE:America/Los_Angeles
X-WR-CALDESC:Export of 

BEGIN:VTIMEZONE
TZID:America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:STANDARD
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:PST
DTSTART:19701025T020000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:PDT
DTSTART:19700405T020000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU
END:DAYLIGHT
END:VTIMEZONE
\n";
//echo $EndTime ." " . date("F jS, Y @ g:i:sa",$EndTime);
//print "
\n"; if (isset($Note)) { $Note = str_replace(",","\,",$Note); print "DESCRIPTION:".str_replace("\r\n","\\n",$Note)."\n"; } /*if (substr($value,0,12) != "\0\0\0\0\x05\0\0\0\0\0\0\0") { print "
";
echo $value."\n";
echo chunk_split(implode(" ",unpack("H*",$value)),2," ") . "
\n"; echo md5($value)."\n"; print "
"; }*/ print "END:VEVENT\n"; $Count++; } //print $Entries[0]; print $DatabookFile; print "END:VCALENDAR\n"; ?>