[e:loop={'select * from [!db.pre!]enewsclass where bclassid in(1) order by rand() desc limit 10',10,24,0}] <? if($bqr['classurl']=='') { $sccurl=$public_r['newsurl'].$bqr['classpath']."/"; } else { $sccurl=$bqr['classurl']."/"; } ?> <a target="_blank" href="<?=$sccurl?>"><?=$bqr['classname']?></a> | [/e:loop]
如果你要随机调用栏目id=5下的栏目,就把代码改成bclassid in(5)就行了,如果是多个就改成bclassid in(1,3,5),如果是全站就改成bclassid=0就可以了。