getPageById($row['idPage']); $row['url'] = BASE_URL . '/' . $page['fullAlias']; break; case 'link': break; case 'file': $row['url'] = BASE_URL . '/userfiles/files/' . rawurlencode($row['file']); break; case 'none': $row['url'] = ''; break; default: break; } return $this; } public function getFeedData() { $feed = array(); $feed['title'] = SITE_NAME; $feed['link'] = BASE_URL_LANGUAGE . '/' . CURRENT_PAGE; $feed['published'] = gmdate('D, d M Y H:i:s'); $feed['charset'] = 'utf-8'; $feed['language'] = 'en-us'; $maxItems = (int) $this->maxFeedItemCount; $list = $this->getList(array('order' => 'date DESC', 'limit' => $maxItems)); foreach ($list as $item) { $feedItem = array( 'title' => $item['title'], 'link' => BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL . '/view/' . $item['id'], 'lastUpdate' => strtotime($item['date']) ); if (empty($item['introduction'])) { $feedItem['description'] = $item['content']; } else { $feedItem['description'] = htmlspecialchars($item['introduction']) . ' ' . '[Read more]'; } $feed['entries'][] = $feedItem; } return $feed; } public function getExistingYears() { if (null === $this->_existsYears) { $select = $this->_db->select(); $select->from($this->_getPair($this->_tableAlias), 'DISTINCT YEAR(date)'); $select->where("(`expiredDate` > CURDATE()) OR `expiredDate` IS null"); $select->where("(`date` <= CURDATE()) OR `date` IS null"); $select->order('date DESC'); $this->_existsYears = $this->_db->fetchCol($select); } return $this->_existsYears; } public function filterByDate() { $select = $this->getListSelect(); $select->where("(`expiredDate` > CURDATE()) OR `expiredDate` IS null"); $select->where("(`date` <= CURDATE()) OR `date` IS null"); return $this; } public function filterByYear($year) { $select = $this->getListSelect(); $select->where(" `date` LIKE ?", "{$year}-%"); return $this; } public function getSearchList(array $providerOptions) { $this->filterByDate(); return parent::getSearchList($providerOptions); } public function filterPWXItems() { $this->getListSelect()->where('isPwx = ?', 'y'); return $this; } }