iCalendar creation not working with Outlook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to implement this iCalendar/vCalendar that I saw at this URL
http://www.phpbuilder.com/columns/chow20021007.php3

Here is the error I get in Outlook:
"This error can appear if you have attempted to save a recurring Lunar
appointment in iCalendar format. To avoid this error, set the appointment
option to Gregorian instead of Lunar."

It works fine in KOrganizer (KDE), Entorage (Mac OS-X), iCal. I couldn't
figure out how to get Evolution to use it.

I find tons of people complaining on Google about this error message, but no
real solution but to use "\n" -- which I have done I think. I have even
commented out the DESCRIPTION field, and that didn't help.

Does anyone have a real working example, class, snippet, whatever for an
iCalendar generator that works in Outlook?

Here is my page...
http://www.rollinballzcrew.com/nextparty-new.phtml

Here is my Code:

<?php 
    $db = mysql_connect ("localhost","user","password") or die ("Could not
connect to SQL server.");
    mysql_select_db ("rbc",$db) or die ("Could not select RBC Database");
	
	if (isset($_GET['id']) && intval($_GET['id'] > 0))
	{
		$pth = mysql_query("SELECT *, UNIX_TIMESTAMP(party_date) AS
start, UNIX_TIMESTAMP(DATE_ADD(party_date, INTERVAL 6 HOUR)) AS end FROM
party_table WHERE party_id = ".$_GET['id']." LIMIT 1", $db);
		if ($pth && mysql_num_rows($pth) == 1)
		{
			$prow = mysql_fetch_array($pth,MYSQL_ASSOC);
			
	
//http://www.phpbuilder.com/columns/chow20021007.php3?page=2
			
			//http://www.sitellite.org/docs/Date/vCal.html
	
//http://www.scheduleworld.com/outlookInteroperability.html 
			//http://www.ietf.org/rfc/rfc2445.txt
			//http://www.linuxjournal.com/article/8159
			
		  	//$Filename = "RBC_Event" . $_GET['id'] . ".vcs";
			//header("Content-Type: text/x-vCalendar");
		    $Filename = "RBC_Event-" . $_GET['id'] . ".ics";
		    header("Content-Type: text/Calendar");
			
		    header("Content-Disposition: inline;
filename=".$Filename);
			$DescDump = str_replace("\r", "=0D=0A",
$prow['party_description']);
			$vCalStart = date("Ymd\THi00", $prow['start']);
			$vCalEnd = date("Ymd\THi00", $prow['end']);
			
			print "BEGIN:VCALENDAR\n";
			print "VERSION:2.0\n";
			print "PRODID:RBC Web Calendar\n";
			print "METHOD:PUBLISH\n";
//			print "TZ:-08\n";
				print "BEGIN:VEVENT\n";
				print "DTSTART:".$vCalStart."Z\n";
				print "DTEND:".$vCalEnd."Z\n";
				print
"LOCATION:".$prow['party_location']."\n";
//				print "TRANSP:OPAQUE\n";
//				print "UUID:".microtime()."\n";
//				print "DTSTAMP:20050509T153037\n";
				print "SUMMARY:".$prow['party_name']."\n";
	//			print
"DESCRIPTION;ENCODING=QUOTED-PRINTABLE: ".$DescDump."\n";
//				print
"DESCRIPTION;ENCODING=QUOTED-PRINTABLE: Test\n";
				print "PRIORITY:3\n";
				print "CLASS:PUBLIC\n";
					print "BEGIN:VALARM\n";
					print "TRIGGER:PT15M\n";
					print "ACTION:DISPLAY\n";
					print "END:VALARM\n";
				print "END:VEVENT\n";
			print "END:VCALENDAR\n";
			exit;
		}
	} //if vcal

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux