public function __construct($params = null) { parent::__construct($params); $this->page = max(1, $this->getRequest()->get('page', 1, waRequest::TYPE_INT)); $this->search_params = $this->getRequest()->param(); $layout = $this->getRequest()->get('layout', 'default', waRequest::TYPE_STRING_TRIM); if ($layout == 'lazyloading' && $this->page > 1) { $this->is_lazyloading = true; } if (false && ($this->cache_time = $this->getConfig()->getOption('cache_time'))) { $params = $this->search_params; $params['page'] = $this->page; $this->cache_id = blogHelper::buildCacheKey($params); /** * @todo enable partial caching wait for Smarty 3.2.x * @link http://www.smarty.net/forums/viewtopic.php?p=75251 */ $this->cache = new waSerializeCache($this->cache_id, $this->cache_time); if ($this->cache->isCached()) { if ($post_ids = $this->cache->get()) { //get comments count per post $posts = array_fill_keys($post_ids, array()); blogHelper::extendPostComments($posts); $this->view->assign('posts', $posts); } } } if (!$this->is_lazyloading) { $this->setLayout(new blogFrontendLayout()); } $this->setThemeTemplate('stream.html'); return $this; }
public function __construct($params = null) { parent::__construct($params); $this->setThemeTemplate('post.html', waRequest::param('theme', 'default')); /** * @todo enable partial caching wait for Smarty 3.2.x * @link http://www.smarty.net/forums/viewtopic.php?p=75251 */ if (false && ($cache_time = $this->getConfig()->getOption('cache_time'))) { if ($post_url = waRequest::param('url', false, 'string_trim')) { $this->cache_id = 'url_' . $post_url; } elseif ($post_id = waRequest::param('id', 0, 'int')) { $this->cache_id = 'id_' . $post_id; } $this->cache_time = $cache_time; } }
public function display($clear_assign = false) { $result = parent::display($clear_assign); $result = str_replace('%replace-with-real-post-title%', '<span class="replace-with-real-post-title"></span>', $result); return $result; }