本文整理汇总了PHP中pagination::prevLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::prevLabel方法的具体用法?PHP pagination::prevLabel怎么用?PHP pagination::prevLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::prevLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_easy_gallery
function show_easy_gallery($atts, $content = null)
{
$order = 'desc';
$pagesql = '';
$limit = '';
$count = 8;
$page = true;
$page_st = true;
$theme = 'fancybox';
$view = 'album';
$album = '';
global $wpdb;
//echo "select * from easy_photos order by $order limit $limit offset $offset";
if (isset($atts['order'])) {
$order = $atts['order'];
}
if (isset($atts['theme'])) {
$theme = trim($atts['theme']);
if ($theme != 'fancybox' && $theme != 'swipebox') {
$theme = 'fancybox';
}
}
if (isset($atts['view'])) {
$view = trim($atts['view']);
if ($view != 'album' && $view != 'image') {
$view = 'album';
}
}
if (isset($atts['album'])) {
$album = trim($atts['album']);
}
if (isset($atts['limit'])) {
$count = trim($atts['limit']);
if ($count < 1) {
$count = 2;
}
}
$order = strtolower($order);
if ($order != 'asc' && $order != 'desc') {
$order = 'desc';
}
if (isset($atts['pagination'])) {
$page_st = trim($atts['pagination']);
if ($page_st != 'true' && $page_st != 'false') {
$page_st = 'true';
}
}
if ($page_st == 'true') {
$page = true;
$sql = " SELECT DISTINCT(a.album_id) FROM easy_album a,easy_photos b WHERE a.album_id=b.album_id AND a.disabled=0 AND b.disabled=0";
if ($album != '') {
$sql = $sql . " and a.album_id = {$album}";
}
if ($view == 'image') {
$sql = "select * from easy_photos where album_id not in(select album_id from easy_album b where b.disabled=1) and disabled=0";
if ($album != '') {
$sql = $sql . " and album_id = {$album}";
}
}
$rows = $wpdb->get_results($sql);
$items = count($rows);
if ($items > 0) {
$p = new pagination();
$p->items($items);
$p->limit($count);
// Limit entries per page
if ($album != '') {
$p->target(get_permalink() . '?album=' . $album);
} else {
$p->target(get_permalink());
}
//$p->urlFriendly();
if (isset($p->paging)) {
$p->currentPage($_GET[$p->paging]);
}
// Gets and validates the current page
$p->calculate();
// Calculates what to show
$p->parameterName('paging');
$p->nextLabel('');
//removing next text
$p->prevLabel('');
//removing previous text
$p->nextIcon('►');
//Changing the next icon
$p->prevIcon('◄');
//Changing the previous icon
$p->adjacents(1);
//No. of page away from the current page
if (!isset($_GET['paging'])) {
$p->page = 1;
} else {
$p->page = $_GET['paging'];
}
//Query for limit paging
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
} else {
echo "No Images";
}
} else {
//.........这里部分代码省略.........
示例2: pagination
$p = new pagination();
$p->items($items);
$p->limit(12);
// Limit entries per page
$p->target(get_permalink() . 'admin.php?page=easy-gallery-home');
//$p->urlFriendly();
if (isset($p->paging)) {
$p->currentPage($_GET[$p->paging]);
}
// Gets and validates the current page
$p->calculate();
// Calculates what to show
$p->parameterName('paging');
$p->nextLabel('');
//removing next text
$p->prevLabel('');
//removing previous text
$p->nextIcon('►');
//Changing the next icon
$p->prevIcon('◄');
//Changing the previous icon
$p->adjacents(1);
//No. of page away from the current page
if (!isset($_GET['paging'])) {
$p->page = 1;
} else {
$p->page = $_GET['paging'];
}
//Query for limit paging
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
}