Hi all,

This is a very erratic issue,
on my local site, always can read event list rightly.
but on my server site, somtimes can read event list, somtimes got
error:
" Warning: Invalid argument supplied for foreach()... ".

some code:

 // load google data config
    require_once '../includes/google/gconfig.php';

    // generate query to get event list
    $query = $gcal->newEventQuery();
    $query->setMaxresults($g["google_cal_maxresult_admin"]);
    $query->setUser($user);
    $query->setVisibility($g["google_cal_visibility"]);
    $query->setProjection($g["google_cal_projection"]);
    $query->setOrderby('starttime');

    $default_year = date('Y');
    $default_month = date('m');
    if(isset($_REQUEST["select_year"]))
                $default_year = $_REQUEST["select_year"];

   if(isset($_REQUEST["select_month"]))
      $default_month = $_REQUEST["select_month"];

    $startDate = $default_year.'-'.$default_month.'-01';
    $endDate = $default_year.'-'.$default_month.'-31';

    $query->setStartMin($startDate);
    $query->setStartMax($endDate);


    // get and parse calendar feed
    try {
      $feed = $gcal->getCalendarEventFeed($query);
    } catch (Zend_Gdata_App_Exception $e) {
      echo "Error: " . $e->getResponse();
    }

  echo $feed->title;
  foreach ($feed as $event) {
    echo stripslashes($event->title);
  }


 I press F5, sometimes got right date, sometimes got error:
Warning: Invalid argument supplied for foreach()... ".


Thanks,
Asan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to