帝国cms列表模板调用顶赞踩评论tag和此内容包含图片总数

帝国cms列表模板调用顶赞评论tag和此内容包含图片总数
如图:
QQ截图20221128193448.png

列表内容模板(list.var)
顶的功能需要在模板里面加上
<script type="text/javascript" src="[!--news.url--]e/data/js/ajax.js"></script>
如下:
  1. $cl=$empire->fetch1("select classname from {$dbtbpre}enewsclass where classid='$r[classid]'");
  2. $classname=$cl['classname'];
  3. $fr=$empire->fetch1("select infotags,newstext from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]'");
  4. $newstext=$fr['newstext'];
  5. $imgcount=substr_count($newstext,"<img");
  6. $infotags=$fr['infotags'];
  7. $r_tag=explode(",",$infotags);
  8. for($i=0;$i<count($r_tag);$i++){
  9.         if($r_tag[$i]){
  10.                 $tagslink=$public_r[newsurl]."e/tags/?tagname=".urlencode($r_tag[$i]);
  11.                 $tags.="<a href='$tagslink' target='_blank' rel='tag'>".$r_tag[$i]."</a> / ";
  12.         }
  13. }
  14. if($r[titlepic]!=''){
  15. $titlepic=' <p class="focus"><a target="_blank" href="[!--titleurl--]" class="thumbnail"><img data-original="'.sys_ResizeImg($r[titlepic],218,218,1).'" class="thumb"/></a></p>';
  16. $width='';
  17. }else{
  18. $titlepic='';
  19. $width='style="margin-right: 0px;"';
  20. }
  21. if($r[jiage]!=''){
  22. $small='<i class="red">   [!--jiage--]</i>';
  23. $goods='<span class="art-link"><a href="[!--news.url--]go.php?go='.base64_encode($r[goods]).'" target="_blank" class="btn-red">去看看 <em></em></a></span>';
  24. }else{
  25. $small='<small class="text-muted"><span class="glyphicon glyphicon-picture"></span>'.$imgcount.'</small>';
  26. $goods='';
  27. }
  28. $listtemp='<article class="excerpt excerpt-one">
  29.         <header><a class="cat label label-important" href="[!--this.classlink--]">'.$classname.'<i class="label-arrow"></i></a>
  30.           <h2><a target="_blank" href="[!--titleurl--]" title="[!--oldtitle--]">[!--title--]</a></h2>
  31.           '.$small.'</header>
  32.         <p class="text-muted time">[!--username--] 发布于 [!--newstime--]</p>
  33.         '.$titlepic.'
  34.         <p class="note" '.$width.'>[!--smalltext--]</p>
  35.         <p class="text-muted views"><span class="post-views">阅读(<script src=[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]></script>)</span><span class="post-comments">评论(<span>[!--plnum--]</span>)</span><a href="JavaScript:makeRequest('."'[!--news.url--]e/public/digg?classid=[!--classid--]&id=[!--id--]&dotop=1&doajax=1&ajaxarea=diggnum[!--id--]'".','."'EchoReturnedText'".','."'GET'".','."''".');" class="post-like"><i class="glyphicon glyphicon-thumbs-up"></i>赞 (<span id="diggnum[!--id--]"><script src=[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]&down=5></script></span>)</a><span class="post-tags">标签:'.rtrim($tags,' / ').'</span>'.$goods.'</p>
  36.       </article>';
复制代码






上一篇:帝国cms 列表页内容模板调用文章正文字段
下一篇:帝国cms调用顶赞最多的内容排序
如无回复请发邮件