本文整理汇总了PHP中paging::setCurrentPage方法的典型用法代码示例。如果您正苦于以下问题:PHP paging::setCurrentPage方法的具体用法?PHP paging::setCurrentPage怎么用?PHP paging::setCurrentPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paging
的用法示例。
在下文中一共展示了paging::setCurrentPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paging
// XXXXXXXX Search fields
// Title
// Description
//echo 'psf: '.$postSearchForm.'-';
/*
* Paging
*/
$mediaPerPage = $config['settings']['media_perpage'];
// Set the default media per page amount
$mediaPages = new paging('search');
$mediaPages->setPerPage($mediaPerPage);
$mediaPages->setPageName('search.php?');
$mediaPages->setPageVar();
// No get or post data sent or a clearSearch request - resetting search
if (!$_GET and !$_POST or $_REQUEST['clearSearch']) {
$mediaPages->setCurrentPage(1);
unset($_SESSION['searchForm']);
$_SESSION['searchForm']['allFields'] = true;
}
//echo $_SESSION['searchForm']['firstLoad'];
if ($postSearchForm) {
$mediaPages->setCurrentPage(1);
unset($_SESSION['searchForm']['resultsArray']);
// Clear any previous results array
}
if ($_GET['clear']) {
// Clear individual data
switch ($_GET['clear']) {
case "mediaTypes":
unset($_SESSION['searchForm']['mediaTypes']);
unset($_SESSION['searchForm']['seachForIDs']['mediaTypes']);
示例2: paging
*/
$mediaPerPage = $config['settings']['media_perpage'];
// Set the default media per page amount
$mediaPages = new paging('media');
$mediaPages->setPerPage($mediaPerPage);
/*
* Gallery Paging
*/
$galleryPerPage = $config['settings']['gallery_perpage'];
// Set the default galleries per page amount
$galleryPages = new paging('gallery');
$galleryPages->setPerPage($galleryPerPage);
if ($_SESSION['currentMode'] != $mode) {
$_SESSION['currentMode'] = $mode;
$mediaPages->setCurrentPage(1);
$galleryPages->setCurrentPage(1);
unset($_SESSION['prevNextArraySess']);
// Clear any prevNextArraySess previously set
unset($_SESSION['sessGallerySortBy']);
// Clear sessGallerySortBy
unset($_SESSION['sessGallerySortType']);
// Clear sessGallerySortType
}
if (!$_SESSION['id'] or !$_GET['id']) {
$_SESSION['id'] = 0;
}
// If there is no id then set the session to 0
if ($id != '' and $_SESSION['id'] != $id) {
$_SESSION['id'] = $id;
$mediaPages->setCurrentPage(1);
$galleryPages->setCurrentPage(1);