闹腾半天,使用官方的标签貌似还是有问题,直接用GET调用应该可以解决了。标记下:
<!-- {get sql="SELECT * FROM phpcms_announce WHERE TO_DAYS( NOW() ) - TO_DAYS( todate ) < 0 or todate='0000-00-00'  ORDER BY announceid DESC" rows="3"} -->
<!-- {if $r[passed]} -->
<li><a href="announce/?announceid={$r[announceid]}">{str_cut($r[title], 40,'')}</a></li>
<!-- {/if} -->
<!-- {/get} -->
或者:
<!-- {get sql="SELECT * FROM phpcms_announce WHERE (TO_DAYS( NOW() ) - TO_DAYS( todate ) < 0 or todate='0000-00-00') and passed=1 ORDER BY announceid DESC" rows="3"} -->
<li><a href="announce/?announceid={$r[announceid]}">{str_cut($r[title], 40,'')}</a></li>
<!-- {/get} -->