/** * Generate List of Posts for calendar * * @return HTML presentation of data */ function GenPostCalendarDay() { // date=2009/3/18 $sCode = MsgBox(_t('_Empty')); $sDate = bx_get('date'); $aDate = explode('/', $sDate); $iValue1 = (int) $aDate[0]; $iValue2 = (int) $aDate[1]; $iValue3 = (int) $aDate[2]; if ($iValue1 > 0 && $iValue2 > 0 && $iValue3 > 0) { $this->iPostViewType = 4; $sCaption = _t('_bx_blog_caption_browse_by_day') . getLocaleDate(strtotime("{$iValue1}-{$iValue2}-{$iValue3}"), BX_DOL_LOCALE_DATE_SHORT); if (!$this->isAllowedBlogsPostsBrowse()) { return DesignBoxContent($sCaption, $this->_oTemplate->displayAccessDenied(), 1); } require_once $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'; $oTmpBlogSearch = new BxBlogsSearchUnit($this); $oTmpBlogSearch->PerformObligatoryInit($this, $this->iPostViewType); $oTmpBlogSearch->aCurrent['paginate']['perPage'] = $this->_oConfig->getPerPage(); $oTmpBlogSearch->aCurrent['sorting'] = 'last'; $oTmpBlogSearch->aCurrent['restriction']['calendar-min'] = array('value' => "UNIX_TIMESTAMP('{$iValue1}-{$iValue2}-{$iValue3} 00:00:00')", 'field' => 'PostDate', 'operator' => '>=', 'no_quote_value' => true); $oTmpBlogSearch->aCurrent['restriction']['calendar-max'] = array('value' => "UNIX_TIMESTAMP('{$iValue1}-{$iValue2}-{$iValue3} 23:59:59')", 'field' => 'PostDate', 'operator' => '<=', 'no_quote_value' => true); $sCode = $oTmpBlogSearch->displayResultBlock(); $sCode = $oTmpBlogSearch->aCurrent['paginate']['totalNum'] == 0 ? MsgBox(_t('_Empty')) : $sCode; $sRequest = BX_DOL_URL_ROOT . 'modules/boonex/blogs/blogs.php?action=show_calendar_day&date=' . "{$iValue1}/{$iValue2}/{$iValue3}" . '&page={page}&per_page={per_page}'; $oTmpBlogSearch->aCurrent['paginate']['page_url'] = $sRequest; $sPagination = $oTmpBlogSearch->showPagination3(); } $sRetHtmlVal = <<<EOF <div class="bx-def-bc-padding"> {$sCode} </div> {$sPagination} EOF; return DesignBoxContent($sCaption, $sRetHtmlVal, 1); }
/** * Generate List of Posts for calendar * * @return HTML presentation of data */ function GenPostCalendarDay() { // date=2009/3/18 $sCode = MsgBox(_t('_Empty')); $sDate = bx_get('date'); $aDate = explode('/', $sDate); $iValue1 = (int) $aDate[0]; $iValue2 = (int) $aDate[1]; $iValue3 = (int) $aDate[2]; if ($iValue1 > 0 && $iValue2 > 0 && $iValue3 > 0) { $this->iPostViewType = 4; $sCaption = _t('_bx_blog_caption_browse_by_day') . getLocaleDate(strtotime("{$iValue1}-{$iValue2}-{$iValue3}"), BX_DOL_LOCALE_DATE_SHORT); if (!$this->isAllowedBlogsPostsBrowse()) { return DesignBoxContent($sCaption, $this->_oTemplate->displayAccessDenied(), 1); } require_once $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'; $oTmpBlogSearch = new BxBlogsSearchUnit($this); $oTmpBlogSearch->PerformObligatoryInit($this, $this->iPostViewType); $oTmpBlogSearch->aCurrent['paginate']['perPage'] = (int) getParam('blog_step'); $oTmpBlogSearch->aCurrent['sorting'] = 'last'; $oTmpBlogSearch->aCurrent['restriction']['calendar-min'] = array('value' => "UNIX_TIMESTAMP('{$iValue1}-{$iValue2}-{$iValue3} 00:00:00')", 'field' => 'PostDate', 'operator' => '>=', 'no_quote_value' => true); $oTmpBlogSearch->aCurrent['restriction']['calendar-max'] = array('value' => "UNIX_TIMESTAMP('{$iValue1}-{$iValue2}-{$iValue3} 23:59:59')", 'field' => 'PostDate', 'operator' => '<=', 'no_quote_value' => true); $sCode = $oTmpBlogSearch->displayResultBlock(); $sCode = $oTmpBlogSearch->aCurrent['paginate']['totalNum'] == 0 ? MsgBox(_t('_Empty')) : $sCode; // Prepare link to pagination if ($this->bUseFriendlyLinks == false || $this->bAdminMode == true) { //old variant $sRequest = bx_html_attribute($_SERVER['PHP_SELF']) . '?action=top_posts&page={page}&per_page={per_page}'; } else { $sRequest = BX_DOL_URL_ROOT . 'blogs/top_posts/{per_page}/{page}'; } // End of prepare link to pagination $oTmpBlogSearch->aCurrent['paginate']['page_url'] = $sRequest; $sPagination = $oTmpBlogSearch->showPagination3(); } $sRetHtmlVal = <<<EOF <div class="dbContent"> \t{$sCode} </div> {$sPagination} EOF; return DesignBoxContent($sCaption, $sRetHtmlVal, 1); }