织梦DEDECMS 获取当前文档地址_DedeCms教程
教程Tag:暂无Tag,欢迎添加,赚取U币!
我是在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图片按月存放怎么实现?代码分享
- 织梦dedecms 5.7 sp1模板怎么添加下拉菜单
- DedeCMS 批量取消审核文档的实现方法
- 织梦dedecms 5.1 utf-8版本英文修改方法
- 织梦dedecms自定义表单,“必填项”设置方法
- 织梦DEDECMS{dede:freelist/}列表调用增加排序方式
- 织梦dedecms模板制作时,循环递增autoindex使用方法整理
- dedecms中一问一答式调用问答模块问与答简介调用问答系统代码
- dede审核时间与更新文章发布日期同步
- 如何在DedeCms 标记中运行PHP
- 彻底解决dedecms专题内容的介绍文字最多250个字的问题
- dedecms的首页、内容页、列表页中 动态JS调用评论数