帝国CMS列表页内容模板(list.var)中图片判断显示(带TAG标签调用) 实例如下: $fr=$empire->fetch1("select infotags,newstext from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]'");
$infotags=$fr['infotags'];
$r_tag=explode(",",$infotags);
for($i=0;$i<count($r_tag);$i++){
if($r_tag[$i]){
$tagslink=$public_r[newsurl]."e/tags/?tagname=".urlencode($r_tag[$i]);
$tags.="<a href='$tagslink' target='_blank' rel='tag'>".$r_tag[$i]."</a> ";
}
}
if($r['titlepic']!=''){
$titlepic='<a href="[!--titleurl--]" title="[!--title--]" target="_blank" class="list-tu"><img src="[!--titlepic--]" alt="[!--title--]" /></a>';
$style='';
}else{
$titlepic='';
$style=' style="margin-left: 0px;"';
}
$listtemp='
<li> <h2><a href="[!--titleurl--]" title="[!--title--]" target="_blank">[!--title--]</a></h2> <span class="title-l"></span> <small> <span class="sjwu"><i class="fa fa-user"></i> [!--username--]</span> <span><i class="fa fa-clock-o"></i> [!--newstime--] </span> <span class="sjwu"><i class="fa fa-folder"></i> <a href="[!--class.url--]" title="查看[!--class.name--]的更多文章" target="_blank">[!--class.name--]</a></span> <span><i class="fa fa-eye"></i> <script src=[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]&addclick=1></script> ℃</span> <span class="sjwu"><i class="fa fa-comments-o"></i> <a href="[!--titleurl--]#comment" title="欢迎你对本文发表看法"><script src=[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]&down=2></script> 评论</a></span> </small> <p> '.$titlepic.' [!--smalltext--]... </p>
<div class="clear"></div> </li> ';
|