帝国CMS首页文章图片判断显示和带TAG标签调用(有图显示,无图则不显示图片) 话不多说,直接贴实例: <?
$tags='';
$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$bqr[stb]} where id='$bqr[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($bqr['titlepic']!=''){
$titlepic='<div class="post__thumb min-height-160"><a href="'.$bqr['titleurl'].'" alt="'.$bqr['title'].'"> <img class="lazyload" src="[!--news.url--]DGSJ_CMS/img/diguo_cms.gif" data-src="'.$bqr['titlepic'].'?x-oss-process=image/resize,m_fill,w_400,h_200" alt="'.$bqr['title'].'" width="400" height="200" /> </a></div>';
$style='';
}else{
$titlepic='';
$style=' style="margin-left: 0px;"';
}
?>
|