定义两个变量存储空图的显示代码,在万能列表里,执行第一次时,将第一个字符串设为空,第二次循环将第二个字符串设为空<ul>
<!--picture-->
<?
//空图
$tmpstr1 = "<li><DL><DD><img src='/e/data/images/notimg.gif' border=0 width=180 height=100></DD></DL></li>";
$tmpstr2 = "<li><DL><DD><img src='/e/data/images/notimg.gif' border=0 width=180 height=100></DD></DL></li>";
?>
<?$tablename = $class_r[6][tbname] ?>
[e:loop={"select * from [!db.pre!]ecms_".$tablename." where checked=1 and ispic=1 and pid6=$classid order by newstime desc limit 2",5,24,0}]
<?
if ($bqno==1){$tmpstr1="";}
if ($bqno==2){$tmpstr2="";}
?>
<li >
<DL>
<DD><a href="<?=$bqsr[titleurl]?>" title="<?=$bqr[title]?>" target="_blank" ><img src="<?=$bqr[titlepic]?$bqr[titlepic]:'/e/data/images/notimg.gif'?>" border=0 width=180 height=100></a></DD>
<DT><a href="<?=$bqsr[titleurl]?>" title="<?=$bqr[title]?>" target="_blank" ><?=DoTitleFont($bqr[titlefont],esub($bqr[title],30))?></a></DT>
</DL>
</li>
[/e:loop]
<?=$tmpstr1;?>
<?=$tmpstr2?>
</ul>
评论