帝国cms列表页有缩略图显示缩略图无缩略图不显示缩略图判断语句

写法1:

$fr=$empire->fetch1("select infotags from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]'");
$infotags=$fr['infotags'];
$r_tag=explode(",",$infotags);
$tagstr=dp_InfoTag($r['classid'],$r['id'],'| ',5);
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>";
}
}
$cl=$empire->fetch1("select classname from {$dbtbpre}enewsclass where classid='$r[classid]'");
$classname=$cl['classname'];
if($r['titlepic']!=''){
$titlepic='<a href="[!--titleurl--]" class="pic"> <img class="lazy" src="[!--titlepic--]" alt="[!--oldtitle--]" title="[!--oldtitle--]" width="200" height="150"> </a>';
}else{
$titlepic='<a href="[!--titleurl--]" class="pic"> <img class="lazy" src="[!--news.url--]skin/ecms249/images/notimg.gif" alt="[!--oldtitle--]" title="[!--oldtitle--]" width="200" height="150"> </a>';
}
$listtemp='<li class="post_part clear"> '.$titlepic.'
<div class="cont">
<h3><a href="[!--titleurl--]" class="title">[!--title--]</a></h3>
<div class="info"> <span class="author"> <a href="[!--this.classlink--]" class="name">'.$classname.'</a> <span class="gap_point">•</span><span>[!--newstime--]</span> </span> </div>
<p class="summary">[!--smalltext--]... </p>
<div class="tag"> <i class="fa fa-tag"></i> '.$tagstr.' </div>
</div>
</li>';

 

写法2:

$fr=$empire->fetch1("select infotags 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>";
}
}
$cl=$empire->fetch1("select classname from {$dbtbpre}enewsclass where classid='$r[classid]'");
$classname=$cl['classname'];
if($r['titlepic']!=''){
$titlepic='
<li class="ls_list_li ts">
<div class="li_l fl photo yj_10">
<a href="[!--titleurl--]" class="l_img" target="_blank" title="[!--oldtitle--]"><img src="[!--titlepic--]" alt="[!--oldtitle--]"></a>
</div>
<div class="li_r fr">
<h3><a href="[!--titleurl--]" class="f18 bt_a nobold chao" target="_blank" title="[!--oldtitle--]">'.DoTitleFont($r[titlefont],$r[title]).'</a></h3>
<p class="chao2 c9 f13 bj_mt15">[!--smalltext--]...</p>
<div class="div_b bj_mt15">
<time class="c9 f12"><em class="cc f12">时间:</em>[!--newstime--]</time>
</div>
</div>
</li>
';
}else{
$titlepic='
<li class="ls_list_li list_li ts">
<div class="li_r">
<h3><a href="[!--titleurl--]" class="f18 bt_a chao nobold" target="_blank" title="[!--oldtitle--]">'.DoTitleFont($r[titlefont],$r[title]).'</a></h3>
<p class="chao2 c9 f13 bj_mt15">[!--smalltext--]...</p>
<div class="div_b bj_mt15">
<time class="c9 f12"><em class="cc f12">时间:</em>[!--newstime--]</time>
</div>
</div>
</li>
';
}
$listtemp='

'.$titlepic.'
';

 

图片[1]-帝国cms列表页有缩略图显示缩略图无缩略图不显示缩略图判断语句-HostJL-VPS主机交流

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容