From 21c12bfb323d5b078eb70c20be8ea18be081a936 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 25 Nov 2008 15:52:44 +0000 Subject: Added post-to-google-calendar through Zend (when installed) --- forum/utils/googlecalendar.php | 60 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 forum/utils/googlecalendar.php (limited to 'forum/utils/googlecalendar.php') diff --git a/forum/utils/googlecalendar.php b/forum/utils/googlecalendar.php new file mode 100644 index 0000000..e6305f8 --- /dev/null +++ b/forum/utils/googlecalendar.php @@ -0,0 +1,60 @@ +title . "\n" . $event->description)); + $start = date(DATE_ATOM, $event->starttime); + $end = date(DATE_ATOM, $event->starttime + $event->duration); + + // construct event object + // save to server + + try { + $gevent = $gcal->newEventEntry(); + $gevent->title = $gcal->newTitle($title); + $when = $gcal->newWhen(); + $when->startTime = $start; + $when->endTime = $end; + $gevent->when = array($when); + $gcal->insertEvent($gevent); + } catch (Zend_Gdata_App_Exception $e) { + echo "Error: " . $e->getResponse(); + } + + // echo 'Event successfully added!'; +} +?> -- cgit v1.2.3