以下为引用的内容: // 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; } // 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); } |