写法1: $fr=$empire->fetch1(\"select infotags from {$dbtbpre}ecms_news_data_{$r

写法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--]" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  class="pic"> <img class="lazy" src="[!--titlepic--]" alt="[!--oldtitle--]" title="[!--oldtitle--]" width="200" height="150"> </a>';
}else{
$titlepic='<a href="[!--titleurl--]" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  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--]" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  class="title">[!--title--]</a></h3>
<div class="info"> <span class="author"> <a href="[!--this.classlink--]" rel="external nofollow"  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--]" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  class="l_img" target="_blank" title="[!--oldtitle--]"><img src="[!--titlepic--]" alt="[!--oldtitle--]"></a>
</div>
<div class="li_r fr">
<h3><a href="[!--titleurl--]" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  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--]" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  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.'
';

 

温馨提示:本文最后更新于 2022-02-26 10:47 ,某些文章具有时效性,若有错误或已失效,请在下方留言或联系QQ115904045
声明:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:115904045@qq.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA打赏
共{{data.count}}人
人已打赏
帝国CMS教程

帝国cms调用tag以及tag内文章缩略图的二次开发记录

2022-2-26 10:47:21

帝国CMS教程

PHP获取当前页面url地址,并且获取url地址中的参数

2022-2-26 10:47:23

  • 0 条回复 A文章作者 M管理员
      暂无讨论,说说你的看法吧
    购物车
    优惠劵
    今日签到
    有新私信 私信列表
    搜索

    夕阳无别事,等风也等你

    联系我们