實(shí)現(xiàn)讓DeDecms的上下文章鏈接限制在當(dāng)前欄目?jī)?nèi)
找到include/inc_archives_view.php中的function GetPreNext()函數(shù),修改為:
//--------------------------
//獲取上一篇,下一篇鏈接
//--------------------------
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 .= " 下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
}
else{
$rs .= " 下一篇:沒(méi)有了 ";
}
return $rs;
}
如果你不會(huì)修改,還可以下載修改后的:inc_archives_view.php。
相關(guān)文章
dedecms負(fù)載性能優(yōu)化實(shí)例,三招讓你的dedecms快10倍以上
對(duì)dedecms表現(xiàn)出來(lái)的相對(duì)較差的性能也感覺(jué)比較迷惑,到底是什么在制約其負(fù)載效率?難道真的是某些腦殘的dede論壇版主說(shuō)的是因?yàn)閙ysql不堪重負(fù)的原因嗎?2008-09-09DEDECMS后臺(tái)數(shù)據(jù)備份還原的應(yīng)用
前臺(tái)與測(cè)試過(guò)程--之備份與還原2009-02-02實(shí)現(xiàn)讓DeDecms的上下文章鏈接限制在當(dāng)前欄目?jī)?nèi)
使用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的限制。2008-03-03dedecms織夢(mèng)系統(tǒng)數(shù)據(jù)庫(kù)表結(jié)構(gòu)詳細(xì)說(shuō)明-附表名與字段名
dedecms織夢(mèng)系統(tǒng)是一個(gè)自由和開(kāi)放源碼的內(nèi)容管理系統(tǒng),簡(jiǎn)單易用,功能豐富,原生php程序,二開(kāi)簡(jiǎn)單,曾經(jīng)流行了好多年,就是現(xiàn)在還有人再使用。本文囊括了dedecms數(shù)據(jù)庫(kù)所有的86張數(shù)據(jù)表結(jié)構(gòu)和字段詳細(xì)說(shuō)明,需要的朋友可以參考下。2023-04-04dedecms v5 跳轉(zhuǎn)網(wǎng)址 直接鏈接而非跳轉(zhuǎn)的實(shí)現(xiàn)方法修正版
最近在使用dedecms建站的時(shí)候發(fā)現(xiàn)這個(gè)問(wèn)題,如果調(diào)轉(zhuǎn)網(wǎng)址是直接的連接地址,效果就更好了,網(wǎng)上的版本有點(diǎn)來(lái),我也是參考他們的整理出來(lái)的2008-07-07DeDecms中實(shí)現(xiàn)更漂亮整齊的縮略圖的實(shí)現(xiàn)代碼
dede的縮略圖被很多人投訴過(guò),其原因是直接將原有的大圖限制塊寬度直接縮小或放大,如此一來(lái)自然縮略圖的效果非常差。本身php就允許對(duì)圖片進(jìn)行各種截取、重新生成、合并、壓縮等操作,因此為了追求完美,你可以參考下文。2008-03-03dedecms統(tǒng)計(jì)欄目文章數(shù)量實(shí)現(xiàn)代碼修訂版
以下的實(shí)現(xiàn)辦法為修訂的方法,可實(shí)現(xiàn)任意指定欄目的文章數(shù)量統(tǒng)計(jì),包括最終列表欄目和含有子欄目的欄目。2008-03-03