Using the Smarty + adodb paging example, the code of the paging part is given below. If you do not know, you can leave a message below, and the webmaster will see and reply.
Using the Smarty + adodb paging example, the following section shows the paging part.Code. If you do not know, you can leave a message below, and the webmaster will see and reply.
ReprintedPlease specify the source:PHPDeveloper Resources string 7
Paging File: page. lbi
String 8
Php section ....
// Level E member's product commend list
Public function product_comm ($ size = 5 ){
$ Pre = $ size <> 5 &&! Empty ($ _ REQUEST ['lb'])? "AND prolb LIKE '%". $ _ REQUEST ['lb']. "% '":"";
$ This-> where = "judge_flag = 0 AND pubname = '". $ _ REQUEST ['user']. "' $ pre ";
$ SQL = "SELECT id, pingpai, img, huohao FROM user_proinfo WHERE". $ this-> where.
"Order by pubtime DESC ";
$ Res = $ this-> selectRs-> SelectLimit ($ SQL, $ size, ($ this-> page-1) * $ size );
$ This-> NaviPage_cM ("'User _ proinfo '", $ size, $ this-> where );
Return $ res;
}
String 3
// Embed in all must be used cat page function
Private function NaviPage_cM ($ table, $ size, $ where ){
$ Count = $ this-> selectRs-> GetOne ("select count (*) FROM $ table WHERE $ where ");
$ Pages = @ ceil ($ count/$ size );
For ($ I = 0; $ I <= $ pages; $ I ++) $ arr [] = $ I;
$ Navi_cM = array ("option" => $ arr,
"Page" => $ this-> page,
"Pages" => $ pages,
"Count" => $ count, string 7
"Size" => $ size,
"Param" => $ this-> param
);
$ This-> tpl-> assign ("navi_cM", $ navi_cM );
}
<完>