找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 149|回复: 0

[cms教程] 织梦DEDECMS 获取当前文档地址

[复制链接]

该用户从未签到

发表于 2020-5-19 09:47:44 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我是在DEDECMS2007下做的,不知道这篇文章是否多余,DEDECMS调用很方便,但是我找了很久没有
        找到调用当前文档的方法,故做了以下教程:DEDECMS 获取当前文档地址。
        修改方法如下:
        修改include/inc_archives_view.php
        找到
        //--------------------------
        //获取上一篇,下一篇链接
        //--------------------------
        function GetPreNext($gtype='')
        {
        $rs = "";
        if(count($this->PreNext)
        {
         
        $aid = $this->ArcID;
        $next = " xkzzz_archives.ID>'$aid' And xkzzz_archives.arcrank>-1 order by xkzzz_archives.ID asc ";
        $pre = " xkzzz_archives.ID-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', = "上一篇:[url=$mlink,{$preRow['title',}[/url] ";
        }
        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', = "下一篇:[url=$mlink,{$nextRow['title',}[/url] ";
        }
        else{
        $this->PreNext['next', = "下一篇:没有了 ";
        }
        }
         
        if($gtype=='pre'){
回复

使用道具 举报

网站地图|页面地图|文字地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2024-11-27 04:32

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表