利用帝国cms做网站的时候有时在展示新闻列表需要调用附表字段展示,具体实现方法可以在灵动标签内再次调用附表并查询出对应的内容。具体代码参考如下:
[e:loop={0,6,3,1,'','newstime DESC'}]
<?php
$fr=$empire->fetch1("select newstext from {$dbtbpre}ecms_news_data_{$bqr['stb']} where id='$bqr[id]'");
$imgcount=substr_count($fr['newstext'],"<img");
?>
<div class="enpty-home enpty-index"><div class="box"><div class="pic"> <a href="<?=$bqsr['titleurl']?>" target="_blank"> <img class="lazy" src="/skin/ecms145/images/load.gif" data-original="<?=sys_ResizeImg($bqr['titlepic'],362,468,1)?>" style="width:170px;height:220px;" /> <span class="pic-num"><?=$imgcount?>张</span></a></div><a class="text" href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a><div class="info">发布日期:<?=date('Y-m-d',$bqr['newstime'])?></div></div></div>
[/e:loop]