![]() |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
i see that the question is reccurent.
i have found a way to have an answer. using the calendar link : Code:
// get the calendars list feed $gdataCal = new Zend_Gdata_Calendar($client); $calFeed = $gdataCal->getCalendarListFeed(); // get the calendar url (0 is first one, then 1 is second one etc...) $url = $calFeed[1]->link[0]->href; // ask for feeds $events = $gdataCal->getCalendarEventFeed($url); .... Code:
// get the calendars list feed
$gdataCal = new Zend_Gdata_Calendar($client);
$calFeed = $gdataCal->getCalendarListFeed();
// get the calendar user ( $cals[1] for the first calendar... )
$id = $cals[1]->id->text;
$user = str_replace(Zend_Gdata_Calendar::CALENDAR_FEED_URI.'/default/', "", $id); // kind of dirty way to get the info, nut it lokks working :)
// ask for feeds
$query->setUser($user);
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setFutureevents('true');
$events = $gdataCal->getCalendarEventFeed($query);
......
Last edited by wene; 08-23-2007 at 04:04 AM. |
|
|||
|
There is a cleaner way to use queries. Get the URL, and pass it as a parameter in the newEventQuery() constructor. The trick is to then set user, projection, and visibility to NULL or they will be set twice (they are already in the URL)
See the API docs - specifically the constructor $gdataCal = new Zend_Gdata_Calendar($client); $calFeed = $gdataCal->getCalendarListFeed(); // get all calendars the user has created Code:
foreach ($calFeed as $calendar) {
$url = $calendar->link[0]->href;
$query = $gdataCal->newEventQuery( $url );
$query->setUser(NULL);
$query->setVisibility(NULL);
$query->setProjection(NULL);
$query->setOrderby('starttime');
$query->setStartMin($startDate);
$query->setStartMax($endDate);
$eventFeed = $gdataCal->getCalendarEventFeed($query);
//… do something with $eventFeed
}
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| Designed by: Miner Skinz |
Powered by vBulletin® Version 3.8.4 Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Search Engine Friendly URLs by vBSEO 3.1.0 |
![]() |