帝国cms常见问题: 列表页分页样式修改美化,帝国cms常见问题:分页文件在哪里

修改帝国默认的列表分页样式和伪静态页面留言版的分页样式。本来想在默认的模板标签上修改,看了看代码,<b>和<a>标签前后都多了&nbsp空格,如果在现在的基础上改,简单改改也行,不

修改帝国默认的列表分页样式和伪静态页面留言版的分页样式。本来想在默认的模板标签上修改,看了看代码,<b>和<a>标签前后都多了&nbsp空格,如果在现在的基础上改,简单改改也行,不过实在是受不了那么多空格符,而且如果用display:block的话,会出现一个阶梯状的样式,所以修改分页的样式势在必行。今天跟着小编来看看如何更改样式吧,先看看更改过后的样式图zGoECMSPLUS

效果演示地址如下http://m-meili.demo.yuanmazhu.com/xiangmu/zGoECMSPLUS

帝国cms 列表页分页样式修改美化,帝国CMS(EmpireCMS)分页文件在哪里zGoECMSPLUS

找到/e/class/t_functions.php,分页函数就在这个文件里面。zGoECMSPLUS

以下是分页函数源码,自己的分页需要根据样式修改源码zGoECMSPLUS

//列表模板之列表式分页zGoECMSPLUS
function sys_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search="",$add){zGoECMSPLUS
    global $fun_r,$public_r;zGoECMSPLUS
    if($num<=$line)zGoECMSPLUS
    {zGoECMSPLUS
        $pager['showpage']='';zGoECMSPLUS
        return $pager;zGoECMSPLUS
    }zGoECMSPLUS
    //文件名zGoECMSPLUS
    if(empty($add['dofile']))zGoECMSPLUS
    {zGoECMSPLUS
        $add['dofile']='index';zGoECMSPLUS
    }zGoECMSPLUS
    //静态页数zGoECMSPLUS
    $repagenum=$add['repagenum'];zGoECMSPLUS
    $page_line=$public_r['listpagelistnum'];zGoECMSPLUS
    $snum=2;zGoECMSPLUS
    //$totalpage=ceil($num/$line);//取得总页数zGoECMSPLUS
    $firststr='<a title="Total record">&nbsp;<b>'.$num.'</b> </a>&nbsp;&nbsp;';zGoECMSPLUS
    //上一页zGoECMSPLUS
    if($page<>1)zGoECMSPLUS
    {zGoECMSPLUS
        $toppage='<a href="'.$dolink.$add['dofile'].$type.'">'.$fun_r['startpage'].'</a>&nbsp;';zGoECMSPLUS
        $pagepr=$page-1;zGoECMSPLUS
        if($pagepr==1)zGoECMSPLUS
        {zGoECMSPLUS
            $prido=$add['dofile'].$type;zGoECMSPLUS
        }zGoECMSPLUS
        elsezGoECMSPLUS
        {zGoECMSPLUS
            $prido=$add['dofile'].'_'.$pagepr.$type;zGoECMSPLUS
        }zGoECMSPLUS
        $prepage='<a class="prev" href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>';zGoECMSPLUS
    }zGoECMSPLUS
    //下一页zGoECMSPLUS
    if($page!=$totalpage)zGoECMSPLUS
    {zGoECMSPLUS
        $pagenex=$page+1;zGoECMSPLUS
        $nextpagelink=$repagenum&&$repagenum<$pagenex?eReturnRewritePageLink2($add,$pagenex):$dolink.$add['dofile'].'_'.$pagenex.$type;zGoECMSPLUS
        $lastpagelink=$repagenum&&$repagenum<$totalpage?eReturnRewritePageLink2($add,$totalpage):$dolink.$add['dofile'].'_'.$totalpage.$type;zGoECMSPLUS
        $nextpage='&nbsp;<a class="next" href="'.$nextpagelink.'">'.$fun_r['nextpage'].'</a>';zGoECMSPLUS
        $lastpage='&nbsp;<a href="'.$lastpagelink.'">'.$fun_r['lastpage'].'</a>';zGoECMSPLUS
    }zGoECMSPLUS
    $starti=$page-$snum<1?1:$page-$snum;zGoECMSPLUS
    $no=0;zGoECMSPLUS
    for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)zGoECMSPLUS
    {zGoECMSPLUS
        $no++;zGoECMSPLUS
        if($page==$i)zGoECMSPLUS
        {zGoECMSPLUS
            $is_1="<b>";zGoECMSPLUS
            $is_2="</b>";zGoECMSPLUS
        }zGoECMSPLUS
        elseif($i==1)zGoECMSPLUS
        {zGoECMSPLUS
            $is_1='<a href="'.$dolink.$add['dofile'].$type.'">';zGoECMSPLUS
            $is_2="</a>";zGoECMSPLUS
        }zGoECMSPLUS
        elsezGoECMSPLUS
        {zGoECMSPLUS
            $thispagelink=$repagenum&&$repagenum<$i?eReturnRewritePageLink2($add,$i):$dolink.$add['dofile'].'_'.$i.$type;zGoECMSPLUS
            $is_1='<a href="'.$thispagelink.'">';zGoECMSPLUS
            $is_2="</a>";zGoECMSPLUS
        }zGoECMSPLUS
        $returnstr.='&nbsp;'.$is_1.$i.$is_2;zGoECMSPLUS
    }zGoECMSPLUS
    zGoECMSPLUS
    if(empty($prepage)){zGoECMSPLUS
        zGoECMSPLUS
        $prepage='<a class="prev" ></a>';zGoECMSPLUS
    }zGoECMSPLUS
        if(empty($nextpage)){zGoECMSPLUS
        zGoECMSPLUS
        $nextpage='<a class="next" ></a>';zGoECMSPLUS
    }zGoECMSPLUS
    zGoECMSPLUS
    $returnstr=$prepage."<em>".$page."/".$num."</em>".$nextpage;zGoECMSPLUS
    zGoECMSPLUS
    zGoECMSPLUS
    $pager['showpage']=$returnstr;zGoECMSPLUS
    return $pager;zGoECMSPLUS
}zGoECMSPLUS
 zGoECMSPLUS

