version = "1.0"; $this->build = "20130725"; self::setDefaults(); self::setConfig($config); } public function translateFeed($feed = null) { $data = $this->feedslist; if (is_readable($data)) { $data = json_decode(file_get_contents($data)); $this->feeds = $data; } else { return $this->feed_url; } return $this->feeds->$feed; } public function buildPage($page = 'list', $feed = null) { // Set our template path to shorthand $tpl = $this->templatepath; require_once $tpl . '/header.php'; $feed = $this->translateFeed($feed); $simplepie = new \SimplePie(); $simplepie->set_feed_url($feed); $simplepie->init(); $simplepie->handle_content_type(); $data['this'] = $this; switch ($page) { case 'show': $data['feed'] = $simplepie; break; case 'list': default: $data['feeds'] = $this->feedslist; break; } if (is_readable($tpl . DIRECTORY_SEPARATOR . $page . '.php')) { require_once $tpl . DIRECTORY_SEPARATOR . $page . '.php'; } require_once $tpl . '/footer.php'; return true; } public function getFeedTitle($feed = null) { if (empty($feed)) { return 'Feed "'.$feed.'" not known.'; } else { $feed = $this->translateFeed($feed); $simplepie = new \SimplePie(); $simplepie->set_feed_url($feed); $simplepie->init(); $simplepie->handle_content_type(); return $simplepie->get_title(); } return false; } public function lnk($link = null, $text = '') { return '' . $text . ''; } public function lst($text = null) { return '