本文整理汇总了PHP中BxDolPaginate::getSimplePaginate方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolPaginate::getSimplePaginate方法的具体用法?PHP BxDolPaginate::getSimplePaginate怎么用?PHP BxDolPaginate::getSimplePaginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolPaginate
的用法示例。
在下文中一共展示了BxDolPaginate::getSimplePaginate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showPagination
/**
* Function will generate page's pagination;
*
* @param : $sModulePath (string) - path to current module;
* @return : (text) - html presentation data;
*/
function showPagination($sModulePath, $sScript = null)
{
$aParameters['settings'] = array('count' => $this->aCurrent['paginate']['totalNum'], 'per_page' => $this->aCurrent['paginate']['perPage'], 'page' => $this->aCurrent['paginate']['page']);
$aParameters['settings']['page_url'] = $sModulePath . '&page={page}&per_page={per_page}';
$aParameters['settings']['on_change_page'] = $sScript ? $sScript : null;
$aParameters['settings']['on_change_per_page'] = null;
$oPaginate = new BxDolPaginate(array_shift($aParameters));
$sPaginate = '<div class="clear_both"></div>' . $oPaginate->getSimplePaginate(null, -1, -1, false);
return $sPaginate;
}
示例2: showPaginationAjax
function showPaginationAjax($sBlockId)
{
$oMain = $this->getMain();
$oConfig = $oMain->_oConfig;
bx_import('BxDolPaginate');
$sUrlStart = BX_DOL_URL_ROOT . $oConfig->getBaseUri() . $this->sBrowseUrl;
$sUrlStart .= false === strpos($sUrlStart, '?') ? '?' : '&';
$oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'count' => $this->aCurrent['paginate']['totalNum'], 'per_page' => $this->aCurrent['paginate']['perPage'], 'page' => $this->aCurrent['paginate']['page'], 'on_change_page' => "getHtmlData('{$sBlockId}', '{$sUrlStart}page={page}&per_page={per_page}&block={$sBlockId}" . (false !== bx_get($this->sFilterName) ? '&' . $this->sFilterName . '=' . bx_get($this->sFilterName) : '') . "');"));
return $oPaginate->getSimplePaginate(false, -1, -1, false);
}
示例3: ajaxBrowse
function ajaxBrowse($sMode, $iPerPage, $aMenu = array(), $sValue = '', $isDisableRss = false, $isPublicOnly = true)
{
bx_import('SearchResult', $this->oMain->_aModule);
$sClassName = $this->sSearchResultClassName;
$o = new $sClassName($sMode, $sValue);
$o->aCurrent['paginate']['perPage'] = $iPerPage;
$o->setPublicUnitsOnly($isPublicOnly);
if (!$aMenu) {
$aMenu = $isDisableRss ? '' : array(_t('_RSS') => array('href' => $o->aCurrent['rss']['link'] . (false === strpos($o->aCurrent['rss']['link'], '?') ? '?' : '&') . 'rss=1', 'icon' => 'rss'));
}
if ($o->isError) {
return array(MsgBox(_t('_Error Occured')), $aMenu);
}
if (!($s = $o->displayResultBlock())) {
return $isPublicOnly ? array(MsgBox(_t('_Empty')), $aMenu) : '';
}
$sFilter = false !== bx_get($this->sFilterName) ? $this->sFilterName . '=' . bx_get($this->sFilterName) . '&' : '';
$oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'count' => $o->aCurrent['paginate']['totalNum'], 'per_page' => $o->aCurrent['paginate']['perPage'], 'page' => $o->aCurrent['paginate']['page'], 'on_change_page' => 'return !loadDynamicBlock({id}, \'' . $this->sUrlStart . $sFilter . 'page={page}&per_page={per_page}\');'));
$sAjaxPaginate = $oPaginate->getSimplePaginate($this->oConfig->getBaseUri() . $o->sBrowseUrl);
return array($s, $aMenu, $sAjaxPaginate, '');
}
示例4: BxDolPaginate
function showPagination2($bAdmin = false, $sOverrideViewAllUrl = false, $bShort = true)
{
bx_import('BxDolPaginate');
$aLinkAddon = $this->getLinkAddByPrams();
$sAllUrl = $sOverrideViewAllUrl ? $sOverrideViewAllUrl : $this->getCurrentUrl('browseAll', 0, '');
$sLink = bx_html_attribute($_SERVER['PHP_SELF']) . '?blogs_mode=' . $this->aCurrent['sorting'] . $aLinkAddon['params'];
$oPaginate = new BxDolPaginate(array('page_url' => $sLink, 'count' => $this->aCurrent['paginate']['totalNum'], 'per_page' => $this->aCurrent['paginate']['perPage'], 'page' => $this->aCurrent['paginate']['page'], 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock({id}, \'' . $sLink . '&page={page}&per_page={per_page}\');', 'on_change_per_page' => 'return !loadDynamicBlock({id}, \'' . $sLink . '&page=1&per_page=\' + this.value);'));
$sPaginate = $bShort ? $oPaginate->getSimplePaginate($sAllUrl) : $oPaginate->getPaginate();
$sPaginate = '<div class="clear_both"></div>' . $sPaginate;
return $sPaginate;
}
示例5: showBlockMutualFriends
function showBlockMutualFriends($sCaption, $bNoDB = false)
{
$iViewer = getLoggedId();
if ($this->_iProfileID == $iViewer) {
return;
}
if ($this->iCountMutFriends > 0) {
$sCode = $sPaginate = '';
$iPerPage = $this->iFriendsPerPage;
$iPage = (int) $_GET['page'] > 0 ? (int) $_GET['page'] : 1;
$aTmplVars = array('bx_repeat:friends' => array());
foreach ($this->aMutualFriends as $iKey => $sValue) {
$aTmplVars['bx_repeat:friends'][] = array('content' => get_member_thumbnail($iKey, 'none', true));
}
$sCode = $GLOBALS['oSysTemplate']->parseHtmlByName('profile_friends.html', $aTmplVars);
if ($this->iCountMutFriends > $iPerPage) {
$oPaginate = new BxDolPaginate(array('page_url' => BX_DOL_URL_ROOT . 'profile.php', 'count' => $this->iCountMutFriends, 'per_page' => $iPerPage, 'page' => $iPage, 'on_change_page' => 'return !loadDynamicBlock({id}, \'' . getProfileLink($this->_iProfileID) . '?page={page}&per_page={per_page}\');'));
$sPaginate = $oPaginate->getSimplePaginate('', -1, -1, false);
}
if ($bNoDB) {
return array($sCode, array(), $sPaginate, true);
} else {
return DesignBoxContent(_t($sCaption), $sCode, 1);
}
}
}
示例6: getMembers
function getMembers($sBlockName, $aParams = array(), $iLimit = 16, $sMode = 'last')
{
$aDefFields = array('ID', 'NickName', 'Couple', 'Sex');
$sCode = '';
$iOnlineTime = (int) getParam("member_online_time");
//main fields
$sqlMainFields = "";
foreach ($aDefFields as $iKey => $sValue) {
$sqlMainFields .= "`Profiles`. `{$sValue}`, ";
}
$sqlMainFields .= "if(`DateLastNav` > SUBDATE(NOW(), INTERVAL {$iOnlineTime} MINUTE ), 1, 0) AS `is_online`";
// possible conditions
$sqlCondition = "WHERE `Profiles`.`Status` = 'Active' and (`Profiles`.`Couple` = 0 or `Profiles`.`Couple` > `Profiles`.`ID`)";
if (is_array($aParams)) {
foreach ($aParams as $sField => $sValue) {
$sqlCondition .= " AND `Profiles`.`{$sField}` = '{$sValue}'";
}
}
// top menu and sorting
$aModes = array('last', 'top', 'online');
$aDBTopMenu = array();
if (empty($_GET[$sBlockName . 'Mode'])) {
$sMode = 'last';
} else {
$sMode = in_array($_GET[$sBlockName . 'Mode'], $aModes) ? $_GET[$sBlockName . 'Mode'] : ($sMode = 'last');
}
$sqlOrder = "";
foreach ($aModes as $sMyMode) {
switch ($sMyMode) {
case 'online':
if ($sMode == $sMyMode) {
$sqlCondition .= " AND `Profiles`.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $iOnlineTime . " MINUTE)";
$sqlOrder = " ORDER BY `Profiles`.`Couple` ASC";
}
$sModeTitle = _t('_Online');
break;
case 'last':
if ($sMode == $sMyMode) {
$sqlOrder = " ORDER BY `Profiles`.`Couple` ASC, `Profiles`.`DateReg` DESC";
}
$sModeTitle = _t('_Latest');
break;
case 'top':
if ($sMode == $sMyMode) {
$oVotingView = new BxTemplVotingView('profile', 0, 0);
$aSql = $oVotingView->getSqlParts('`Profiles`', '`ID`');
$sqlOrder = $oVotingView->isEnabled() ? " ORDER BY `Profiles`.`Couple` ASC, (`pr_rating_sum`/`pr_rating_count`) DESC, `pr_rating_count` DESC, `Profiles`.`DateReg` DESC" : $sqlOrder;
$sqlMainFields .= $aSql['fields'];
$sqlLJoin = $aSql['join'];
$sqlCondition .= " AND `pr_rating_count` > 1";
}
$sModeTitle = _t('_Top');
break;
}
$aDBTopMenu[$sModeTitle] = array('href' => BX_DOL_URL_ROOT . "index.php?{$sBlockName}Mode={$sMyMode}", 'dynamic' => true, 'active' => $sMyMode == $sMode);
}
if (empty($sqlLJoin)) {
$sqlLJoin = '';
}
$iCount = (int) db_value("SELECT COUNT(`Profiles`.`ID`) FROM `Profiles` {$sqlLJoin} {$sqlCondition}");
$aData = array();
$sPaginate = '';
if ($iCount) {
$iLimit = (int) $iLimit > 0 ? (int) $iLimit : 8;
$iPages = ceil($iCount / $iLimit);
$iPage = empty($_GET['page']) ? 1 : (int) $_GET['page'];
if ($iPage > $iPages) {
$iPage = $iPages;
}
if ($iPage < 1) {
$iPage = 1;
}
$sqlFrom = ($iPage - 1) * $iLimit;
$sqlLimit = "LIMIT {$sqlFrom}, {$iLimit}";
$sqlQuery = "SELECT " . $sqlMainFields . " FROM `Profiles` {$sqlLJoin} {$sqlCondition} {$sqlOrder} {$sqlLimit}";
$rData = db_res($sqlQuery);
$iCurrCount = mysql_num_rows($rData);
$aOnline = $aTmplVars = array();
while ($aData = mysql_fetch_assoc($rData)) {
$aOnline['is_online'] = $aData['is_online'];
$aTmplVars[] = array('thumbnail' => get_member_thumbnail($aData['ID'], 'none', true, 'visitor', $aOnline));
}
$sCode = $GLOBALS['oSysTemplate']->parseHtmlByName('members_list.html', array('bx_repeat:list' => $aTmplVars));
if ($iPages > 1) {
$oPaginate = new BxDolPaginate(array('page_url' => BX_DOL_URL_ROOT . 'index.php', 'count' => $iCount, 'per_page' => $iLimit, 'page' => $iPage, 'on_change_page' => 'return !loadDynamicBlock({id}, \'index.php?' . $sBlockName . 'Mode=' . $sMode . '&page={page}&per_page={per_page}\');'));
$sPaginate = $oPaginate->getSimplePaginate(BX_DOL_URL_ROOT . 'browse.php');
}
} else {
$sCode = MsgBox(_t("_Empty"));
}
return array($sCode, $aDBTopMenu, $sPaginate, true);
}
示例7: switch
/**
* Generate spy block
*
* @param $aVars array
* $aVars[type] - string
* $aVars[page_url] - string
* $aVars[page] - integer
* $aVars[profile] - integer
* @return array
*/
function _getSpyBlock($aVars)
{
if (!isset($aVars['active'])) {
$aVars['active'] = false;
}
if (!isset($aVars['dynamic'])) {
$aVars['dynamic'] = bx_get('dynamic') !== false;
}
if (!isset($aVars['type'])) {
$aVars['type'] = bx_get('type') !== false ? bx_get('type') : 'all';
}
if (!isset($aVars['page_ajax'])) {
$aVars['page_ajax'] = true;
}
if (!isset($aVars['page'])) {
$aVars['page'] = bx_get('page') !== false ? (int) bx_get('page') : 1;
}
$aVars['page'] = $aVars['page'] > 0 ? $aVars['page'] : 1;
//-- set search filter --//
$this->oSearch->aCurrent['restriction']['viewed']['value'] = '';
if ($aVars['type'] != 'all') {
$this->oSearch->aCurrent['restriction']['type']['value'] = process_db_input($aVars['type'], BX_TAGS_STRIP);
}
switch ($this->sSpyMode) {
case 'friends_events':
$this->oSearch->aCurrent['join']['friends_data'] = array('type' => 'INNER', 'table' => $this->_oDb->sTablePrefix . 'friends_data', 'mainField' => 'id', 'onField' => 'event_id', 'joinFields' => array());
$this->oSearch->aCurrent['restriction']['friends']['value'] = $aVars['profile'];
$this->oSearch->aCurrent['restriction']['no_my']['value'] = $aVars['profile'];
break;
default:
//--- get only member's activity ---//
if ($aVars['profile']) {
$this->oSearch->aCurrent['restriction']['only_me']['value'] = $aVars['profile'];
}
}
//-- get data --//
$aActivites = $this->oSearch->getSearchData();
$sActivites = $this->_proccesActivites($aActivites);
$sOutputCode = $this->_oTemplate->getWrapper($this->sEventsWrapper, $aActivites ? $sActivites : MsgBox(_t('_Empty')));
//-- process pagination URL --//
$sPaginate = '';
if ($this->oSearch->aCurrent['paginate']['totalNum'] > $this->_oConfig->iPerPage) {
$aVars['page_url'] .= (strpos($aVars['page_url'], '?') === false ? '?' : '&') . 'type=' . $aVars['type'] . '&page={page}&per_page={per_page}';
$sOnClick = '';
if ($aVars['page_ajax']) {
$sOnClick = 'return !loadDynamicBlock({id}, \'' . $aVars['page_url'] . '\')';
}
$oPaginate = new BxDolPaginate(array('page_url' => $aVars['page_url'], 'count' => $this->oSearch->aCurrent['paginate']['totalNum'], 'per_page' => $this->_oConfig->iPerPage, 'page' => $aVars['page'], 'on_change_page' => $sOnClick));
$sPaginate = $oPaginate->getSimplePaginate(null, -1, -1, false);
}
if ($aVars['dynamic']) {
header('Content-Type: text/html; charset=utf-8');
} else {
$this->_oTemplate->addCss('spy.css');
}
//-- check init part --//
if ($aVars['page'] == 1) {
$sOutputCode = $this->getInitPart($aVars['type'], $aVars['profile'], $aVars['active']) . $sOutputCode;
}
return array($sOutputCode, array(), $sPaginate, true);
}
示例8: getAdminPart
function getAdminPart($aCondition = array(), $aCustom = array())
{
$this->oSearch->bAdminMode = true;
$iPerPage = isset($_GET['per_page']) ? (int) $_GET['per_page'] : (int) $this->oConfig->getGlParam('number_albums_home');
$iPage = isset($_GET['page']) ? (int) $_GET['page'] : $this->oSearch->aCurrent['paginate']['page'];
$this->oSearch->aCurrent['restriction']['owner']['value'] = $this->iOwnerId;
$aCondition['show_empty'] = true;
$sCode = $this->oSearch->getAlbumList($iPage, $iPerPage, $aCondition);
$aBtns = array('action_delete' => _t('_Delete'));
$sSection = isset($aCustom['section']) ? strip_tags($aCustom['section']) : '';
$iId = isset($aCustom['page_block_id']) ? (int) $aCustom['page_block_id'] : 1;
$aLinkAddon = $this->oSearch->getLinkAddByPrams();
$sLink = BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'albums/my/' . $sSection;
$this->oSearch->aCurrent['paginate']['perPage'] = 2;
$oPaginate = new BxDolPaginate(array('page_url' => $sLink, 'count' => $this->oSearch->aCurrent['paginate']['totalAlbumNum'], 'per_page' => $iPerPage, 'page' => $iPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock(' . $iId . ', \'' . $sLink . $aLinkAddon['params'] . '&page={page}&per_page={per_page}\');', 'on_change_per_page' => 'return !loadDynamicBlock(' . $iId . ', \'' . $sLink . $aLinkAddon['params'] . '&page=1&per_page=\' + this.value);'));
$sPaginate = $oPaginate->getSimplePaginate(BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'albums/browse/owner/' . getNickName($this->iOwnerId));
$sManage = $this->oSearch->showAdminActionsPanel($this->oSearch->aCurrent['name'] . '_admin_form', $aBtns);
$aUnit = array('main_code' => $GLOBALS['oFunctions']->centerContent($sCode, '.sys_album_unit') . $sPaginate . $sManage, 'bx_if:hidden' => '');
return $this->oTemplate->parseHtmlByName('manage_form.html', $aUnit);
}
示例9: getBottomMenu
function getBottomMenu($sAllLinkType = 'browseAll', $iId = 0, $sUri = '', $aExclude = array(), $bPgnSim = TRUE)
{
if (strpos($sAllLinkType, 'http') === false) {
if (isset($this->aConstants['linksTempl'][$sAllLinkType])) {
$sAllUrl = $this->getCurrentUrl($sAllLinkType, $iId, $sUri);
} else {
$sAllUrl = $this->getCurrentUrl('browseAll', 0, '');
}
} else {
$sAllUrl = $sAllLinkType;
}
$sModeName = $this->aCurrent['name'] . '_mode';
$sMode = isset($_GET[$sModeName]) ? '&' . $sModeName . '=' . rawurlencode($_GET[$sModeName]) : $sModeName . '=' . $this->aCurrent['sorting'];
$aLinkAddon = $this->getLinkAddByPrams($aExclude);
$sLink = bx_html_attribute($_SERVER['PHP_SELF']);
$oPaginate = new BxDolPaginate(array('page_url' => $sAllUrl, 'count' => $this->aCurrent['paginate']['totalNum'], 'per_page' => $this->aCurrent['paginate']['perPage'], 'page' => $this->aCurrent['paginate']['page'], 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock({id}, \'' . $sLink . '?' . $sMode . $aLinkAddon['params'] . $aLinkAddon['paginate'] . '\');', 'on_change_per_page' => 'return !loadDynamicBlock({id}, \'' . $sLink . '?' . $sMode . $aLinkAddon['params'] . '&page=1&per_page=\' + this.value);'));
return $bPgnSim ? $oPaginate->getSimplePaginate($sAllUrl) : $oPaginate->getPaginate();
}
示例10: PageCodeLog
function PageCodeLog($sMode)
{
switch ($sMode) {
case 'dnsbl':
case 'dnsbluri':
case 'akismet':
case 'stopforumspam':
break;
default:
$sMode = 'dnsbl';
}
$iPage = isset($_GET['page']) && (int) $_GET['page'] > 0 ? (int) $_GET['page'] : 1;
$iPerPage = 12;
$iStart = ($iPage - 1) * $iPerPage;
$aLog = $GLOBALS['MySQL']->getAll("SELECT SQL_CALC_FOUND_ROWS * FROM `sys_antispam_block_log` WHERE `type` = ? ORDER BY `added` DESC LIMIT {$iStart}, {$iPerPage}", [$sMode]);
$iCount = $GLOBALS['MySQL']->getOne("SELECT FOUND_ROWS()");
foreach ($aLog as $k => $r) {
$aLog[$k]['ip'] = long2ip($r['ip']);
$aLog[$k]['member_url'] = $r['member_id'] ? getProfileLink($r['member_id']) : 'javascript:void(0);';
$aLog[$k]['member_nickname'] = $r['member_id'] ? getNickName($r['member_id']) : _t('_Guest');
$aLog[$k]['extra'] = bx_html_attribute($r['extra']);
$aLog[$k]['ago'] = defineTimeInterval($r['added']);
}
$sPaginate = '';
if ($iCount > $iPerPage) {
$sUrlStart = BX_DOL_URL_ADMIN . 'antispam.php?action=log&type=' . $sMode;
$oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'count' => $iCount, 'per_page' => $iPerPage, 'page' => $iPage, 'on_change_page' => "getHtmlData('sys-adm-antispam-log', '{$sUrlStart}&page={page}');"));
$sPaginate = $oPaginate->getSimplePaginate(false, -1, -1, false);
}
if (is_array($aLog) && !empty($aLog)) {
return $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_log.html', array('bx_repeat:items' => $aLog, 'paginate' => $sPaginate));
} else {
return MsgBox(_t('_Empty'));
}
}
示例11: BxDolPaginate
function showPagination2($bAdmin = false)
{
$aLinkAddon = $this->getLinkAddByPrams();
$sAllUrl = $this->getCurrentUrl('browseAll', 0, '');
$oPaginate = new BxDolPaginate(array('page_url' => $this->aCurrent['paginate']['page_url'], 'count' => $this->aCurrent['paginate']['totalNum'], 'per_page' => $this->aCurrent['paginate']['perPage'], 'page' => $this->aCurrent['paginate']['page'], 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock({id}, \'' . bx_html_attribute($_SERVER['PHP_SELF']) . '?ads_mode=' . $this->aCurrent['sorting'] . $aLinkAddon['params'] . '&page={page}&per_page={per_page}\');'));
$sPaginate = '<div class="clear_both"></div>' . $oPaginate->getSimplePaginate($sAllUrl);
return $sPaginate;
}
示例12: MsgBox
/**
* Generate spy block
*
* @param $aVars array
* $aVars[type] - string
* $aVars[page_url] - string
* $aVars[page] - integer
* $aVars[page_block] - integer
* $aVars[profile] - integer
* @return array
*/
function _getSpyBlock($aVars)
{
$sPaginate = '';
//-- Set search filter --//
$this->oSearch->aCurrent['restriction']['viewed']['value'] = '';
if ('all' != $aVars['type']) {
$this->oSearch->aCurrent['restriction']['type']['value'] = process_db_input($aVars['type'], BX_TAGS_STRIP);
}
if ($aVars['profile']) {
// get only member's activity;
$this->oSearch->aCurrent['restriction']['only_me']['value'] = $aVars['profile'];
}
//--
//-- get data --//
$aActivites = $this->oSearch->getSearchData();
$sActivites = $this->_proccesActivites($aActivites);
//--
$sOutputCode = $this->_oTemplate->getWrapper($this->sEventsWrapper, $aActivites ? $sActivites : MsgBox(_t('_Empty')));
//-- process top block's links --//
$aDBTopMenu = array();
$aDBTopMenu[_t('_bx_spy_all_activity')] = array('href' => $aVars['page_url'] . '?type=all', 'dynamic' => true, 'active' => $aVars['type'] == 'all');
$aDBTopMenu[_t('_bx_spy_content_updates')] = array('href' => $aVars['page_url'] . '?type=content_activity', 'dynamic' => true, 'active' => $aVars['type'] == 'content_activity');
$aDBTopMenu[_t('_bx_spy_profiles_updates')] = array('href' => $aVars['page_url'] . '?type=profiles_activity', 'dynamic' => true, 'active' => $aVars['type'] == 'profiles_activity');
//--
//-- process pagination URL --//
if ($this->oSearch->aCurrent['paginate']['totalNum'] > $this->_oConfig->iPerPage) {
$sPaginationUrl = 'return !loadDynamicBlock({id}, \'' . $aVars['page_url'] . '?pageBlock=' . $aVars['page_block'] . '&type=' . $aVars['type'] . '&page={page}&per_page={per_page}\');';
$oPaginate = new BxDolPaginate(array('page_url' => $aVars['page_url'], 'count' => $this->oSearch->aCurrent['paginate']['totalNum'], 'per_page' => $this->_oConfig->iPerPage, 'page' => $aVars['page'], 'per_page_changer' => false, 'page_reloader' => false, 'on_change_page' => $sPaginationUrl, 'on_change_per_page' => ''));
$sPaginate = $oPaginate->getSimplePaginate(null, -1, -1, false);
}
//--
//-- check init part --//
if ($aVars['page'] == 1) {
$sOutputCode = $this->getInitPart($aVars['type'], $aVars['profile']) . $sOutputCode;
}
//--
//concate stop notification code
$sOutputCode = $this->_oTemplate->getStopNotificationCode() . $sOutputCode;
return array($sOutputCode, $aDBTopMenu, $sPaginate);
}
示例13: array
function _blockFans($iPerPage, $sFuncIsAllowed = 'isAllowedViewFans', $sFuncGetFans = 'getFans')
{
if (!$this->_oMain->{$sFuncIsAllowed}($this->aDataEntry)) {
return '';
}
$iPage = (int) $_GET['page'];
if ($iPage < 1) {
$iPage = 1;
}
$iStart = ($iPage - 1) * $iPerPage;
$aProfiles = array();
$iNum = $this->_oDb->{$sFuncGetFans}($aProfiles, $this->aDataEntry[$this->_oDb->_sFieldId], true, $iStart, $iPerPage);
if (!$iNum || !$aProfiles) {
return MsgBox(_t("_Empty"));
}
bx_import('BxTemplSearchProfile');
$oBxTemplSearchProfile = new BxTemplSearchProfile();
$sMainContent = '';
foreach ($aProfiles as $aProfile) {
$sMainContent .= $oBxTemplSearchProfile->displaySearchUnit($aProfile, array('ext_css_class' => 'bx-def-margin-sec-top-auto'));
}
$ret .= $sMainContent;
$ret .= '<div class="clear_both"></div>';
$oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'count' => $iNum, 'per_page' => $iPerPage, 'page' => $iPage, 'on_change_page' => 'return !loadDynamicBlock({id}, \'' . bx_append_url_params(BX_DOL_URL_ROOT . $this->_oMain->_oConfig->getBaseUri() . "view/" . $this->aDataEntry[$this->_oDb->_sFieldUri], 'page={page}&per_page={per_page}') . '\');'));
$sAjaxPaginate = $oPaginate->getSimplePaginate('', -1, -1, false);
return array($ret, array(), $sAjaxPaginate);
}
示例14: getAdminPart
function getAdminPart($aCondition = array(), $aCustom = array())
{
$this->oSearch->clearFilters(array('allow_view', 'album_status'), array('albumsObjects', 'albums'));
$iPerPage = isset($_GET['per_page']) ? (int) $_GET['per_page'] : (int) $this->oConfig->getGlParam('number_albums_home');
$iPage = isset($_GET['page']) ? (int) $_GET['page'] : $this->oSearch->aCurrent['paginate']['page'];
$this->oSearch->bAdminMode = true;
$aCondition['show_empty'] = true;
$aCondition['hide_default'] = true;
$aCondition['owner'] = $this->iOwnerId;
$sCode = $this->oSearch->getAlbumList($iPage, $iPerPage, $aCondition);
$iCount = $this->oSearch->aCurrent['paginate']['totalAlbumNum'];
$aBtns = array('action_delete' => _t('_Delete'));
$sPaginate = '';
if ($iCount > $iPerPage) {
$sSection = isset($aCustom['section']) ? strip_tags($aCustom['section']) : '';
if ($this->oConfig->isPermalinkEnabled) {
$sSection .= '?';
}
$iId = isset($aCustom['page_block_id']) ? (int) $aCustom['page_block_id'] : 1;
$aLinkAddon = $this->oSearch->getLinkAddByPrams();
$sLink = BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'albums/my/';
$sLinkJs = $sLink . $sSection . $aLinkAddon['params'];
$oPaginate = new BxDolPaginate(array('page_url' => $sLink, 'count' => $iCount, 'per_page' => $iPerPage, 'page' => $iPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock(' . $iId . ', \'' . $sLinkJs . '&page={page}&per_page={per_page}\');', 'on_change_per_page' => 'return !loadDynamicBlock(' . $iId . ', \'' . $sLinkJs . '&page=1&per_page=\' + this.value);'));
$sPaginate = $oPaginate->getSimplePaginate(BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'albums/browse/owner/' . getUsername($this->iOwnerId));
}
$sManage = $this->oSearch->showAdminActionsPanel($this->oSearch->aCurrent['name'] . '_admin_form', $aBtns);
$aUnit = array('main_code' => $sCode, 'paginate' => $sPaginate, 'manage' => $sManage);
return $this->oTemplate->parseHtmlByName('manage_form_albums.html', $aUnit);
}
示例15: getFriendNumber
function getBlockCode_Friends()
{
$iLimit = 10;
$sAllFriends = 'viewFriends.php?iUser=' . $this->iMember;
$sOutputHtml = null;
// count all friends ;
$iCount = getFriendNumber($this->iMember);
$sPaginate = '';
if ($iCount) {
$iPages = ceil($iCount / $iLimit);
$iPage = isset($_GET['page']) ? (int) $_GET['page'] : 1;
if ($iPage < 1) {
$iPage = 1;
}
if ($iPage > $iPages) {
$iPage = $iPages;
}
$sqlFrom = ($iPage - 1) * $iLimit;
$sqlLimit = "LIMIT {$sqlFrom}, {$iLimit}";
} else {
return;
}
$aAllFriends = getMyFriendsEx($this->iMember, '', 'image', $sqlLimit);
$iCurrCount = count($aAllFriends);
foreach ($aAllFriends as $iFriendID => $aFriendsPrm) {
$sOutputHtml .= '<div class="member_block">';
$sOutputHtml .= get_member_thumbnail($iFriendID, 'none', true, 'visitor', array('is_online' => $aFriendsPrm[5]));
$sOutputHtml .= '</div>';
}
$sOutputHtml = $GLOBALS['oFunctions']->centerContent($sOutputHtml, '.member_block');
$oPaginate = new BxDolPaginate(array('page_url' => BX_DOL_URL_ROOT . 'member.php', 'count' => $iCount, 'per_page' => $iLimit, 'page' => $iPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock({id}, \'member.php?page={page}&per_page={per_page}\');', 'on_change_per_page' => ''));
$sPaginate = $oPaginate->getSimplePaginate($sAllFriends);
return array($sOutputHtml, array(), $sPaginate);
}