Powerful php paging code class. This tutorial provides you with a paging code of the discuz forum type. we have written this code as a function. let's take a look at it. This tutorial provides a series of discuz forum-style paging code for your friends. let's write this code into a function. let's take a look at it.
This tutorial provides you with a paging code of the discuz forum type. we have written this code as a function. let's take a look at it.
// Number of pages
Function getPage ($ page, $ pageSize ){
$ This-> getRowsCount ();
$ This-> getPageCount ($ pageSize );
// Print $ this-> pageCount;
If ($ page = "") | ($ page <"1") | (! Ereg ("[0-9] +", $ page ))){
$ This-> notePage = "1 ";
} Else if ($ page >$ this-> pageCount ){
$ This-> notePage = $ this-> pageCount;
} Else {
$ This-> notePage = $ page;
}
Return $ this-> notePage;
}
// Retrieve the total number of records
Function getRowsCount (){
$ This-> getRes ($ this-> SQL _number );
$ Row = $ this-> getRows ();
$ This-> number = $ row [0];
Return $ this-> number;
}
// Obtain the number of pages
Function getPageCount ($ pageSize ){
$ This-> pageCount = ceil ($ this-> number/$ pageSize );
Return $ this-> pageCount;
}
// Paging code
Function getPageContent ($ page, $ url, $ pageSize ){
If ($ page = "1 "){
$ View. = "[Homepage]";
$ View. = "[previous page]";
} Else {
$ View. = "[Homepage]";
$ View. = "[previous page]";
}
If ($ page <$ this-> pageCount ){
$ View. = "[Next Page]";
$ View. = "pageCount."> [last page] ";
} Else {
$ View. = "[Next Page]";
$ View. = "[last page]";
}
Return $ view. "Current number ". $ page. "page/total ". $ this-> pageCount. "page ". $ this-> number. "Record ". "Go to ". $ this-> getUrl ($ url, $ page );
}
// Go to the page by page
Function getUrl ($ url, $ page ){
$ Go ="Page
");
Print ("alert ('". $ speak ."');");
Print ("location. href = '". $ url ."';");
Print ("script");
}
Bytes. This tutorial provides you with the following information...