123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- //---------------------------用户自定义标签函数文件
- function page11($num,$line,$page_line,$start,$page,$search){
- global $fun_r;
- $num=(int)$num;
- $line=(int)$line;
- $page_line=(int)$page_line;
- $start=(int)$start;
- $page=(int)$page;
- $tagid = $_GET['tagid'];
- if($num<=$line)
- {
- return '';
- }
- $search=RepPostStr($search,1);
- $url=eReturnSelfPage(0).'?page';
- $snum=2;//最小页数
- $totalpage=ceil($num/$line);//取得总页数
- //$firststr='<li class="previous disabled"><a href="/tag-'.$tagid.'.html">'.$fun_r['startpage'].'</a></li>';
- $firststr='';
- //上一页
- if($page<>0)
- {
- $toppage='<li class="previous disabled"><a href="/tag-'.$tagid.'-0.html">'.$fun_r['startpage'].'</a></li>';
- $pagepr=$page-1;
- if($pagepr==0){
- $prepage='<li class="previous disabled"><a href="/tag-'.$tagid.'-0.html">'.$fun_r['pripage'].'</a></li>';
- }else{
- $prepage='<li class="previous disabled"><a href="/tag-'.$tagid.'-'.$pagepr.'.html">'.$fun_r['pripage'].'</a></li>';
- }
- }
- //下一页
- if($page!=$totalpage-1)
- {
- $pagenex=$page+1;
- $nextpage='<li class="next"><a href="/tag-'.$tagid.'-'.$pagenex.'.html">'.$fun_r['nextpage'].'</a></li>';
- $lastpage='<li class="next"><a href="/tag-'.$tagid.'-'.($totalpage-1).'.html">'.$fun_r['lastpage'].'</a></li>';
- }
- $starti=$page-$snum<0?0:$page-$snum;
- $no=0;
- for($i=$starti;$i<$totalpage&&$no<$page_line;$i++)
- {
- $no++;
- if($page==$i)
- {
- $is_1="<li class=\"disabled active\"><a>";
- $is_2="</a></li>";
- }
- else
- {
- $is_1='<li><a href="/tag-'.$tagid.'-'.$i.'.html">';
- $is_2="</a></li>";
- }
- $pagenum=$i+1;
- $returnstr.="".$is_1.$pagenum.$is_2;
- }
- $returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
- return $returnstr;
- }
- ?>
|