Home > CMS Tutorial > Empire CMS > body text

How to call tags in list.var of empire cms list page

藏色散人
Release: 2019-12-14 09:18:32
Original
2858 people have browsed it

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=&#39;$tagslink&#39; target=&#39;_blank&#39;>".$r_tag[$i]."</a> "; 
} 
} 
$listtemp=&#39;<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">标签:&#39;.$tags.&#39;</div> 
<div class="cont_2"><span>来源:</span>HK吧<span>作者:</span>www.haik8.com <span>点击率:</span>708</div> 
</div>&#39;;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template