Salad UN

To Taste The Salad Of Life.

« 如何用好软文营销KingCMS生成下级列表及下级列表文章 »

KingCMS双层标签无法正常使用的问题修复

[ At 2008-9-15 By Ash   0 comments ]
这里以文章模块为例子,其他模块也一样,只是可能数据库的表名不一样
 
1 function king_tag_article(tag,invalue)
                  case"sub"'只调用当前栏目下面的,并不是所有的,若加入所有,需要递归,麻烦
                        listid=king.getvalue(invalue,"listid")
                        insql_id="and "&king_tag_article_getsublist(listid)

2 function king_tag_article_getsublist(l1)
        dim rs,data,i,I1
        if validate(l1,2) then
                set rs=conn.execute("select listid from kingart_list where listid1="&l1&" order by listorder desc;")
                        if not rs.eof and not rs.bof then
                                data=rs.getrows()
                                for i=0 to ubound(data,2)
                                        if len(I1)>0 then
                                                I1=I1&","&data(0,i)
                                        else
                                                I1=data(0,i)
                                        end if
                                next
                                I1=" listid in ("&I1&")"
                        else
                                I1=" listid=0"

                        end if
                        rs.close
                set rs=nothing
        end if
        king_tag_article_getsublist=I1
end function
 
生成的标签如下
 
{{king:article listid="sub"}}
  栏目列表:{king:listname/}
  {king:article type="new" number="20" listid="current"}
    文章标题:(king:title/)
    文章路径:(king:path/)
    所属栏目: (king:listname/)
  {/king}
{{/king}}

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722 Code detection by Codefense

Copyright 2008 www.s-un.cn. Some Rights Reserved.