日历事件列表显示已删除的事件.我怎么能把它们藏起来


Calendar event list shows deleted events. How can i hide them?

在我的主页上,我显示了在谷歌日历中创建的事件列表。请参阅:我的主页->事件列表

现在我已经从日历中删除了活动。这些在常规的谷歌日历中不再可见,但现在它们已经出现在我的活动列表中。

这是我的事件列表的脚本:

<a href="http://www.takenosono.de/termine.phtml">
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
$service = new Zend_Gdata_Calendar();
$query = $service->newEventQuery();
$query->setUser('mymagiccookie%40group.calendar.google.com');
$query->setVisibility('public');
$query->setProjection('full');
$query->setStartMin(date('Y-n-j'));
$query->setStartMax(date('Y-n-j', time() + (60*60 *24*60)));
$query->setOrderby ('starttime');
$query->setSortOrder('a');
//$query->setFutureevents(true);
$eventFeed = $service->getCalendarEventFeed($query);
echo "<h3>Besondere Termine:</h3><h6>";
setlocale(LC_TIME, 'deu', 'de_DE.UTF-8');
foreach ($eventFeed as $event) {
echo "" . $event->title->text .   "'n";
// Zend_Gdata_App_Extensions_Title->__toString() is defined, so the
// following will also work on PHP >= 5.2.0
//echo "'t<li>" . $event->title .  " (" . $event->id . ")'n";
foreach ($event->when as $when) {
$startTime = $when->startTime;
$endTime = $when->endTime;
echo "<br>" . strftime("%a %d. ", strtotime( $startTime )); 
if (strftime("%d.", strtotime( $endTime )) != strftime("%d.", strtotime( $startTime ))):
echo strftime("bis  %d. ", strtotime( $endTime ));
endif;
echo strftime("%b", strtotime( $endTime ));
if (strftime("%d.", strtotime( $endTime )) == strftime("%d.", strtotime( $startTime ))):
echo strftime(" - %H:%M", strtotime( $startTime ));
endif;
echo "<br><br><img src='picture/Trenner.gif'><br>";
 }
 }
 echo "mehr: hier klicken...";
 ?>
</a>

问题是:我该怎么做才能使删除的事件不再显示在此列表中?有人能帮忙吗?

只需像这样使用事件状态:

foreach ($eventFeed as $event) {
    if ($event->getEventStatus() != 'http://schemas.google.com/g/2005#event.canceled')
    {
        //your foreach code
    }
}