DEDECMS 獲取當(dāng)前文檔地址
來源:易賢網(wǎng) 閱讀:983 次 日期:2016-07-02 11:03:19
溫馨提示:易賢網(wǎng)小編為您整理了“DEDECMS 獲取當(dāng)前文檔地址”,方便廣大網(wǎng)友查閱!

找到調(diào)用當(dāng)前文檔的方法,故做了以下教程:DEDECMS 獲取當(dāng)前文檔地址。

修改方法如下:

修改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'){

$rs = $this->PreNext['pre'];

}

else if($gtype=='next'){

$rs = $this->PreNext['next'];

}

else{

$rs = $this->PreNext['pre']." &nbsp; ".$this->PreNext['next'];

}

return $rs;

}

看了大家都知道了,我是根據(jù)上一頁下一頁來改的

當(dāng)然不會影響上一頁和下一頁的使用

修改

if(count($this->PreNext)<2)

if(count($this->PreNext)<3)

找到

$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 ";

在下面添加

$dqy = " xkzzz_archives.ID='$aid' And xkzzz_archives.arcrank>-1 order by xkzzz_archives.ID asc ";

找到

$nextRow = $this->dsql->GetOne($query.$next);

$preRow = $this->dsql->GetOne($query.$pre);

在下面添加

$dqyRow = $this->dsql->GetOne($query.$dqy);

找到

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(is_array($dqyRow)){

$mlink = GetFileUrl($dqyRow['ID'],$dqyRow['typeid'],$dqyRow['senddate'],

$dqyRow['title'],$dqyRow['ismake'],$dqyRow['arcrank'],$dqyRow['namerule'],

$dqyRow['typedir'],$dqyRow['money'],true,$dqyRow['siteurl']);

$this->PreNext['dqy'] = "本頁地址:<a href='$mlink'>$mlink</a> ";

}

else{

$this->PreNext['dqy'] = "當(dāng)前頁:沒有了 ";

}

找到

if($gtype=='pre'){

$rs = $this->PreNext['pre'];

}

else if($gtype=='next'){

$rs = $this->PreNext['next'];

}

else{

$rs = $this->PreNext['pre']." &nbsp; ".$this->PreNext['next'];

}

return $rs;

}

修改為

if($gtype=='pre'){

$rs = $this->PreNext['pre'];

}

else if($gtype=='next'){

$rs = $this->PreNext['next'];

}

else if($gtype=='dqy'){

$rs = $this->PreNext['dqy'];

}

else{

$rs = $this->PreNext['pre']." &nbsp; ".$this->PreNext['next'];

}

return $rs;

}

在內(nèi)容頁模版需要調(diào)用的地方調(diào)用 {dede:prenext get=’dqy’/}

OK,搞定,重新生成下看看!

更多信息請查看CMS教程
易賢網(wǎng)手機網(wǎng)站地址:DEDECMS 獲取當(dāng)前文檔地址
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇剩?/div>
相關(guān)閱讀CMS教程

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)