zoukankan      html  css  js  c++  java
  • 如何给织梦文章分页标题加上序号呢?

      为了方便浏览者的阅读,我们可以在织梦dedeCMS的分页文章标题加上序号。我们先来分析一下,
      经过研究我们发现织梦模板文章分页所需要的文件是arc.archives.class.php ,
      所以我们可以通过添加一句代码,为织梦模板文章分页标题加上序号。下面是具体操作过程:
      修改文件:/include/arc.archives.class.php
      行数:大约347行 (行数可能由于更新有变化)
      修改代码如下:https://www.xuanhe.net
      //循环生成HTML文件
      else
      {
      for($i=1;$i<=$this->TotalPage;$i++)
      {
      $tempTitle=$this->Fields['title'];//临时存储一个标题副本
      if($i>1)
      {
      $truefilename = $this->GetTruePath().$fileFirst."_".$i.".".$this->ShortName;
      //为分页标题加上序号。2009.2.13
      $this->Fields['title'] = $this->Fields['title'].'('.$i.')';//在标题后面多加个序号
      }
      else
      {
      $truefilename = $this->GetTruePath().$filename;
      }
      $this->ParseDMFields($i,1);
      $this->dtp->SaveTo($truefilename);
      $this->Fields['title']=$tempTitle;//生成html,还原标题
      }
      }

  • 相关阅读:
    Hibernate Validation注解列表
    Java_Shell多线程
    Lua读写文件
    shell导出和导入redis
    大文件读写
    Java_Hbase优化
    控制语句if
    字典(DICT)
    元组Tuple
    Session 会话
  • 原文地址:https://www.cnblogs.com/zqw111/p/13030302.html
Copyright © 2011-2022 走看看