<table width="100%" border="0" cellspacing="1" cellpadding="3"><?$jie=""?> [e:loop={"select * from [!db.pre!]ecms_news where id+5>'$navinfor[id]' and id<'$navinfor[id]' and classid='$navinfor[classid]' and checked=1 order by id asc limit 4",1,24,0}] <? if($jie!=$bqr[ftitle]){ echo "<tr><td bgColor=#e3e3e3 colSpan=4 align=middle>".$bqr[ftitle]."</td><tr>"; $jie=$bqr[ftitle]; }
?> <tr><td><strong>[!--pagetitle--]</strong> (当前页面)</td></tr> [e:loop={"select * from [!db.pre!]ecms_news where id>'$navinfor[id]' and classid='$navinfor[classid]' and checked=1 order by id asc limit 4",1,24,0}] <? if($jie!=$bqr[ftitle]){ echo "<tr><td bgColor=#e3e3e3 colSpan=4 align=middle>".$bqr[ftitle]."</td><tr>"; $jie=$bqr[ftitle]; }
[e:loop={"select * from [!db.pre!]ecms_news where id+5>'$navinfor[id]' and id<'$navinfor[id]' and classid='$navinfor[classid]' and checked=1 order by id asc limit 4",1,24,0}]
修改为:
[e:loop={"select * from (select * from [!db.pre!]ecms_news where id<'$navinfor[id]' and classid='$navinfor[classid]' and checked=1 order by id desc limit 4) as mytemp order by id asc",1,24,0}]