| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 696 人关注过本帖
标题:动易无限级分类代码
只看楼主 加入收藏
天涯听雨
Rank: 2
来 自:东莞
等 级:论坛游民
威 望:4
帖 子:497
专家分:64
注 册:2007-8-25
结帖率:100%
收藏
 问题点数:0 回复次数:1 
动易无限级分类代码
把动易里的无限级分类代码整理了一下发出,给大伙参考一:
'**************************************************
'函数名:GetClass_Option
'作  用:栏目下拉菜单
'参  数:
' ClassID ---- 当前分类ID
'返回值:栏目下拉菜单
'**************************************************
Function GetClass_Option(ClassID)
    Dim rsClass, sqlClass, strClass_Option, tmpDepth, i, ClassNum
    Dim arrShowLine(40)
   
    'ClassID 分类ID
    'ClassName  栏目名称
    'ParentID 父ID
    'Depth 栏目深度
    'RootID 根ID
    'Child 子栏目数
    'arrChildID 所有子栏目
    'PrevID 上一个栏目ID
    'NextID 下一个栏目ID
    'OrderID 排序ID
    For i = 0 To UBound(arrShowLine)
        arrShowLine(i) = False
    Next
    sqlClass = "Select ClassID,ClassName,ParentID,Depth,RootID,Child,arrChildID,PrevID,NextID,OrderID from PE_Class Order BY RootID,OrderID"
    Set rsClass = Conn.Execute(sqlClass)
    If rsClass.BOF And rsClass.EOF Then
        strClass_Option = strClass_Option & "<option value=''>请先添加栏目</option>"
    Else
        Do While Not rsClass.EOF
            ClassNum = ClassNum + 1
            tmpDepth = rsClass("Depth")
            If rsClass("NextID") > 0 Then
                arrShowLine(tmpDepth) = True
            Else
                arrShowLine(tmpDepth) = False
            End If
           
            strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
           
            if rsClass("ClassID")=ClassID then
               strClass_Option = strClass_Option & " selected"
            end if
            strClass_Option = strClass_Option & ">"
           
            If tmpDepth > 0 Then
                For i = 1 To tmpDepth
                    strClass_Option = strClass_Option & "  "
                    If i = tmpDepth Then
                        If rsClass("NextID") > 0 Then
                            strClass_Option = strClass_Option & "├ "
                        Else
                            strClass_Option = strClass_Option & "└ "
                        End If
                    Else
                        If arrShowLine(i) = True Then
                            strClass_Option = strClass_Option & "│"
                        Else
                            strClass_Option = strClass_Option & " "
                        End If
                    End If
                Next
            End If
            strClass_Option = strClass_Option & rsClass("ClassName")
            strClass_Option = strClass_Option & "</option>"
            rsClass.MoveNext
        Loop
    End If
    rsClass.Close
    Set rsClass = Nothing
    GetClass_Option = strClass_Option
End Function
搜索更多相关主题的帖子: 分类 代码 
2009-08-29 14:44
xing599666
Rank: 2
等 级:论坛游民
帖 子:104
专家分:91
注 册:2005-5-17
收藏
得分:0 
没人看  我我来帮你顶
2009-08-31 08:45
快速回复:动易无限级分类代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016353 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved