主页 > 编程资料 > Dedecms >
发布时间:2015-09-27 作者:网络 阅读:369次
个人修改记录,不一定适合大众.
列表命名规则:

复制代码代码如下:
/list/list-{tid}-{page}.html

文章命名规则:

复制代码代码如下:
/test/{Y}{M}/{aid}.html

.htaccess

复制代码代码如下:
RewriteRule ^([a-zA-Z]+)/([0-9]+)/([0-9]+)\.html$ /plus/view.php?arcID=$3
RewriteRule ^([a-zA-Z]+)/([0-9]+)/([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$3&pageno=$4

include/arc.archives.class.php

复制代码代码如下:
//获得动态页面分页列表
function GetPagebreakDM($totalPage,$nowPage,$aid)
{
global $cfg_rewrite;
if($totalPage==1)
{
return “”;
}
$PageList = “
  • 共”.$totalPage.”页:
  • ”;
    $nPage = $nowPage-1;
    $lPage = $nowPage+1;
    if($nowPage==1)
    {
    $PageList.=”
  • 上一页
  • ”;
    }
    else
    {
    if($nPage==1)
    {
    $PageList.=”
  • 上一页
  • ”;
    if($cfg_rewrite == ‘Y’)
    {
    $PageList = preg_replace(“/view.php\?aid=(\d+)/i”,’-\\1-1.html’,$PageList);
    }
    }
    else
    {
    $PageList.=”
  • 上一页
  • ”;
    if($cfg_rewrite == ‘Y’)
    {
    $PageList = str_replace(“view.php?aid=”,“”,$PageList);
    $PageList = preg_replace(“/&pageno=(\d+)/i”,’-\\1.html’,$PageList);
    }
    }
    }
    for($i=1;$i<=$totalPage;$i++)
    {
    if($i==1)
    {
    if($nowPage!=1)
    {
    $PageList.=”
  • 1
  • ”;
    if($cfg_rewrite == ‘Y’)
    {
    $PageList = preg_replace(“/view.php\?aid=(\d+)/i”,’-\\1-1.html’,$PageList);
    }
    }
    else
    {
    $PageList.=”
  • 1
  • ”;
    }
    }
    else
    {
    $n = $i;
    if($nowPage!=$i)
    {
    $PageList.=”
  • ”.$n.”
  • ”;
    if($cfg_rewrite == ‘Y’)
    {
    $PageList = str_replace(“view.php?aid=”,“”,$PageList);
    $PageList = preg_replace(“/&pageno=(\d+)/i”,’-\\1.html’,$PageList);
    }
    }
    else
    {
    $PageList.=”
  • {$n}
  • ”;
    }
    }
    }
    if($lPage <= $totalPage)
    {
    $PageList.=”
  • 下一页
  • ”;
    if($cfg_rewrite == ‘Y’)
    {
    $PageList = str_replace(“view.php?aid=”,“”,$PageList);
    $PageList = preg_replace(“/&pageno=(\d+)/i”,’-\\1.html’,$PageList);
    }
    }
    else
    {
    $PageList.= “
  • 下一页
  • ”;
    }
    return $PageList;
    }
    //获得静态页面分页列表
    function GetPagebreak($totalPage,$nowPage,$aid)
    {
    if($totalPage==1)
    {
    return “”;
    }
    $PageList = “
  • 共”.$totalPage.”页:
  • ”;
    $nPage = $nowPage-1;
    $lPage = $nowPage+1;
    if($nowPage==1)
    {
    $PageList.=”
  • 上一页
  • ”;
    }
    else
    {
    if($nPage==1)
    {
    $PageList.=”
  • NameFirst.”.”.$this->ShortName.”‘>上一页
  • ”;
    }
    else
    {
    $PageList.=”
  • NameFirst.“-”.$nPage.”.”.$this->ShortName.”‘>上一页
  • ”;
    }
    }
    for($i=1;$i<=$totalPage;$i++)
    {
    if($i==1)
    {
    if($nowPage!=1)
    {
    $PageList.=”
  • NameFirst.”.”.$this->ShortName.”‘>1
  • ”;
    }
    else
    {
    $PageList.=”
  • 1
  • ”;
    }
    }
    else
    {
    $n = $i;
    if($nowPage!=$i)
    {
    $PageList.=”
  • NameFirst.“-”.$i.”.”.$this->ShortName.”‘>”.$n.”
  • ”;
    }
    else
    {
    $PageList.=”
  • {$n}
  • ”;
    }
    }
    }
    if($lPage <= $totalPage)
    {
    $PageList.=”
  • NameFirst.“-”.$lPage.”.”.$this->ShortName.”‘>下一页
  • ”;
    }
    else
    {
    $PageList.= “
  • 下一页
  • ”;
    }
    return $PageList;
    }

    include/arc.listview.class.php

    复制代码代码如下:
    $plist = str_replace(‘&TotalResult=’, ‘-’, $plist);

    去除动态列表网址里带有列表的文章总数

    复制代码代码如下:
    $plist = preg_replace(“/&TotalResult=(\d+)/i”, ”, $plist);
    关键字词: