帝国cms修改[!show.listpage]分页页码所生成的html标签

在使用帝国cms系统时,我们用[!–show.page–]和[!–show.listpage–]来生成页码

其中[!–show.listpage–]所生成的html页码代码为:

帝国cms修改[!show.listpage]分页页码所生成的html标签

<a title=”Total record”>&nbsp;<b>9</b> </a>&nbsp;&nbsp;

<a href=”/dg/news/china/index.html”>首页</a>&nbsp;

<a href=”/dg/news/china/index.html”>上一页</a>&nbsp;

<a href=”/dg/news/china/index.html”>1</a>&nbsp;

<b>2</b>&nbsp;

<a href=”/dg/news/china/index_3.html”>3</a>&nbsp;

<a href=”/dg/news/china/index_3.html”>下一页</a>&nbsp;

<a href=”/dg/news/china/index_3.html”>尾页</a>

 

现在我们来修改其样式

帝国的分页样式在e>class>下的t_functions.php这个文件里

列表页模板[!–show.listpage–]:分页导航(列表式) 在90-149行

一,总页码数

大概在118行找到$firststr='<a title=”Total record”>&nbsp;<b>’.$num.'</b> </a>&nbsp;&nbsp;’;

比较一下

$firststr=’<a title=”Total record”>&nbsp;<b>‘.$num.’</b> </a>&nbsp;&nbsp;’;

              <a title=”Total record”>&nbsp;<b>9</b> </a>&nbsp;&nbsp;

这里也就是说明,总页码“9” 所对应的变量为 ‘.$num.’  $firststr 是总页码的变量名称

二,首页

我们再找到$toppage='<a href=”‘.$dolink.’index’.$type.'”>’.$fun_r[‘startpage’].'</a>&nbsp;’;

比较一下

  $toppage=’<a href=”‘.$dolink.’index’.$type.’“>‘.$fun_r[‘startpage’].’</a>&nbsp;’;

                  <a href=”/dg/news/china/index.html“>首页</a>&nbsp;

这里我们能看出来 首页所对应的“首页”代码为“‘.$fun_r[‘startpage’].’”  其链接所对应“‘.$dolink.’index’.$type.’

三.上一页

我们再找到$prepage='<a href=”‘.$dolink.$prido.'”>’.$fun_r[‘pripage’].'</a>’;

比较一下

$prepage='<a href=”‘.$dolink.$prido.’“>‘.$fun_r[‘pripage’].’</a>’;

                 <a href=”/dg/news/china/index.html“>上一页</a>&nbsp;

四,下一页和尾页

这里所对应的代码为每一页的页码标签

找到

$nextpage=’&nbsp;<a href=”‘.$dolink.’index_’.$pagenex.$type.’“>‘.$fun_r[‘nextpage’].’</a>’;
$lastpage=’&nbsp;<a href=”‘.$dolink.’index_’.$totalpage.$type.’“>‘.$fun_r[‘lastpage’].’</a>’;

这里所对应的代码为 下一页和尾页

<a href=”%20/dg/news/china/index_3.html“>下一页</a>&nbsp;

<a href=”%20/dg/news/china/index_3.html“>尾页</a>

五,所在页面  前面页码和  所在页面的后页代码

$starti=$page-$snum<1?1:$page-$snum;
    $no=0;
    for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)
    {
        $no++;
        if($page==$i)
        {
            $is_1=”<b>”;
            $is_2=”</b>”;

        elseif($i==1)
        {
            $is_1='<a href=”‘.$dolink.$add[filename].$type.’“>’;
           $is_2=”</a>
“;
        }
        else
        {
            $is_1='<a href=”‘.$dolink.$add[filename].’_’.$i.$type.’“>’;
           $is_2=” </a>
“;
        }
        $returnstr.=’&nbsp;’.$is_1.$i.$is_2;

1.所在页面的代码

            $is_1=”<b>”;
            $is_2=”</b>”;

意思为所在页面标签为<b>所在页面</b>

2.所在页面之后的页码

          elseif($i==1)
        {
            $is_1='<a href=”‘.$dolink.$add[filename].$type.’“>’;
           $is_2=”</a>
“;

意思为所在页面

为<a>之前页面</a>  

3.所在页面之后的页码

        else
        {
            $is_1='<a href=”‘.$dolink.$add[filename].’_’.$i.$type.’“>’;
           $is_2=” </a>
“;

意思为所在页面之后的页面

为<a>之后的页面</a>

原文链接:https://www.cnblogs.com/officexie/p/3191431.html
本文来源 爱码网,其版权均为 原网址 所有 与本站无关,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源。

© 版权声明

相关文章