温馨提示:修改之前最好做好备份。zGoECMSPLUS

如下示例代码:

<p>//列表模板之列表式分页<br />function sys_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search=&quot;&quot;,$add){<br />&nbsp;&nbsp; &nbsp;global $fun_r,$public_r;<br />&nbsp;&nbsp; &nbsp;if($num&lt;=$line)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$pager[&#39;showpage&#39;]=&#39;&#39;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return $pager;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;//文件名<br />&nbsp;&nbsp; &nbsp;if(empty($add[&#39;dofile&#39;]))<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$add[&#39;dofile&#39;]=&#39;index&#39;;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;//静态页数<br />&nbsp;&nbsp; &nbsp;$repagenum=$add[&#39;repagenum&#39;];<br />&nbsp;&nbsp; &nbsp;$page_line=$public_r[&#39;listpagelistnum&#39;];<br />&nbsp;&nbsp; &nbsp;$snum=2;<br />&nbsp;&nbsp; &nbsp;//$totalpage=ceil($num/$line);//取得总页数<br />&nbsp;&nbsp; &nbsp;$firststr=&#39;&lt;a title=&quot;Total record&quot;&gt;&amp;nbsp;&lt;b&gt;&#39;.$num.&#39;&lt;/b&gt; &lt;/a&gt;&amp;nbsp;&amp;nbsp;&#39;;<br />&nbsp;&nbsp; &nbsp;//上一页<br />&nbsp;&nbsp; &nbsp;if($page&lt;&gt;1)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$toppage=&#39;&lt;a href=&quot;&#39;.$dolink.$add[&#39;dofile&#39;].$type.&#39;&quot;&gt;&#39;.$fun_r[&#39;startpage&#39;].&#39;&lt;/a&gt;&amp;nbsp;&#39;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$pagepr=$page-1;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if($pagepr==1)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$prido=$add[&#39;dofile&#39;].$type;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$prido=$add[&#39;dofile&#39;].&#39;_&#39;.$pagepr.$type;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$prepage=&#39;&lt;a class=&quot;prev&quot; href=&quot;&#39;.$dolink.$prido.&#39;&quot;&gt;&#39;.$fun_r[&#39;pripage&#39;].&#39;&lt;/a&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;//下一页<br />&nbsp;&nbsp; &nbsp;if($page!=$totalpage)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$pagenex=$page+1;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$nextpagelink=$repagenum&amp;&amp;$repagenum&lt;$pagenex?eReturnRewritePageLink2($add,$pagenex):$dolink.$add[&#39;dofile&#39;].&#39;_&#39;.$pagenex.$type;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$lastpagelink=$repagenum&amp;&amp;$repagenum&lt;$totalpage?eReturnRewritePageLink2($add,$totalpage):$dolink.$add[&#39;dofile&#39;].&#39;_&#39;.$totalpage.$type;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$nextpage=&#39;&amp;nbsp;&lt;a class=&quot;next&quot; href=&quot;&#39;.$nextpagelink.&#39;&quot;&gt;&#39;.$fun_r[&#39;nextpage&#39;].&#39;&lt;/a&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$lastpage=&#39;&amp;nbsp;&lt;a href=&quot;&#39;.$lastpagelink.&#39;&quot;&gt;&#39;.$fun_r[&#39;lastpage&#39;].&#39;&lt;/a&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;$starti=$page-$snum&lt;1?1:$page-$snum;<br />&nbsp;&nbsp; &nbsp;$no=0;<br />&nbsp;&nbsp; &nbsp;for($i=$starti;$i&lt;=$totalpage&amp;&amp;$no&lt;$page_line;$i++)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$no++;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if($page==$i)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$is_1=&quot;&lt;b&gt;&quot;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$is_2=&quot;&lt;/b&gt;&quot;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;elseif($i==1)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$is_1=&#39;&lt;a href=&quot;&#39;.$dolink.$add[&#39;dofile&#39;].$type.&#39;&quot;&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$is_2=&quot;&lt;/a&gt;&quot;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$thispagelink=$repagenum&amp;&amp;$repagenum&lt;$i?eReturnRewritePageLink2($add,$i):$dolink.$add[&#39;dofile&#39;].&#39;_&#39;.$i.$type;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$is_1=&#39;&lt;a href=&quot;&#39;.$thispagelink.&#39;&quot;&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$is_2=&quot;&lt;/a&gt;&quot;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$returnstr.=&#39;&amp;nbsp;&#39;.$is_1.$i.$is_2;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;if(empty($prepage)){<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$prepage=&#39;&lt;a class=&quot;prev&quot; &gt;&lt;/a&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(empty($nextpage)){<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$nextpage=&#39;&lt;a class=&quot;next&quot; &gt;&lt;/a&gt;&#39;;<br />&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;$returnstr=$prepage.&quot;&lt;em&gt;&quot;.$page.&quot;/&quot;.$num.&quot;&lt;/em&gt;&quot;.$nextpage;<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;$pager[&#39;showpage&#39;]=$returnstr;<br />&nbsp;&nbsp; &nbsp;return $pager;<br />}<br />&nbsp;</p>
分享到 :
相关推荐

发表评论

登录... 后才能评论

评论(3)

加入本站VIP会员订阅计划,海量资源免费下载查看

目前为止共有3位优秀的VIP会员加入!

立即加入VIP会员