Home >CMS Tutorial >Empire CMS >How to call tags in list.var of empire cms list page
How to call tags from list.var on the empire cms list page?
List page list.var calls tags. Many friends want to implement this function. This article has collected and compiled some practical codes and posted them to share with everyone. I hope it can help you solve the problem. If you are interested You can refer to the
recommendation to learn "Empire cms tutorial"
Copy the following code to the list content template (list.var), remember to select the list page: Use the program code
The code is as follows:
$nsmalltext=$r[smalltext]; $ntext=strip_tags($nsmalltext);//去除内容简介里的HTML标签 $newtext=esub($ntext,100,'...') ;//限制100字 $keyboard=$r[keyboard]; $r_tag=explode(",",$keyboard); $tempid=1;//这里是搜索模板ID for($i=0;$i<count($r_tag);$i++) { if($r_tag[$i]) { $tagslink=$public_r[newsurl]."e/tags/?tagname=".$r_tag[$i];//链接 $tagslink=$public_r[newsurl]."e/search/?searchget=1&tbname=$tbname& amp;tempid=$tempid&show=keyboard&keyboard=".$r_tag[$i];//如果链接到搜索 页面用此行代码,如果不是请删除 $tags.="<a href='$tagslink' target='_blank'>".$r_tag[$i]."</a> "; } } $listtemp='<div class="m_2"> <div class="m_2_a"><a href="/html/10752.html" title="[!--oldtitle--]">[!--title--]</a>[[!--newstime--]]</div> <p> [!--smalltext--]...<a href="/html/10752.html" class="link2">[详情]</a></p> <div class="cont_4">标签:'.$tags.'</div> <div class="cont_2"><span>来源:</span>HK吧<span>作者:</span>www.haik8.com <span>点击率:</span>708</div> </div>';
The above is the detailed content of How to call tags in list.var of empire cms list page. For more information, please follow other related articles on the PHP Chinese website!