當前位置: 首頁>>代碼示例>>PHP>>正文


PHP pagination::showCounter方法代碼示例

本文整理匯總了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") {
開發者ID:shahadat014,項目名稱:geleyi,代碼行數:67,代碼來源:woocommerce-ac.php


注:本文中的pagination::showCounter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。