public function hookLeftColumn($params) { if (Module::isInstalled('smartblog') != 1) { $this->smarty->assign(array('smartmodname' => $this->name)); return $this->display(__FILE__, 'views/templates/front/install_required.tpl'); } else { if (!$this->isCached('smartblogcategories.tpl', $this->getCacheId())) { $view_data = array(); $id_lang = $this->context->language->id; $BlogCategory = new BlogCategory(); $categories = $BlogCategory->getCategory(1, $id_lang); $i = 0; foreach ($categories as $category) { $categories[$i]['count'] = $BlogCategory->getPostByCategory($category['id_smart_blog_category']); $i++; } $this->smarty->assign(array('categories' => $categories)); } return $this->display(__FILE__, 'views/templates/front/smartblogcategories.tpl', $this->getCacheId()); } }
public function smartblogcategoriesHookLeftColumn($params) { if (!$this->isCached('plugins/smartblogcategories.tpl')) { $view_data = array(); $id_lang = $this->context->language->id; $BlogCategory = new BlogCategory(); $categories = $BlogCategory->getCategory(1, $id_lang); $i = 0; foreach ($categories as $category) { $categories[$i]['count'] = $BlogCategory->getPostByCategory($category['id_smart_blog_category']); $i++; } $protocol_link = Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://'; $protocol_content = (isset($useSSL) and $useSSL and Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; $smartbloglink = new SmartBlogLink($protocol_link, $protocol_content); $this->smarty->assign(array('smartbloglink' => $smartbloglink, 'categories' => $categories)); } return $this->display(__FILE__, 'views/templates/front/plugins/smartblogcategories.tpl'); }