/** * Class constructor * * @access public */ public function __construct() { parent::__construct(); $this->_key = VGet::website(); $this->_slug = VGet::slug(); $this->get_prefs(); $this->get_post(); $this->build_title(); $this->create(); }
/** * Retrieve the timeline of a website * * @access private */ private function get_timeline() { try { $site = VGet::website(); if (!empty($site) || $site === 0) { $this->_key = VGet::website(); } else { $data = $this->_prefs->_data['timeline']; reset($data); $this->_key = key($data); } if (empty($this->_prefs->_data['timeline'])) { throw new Exception('No website in your preferences!'); } if (!isset($this->_prefs->_data['timeline'][$this->_key])) { throw new Exception('Requested website not found!'); } $url = $this->_prefs->_data['timeline'][$this->_key]['url'] . 'admin/index.php?ns=rpc&ctl=timeline&since=' . $this->_since; $curl = new Curl($url); $this->_timeline = json_decode($curl->_content, true); } catch (Exception $e) { $this->_action_msg = ActionMessages::custom_wrong($e->getMessage()); } }