首页 > 运营 > 帮助中心 > 正文

帝国CMS分页样式函数修改方法

2020-01-27 17:48:12
字体:
来源:转载
供稿:网友

帝国CMS功能设计得如此出色,所有CMS中可定制性最强(不和CMF比哈)。

还是要吐槽一下!艹!还用的是table+css布局,这么丑!这是十几年前的技术吧!

(我只想说,帝国CMS把UI做好点,再把新手入门教程写简单点,市场占有率一定会提升一大截!)

今天和大家分享帝国cms分页样式函数修改方法。

1)列表分页位置:e/class/t_functions.php

修改列表模板之列表式分页函数,错新网的修改的方法在后面。

2)列表模板之列表式的CSS样式修改

修改前:

帝国CMS分页样式函数修改方法 第1张

修改后:

帝国CMS分页样式函数修改方法 第2张

列表模板之列表式分页函数如下:

  1. //列表模板之列表式分页
  2. function sys_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search="",$add){
  3.     global $fun_r,$public_r;
  4.     if($num<=$line)
  5.     {
  6.         $pager['showpage']='';
  7.         return $pager;
  8.     }
  9.     //文件名
  10.     if(empty($add['dofile']))
  11.     {
  12.         $add['dofile']='index';
  13.     }
  14.     //静态页数
  15.     $repagenum=$add['repagenum'];
  16.     $page_line=$public_r['listpagelistnum'];
  17.     $snum=2;
  18.     //$totalpage=ceil($num/$line);//取得总页数
  19.  
  20.     $firststr='<b>页次'.$page.'/'.$totalpage.'</b> '; 
  21.     //上一页
  22.     if($page<>1)
  23.     {
  24.         $toppage='<a href="'.$dolink.$add['dofile'].$type.'">'.$fun_r['startpage'].'</a>&nbsp;';
  25.         $pagepr=$page-1;
  26.         if($pagepr==1)
  27.         {
  28.             $prido=$add['dofile'].$type;
  29.         }
  30.         else
  31.         {
  32.             $prido=$add['dofile'].'_'.$pagepr.$type;
  33.         }
  34.         $prepage='<a href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>';
  35.     }
  36.     //下一页
  37.     if($page!=$totalpage)
  38.     {
  39.         $pagenex=$page+1;
  40.         $nextpagelink=$repagenum&&$repagenum<$pagenex?eReturnRewritePageLink2($add,$pagenex):$dolink.$add['dofile'].'_'.$pagenex.$type;
  41.         $lastpagelink=$repagenum&&$repagenum<$totalpage?eReturnRewritePageLink2($add,$totalpage):$dolink.$add['dofile'].'_'.$totalpage.$type;
  42.         $nextpage='<a href="'.$nextpagelink.'">'.$fun_r['nextpage'].'</a>';
  43.         $lastpage='<a href="'.$lastpagelink.'">'.$fun_r['lastpage'].'</a>';
  44.     }
  45.     $starti=$page-$snum<1?1:$page-$snum;
  46.     $no=0;
  47.     for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)
  48.     {
  49.         $no++;
  50.         if($page==$i)
  51.         {
  52.             $is_1="<b>";
  53.             $is_2="</b>";
  54.         }
  55.         elseif($i==1)
  56.         {
  57.             $is_1='<a href="'.$dolink.$add['dofile'].$type.'">';
  58.             $is_2="</a>";
  59.         }
  60.         else
  61.         {
  62.             $thispagelink=$repagenum&&$repagenum<$i?eReturnRewritePageLink2($add,$i):$dolink.$add['dofile'].'_'.$i.$type;
  63.             $is_1='<a href="'.$thispagelink.'">';
  64.             $is_2="</a>";
  65.         }
  66.         $returnstr.=''.$is_1.$i.$is_2;
  67.     }
  68.     $returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
  69.     $pager['showpage']=$returnstr;
  70.     return $pager;
  71. }

CSS样式如下:

  1. .pages {overflow: hidden;margin: 20px auto 0;border: 1px solid #eeeeee;border-radius: 8px;background-color:#fff;color:#8e8b8b;list-style:outside none none;}
  2. .pages a {float:left;width:50px;height:50px;border-right:1px solid #eeeeee;text-align:center;line-height:50px;}
  3. .pages b {float:left;width:50px;height:50px;border-right:1px solid #eeeeee;background-color:#ff6600;color:#fff;text-align:center;line-height:50px;}
  4. .pages b:first-child {width:100px;background-color: #fff;color: #333;}

欢迎大家一起分享交流。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表