本文整理汇总了PHP中paging::setPageName方法的典型用法代码示例。如果您正苦于以下问题:PHP paging::setPageName方法的具体用法?PHP paging::setPageName怎么用?PHP paging::setPageName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paging
的用法示例。
在下文中一共展示了paging::setPageName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pluralizeKeywords
// Pluralize keywords function - singularize and pluralize
function pluralizeKeywords($keyword)
{
}
// 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
示例2:
$_SESSION['sessGallerySortType'] = $currentGallery['dsorting2'] ? $currentGallery['dsorting2'] : $config['settings']['dsorting2'];
}
if ($_SESSION['sessGallerySortBy'] != 'media_id') {
// Add a secondary ordering type just in case
$sql .= ",{$dbinfo[pre]}media.media_id DESC";
}
$sql = "\r\n\t\t\t\t\tSELECT SQL_CALC_FOUND_ROWS *\r\n\t\t\t\t\tFROM {$dbinfo[pre]}media\r\n\t\t\t\t\tLEFT JOIN {$dbinfo[pre]}media_galleries \r\n\t\t\t\t\tON {$dbinfo[pre]}media.media_id = {$dbinfo[pre]}media_galleries.gmedia_id\r\n\t\t\t\t\tWHERE {$dbinfo[pre]}media_galleries.gallery_id = {$currentAlbumID}\r\n\t\t\t\t\tAND {$dbinfo[pre]}media.active = 1\r\n\t\t\t\t\tGROUP BY {$dbinfo[pre]}media.media_id\r\n\t\t\t\t\tORDER BY {$dbinfo[pre]}media.{$_SESSION[sessGallerySortBy]} {$_SESSION[sessGallerySortType]}\r\n\t\t\t\t";
// LIMIT {$mediaStartRecord},{$mediaPerPage}
$crumbs[1]['linkto'] = $siteURL . "/contributor.my.media.php?mode=album&albumID={$albumID}";
// Check for SEO
$crumbs[1]['name'] = $currentAblum['name'];
break;
}
$_SESSION['crumbsSession'] = $crumbs;
// Assign these to a session to be used elsewhere
$mediaPages->setPageName('contributor.my.media.php?mode=' . $_SESSION['currentContrMode']);
$mediaPages->setPageVar();
if ($page) {
$mediaPages->setCurrentPage($page);
} else {
$mediaPages->setCurrentPage($_SESSION['mediaCurrentPage']);
}
// Use session current page
$mediaStartRecord = $mediaPages->getStartRecord();
// Get the record the db should start at
if ($sql) {
/*
* Previous and next button array
*/
if (!$_SESSION['prevNextArraySess']) {
$prevNextResult = mysqli_query($db, str_replace('*', "{$dbinfo[pre]}media.media_id", $sql . $maxPrevNext));
示例3: unset
}
// 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);
unset($_SESSION['prevNextArraySess']);
// Clear any prevNextArraySess previously set
unset($_SESSION['sessGallerySortBy']);
// Clear sessGallerySortBy
unset($_SESSION['sessGallerySortType']);
// Clear sessGallerySortType
}
$mediaPages->setPageName('gallery.php?mode=' . $_SESSION['currentMode']);
$mediaPages->setPageVar();
$galleryPages->setPageName('gallery.php?mode=' . $_SESSION['currentMode']);
$galleryPages->setPageVar('gpage');
if ($page) {
if (!is_numeric($page)) {
header("location: error.php?eType=invalidQuery");
exit;
}
$mediaPages->setCurrentPage($page);
// Set new current media page
} else {
$mediaPages->setCurrentPage($_SESSION['mediaCurrentPage']);
}
// Use session current page
if ($gpage) {
if (!is_numeric($gpage)) {
header("location: error.php?eType=invalidQuery");
示例4: paging
require_once BASE_PATH . '/assets/includes/errors.php';
require_once BASE_PATH . '/assets/classes/paging.php';
try {
$_SESSION['currentMode'] = 'newest-media';
/*
* Media Paging
*/
$mediaPerPage = $config['settings']['media_perpage'];
// Set the default media per page amount
$mediaPages = new paging('media');
$mediaPages->setPerPage($mediaPerPage);
if (!$_GET['page']) {
// No page passed go to page 1
$mediaPages->setCurrentPage(1);
}
$mediaPages->setPageName('newest.media.php');
//?mode='.$_SESSION['currentMode']
$mediaPages->setPageVar();
if ($page) {
$mediaPages->setCurrentPage($page);
} else {
$mediaPages->setCurrentPage($_SESSION['mediaCurrentPage']);
}
// Use session current page
$mediaStartRecord = $mediaPages->getStartRecord();
// Get the record the db should start at
unset($_SESSION['id']);
$mediaCount = mysqli_num_rows(mysqli_query($db, "\r\n\t\t\tSELECT {$dbinfo[pre]}media.umedia_id\r\n\t\t\tFROM {$dbinfo[pre]}media\r\n\t\t\tLEFT JOIN {$dbinfo[pre]}media_galleries \r\n\t\t\tON {$dbinfo[pre]}media.media_id = {$dbinfo[pre]}media_galleries.gmedia_id\r\n\t\t\tWHERE {$dbinfo[pre]}media_galleries.gallery_id IN ({$memberPermGalleriesForDB})\r\n\t\t\tAND {$dbinfo[pre]}media.active = 1 \r\n\t\t\tAND {$dbinfo[pre]}media.approval_status = 1 \r\n\t\t\tGROUP BY {$dbinfo[pre]}media.media_id\r\n\t\t"));
// Get the total number of items
if ($mediaCount > $mediaPerPage * 20) {
$mediaCount = $mediaPerPage * 20;