<?php $sql=$empire->query("SELECT id FROM {$dbtbpre}ecms_news_index WHERE classid='$navinfor[classid]' and id >= ((SELECT MAX(id) FROM {$dbtbpre}ecms_news_index where classid='$navinfor[classid]')-(SELECT MIN(id) FROM {$dbtbpre}ecms_news_index where classid='$navinfor[classid]')) * RAND() + (SELECT MIN(id) FROM {$dbtbpre}ecms_news_index where classid='$navinfor[classid]') ORDER BY id limit 10"); while($rs=$empire->fetch($sql)){ $r=$empire->fetch1("select * from {$dbtbpre}ecms_news where classid='$navinfor[classid]' and id='$rs[id]' limit 1"); ?> <li> <a href="<?=$r[titleurl]?>"> <div class="cover"> <img src="<?=$r[titlepic]?$r[titlepic]:'/e/data/images/timg.gif'?>" class="cover-img"> </div> <div class="title"><?=$r[title]?></div> </a> </li> <?}?>