因为。这个页面还没做好。。等做好了。。再给大家演示。。。。。。调用方法:$page_attr=pages_open($num[0]['cun'],$get_page,$max_page,'http://wuhan.qunaerwan.com/jingdian-'.$pieces[0].'-'.$pieces[1].'-'.$pieces[2].'-'.$pieces[3].'-'.$pieces[4].'-'.$pieces[5].'-'.$key.'-');/*** 自定义伪静态的分页函数。** @param $num 信息总数* @param $curr_page 当前分页* @param $perpage 每页显示数* @param $urlrule URL规则* @param $array 需要传递的数组,用于增加额外的方法* @return 分页*/function pages_open($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(),$setpages = 10){ $multipage = ''; if($num > $perpage) { $page = $setpages+1; $offset = ceil($setpages/2-1); $pages = ceil($num / $perpage); if (defined('IN_ADMIN') && !defined('PAGES')) define('PAGES', $pages); $from = $curr_page - $offset; $to = $curr_page + $offset; $more = 0; if($page >= $pages) { $from = 2; $to = $pages-1; } else { if($from <= 1) { $to = $page-1; $from = 2; } elseif($to >= $pages) { $from = $pages-($page-2); $to = $pages-1; } $more = 1; } $multipage .= ''.$num.L('page_item').''; if($curr_page>0) { if($curr_page==1) { $multipage .= ' '.L('previous').''; $multipage .= ' 1'; } elseif($curr_page>6 && $more) { $multipage .= ' '.L('previous').''; $multipage .= ' 1..'; } else { $multipage .= ' '.L('previous').''; $multipage .= ' 1'; } } for($i = $from; $i <= $to; $i++) { if($i != $curr_page) { $multipage .= ' '.$i.''; } else { $multipage .= ' '.$i.''; } } if($curr_page<$pages) { if($curr_page<$pages-5 && $more) { $multipage .= ' ..'.$pages.' '.L('next').''; } else { $multipage .= ' '.$pages.' '.L('next').''; } } elseif($curr_page==$pages) { $multipage .= ' '.$pages.' '.L('next').''; } else { $multipage .= ' '.$pages.' '.L('next').''; } } return $multipage;}