本文整理汇总了PHP中Pagination::calculate方法的典型用法代码示例。如果您正苦于以下问题:PHP Pagination::calculate方法的具体用法?PHP Pagination::calculate怎么用?PHP Pagination::calculate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pagination
的用法示例。
在下文中一共展示了Pagination::calculate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAction
public function mainAction()
{
$model = new PageModel();
$modelProfile = new ProfileModel();
$this->view->ladder_list = $modelProfile->getTopLadder(5);
$this->view->last_reg_list = $modelProfile->getLastRegistered(5);
$this->view->last_matches = $modelProfile->getLastMatchesList(5);
$act = Request::getUri(0);
$id = intval(Request::getUri(1));
if ($act == 'read' && $id > 0) {
redirect(SITE_URL . 'main/readblog?pid=' . $id);
// echo SITE_URL.'main/readblog';
$news = $model->getNews($id, Lang::$language);
if (!$news) {
error404();
}
$this->view->news = $content;
// $news;
$this->view->title = $title;
//$news->name;
} else {
Pagination::calculate(get('page'), 10, $model->countNews(Lang::$language));
$this->view->newsList = $model->getAllNews(Lang::$language, Pagination::$start, Pagination::$end);
$this->view->title = Lang::translate('MAIN_TITLE');
}
}
示例2: blacklistAction
public function blacklistAction()
{
$model = new FriendsModel();
Pagination::calculate(get('page', 'int'), 15, $model->countFriends(Request::getParam('user')->id, 'out', 0, 1, false));
$this->view->blacklist = $model->getFriends(Request::getParam('user')->id, 'out', 0, 1, false, Pagination::$start, Pagination::$end);
$this->view->title = Lang::translate('BLACKLIST_TITLE');
}
示例3: indexAction
public function indexAction()
{
$model = new MailModel();
Pagination::calculate(get('page', 'int'), 10, $model->countDialog(Request::getParam('user')->id));
$this->view->list = $model->selectDialog(Request::getParam('user')->id, Pagination::$start, Pagination::$end);
$this->view->title = Lang::translate('INDEX_TITLE');
}
示例4: mainAction
public function mainAction()
{
$model = new PageModel();
$act = Request::getUri(0);
$id = intval(Request::getUri(1));
if ($act == 'read' && $id > 0) {
$news = $model->getNews($id, Lang::$language);
if (!$news) {
error404();
}
$this->view->news = $news;
$this->view->title = $news->name;
} else {
Pagination::calculate(get('page'), 10, $model->countNews(Lang::$language));
$this->view->newsList = $model->getAllNews(Lang::$language, Pagination::$start, Pagination::$end);
$this->view->title = Lang::translate('MAIN_TITLE');
}
}
示例5: historyAction
public function historyAction()
{
$model = new ProfileModel();
Pagination::calculate(get('page', 'int'), 20, $model->countMatchesHistory(Request::getParam('user')->id));
$this->view->langPars = true;
$this->view->list = $model->getHistoryList(Request::getParam('user')->id, Pagination::$start, Pagination::$end);
$this->view->title = Lang::translate('HISTORY_TITLE');
}
示例6: search_usersAction
public function search_usersAction()
{
if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {
error404();
}
$model = new AdminModel();
$response['target_h']['#listing'] = '';
$response['error'] = 0;
$uid = post('__uid', 'int');
$nickname = post('__nickname');
$steamid = post('__steamid', 'int');
$role = post('__role');
$page = post('page');
$count = $model->countSearchUsers($uid, $nickname, $steamid, $role);
Pagination::calculate($page, 10, $count);
$result = $model->searchUsers($uid, $nickname, $steamid, $role, Pagination::$start, Pagination::$end);
while ($list = mysqli_fetch_object($result)) {
if ($list->role == 'ban' && ($list->banRange == '0' or $list->banRange + $list->banDate > time())) {
if ($list->banRange == '0') {
$banTime = '(' . Lang::translate('USERS_BAN_FOREVER') . ')';
} else {
$banTime = '(' . Lang::translate('USERS_BAN_TO') . ' ' . printTime($list->banRange + $list->banDate, "H:i / m.d.Y") . ')';
}
$banned = '<div class="usersBanned">' . Lang::translate('USERS_BANNED') . ' ' . $banTime . '</div>';
$banned .= '<div class="usersReason">' . $list->banComment . '</div>';
} else {
$banned = '';
}
if ($list->role == 'moder' or $list->role == 'admin') {
$role = ' <span class="usersRole">(' . $list->role . ')</span>';
} else {
$role = '';
}
if ($list->role == 'user' or $list->role == 'claim') {
$btn = '<dib class="usersBtn btn" onclick="' . ajaxLoad(url('admin', 'ban'), 'process', 'id:' . $list->id . '|height:\'+winH()+\'|width:\'+winW()+\'', 'openPopup') . '">' . Lang::translate('USERS_BAN') . '</dib>';
} else {
$btn = '';
}
$response['target_h']['#listing'] .= '<div class="usersRow">' . '<div class="usersImage"><a href="' . url($list->id) . '" target="_blank"><img src="' . getAvatar($list->id, 'm') . '"></a></div>' . '<div class="usersInfo">' . '<div class="usersName"><a href="' . url($list->id) . '">' . $list->nickname . '</a><span class="level-icon">' . $list->level . '</span> <span>ID:' . $list->id . '</span>' . $role . '</div>' . '<div class="usersRes"></div>' . '<div class="usersAction">' . '<div class="usersActionEl">' . $banned . $btn . '</div>' . '</div>' . '</div>' . '</div>';
}
$ajaxPag['href'] = '#';
$ajaxPag['url'] = url('admin', 'search_users');
$ajaxPag['permit'] = 'process';
$ajaxPag['fields'] = '#uid!|#nickname!|#steamid!|#role!|';
$response['target_h']['#listing'] .= '<div class="pagin">' . Pagination::ajaxPagination(2, 'span', $ajaxPag) . '</div>';
echo json_encode($response);
exit;
}