From: Rasmus V. <oo...@ik...> - 2005-11-09 11:58:56
|
Hi, I'd like to suggest a minor little change in the script for publishing iCal files without webDAV support as iCal suggest to distribute the URL to the publishing script when a user publishes his/ her calendar. If the GET-method would serve the actual ICS-file content then users would be able to let iCal email URL:s directly. Something like this: /* GET requests to output calendar file content */ if($_SERVER['REQUEST_METHOD'] == 'GET') { $calendar_file = urldecode($calendar_path.substr($_SERVER ['REQUEST_URI'] , ( strrpos($_SERVER['REQUEST_URI'], '/') + 1) )) ; // read from file if($fp = fopen($calendar_file,'r')) { $data = fread($fp, filesize($calendar_file)); fclose($fp); header("Content-type: text/calendar"); echo $data; } else { logmsg( 'couldnt open file '.$calendar_file); } return; } Just instead of redirecting the request to the main calendar, this would make phpicalendar completely transparent to iCal users. Also if the calendar name includes a space the filename needs to be urldecoded (unpublishing needs this as well or the filename will not be deleted). Anyway, thanks for an excellent package! .raz |