Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type=button onclick='document.location="index.php?csinal=1"' value='gomb'>
- <?php
- $path = '/home/a3872568/public_html/Zend/library';
- set_include_path(get_include_path() . PATH_SEPARATOR . $path);
- require_once '/home/a3872568/public_html/Zend/library/Zend/Loader.php';
- Zend_Loader::loadClass('Zend_Gdata');
- Zend_Loader::loadClass('Zend_Gdata_AuthSub');
- Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
- Zend_Loader::loadClass('Zend_Gdata_Calendar');
- $user = 'myaccount@gmail.com';
- $pass = 'mypassword';
- $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
- $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
- function createEvent ($client, $title = 'Tennis with Beth',
- $desc='Meet for a quick lesson', $where = 'On the courts',
- $startDate = '2011-06-30', $startTime = '10:00pm',
- $endDate = '2011-06-30)', $endTime = '10:06pm', $tzOffset = '+01')
- {
- $gdataCal = new Zend_Gdata_Calendar($client);
- $newEvent = $gdataCal->newEventEntry();
- $newEvent->title = $gdataCal->newTitle($title);
- $newEvent->where = array($gdataCal->newWhere($where));
- $newEvent->content = $gdataCal->newContent("$desc");
- $when = $gdataCal->newWhen();
- $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
- $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
- $newEvent->when = array($when);
- // Upload the event to the calendar server
- // A copy of the event as it is recorded on the server is returned
- $createdEvent = $gdataCal->insertEvent($newEvent);
- return $createdEvent->id->text;
- }
- if(isset($_GET[csinal]))
- createEvent($client, 'New Years Party',
- 'Ring in the new year with Kim and I',
- 'Our house',
- '2011-06-30', '10:00pm', '2011-06-30', '10:06pm', '+01' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement