当前位置: 首页>>代码示例>>PHP>>正文


PHP pagination::prevIcon方法代码示例

本文整理汇总了PHP中pagination::prevIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::prevIcon方法的具体用法?PHP pagination::prevIcon怎么用?PHP pagination::prevIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pagination的用法示例。


在下文中一共展示了pagination::prevIcon方法的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('&#9658;');
            //Changing the next icon
            $p->prevIcon('&#9668;');
            //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 {
//.........这里部分代码省略.........
开发者ID:shankpaul,项目名称:easygallery,代码行数:101,代码来源:easy-front-end.php

示例2: count

    $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('&#9658;');
    //Changing the next icon
    $p->prevIcon('&#9668;');
    //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;
}
?>
				<div class="easy_album_list">
					<?php 
$rows = $wpdb->get_results("select *,(select count(id)  from easy_photos b  where a.album_id=b.album_id ) as no_img from easy_album a order by album_id desc {$limit}");
开发者ID:shankpaul,项目名称:easygallery,代码行数:31,代码来源:easy-gallery-home.php


注:本文中的pagination::prevIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。