织梦DEDECMS 获取当前文档地址
来源:本站原创|时间:2021-08-05|栏目:dedecms|点击: 次
我是在DEDECMS2007下做的,不知道这篇文章是否多余,DEDECMS调用很方便,但是我找了很久没有
找到调用当前文档的方法,故做了以下教程: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'){
栏 目:dedecms
下一篇:彻底解决dedecms专题内容的介绍文字最多250个字的问题
本文标题:织梦DEDECMS 获取当前文档地址
本文地址:https://www.xiuzhanwang.com/a1/dedecms/15525.html
您可能感兴趣的文章
- 08-05Dedecms文件目录结构解说(能知道织梦每个文件有什么用)
- 08-05Dedecms5.7版ckeditor网页编辑器添加中文字体
- 08-05织梦DedeCMS获取当前栏目文章数量
- 08-05织梦模板如何添加和调用自定义字段的方法
- 08-05DedeCMS后台模块列表显示空白的解决办法
- 08-05DedeCMS自定义字段图片调用的问题{dede:img ...}解决方法
- 08-05织梦DedeCMS调用显示discuz里面主题的方法
- 08-05限制织梦会员每天投稿数量方法
- 08-05常用的织梦dedecms安全设置集合整理
- 08-05织梦教程:后台编辑器添加中文字体方法