本文整理汇总了PHP中pagination::showCounter方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::showCounter方法的具体用法?PHP pagination::showCounter怎么用?PHP pagination::showCounter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::showCounter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: url
//.........这里部分代码省略.........
</div>
<?php
} elseif ($action == 'listcart' || $action == '') {
?>
<p> <?php
_e('The list below shows all Abandoned Carts which have remained in cart for a time higher than the "Cart abandoned cut-off time" setting.', 'woocommerce-ac');
?>
</p>
<?php
//echo plugins_url();
include_once "pagination.class.php";
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
$wpdb->get_results("SELECT wpac . * , wpu.user_login, wpu.user_email \n\t\t\t\t\t FROM `" . $wpdb->prefix . "ac_abandoned_cart_history` AS wpac \n\t\t\t\t\t LEFT JOIN " . $wpdb->prefix . "users AS wpu ON wpac.user_id = wpu.id\n\t\t\t\t\t WHERE recovered_cart='0' AND unsubscribe_link='0' ");
$count = $wpdb->num_rows;
if ($count > 0) {
$p = new pagination();
$p->items($count);
$p->limit(10);
// Limit entries per page
$p->target("admin.php?page=woocommerce_ac_page&action=listcart");
if (isset($p->paging)) {
if (isset($_GET[$p->paging])) {
$p->currentPage($_GET[$p->paging]);
}
// Gets and validates the current page
}
$p->calculate();
// Calculates what to show
$p->parameterName('paging');
$p->adjacents(1);
//No. of page away from the current page
$p->showCounter(true);
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 {
$limit = "";
}
?>
<div class="tablenav">
<div class='tablenav-pages'>
<?php
if ($count > 0) {
echo $p->show();
}
// Echo out the list of paging.
?>
</div>
</div>
<?php
$order = "";
if (isset($_GET['order'])) {
$order = $_GET['order'];
}
if ($order == "") {
$order = "desc";
$order_next = "asc";
} elseif ($order == "asc") {