From 309dbfc09b91c5a389d5bf040d78485487a3e51b Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 19 Nov 2003 22:17:24 +0000 Subject: Changed line endings to UNIX. --- calendars/publish.php | 136 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 1 deletion(-) (limited to 'calendars') diff --git a/calendars/publish.php b/calendars/publish.php index fb6a025..9a75e99 100644 --- a/calendars/publish.php +++ b/calendars/publish.php @@ -1 +1,135 @@ - $v) { if(strstr($v,'X-WR-CALNAME:')) { $arr = explode(':',$v); $calendar_name = trim($arr[1]); break; } } $calendar_name = isset($calendar_name) ? $calendar_name : 'default'; // write to file if($fp = fopen($calendar_path.$calendar_name.'.ics','w+')) { fputs($fp, $data, strlen($data) ); fclose($fp); } else { logmsg( 'couldnt open file '.$calendar_path.$calendar_name.'.ics' ); } } } // for logging function logmsg($str){ if(defined('PHPICALENDAR_LOG_PUBLISHING') && PHPICALENDAR_LOG_PUBLISHING == 1) { if($fp = fopen('publish_log.txt','a+')) { $str .= "\n"; fputs($fp, $str, strlen($str) ); fclose($fp); } } } ?> \ No newline at end of file + $v) + { + if(strstr($v,'X-WR-CALNAME:')) + { + $arr = explode(':',$v); + $calendar_name = trim($arr[1]); + break; + } + } + + $calendar_name = isset($calendar_name) ? $calendar_name : 'default'; + + // write to file + if($fp = fopen($calendar_path.$calendar_name.'.ics','w+')) + { + fputs($fp, $data, strlen($data) ); + fclose($fp); + } + else + { + logmsg( 'couldnt open file '.$calendar_path.$calendar_name.'.ics' ); + } + } +} + +// for logging +function logmsg($str){ + if(defined('PHPICALENDAR_LOG_PUBLISHING') && PHPICALENDAR_LOG_PUBLISHING == 1) + { + if($fp = fopen('publish_log.txt','a+')) + { + $str .= "\n"; + fputs($fp, $str, strlen($str) ); + fclose($fp); + } + } +} +?> -- cgit v1.2.3