亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

實(shí)現(xiàn)讓DeDecms的上下文章鏈接限制在當(dāng)前欄目?jī)?nèi)

 更新時(shí)間:2008年03月23日 18:27:15   作者:  
使用dedecms的時(shí)候,當(dāng)打開(kāi)某篇文章的時(shí)候,底部會(huì)有“上一篇”“下一篇”的鏈接信息,默認(rèn)情況下,上下鏈接信息并沒(méi)有區(qū)分欄目的屬性,那么需要實(shí)現(xiàn)本欄目?jī)?nèi)的上下篇,如何實(shí)現(xiàn)呢? 基本思路:實(shí)現(xiàn)上下文章鏈接的函數(shù)位于GetPreNext(),我們?cè)谶@個(gè)函數(shù)中獲得欄目ID,然后修改SQL語(yǔ)句,在查詢數(shù)據(jù)庫(kù)的時(shí)候加上欄目ID的限制。
修改方法:
找到include/inc_archives_view.php中的function GetPreNext()函數(shù),修改為:
復(fù)制代碼 代碼如下:

//--------------------------
//獲取上一篇,下一篇鏈接
//--------------------------
function GetPreNext()
{
$rs = "";
$aid = $this->ArcID;
$rid = $this->Fields['typeid'];
$next = " #@__archives.ID>'$aid' and #@__archives.typeID='$rid' order by #@__archives.ID asc ";
$pre = " #@__archives.ID<'$aid' and #@__archives.typeID='$rid' order by #@__archives.ID desc ";
//$next = " #@__archives.ID>'$aid' order by #@__archives.ID asc ";
//$pre = " #@__archives.ID<'$aid' order by #@__archives.ID desc ";
$query = "Select #@__archives.ID,#@__archives.title,
#@__archives.typeid,#@__archives.ismake,#@__archives.senddate,#@__archives.arcrank,#@__archives.money,
#@__arctype.typedir,#@__arctype.typename,#@__arctype.namerule,#@__arctype.namerule2,#@__arctype.ispart,
#@__arctype.moresite,#@__arctype.siteurl 
from #@__archives left join #@__arctype on #@__archives.typeid=#@__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 .= "上一篇:沒(méi)有了 ";
}
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 .= " &nbsp; 下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
}
else{
$rs .= " &nbsp; 下一篇:沒(méi)有了 ";
}
return $rs;
}

如果你不會(huì)修改,還可以下載修改后的:inc_archives_view.php。

相關(guān)文章

最新評(píng)論