• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > DedeCMS教程 > DedeCMS安装使用 >

实现让DeDecms的上下文章链接限制在当前栏目内

来源: www.dedecms8.com 编辑:织梦吧 时间:2010-07-13点击:
修改方法:
找到include/inc_archives_view.php中的function GetPreNext()函数,修改为:
复制代码 代码如下:
//--------------------------
//获取上一篇,下一篇链接
//--------------------------
function GetPreNext()
{
$rs = "";
$aid = $this->ArcID;
$rid = $this->Fields['typeid'];
$next = " dede_archives.ID>'$aid' and dede_archives.typeID='$rid' order by dede_archives.ID asc ";
$pre = " dede_archives.ID<'$aid' and dede_archives.typeID='$rid' order by dede_archives.ID desc ";
//$next = " dede_archives.ID>'$aid' order by dede_archives.ID asc ";
//$pre = " dede_archives.ID<'$aid' order by dede_archives.ID desc ";
$query = "Select dede_archives.ID,dede_archives.title,
dede_archives.typeid,dede_archives.ismake,dede_archives.senddate,dede_archives.arcrank,dede_archives.money,
dede_arctype.typedir,dede_arctype.typename,dede_arctype.namerule,dede_arctype.namerule2,dede_arctype.ispart,
dede_arctype.moresite,dede_arctype.siteurl
from dede_archives left join dede_arctype on dede_archives.typeid=dede_arctype.ID
where ";
$nextRow = $this->dsql->GetOne($query.$next);
$preRow = $this->dsql->GetOne($query.$pre);
if(is_array($preRow)){
$mlink = GetFileUrl($preRow['ID'],$preRow['typeid'],$preRow['senddate'],$preRow['title'],$preRow['ismake'],$preRow['arcrank'],$preRow['namerule'],$preRow['typedir'],$preRow['money'],true,$preRow['siteurl']);
$rs .= "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
}
else{
$rs .= "上一篇:没有了 ";
}
if(is_array($nextRow)){
$mlink = GetFileUrl($nextRow['ID'],$nextRow['typeid'],$nextRow['senddate'],$nextRow['title'],$nextRow['ismake'],$nextRow['arcrank'],$nextRow['namerule'],$nextRow['typedir'],$nextRow['money'],true,$nextRow['siteurl']);
$rs .= " 下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
}
else{
$rs .= " 下一篇:没有了 ";
}
return $rs;
}

如果你不会修改,还可以下载修改后的:inc_archives_view.php。

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1170734538@qq.com ,  QQ