zoukankan      html  css  js  c++  java
  • 帝国cms修改[!--show.listpage--]分页页码所生成的html标签

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

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

    QQ截图20130713160030

    <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=" /dg/news/china/index_3.html">下一页</a>&nbsp;

    <a href=" /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>

  • 相关阅读:
    《Java编程思想》学习笔记(一)
    SpringJDBC中jdbcTemplate 的使用
    JAVA数据库连接池C3p0 以及阿里Druid提供的连接池
    SpringJDBC :jdbcTemplate在连接是出现 org/springframeworkbc/core/JdbcTemplate : Unsupported major.minor version 52.0 异常解决
    JDBC事物的处理
    jdbc连接模拟用户登陆密码判断
    Java读取.properties配置文件并连接数据库
    JDBC的基本概念
    MySql数据库常用语句汇总
    JDBC连接各种数据库的方法,连接MySql,Oracle数据库
  • 原文地址:https://www.cnblogs.com/officexie/p/3191431.html
Copyright © 2011-2022 走看看