主頁 > 網(wǎng)站建設(shè) > 建站知識 > DEDECMS 獲取當前文檔地址

DEDECMS 獲取當前文檔地址

POST TIME:2017-11-13 01:02

關(guān)鍵字描述:地址 文檔 當前 獲取 DEDECMS 2007 教程 方法

  我是在DEDECMS2007下做的,不知道這篇文章是否多余,DEDECMS調(diào)用很方便,但是我找了很久沒有
找到調(diào)用當前文檔的方法,故做了以下教程:DEDECMS 獲取當前文檔地址。

修改方法如下:

修改include/inc_archives_view.php

找到

//--------------------------
//獲取上一篇,下一篇鏈接
//--------------------------
function GetPreNext($gtype='')
{
$rs = "";
if(count($this->PreNext)<2)
{

$aid = $this->ArcID;
$next = " xkzzz_archives.ID>'$aid' And xkzzz_archives.arcrank>-1 order by xkzzz_archives.ID asc ";
$pre = " xkzzz_archives.ID<'$aid' And xkzzz_archives.arcrank>-1 order by xkzzz_archives.ID desc ";
$query = "Select xkzzz_archives.ID,xkzzz_archives.title,
xkzzz_archives.typeid,xkzzz_archives.ismake,xkzzz_archives.senddate,
xkzzz_archives.arcrank,xkzzz_archives.money,
xkzzz_arctype.typedir,xkzzz_arctype.typename,xkzzz_arctype.namerule,xkzzz_arctype.namerule2,
xkzzz_arctype.ispart,
xkzzz_arctype.moresite,xkzzz_arctype.siteurl
from xkzzz_archives left join xkzzz_arctype on xkzzz_archives.typeid=xkzzz_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']);
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
}
else{
$this->PreNext['pre'] = "上一篇:沒有了 ";
}
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']);
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
}
else{
$this->PreNext['next'] = "下一篇:沒有了 ";
}
}

if($gtype=='pre'){
上一頁12 3 下一頁



上一篇:DEDECMS相關(guān)文章不相關(guān)的解決辦法

下一篇:dedecms 5.1版的文字圖片采集教程

收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266