-
餐饮加盟培训管理类网站...
-
语言翻译机构类网站织梦...
-
金融理财投资类网站织梦...
-
管理咨询培训机构类网站...
-
有机生物产品类网站织梦...
-
花店鲜花配送类网站织梦...
-
特色火锅餐饮加盟店网站...
-
行业资讯网类网站织梦模...
-
五金制品厨房用品类网站...
-
天然绿色食品类网站织梦...
-
投资理财金融公司类网站...
-
建筑职业学校类网站织梦...
-
手机APP游戏下载类网站织...
-
节能环保锅炉设备类网站...
-
不秀钢材质钢管类网站织...
-
装修设计类网站织梦模板...
-
民宿景区旅游类网站织梦...
-
中英双语装修建材类网站...
-
渔具批发牧渔类网站织梦...
-
建筑规划施工类网站织梦...
打开/include/extend.func.php文件
在最下面加入以下代码
<span style="font-size:14px;">function GetOneDocUrl($aid){global $dsql;include_once(DEDEINC."/channelunit.func.php");$aid = trim(ereg_replace('[^0-9]','',$aid));$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.siteurl,tp.sitepathFrom `{$chRow['maintable']}` arc left join `dede_arctype` tp on tp.id=arc.typeidwhere 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.sitepathFrom `{$chRow['addtable']}` arc left join `dede_arctype` tp on tp.id=arc.typeidwhere arc.aid='$aid' ";}$arcRow = $dsql->GetOne($nquery);$Url = 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 $Url;}</span>
然后新建一个文件diary.lib.php放到/include/taglib目录里面
代码如下
<span style="font-size:14px;"><?php/*** 调用当前作者文档* @version $Id: diary.lib.php 21:05 2021年4月2日 by 格展网络* @link http://www.91084.com*/if(!defined('DEDEINC')){exit("Request Error!");}function lib_diary(&$ctag,&$refObj){global $dsql,$envs;$jjmhk="row|1,typeid|0";FillAttsDefault($ctag->CAttribute->Items,$jjmhk);extract($ctag->CAttribute->Items);$innertext = trim($ctag->GetInnerText());$ctp = new DedeTagParse();$ctp->SetNameSpace('field','[',']');$ctp->LoadSource($innertext);$writer = $ctag->GetAtt('writer');if($writer=='this'){$writer = isset($refObj->Fields['writer']) ? $refObj->Fields['writer'] : 0;}$query = "select a.id,a.title,a.writer,a.pubdate,a.typeid,b.aid from dede_archives a LEFT JOIN dede_addonarticle b on b.aid=a.id where a.typeid='{$typeid}' and a.writer='{$writer}' order by a.pubdate desc LIMIT 0,$row";$dsql->SetQuery($query);$dsql->Execute('me',$query);while($rs= $dsql->GetArray('me')){$rs['pubdate']=GetDateMK($rs['pubdate']);$rs['arcurl']=GetOneDocUrl($rs['id']);$rs['title'] = 0 == $titlelen?$rs['title']:cn_substr($rs['title'], $titlelen);$ctp->LoadSource($innertext);foreach($ctp->CTags as$tagid=>$ctag) {if(!empty($rs[strtolower($ctag->GetName())])) {$ctp->Assign($tagid,$rs[$ctag->GetName()]);}}$revalue.= $ctp->GetResult();}return $revalue;}</span>
前端代码
{dede:diary row='10' typeid='2' writer='this'}<li><a href="[field:arcurl/]">[field:title/]</a><span class="p-l5">([field:pubdate/])</span></li>{/dede:diary}
效果图
