PHPCMS2008 如何实现循环调用栏目并调出当前栏目下子栏目

2024-11-20 02:48:19
推荐回答(2个)
回答1:

如果你的栏目只有2层目录,那么你最直接的方法就是直接写2个 {get sql xxx}
{get sql="SELECT * FROM phpcms_category where child = 0 ORDER BY catid DESC" return="b"} 获得全部父节点的栏目信息
然后你再
loop $b $n $r
{get sql="SELECT * FROM phpcms_category where catid in ($r[arrchildid]) ORDER BY catid DESC" return="b"} .
大概意思就是这样吧。

回答2:



{get sql="SELECT * FROM `phpcms_category` WHERE `catid`=$m order by listorder" }

  • {$r[catname]}


    • {/get}