帝国cms灵动标签循环调用指定栏目名称栏目缩略图及栏目下信息

帝国cms灵动标签循环调用指定栏目名称栏目缩略图及栏目下信息


   <div class="wrapper category mt">
[e:loop={"select sonclass,classid,classname,classimg from `[!db.pre!]enewsclass` where classid in($public_r[add_home_classid1]) order by myorder,myorder desc",7,24,0}]
<div class="item">
<?php
$sonClassId = trim($bqr[sonclass],"|");
$sonClassId = str_replace("|",",",$sonClassId);
$sql=$empire->query("select title,titlepic,titleurl from {$dbtbpre}ecms_news where classid in ($sonClassId)  limit 20");
$n=1;
$img="";
$li='';
while($rsn=$empire->fetch($sql))
{
	if($n==1){
		$img = '<a href="'.$rsn[titleurl].'" target="_blank"><img src="'.$bqr[classimg].'"  ></a>';
		$n=2;
	}else{
		$li.= '<li><a href="'.$rsn[titleurl].'" title="'.$rsn[title].'">'.$rsn[title].'></a></li>';
	}
	$n++;
}
?>
<div class="title">
  <a href="<?=$bqsr[classurl]?>"><?=$bqsr[classname]?></a>
</div>
<div class="screenshot">
<?=$img?>
</div>
<ul>
<?=$li?>
</ul>
</div>
  [/e:loop]
  </div>

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注