PHPCMS2008 首頁調用不顯示新聞的問題
來源:程序員人生 發布時間:2014-03-20 07:24:03 閱讀次數:2416次
問題:
可以顯示新聞,但是點擊了以后彈出新窗口,但是無法顯示那條新聞。希望懂的朋友幫忙。
<!--{get sql="select title from phpcms_content where catid=12 order by contentid desc,catid desc" rows="10"}-->
<ul class="text_list">
<a href="{$r[url]}" target="_blank" class="{$r[style]}">{$r[title]}</a>
</ul>
<!--{/get}-->
回答:
<!--{get sql="select title,url from phpcms_content where status=99 and catid in(select catid from phpcms_category where parentid=11) order by contentid desc,catid desc" rows="10"}-->
<ul class="text_list">
<a target="_blank" class="{$r[style]}" href="{$r[url]}">{str_cut($r[title],26)}</a>
</ul>
<!--{/get}-->
推薦使用:
sql = "select title,url from phpcms_content where status=99 ".get_sql_catid(11)." order by contentid desc,catid desc"