本文整理汇总了PHP中BxDolPaginate::getMobilePaginate方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolPaginate::getMobilePaginate方法的具体用法?PHP BxDolPaginate::getMobilePaginate怎么用?PHP BxDolPaginate::getMobilePaginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolPaginate
的用法示例。
在下文中一共展示了BxDolPaginate::getMobilePaginate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GenPostListMobile
/**
* Generate List of Posts for mobile frontend
*
* @param $iAuthor - display posts of provided user only
* @param $sMode - display all latest[default], featured or top posts
* @return HTML presentation of data
*/
function GenPostListMobile($iAuthor = 0, $sMode = false)
{
if ($this->_iVisitorID) {
// some workaround for mobile apps, to force login
bx_login($this->_iVisitorID);
}
bx_import('BxDolMobileTemplate');
$oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
$oMobileTemplate->pageStart();
echo $oMobileTemplate->addCss('blogs_common.css', 1);
$iPerPage = 10;
$iPage = (int) bx_get('page');
if ($iPage < 1) {
$iPage = 1;
}
$this->iPostViewType = 4;
$sOrder = 'last';
$sMobileWrapper = 'mobile_row.html';
$aParams = array();
switch ($sMode) {
case 'post':
$aViewingPostInfo = $this->_oDb->getPostInfo((int) bx_get('id'));
if (!$this->oPrivacy->check('view', (int) bx_get('id'), $this->_iVisitorID) || !$this->isAllowedBlogPostView($aViewingPostInfo['OwnerID'], true)) {
$oMobileTemplate->displayAccessDenied($sCaption);
return;
}
$this->iPostViewType = 3;
$aParams = array('id' => (int) bx_get('id'));
$sCaption = _t('_bx_blog_post_view');
$sMobileWrapper = 'mobile_box.html';
echo $oMobileTemplate->addCss('blogs.css', 1);
break;
case 'user':
$aParams = array('id' => (int) bx_get('id'));
$sCaption = _t('_bx_blog_Members_blog', getNickName((int) bx_get('id')));
break;
case 'featured':
$sCaption = _t('_bx_blog_Featured_Posts');
break;
case 'top':
$sOrder = 'top';
$sCaption = _t('_bx_blog_Top_Posts');
break;
case 'popular':
$sOrder = 'popular';
$sCaption = _t('_bx_blog_Popular_Posts');
break;
case 'last':
default:
$sMode = 'last';
$sCaption = _t('_bx_blog_Latest_posts');
}
if ('post' != $sMode && !$this->isAllowedBlogsPostsBrowse()) {
$oMobileTemplate->displayAccessDenied($sCaption);
return;
}
$oTmpBlogSearch = false;
$sCode = $this->_GenPosts($this->iPostViewType, $iPerPage, $sMode, $aParams, $sOrder, $oBlogSearchResults, $sMobileWrapper);
if (!$sCode || $oBlogSearchResults->aCurrent['paginate']['totalNum'] == 0) {
$oMobileTemplate->displayNoData($sCaption);
return;
}
echo $sCode;
if ($sMode != 'post') {
bx_import('BxDolPaginate');
$oPaginate = new BxDolPaginate(array('page_url' => $this->genBlogSubUrl() . '?action=mobile&mode=' . $sMode . '&page={page}', 'count' => $oBlogSearchResults->aCurrent['paginate']['totalNum'], 'per_page' => $iPerPage, 'page' => $iPage));
echo $oPaginate->getMobilePaginate();
}
$oMobileTemplate->pageCode($sCaption, false);
}
示例2: actionMobileLatestEntries
/**
* View list of latest entries for mobile app
*/
function actionMobileLatestEntries($iPage = 1)
{
$sUri = $this->_oConfig->getUri();
$iPerPage = 10;
$iPage = (int) $iPage;
if ($iPage < 1) {
$iPage = 1;
}
bx_import('BxDolMobileTemplate');
$oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
$oMobileTemplate->pageStart();
$sCaption = _t('_' . $sUri . '_bcaption_latest');
$aParams = array('sample_type' => 'archive', 'sample_params' => '', 'viewer_type' => $this->_oTextData->getViewerType(), 'start' => ($iPage - 1) * $iPerPage, 'count' => $iPerPage, 'filter_value' => '');
$iTotalCount = $this->_oDb->getCount($aParams);
$aEntries = $iTotalCount ? $this->_oDb->getEntries($aParams) : array();
if (empty($aEntries)) {
$oMobileTemplate->displayNoData($sCaption);
return;
}
foreach ($aEntries as $aEntry) {
$aVars = array('content' => '<h2>' . $aEntry['caption'] . '</h2>' . getLocaleDate($aEntry['when_uts'], BX_DOL_LOCALE_DATE), 'url' => bx_js_string(BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'mobile_entry/' . $aEntry['id']));
echo $oMobileTemplate->parseHtmlByName('mobile_row.html', $aVars);
}
bx_import('BxDolPaginate');
$oPaginate = new BxDolPaginate(array('page_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'mobile_latest_entries/{page}', 'count' => $iTotalCount, 'per_page' => $iPerPage, 'page' => $iPage));
echo $oPaginate->getMobilePaginate();
$oMobileTemplate->pageCode($sCaption, false);
}