織夢DEDECMS 獲取當前文檔地址_DedeCms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!
      我是在DEDECMS2007下做的,不知道這篇文章是否多余,DEDECMS調用很方便,但是我找了很久沒有
      找到調用當前文檔的方法,故做了以下教程:DEDECMS 獲取當前文檔地址。
      修改方法如下:
      1. 修改include/inc_archives_view.php 
      2. 找到 
      3. //--------------------------  
      4. //獲取上一篇,下一篇鏈接  
      5. //--------------------------  
      6. function GetPreNext($gtype='')  
      7. {  
      8. $rs = "";  
      9. if(count($this->PreNext)<2)  
      10. {  
      11.   
      12. $aid = $this->ArcID;  
      13. $next = " xkzzz_archives.ID>'$aid' And xkzzz_archives.arcrank>-1 order by xkzzz_archives.ID asc ";  
      14. $pre = " xkzzz_archives.ID<'$aid' And xkzzz_archives.arcrank>-1 order by xkzzz_archives.ID desc ";  
      15. $query = "Select xkzzz_archives.ID,xkzzz_archives.title,  
      16. xkzzz_archives.typeid,xkzzz_archives.ismake,xkzzz_archives.senddate, 
      17. xkzzz_archives.arcrank,xkzzz_archives.money,  
      18. xkzzz_arctype.typedir,xkzzz_arctype.typename,xkzzz_arctype.namerule,xkzzz_arctype.namerule2, 
      19. xkzzz_arctype.ispart,  
      20. xkzzz_arctype.moresite,xkzzz_arctype.siteurl  
      21. from xkzzz_archives left join xkzzz_arctype on xkzzz_archives.typeid=xkzzz_arctype.ID  
      22. where ";  
      23. $nextRow = $this->dsql->GetOne($query.$next);  
      24. $preRow = $this->dsql->GetOne($query.$pre);  
      25. if(is_array($preRow)){  
      26. $mlink = GetFileUrl($preRow['ID'],$preRow['typeid'],$preRow['senddate'],$preRow['title'], 
      27. $preRow['ismake'],$preRow['arcrank'],$preRow['namerule'],$preRow['typedir'], 
      28. $preRow['money'],true,$preRow['siteurl']);  
      29. $this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";  
      30. }  
      31. else{  
      32. $this->PreNext['pre'] = "上一篇:沒有了 ";  
      33. }  
      34. if(is_array($nextRow)){  
      35. $mlink = GetFileUrl($nextRow['ID'],$nextRow['typeid'],$nextRow['senddate'], 
      36. $nextRow['title'],$nextRow['ismake'], 
      37. $nextRow['arcrank'],$nextRow['namerule'],$nextRow['typedir'], 
      38. $nextRow['money'],true,$nextRow['siteurl']);  
      39. $this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";  
      40. }  
      41. else{  
      42. $this->PreNext['next'] = "下一篇:沒有了 ";  
      43. }  
      44. }  
      45.   
      46. if($gtype=='pre'){  
      僅供大家學習參考。
       

      查看更多 DedeCms教程  織夢模板  織夢DedeCms視頻教程  織夢dedecms專題

      來源:模板無憂//所屬分類:DedeCms教程/更新時間:2020-05-19
      相關DedeCms教程