Example #1
0
 public function initContent()
 {
     parent::initContent();
     if (!empty($this->id_post) && is_numeric($this->id_post)) {
         $this->displayPost();
     } else {
         $this->displayList();
     }
     $img_path = rtrim($this->conf['img_save_path'], '/') . '/';
     $this->context->smarty->assign(array('img_path' => _PS_BASE_URL_ . __PS_BASE_URI__ . $img_path, 'blog_conf' => $this->conf, 'logged' => $this->context->customer->isLogged(), 'customerName' => $this->context->customer->logged ? $this->context->customer->firstname : false, 'listLink' => $this->list_link, 'posts_rss_url' => BlogPost::linkRss()));
     // Assign template vars related to the category + execute hooks related to the category
     $this->assignCategory();
 }
 private function calculHookCommon($params)
 {
     $pref = array_merge(Psblog::getPreferences(), self::getPreferences());
     $img_path = rtrim($pref['img_save_path'], '/') . '/';
     $list = BlogPost::listPosts(true, true, 0, intval($pref['block_limit_items']));
     if ($list) {
         $i = 0;
         foreach ($list as $val) {
             $list[$i]['link'] = BlogPost::linkPost($val['id_blog_post'], $val['link_rewrite'], $val['id_lang']);
             $i++;
         }
     }
     $this->smarty->assign(array('last_post_list' => $list, 'blog_conf' => $pref, 'linkPosts' => BlogPost::linkList(), 'img_path' => _PS_BASE_URL_ . __PS_BASE_URI__ . $img_path, 'posts_rss_url' => BlogPost::linkRss()));
     return true;
 }
Example #3
0
 public function initContent()
 {
     parent::initContent();
     if (!is_null($this->id_news) && is_numeric($this->id_news)) {
         $this->displayPost();
     } else {
         $this->displayList();
     }
     $this->context->smarty->assign(array('img_path' => _THEME_NEWS_DIR_, 'blog_conf' => $this->conf, 'logged' => $this->context->customer->isLogged(), 'customerName' => $this->context->customer->logged ? $this->context->customer->firstname : false, 'listLink' => $this->list_link, 'newss_rss_url' => BlogPost::linkRss()));
     // Assign template vars related to the category + execute hooks related to the category
     $this->assignCategory();
 }