/** * Blogs block for index page (as PHP function). List of latest posts. * * @return html of last blog posts */ function serviceBlogsIndexPage($bShortPgn = TRUE, $iPerPage = 0) { if (!$this->isAllowedBlogsPostsBrowse()) { return $this->_oTemplate->displayAccessDenied(); } require_once $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'; $oBlogSearch = new BxBlogsSearchUnit(); $oBlogSearch->PerformObligatoryInit($this, 4); $oBlogSearch->aCurrent['paginate']['perPage'] = $iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage('index'); $aVis = array(BX_DOL_PG_ALL); if ($this->getUserId()) { $aVis[] = BX_DOL_PG_MEMBERS; } $oBlogSearch->aCurrent['restriction']['allow_view']['value'] = $aVis; $sCode = $oBlogSearch->displayResultBlock(); $sPostPagination = $oBlogSearch->showPagination2(false, $this->genBlogLink('home'), $bShortPgn); if ($oBlogSearch->aCurrent['paginate']['totalNum'] > 0) { $sCodeBlock = $sCode; return array($sCodeBlock, false, $sPostPagination); } }
/** * Blogs block for index page (as PHP function). List of latest posts. * * @return html of last blog posts */ function serviceBlogsIndexPage() { if (!$this->isAllowedBlogsPostsBrowse()) { return $this->_oTemplate->displayAccessDenied(); } require_once $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'; $oBlogSearch = new BxBlogsSearchUnit(); $oBlogSearch->PerformObligatoryInit($this, 4); $oBlogSearch->aCurrent['paginate']['perPage'] = (int) getParam("max_blogs_on_home"); $sCode = $oBlogSearch->displayResultBlock(); $sPostPagination = $oBlogSearch->showPagination2(); if ($oBlogSearch->aCurrent['paginate']['totalNum'] > 0) { $sCodeBlock = <<<EOF <div class="blog_posts_wrapper">{$sCode}</div> EOF; $aMenu = $oBlogSearch->displayMenu(); return array($sCodeBlock, $aMenu[0], $sPostPagination); } }