A quick and easy-to-use php paging class
| [Code]
Totalpage = $ objpage;} // set the current page function setCurrentpage ($ objpage = 1) {$ this-> currentpage = $ objpage ;} // Set the span function setStride ($ objStride = 1) {$ this-> stride = $ objStride;} // obtain the total page number function getTotalpage () {return $ this-> totalpage;} // Obtain the cross-read function getStride ($ objStride = 1) {return $ this-> stride ;} // Obtain the function getCurrentpage ($ objpage = 1) {return $ this-> currentpage;} // Print the public function Pageprint () {for ($ Tmpa = 1; $ Tmpa <= $ this-> totalpage; $ Tmpa ++) {if ($ Tmpa + $ this-> stride <$ this-> currentpage) {// if ($ Tmpa + $ this-> stride ==$ this-> currentpage) {// The number of pages in the span. $ p = $ this-> currentpage-1; $ willprint. = "homepage previous page";} if ($ Tmpa> $ this-> currentpage + $ this-> stride) {// The break of the page larger than the current page and span;} $ willprint. = "[$ Tmpa]"; if ($ Tmpa = $ this-> currentpage + $ this-> stride) {// The number of pages in the span. $ p = $ this-> currentpage + $ this-> stride + 1; $ willprint. = "Next totalpage \"> last page ";}} echo $ willprint ;}}
Class cut_page extends Page {var $ filename; var $ showtotal; function _ construct ($ filename) {$ this-> cachefile = $ filename; $ this-> showtotal = "yes";} public function filename () {if (file_exists ($ this-> cachefile) {return 1;} else return 0 ;} private $ type; public function typelist ($ typeid) {$ this-> type = $ typeid; $ fp = fopen ($ this-> cachefile, "rb "); $ str = fread ($ fp, filesize ($ this-> cachefile); // echo $ this-> type."
"; // Category ID $ arr = explode (": ", $ str );
For ($ I = 0; $ I Type) {// return $ arr2 [1]; if (isset ($ _ GET |