<ol>
{get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10"}
{if $showdate}<span class="date">{date('Y-m-d',$r[updatetime])}</span>{/if}
{if $showcatname}<span><a href="{$CATEGORY[$r[catid]][url]}" class="catname">{$CATEGORY[$r[catid]][catname]}</a><span>{/if}<li><span>{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}</span> <a href="{$r[url]}" target="{$target}">{if $r[style]}<span class="{$r[style]}">{str_cut($r[title], $titlelen)}</span>{else}{str_cut($r[title], $titlelen)}</a></li>{/if}
{/get}
</ol>get调用时里面可以执行sql语句吗 下面 那里有问题
{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}
{get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10"}
{if $showdate}<span class="date">{date('Y-m-d',$r[updatetime])}</span>{/if}
{if $showcatname}<span><a href="{$CATEGORY[$r[catid]][url]}" class="catname">{$CATEGORY[$r[catid]][catname]}</a><span>{/if}<li><span>{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}</span> <a href="{$r[url]}" target="{$target}">{if $r[style]}<span class="{$r[style]}">{str_cut($r[title], $titlelen)}</span>{else}{str_cut($r[title], $titlelen)}</a></li>{/if}
{/get}
</ol>get调用时里面可以执行sql语句吗 下面 那里有问题
{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}
{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}
这句话出现了问题 请高手帮忙
{$get2[catname]}{/get}{/get}
{$get2[catname]}{/get}{/get}这样是可以的哈。
仔细看参数和调用方式
{get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10" return="$get1"}
{if $showdate}<span class="date">{date('Y-m-d',$r[updatetime])}</span>{/if}
{if $showcatname}<span><a href="{$CATEGORY[$r[catid]][url]}" class="catname">{$CATEGORY[$r[catid]][catname]}</a><span>{/if}<li><span>{get sql="select catname from phpcms_category where catid ='".$get1['parentid']."'" rows="10" return="$get2"}{$get2[catname]}</span> <a href="{$r[url]}" target="{$target}">{if $r[style]}<span class="{$r[style]}">{str_cut($r[title], $titlelen)}</span>{else}{str_cut($r[title], $titlelen)}</a></li>{/if}
{/get} {/get}
</ol>
return="$get2" 我再试试 谢谢你 了