Example #1
0
 function execute($options = null)
 {
     $rss = new AMP_RSSWriter(AMP_SITE_URL, AMP_SITE_NAME, AMP_SITE_META_DESCRIPTION);
     $rss->useModule('ev', 'http://purl.org/rss/1.0/modules/event/');
     $rss->useModule('vCard', 'http://www.w3.org/2001/vcard-rdf/3.0#');
     $rss->useModule('geo', 'http://www.w3.org/2003/01/geo/wgs84_pos#');
     $rss->useModule('content', 'http://purl.org/rss/1.0/modules/content/');
     if (isset($options['calid']) && ($id = $options['calid'])) {
         $timestamp = $this->add_event_rss($rss, $id);
     } else {
         $this->calendar->doAction('Search');
         $timestamp = $this->add_eventlist_rss($rss, $this->calendar->events);
     }
     $rss->lastModified($timestamp);
     while (@ob_end_clean()) {
     }
     $rss->execute();
     exit;
 }
Example #2
0
 function &getDisplay()
 {
     $feed_name = ($name = $this->getTitle()) ? $name : AMP_SITE_NAME;
     $this->feed_metaData['lastBuildDate'] = date('D, d M Y  H:i:s');
     $this->feed_metaData['generator'] = 'Activist Mobilization Platform ' . AMP_SYSTEM_VERSION_ID;
     if (!$this->sourceSet->isReady()) {
         return false;
     }
     $display = new AMP_RSSWriter(AMP_SITE_URL, $feed_name, AMP_SITE_META_DESCRIPTION, $this->feed_metaData);
     $articleSet = $this->sourceSet->instantiateItems($this->sourceSet->getArray(), $this->sourceItem_class);
     foreach ($articleSet as $article) {
         $articleMeta = array();
         $url = $article->getURL();
         if (strpos($url, "http://") === FALSE) {
             $url = AMP_SITE_URL . $url;
         }
         $articleMeta['description'] = $this->_makeDescription($article);
         if ($itemdate = $article->getItemDate()) {
             $articleMeta['pubDate'] = date('r', strtotime($itemdate));
         } else {
             $articleMeta['pubDate'] = date('r');
         }
         $display->addItem($url, $article->getTitle(), $articleMeta);
     }
     return $display;
 }