織夢cms在datalist標簽中調(diào)出文章url方法,DEDE技術(shù)
導(dǎo)讀:DEDE技術(shù)DEDE技術(shù)用過dedecms系統(tǒng)的都知道它的模板標簽自由度有很大的局限性,在 我使用datalist這個標簽時,如果不加擴展是無法直接調(diào)用文章的url的地址的。在arcl夢織模板dede后臺模板。
用過dedecms系統(tǒng)的都知道它的模板標簽自由度有很大的局限性,在我使用datalist這個標簽時,如果不加擴展是無法直接調(diào)用文章的url的地址的。在arclist標簽中可用[field:arcurl]調(diào)出文章url,在sql標簽中
[field:id runphp='yes']$arcRow=GetOneArchive(@me);@me=$arcRow['arcurl'];[/field:id]也可以調(diào)出來。在datalist中似乎沒有什么好辦法,那只有在程序上擴展了。我們注意到sql標簽調(diào)用時GetOneArchive函數(shù),看看它如何工作的打開include文件夾下common.func.php文件找到GetOneArchive函數(shù)
//獲取單篇文檔信息 function GetOneArchive($aid織夢文章模板) { global $dsql; include_once(DEDEINC."/channelunit.func.php"); $aid = trim(ereg_replace('[^0-9]','',$aid)); $reArr = array(); $chRow = $dsql->GetOne("Select arc.*,ch.maintable,ch.addtable,ch.issystem From `dede_arctiny` arc left join `dede_channeltype` ch on ch.id=arc.channel where arc.id='$aid' "); if(!is_array($chRow)) { return $reArr; } else { if(empty($chRow['maintable'])) $chRow['maintable'] = 'dede_archives'; } if($chRow['issystem']!=-1) { $nquery = " Select arc.*,tp.typedir,tp.topid,tp.namerule,tp.moresite,tp.sitdede手機模板eurl,tp.sitepath From `{$chRow['maintable']}` arc left join `dede_arctype` tp on tp.id=arc.typeid where arc.id='$aid' "; } else { $nquery = " Select arc.*,1 as ismake,0 as money,'' as filename,tp.typedir,tp.topid,tp.namerule, tp.moresite,tp.siteurl,tp.sitepath From `{$chRow['addtable']}` arc left join `dede_arctype` tp on tp.id=arc.typeid where arc.aid='$aid' "; } $arcRow = $dsql->GetOne($nquery); if(!is_array($arcRow)) { return $reArr; } if(!isset($arcRow['description'])) { $arcRow['description'] = ''; } if(empty($arcRow['description']) && isset($arcRow['body'])) { $arcRow['description'] = cn_substr(html2text($arcRow['body']),250); } if(!isset($arcRow['pubdate'])) { $arcRow['pubdate'] = $arcRow['senddate']; } if(!isset($arcRow['notpost'])) { $arcRow['notpost'] = 0; } $reArr = $arcRow; $reArr['aid'] = $aid; $reArr['topid'] = $arcRow['topid']; $reArr['arctitle'] = $arcRow['title']; $reArr['arcurl'] = GetFileUrl($aid,$arcRow['typeid'],$arcRow['senddate'],$reArr['title'],$arcRow['ismake'], $arcRow['arcrank'],$arcRow['namerule'], $arcRow['typedir'],$arcRow['money'],$arcRow['filename'],$arcRow['moresite'],$arcRow['siteurl'],$arcRow['sitepath']); return $reArr; }聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-21 ,文章織夢cms在datalist標簽中調(diào)出文章url方法,DEDE技術(shù)主要講述標簽,標題,url網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_32956.html
為你推薦與織夢cms在datalist標簽中調(diào)出文章url方法,DEDE技術(shù)相關(guān)的文章
-
dedecms首頁中文章列表無刷新頂、踩的實現(xiàn)
(120)人喜歡 2023-07-21 -
織夢網(wǎng)站地圖Sitemap+百度Ping推送功能實現(xiàn)
(160)人喜歡 2023-07-21 -
DeDecms后臺設(shè)置及網(wǎng)站地圖seo優(yōu)化,織夢技
(50)人喜歡 2023-07-21 -
DedeCMS模板制作自定義表單時添加驗證碼的
(166)人喜歡 2023-07-21 -
織夢標簽:sonchannel 子欄目調(diào)用,織夢教程
(103)人喜歡 2023-07-21 -
在織夢cms中使用繁體轉(zhuǎn)簡體的函數(shù)BIG5To
(186)人喜歡 2023-07-21