view->version = Application::VERSION; try { $feed = Zend_Feed::import('http://source.keyboard-monkeys.org/projects/communityid/news?format=atom'); } catch (Zend_Exception $e) { // feed import failed $obj = new StdClass(); $obj->link = array('href' => ''); $obj->title = $this->view->translate('Could not retrieve news items'); $obj->updated = ''; $obj->content = ''; $feed = array($obj); } $this->view->news = array(); $i = 0; foreach ($feed as $item) { if ($i++ >= self::NEWS_NUM_ITEMS) { break; } // ATOM uses , while RSS uses foo $item->link = $item->link['href']? $item->link['href'] : $item->link; if (strlen($item->content) > self::NEWS_CONTENT_MAX_LENGTH) { $item->content = substr($item->content, 0, self::NEWS_CONTENT_MAX_LENGTH) . '...
' . $this->view->translate('Read More') . ''; } $this->view->news[] = $item; } $this->_helper->actionStack('index', 'login', 'users'); } }