All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
PHP技巧实例:Smarty+adodb分页示例_php资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/24 5:50:26 Browse times: 359 Comment times: 0

PHP技巧实例:Smarty+adodb分页示例_php资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

PHP技巧实例:Smarty+adodb分页示例_php资料_编程技术-你的首页-uuhomepage.com







利用Smarty+adodb分页示例, 下面给出的是分页部份的代码。有不懂可以在下面留言,站长会看到并回复的。


分页文件:page.lbi




























当前页

/





[ 首页 ]



[ 首页 ]






[ 上一页 ]



[ 上一页 ]






[ 下一页 ]



[ 下一页 ]






[ 末页 ]  



[ 末页 ]



转到 字串6















php部份....


// level E member's product commend list
public function product_comm($size = 5){
上一篇:由浅入深学习动态网页.. = $size <> 5 && !empty($_REQUEST['lb']) ? " AND prolb LIKE '%".$_REQUEST['lb']."%' " : "";
$this->where = " judge_flag = 0 AND pubname = '".$_REQUEST['user']."' 上一篇:由浅入深学习动态网页.. ";
$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;
}
// 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, 字串7
"size" => $size,
"param" => $this->param
);
$this->tpl->assign("navi_cM", $navi_cM);
}














There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.