date_format = $format; return TRUE; } /** * Get date format * * @return string */ public function getDateFormat() { return $this->date_format; } /** * Set path for RSS feed * * @param string $url */ public function addPath($path = "") { if (is_string($path)) { $this->path[] = $path; $this->_setFeeds($path); return TRUE; } return FALSE; } /** * Get path for RSS feed * * @return string */ public function getPath() { return $this->path; } /** * Set RSS link * * @param string $url */ public function setRssLink($url = "") { if (is_string($url)) { $this->rss_link = $url; return TRUE; } return FALSE; } /** * Get RSS link * * @param string $html * * @return string */ public function getRssLink() { return $this->rss_link; } /** * Get RSS link * * @param string $html * * @return string */ public function getRssLinkHTML() { $url = $this->getRssLink(); if (empty($url)) { return ""; } return ' Subscribe to our RSS-feed'; } /** * Set Press Release Flag * * @param string $flag */ public function setPressRelease($flag = FALSE) { if (is_bool($flag)) { $this->press_release = $flag; return TRUE; } return FALSE; } /** * Get Press Release Flag * * @return string */ public function getPressRelease() { return $this->press_release; } /** * Set item count * * @param number $count */ public function setCount($count = 4) { if (is_numeric($count)) { $this->count = $count; return TRUE; } return FALSE; } /** * Get item count * * @return number $count */ public function getCount() { return $this->count; } /** * Get page number * * @return string */ public function getPage() { if (!empty($_GET['page']) && is_numeric($_GET['page'])) { return $_GET['page']; } return 1; } /** * Set description limit * * @param number $limit */ public function setLimit($limit = 200) { if (is_numeric($limit)) { $this->limit = $limit; return TRUE; } return FALSE; } /** * Get description limit * * @return number $limit */ public function getLimit() { return $this->limit; } /** * Set view_more link * * @param string $url * @param string $caption * @param string $prefix */ public function setViewMoreLink($url = "", $caption = 'View all', $prefix = '> ') { if (is_string($url) && is_string($caption) && is_string($prefix)) { $this->view_more = array( 'url' => $url, 'caption' => $caption, 'prefix' => $prefix ); return TRUE; } return FALSE; } /** * Set Match Height * * @param bool $match_height */ public function setMatchHeight($match_height) { if (is_bool($match_height)) { $this->match_height = $match_height; } } /** * Get Match Height * * @return bool */ public function getMatchHeight() { return $this->match_height; } /** * Get ViewMore link * * @return string */ public function getViewMoreLink() { $view_more = $this->view_more; if (empty($view_more['url']) || empty($view_more['caption'])) { return array(); } if (!isset($view_more['prefix'])) { $view_more['prefix'] = ""; } return $view_more; } /** * Get view_more link (HTML) * * @return string */ public function getViewMoreLinkHTML() { $view_more = $this->getViewMoreLink(); if (empty($view_more)) { return ""; } return $view_more['prefix'] . '' . $view_more['caption'] . ''; } /** * Html Output * * @return string */ public function output() { if (!$this->_parseFeeds()) { return '
This news feed is currently empty. Please try again later.
'; } $output = ''; if (!empty($this->items)) { $output .= '' . $item['date'] . '
'; $output .= '' . $item['description'] . '
'; } $output .= '