コード例 #1
0
ファイル: single.php プロジェクト: evgrishin/se1614
 public function initContent()
 {
     $this->context->controller->addJqueryPlugin('cooki-plugin');
     $this->context->controller->addJqueryPlugin('cookie-plugin');
     $this->context->controller->addjqueryPlugin('fancybox');
     $this->context->controller->addCSS(array(_THEME_CSS_DIR_ . 'category.css' => 'all', _THEME_CSS_DIR_ . 'product_list.css' => 'all'));
     parent::initContent();
     $this->SimpleBlogPost->increaseViewsNb();
     /**
     
             Support for SmartShortcode module from CodeCanyon
     
             **/
     if (file_exists(_PS_MODULE_DIR_ . 'smartshortcode/smartshortcode.php')) {
         require_once _PS_MODULE_DIR_ . 'smartshortcode/smartshortcode.php';
     }
     if (Module::isEnabled('smartshortcode')) {
         $smartshortcode = new SmartShortCode();
         $this->SimpleBlogPost->content = $smartshortcode->parse($this->SimpleBlogPost->content);
     }
     $this->context->smarty->assign('post', $this->SimpleBlogPost);
     $this->context->smarty->assign('is_16', version_compare(_PS_VERSION_, '1.6.0', '>=') === true ? true : false);
     $this->context->smarty->assign('gallery_dir', _MODULE_DIR_ . 'ph_simpleblog/galleries/');
     // Comments
     if ($this->SimpleBlogPost->allow_comments == 1) {
         $allow_comments = true;
     } elseif ($this->SimpleBlogPost->allow_comments == 2) {
         $allow_comments = false;
     } elseif ($this->SimpleBlogPost->allow_comments == 3) {
         $allow_comments = Configuration::get('PH_BLOG_COMMENT_ALLOW');
     } else {
         $allow_comments = false;
     }
     $this->context->smarty->assign('allow_comments', $allow_comments);
     if ($allow_comments) {
         $comments = SimpleBlogComment::getComments($this->SimpleBlogPost->id_simpleblog_post);
         $this->context->smarty->assign('comments', $comments);
     }
     if (Configuration::get('PH_BLOG_DISPLAY_RELATED')) {
         $related_products = SimpleBlogPost::getRelatedProducts($this->SimpleBlogPost->id_product);
         $this->context->smarty->assign('related_products', $related_products);
     }
     $this->setTemplate('single.tpl');
 }