-
大理石瓷磚生產(chǎn)類網(wǎng)站織...
-
蔬菜水果批發(fā)類網(wǎng)站織夢(mèng)...
-
花卉養(yǎng)殖資訊類網(wǎng)站織夢(mèng)...
-
家禽飼養(yǎng)基地類網(wǎng)站織夢(mèng)...
-
汽車銷售縱覽類網(wǎng)站織夢(mèng)...
-
旅游公司類網(wǎng)站織夢(mèng)模板...
-
室內(nèi)設(shè)計(jì)裝修工程類網(wǎng)站...
-
汽車音箱喇叭低音炮類網(wǎng)...
-
中英雙語(yǔ)建材瓷磚裝飾類...
-
網(wǎng)站優(yōu)化快速排名類科技...
-
商用貨架展架類網(wǎng)站織夢(mèng)...
-
金屬工藝品加工廠家類網(wǎng)...
-
玻璃制品廠家類網(wǎng)站織夢(mèng)...
-
電子產(chǎn)品營(yíng)銷類網(wǎng)站織夢(mèng)...
-
齒輪設(shè)備類網(wǎng)站織夢(mèng)模板...
-
創(chuàng)業(yè)資訊博客教程類網(wǎng)站...
-
財(cái)富管理培訓(xùn)咨詢類網(wǎng)站...
-
重工業(yè)機(jī)械鋼鐵類網(wǎng)站織...
-
戀愛(ài)情感資訊類網(wǎng)站織夢(mèng)...
-
壓濾機(jī)過(guò)濾設(shè)備類網(wǎng)站織...
給大家分享下根據(jù)文章的Tag標(biāo)簽來(lái)調(diào)用相關(guān)文章的自定義標(biāo)簽,在手動(dòng)填寫(xiě)Tag標(biāo)簽的情況下,效果還是非常不錯(cuò)的。先說(shuō)一下如何給織夢(mèng)系統(tǒng)增加自定義標(biāo)簽,只需要把自定義標(biāo)簽文件上傳到\include\taglib目錄即可。
下面是根據(jù)Tag標(biāo)簽獲取相關(guān)文章的自定義dede:arctag標(biāo)簽代碼:
在目錄下新建一個(gè)arctag.lib.php文件把下面代碼寫(xiě)進(jìn)去。
<?php if(!defined('DEDEINC'))exit('Request Error!');functionlib_arctag(&$ctag,&$refObj){global$dsql;$ar="row|10";FillAttsDefault($ctag->CAttribute->Items);extract($ctag->CAttribute->Items);$innertext=$ctag->GetInnerText();$tcp=newDedeTagParse();$tcp->SetNameSpace("field","[","]");$tcp->LoadSource($innertext);$aid=$refObj->Fields['id'];$revalue='';if($aid){$ids=array();$tag=array();$dsql->Execute("f","select tag from dede_taglist where aid = '$aid'");while($re=$dsql->GetArray("f")){$tag[] =$re['tag'];}if($tag){foreach($tagas$tk){$dsql->Execute("f1","select aid from dede_taglist where tag = '$tk'");while($re1=$dsql->GetArray("f1")){$ids[] =$re1['aid'];}}}if($ids){$ids =array_unique($ids);$sqa="(".join(",",$ids).")";$query= "SELECT se.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepathFROM `dede_archives` se LEFT JOIN `dede_arctype` tp ON se.typeid=tp.id WHERE se.id in$sqalimit$row";$dsql->Execute("f2",$query);while($row1=$dsql->GetArray("f2")){$row1['arcurl'] = GetFileUrl($row1['id'],$row1['typeid'],$row1['senddate'],$row1['title'],$row1['ismake'],$row1['arcrank'],$row1['namerule'],$row1['typedir'],$row1['money'],$row1['filename'],$row1['moresite'],$row1['siteurl'],$row1['sitepath']);$row1['title'] = cn_substr($row1['title'],10);foreach($tcp->CTagsas$tid=>$tt){$tcp->Assign($tid,$row1[$tt->GetName()]);}$revalue.=$tcp->GetResult();}}}return$revalue;}
注意和你使用的織夢(mèng)模板編碼一致。
前端調(diào)用:
{dede:arctag id=10}<ahref="[field:arcurl/]">[field:title/]</a> {/dede:arctag}


