/** * Build cache * * Exceptions of the exist method continue here * So cache generation is stopped if its not a landing page or * when we are on an album comments page and also when a form * has been submitted * * @access public * @param string [$action] Can be "s" or "e" (meaning start or end) */ public function build($action) { if (self::ACTIVATED === false) { return false; } if ((!empty($this->_post) || count($this->_get) > 1) && !in_array(VGet::ctl(), array('search', 'albums'))) { return true; } elseif (VGet::ctl() == 'albums' && VGet::comments()) { return true; } if ($action == 's') { ob_start(); } elseif ($action == 'e') { $content = ob_get_contents(); ob_end_flush(); $cache = new File(); $cache->_content = $content; $cache->save($this->_url); } else { throw new Exception('Unknown cache command'); } }
/** * Display page content * * @access public */ public function display_content() { if (!empty($this->_album) && VGet::comments(false) !== false) { $this->display_comments(); } elseif (!empty($this->_album)) { $this->display_album(); } else { $this->display_albums(); } }