SoFunction
Updated on 2025-04-12

Article List Category

<%
Dim HTML
Set HTML = New NewaspPublic_Cls
Class NewaspPublic_Cls

    Private Sub Class_Initialize()
        On Error Resume Next
         0, 0, 0
    End Sub
    '================================================
'Function name: LoadArticleList
'Use: Load article list
'Arguments: ClassID ----Classification ID
ChannelID ----ChannelID
SpecialID ----SpecialID
'            sType  ---Calling article type, 0=all latest articles, 1=recommended articles, 2=popular articles, 3=graphic articles, 4= latest articles in categories
TopNum ----Show the number of article lists
'           strlen   ---Show title length
ShowClass ----Does the classification be displayed
'         ShowPic  --- Whether to display the graphic title
ShowDate  ---Date is displayed
'          DateMode  ---Show Date Mode
'                 newindow  ----New window opens
    '================================================
    Public Function LoadArticleList(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
        ByVal stype, ByVal TopNum, ByVal strLen, _
        ByVal showclass, ByVal showpic, ByVal showdate, _
        ByVal DateMode, ByVal newindow, ByVal styles)

        Dim Rs, SQL, i, strContent, foundstr
        Dim sTitle, sTopic, ChildStr, ListStyle, BestCode, BestString
        Dim ArticleTopic, ClassName, HtmlFileUrl, WriteTime, LinkTarget, HtmlFileName

        ChannelID = (ChannelID)
        ClassID = (ClassID)
        SpecialID = (SpecialID)
        stype = (stype)

        On Error Resume Next
        (ChannelID)

        If CInt(stype) >= 4 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & ChannelID & " And ClassID=" & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                LoadArticleList = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            Set Rs = Nothing
        Else
            ChildStr = "0"
        End If

        Select Case CInt(stype)
            Case 0: foundstr = "Order By  Desc , Desc"
            Case 1: foundstr = "And  > 0 Order By  Desc , Desc"
            Case 2: foundstr = "Order By  Desc , Desc"
            Case 3: foundstr = "And ( = 1 Or  = 2) Order By  Desc , Desc"
            Case 4: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
            Case 5: foundstr = "And  in (" & ChildStr & ") And  > 0 Order By  Desc , Desc"
            Case 6: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
            Case 7: foundstr = "And  in (" & ChildStr & ") And ( = 1 Or  = 2) Order By  Desc , Desc"
        Case Else
            foundstr = "Order By  Desc , Desc"
        End Select
        If CInt(stype) >= 4 And CLng(ClassID) = 0 Then
            foundstr = "Order By  Desc , Desc"
        End If
        If CLng(SpecialID) <> 0 Then
            foundstr = "And  =" & CLng(SpecialID) & " " & foundstr
        End If
        SQL = " ,,,,,,,,,,"
        SQL = "SELECT Top " & CInt(TopNum) & SQL & " ,,,, FROM [NC_Article] A INNER JOIn [NC_Classify] C ON = WHERE >0 And =" & ChannelID & " " & foundstr & ""
        Set Rs = (SQL)
        i = 0
        If  And  Then
strContent = "No content has been added to this category yet!"
        Else
            strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
            Do While Not 
                If (i Mod 2) = 0 Then
                    ListStyle = Trim(styles) & 1
                Else
                    ListStyle = Trim(styles) & 2
                End If
                If Rs("isBest") <> 0 Then
                    BestCode = 2
BestString = "<font color='" & (3) & "'>Recommended</font>"
                Else
                    BestCode = 1
                    BestString = ""
                End If

                strContent = strContent & (13)

                sTitle = (Rs("title"), CInt(strLen))
                sTitle = (sTitle, Rs("ColorMode"), Rs("FontMode"))
                sTopic = (Rs("BriefTopic"))

                ClassName = (Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("ArticleID"), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                    ClassName = "<a href='" &  & Rs("HtmlFileDir") & "index" &  & "'>" & ClassName & "</a>"
                Else
                    HtmlFileUrl =  & "?ArticleID")
                    ClassName = "<a href='" &  & "?classClassID") & "'>" & ClassName & "</a>"
                End If

                If CInt(showclass) = 0 Then ClassName = ""
                If CInt(showpic) = 0 Then sTopic = ""
                If CInt(showdate) <> 0 Then
                    WriteTime = (Rs("WriteTime"), CInt(DateMode))
                Else
                    WriteTime = ""
                End If
                If CInt(newindow) <> 0 Then
                    LinkTarget = " target=""_blank"""
                Else
                    LinkTarget = ""
                End If
ArticleTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & & "Title: " & Rs("title") & "&#13;&#10;Published: " & Rs("WriteTime") & "&#13;&#10;Number of views: " & Rs("AllHits") & "' class=showlist>" & sTitle & "</a>"
                strContent = Replace(strContent, "{$ArticleTopic}", ArticleTopic)
                strContent = Replace(strContent, "{$ArticleID}", Rs("ArticleID"))
                strContent = Replace(strContent, "{$InstallDir}", )
                strContent = Replace(strContent, "{$ArticleTitle}", sTitle)
                strContent = Replace(strContent, "{$Title}", Rs("title"))
                strContent = Replace(strContent, "{$DateAndTitle}", Rs("WriteTime"))
                strContent = Replace(strContent, "{$BriefTopic}", sTopic)
                strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
                strContent = Replace(strContent, "{$ClassName}", ClassName)
                strContent = Replace(strContent, "[]", "")
                strContent = Replace(strContent, "{$Target}", LinkTarget)
                strContent = Replace(strContent, "{$WriteTime}", WriteTime)
                strContent = Replace(strContent, "{$AticleHits}", Rs("AllHits"))
                strContent = Replace(strContent, "{$ListStyle}", ListStyle)
                strContent = Replace(strContent, "{$BestCode}", BestCode)
                strContent = Replace(strContent, "{$BestString}", BestString)
            
            i = i + 1
            Loop
            strContent = strContent & "</table>"
        End If

        : Set Rs = Nothing
        LoadArticleList = strContent
    End Function
    '================================================
'Function name: ReadArticleList
'Use: Read the article list
'Arguments: str ----original string
    '================================================
    Public Function ReadArticleList(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent
        Dim arrTempContent, arrTempContents, ArrayList
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadArticleList(") > 0 Then
            sTempContent = (strTemp, "{$ReadArticleList(", ")}", 1)
            nTempContent = (strTemp, "{$ReadArticleList(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")

            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadArticleList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11)))
            Next
        End If
        ReadArticleList = strTemp
    End Function
    '================================================
'Function name: LoadSoftList
'Use: Loading software list
'Arguments: ClassID ----Classification ID
ChannelID ----ChannelID
sType  ---Call Type
TopNum  --- Show list count
'           strlen   ---Show title length
ShowClass ----Does the classification be displayed
ShowDate  ---Date is displayed
'          DateMode  ---Show Date Mode
'                 newindow  ----New window opens
    '================================================
    Public Function LoadSoftList(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
        ByVal stype, ByVal TopNum, ByVal strLen, ByVal showclass, _
        ByVal showdate, ByVal DateMode, ByVal newindow, ByVal styles)

        Dim Rs, SQL, i, strContent, foundstr,j
        Dim strSoftName, ChildStr, ListStyle
        Dim HtmlFileName, BestCode, BestString,ChannelPath
        Dim ClassName, HtmlFileUrl, SoftTime, LinkTarget, SoftTopic

        ChannelID = (ChannelID)
        ClassID = (ClassID)
        SpecialID = (SpecialID)
        stype = (stype)

        On Error Resume Next
        (ChannelID)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & ChannelID & " And ClassID = " & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                LoadSoftList = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            
        Else
            ChildStr = 0
        End If
        Select Case CInt(stype)
            Case 0: foundstr = "Order By  Desc , Desc"
            Case 1: foundstr = "And  > 0 Order By  Desc , Desc"
            Case 2: foundstr = "Order By  Desc , Desc"
            Case 3: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 Order By  Desc , Desc"
            Case 5: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
        Case Else
            foundstr = "Order By  Desc , Desc"
        End Select
        If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
            foundstr = "Order By  Desc , Desc"
        End If
        If CLng(SpecialID) <> 0 Then
            foundstr = "And  =" & CLng(SpecialID) & " " & foundstr
        End If
        SQL = " ,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(TopNum) & SQL & " ,,,, FROM [NC_SoftList] A INNER JOIN [NC_Classify] C On = WHERE >0 And =" & ChannelID & " " & foundstr & ""
        Set Rs = (SQL)
        j = 0

        If  And  Then
strContent = "No software was added!"
        Else
            SQL=(-1)
            strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
            For i=0 To Ubound(SQL,2)
                If (j Mod 2) = 0 Then
                    ListStyle = Trim(styles) & 1
                Else
                    ListStyle = Trim(styles) & 2
                End If
                If CInt(SQL(9,i)) <> 0 Then
                    BestCode = 2
BestString = "<font color='" & (3) & "'>Recommended</font>"
                Else
                    BestCode = 1
                    BestString = ""
                End If
                strContent = strContent & (14)
                strSoftName = (SQL(4,i) & " " & SQL(5,i), CInt(strLen))
                strSoftName = (strSoftName, SQL(2,i), SQL(3,i))
                ClassName = (SQL(10,i), SQL(11,i), SQL(12,i))
                HtmlFileName = (SQL(8,i), SQL(0,i), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & SQL(13,i) & (SQL(8,i), ) & HtmlFileName
                    ClassName = "<a href='" &  & SQL(13,i) & "index" &  & "'>" & ClassName & "</a>"
                Else
                    HtmlFileUrl =  & "?<a href='" &  & "?class'>" & ClassName & "</a>"
                End If
                If CInt(showclass) = 0 Then ClassName = ""
                If CInt(showdate) <> 0 Then
                    SoftTime = (SQL(7,i), CInt(DateMode))
                Else
                    SoftTime = ""
                End If
                If CInt(newindow) <> 0 Then
                    LinkTarget = " target=""_blank"""
                Else
                    LinkTarget = ""
                End If
SoftTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & & " Name: " & Trim(SQL(4,i) & " & SQL(5,i)) & "&#13;&#10;Published: " & SQL(7,i) & " " &#13;&#10;Download times: " & SQL(6,i) & "' class=showlist>" & strSoftName & "</a>"
                strContent = Replace(strContent, "{$SoftTopic}", SoftTopic)
                strContent = Replace(strContent, "{$SoftID}", Rs("softid"))
                strContent = Replace(strContent, "{$InstallDir}", )
                strContent = Replace(strContent, "{$SoftName}", strSoftName)
                strContent = Replace(strContent, "{$Title}", SQL(4,i))
                strContent = Replace(strContent, "{$DateAndTitle}", SQL(7,i))
                strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
                strContent = Replace(strContent, "{$ClassName}", ClassName)
                strContent = Replace(strContent, "[]", "")
                strContent = Replace(strContent, "{$Target}", LinkTarget)
                strContent = Replace(strContent, "{$SoftTime}", SoftTime)
                strContent = Replace(strContent, "{$SoftHits}", SQL(6,i))
                strContent = Replace(strContent, "{$ListStyle}", ListStyle)
                strContent = Replace(strContent, "{$BestCode}", BestCode)
                strContent = Replace(strContent, "{$BestString}", BestString)
            j = j + 1
            Next
            SQL=Null
            strContent = strContent & "</table>"
        End If
        : Set Rs = Nothing
        LoadSoftList = strContent
    End Function
    '================================================
'Function name: ReadSoftList
'Use: Read the software list
'Arguments: str ----original string
    '================================================
    Public Function ReadSoftList(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent
        Dim arrTempContent, arrTempContents, ArrayList
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadSoftList(") > 0 Then
            sTempContent = (strTemp, "{$ReadSoftList(", ")}", 1)
            nTempContent = (strTemp, "{$ReadSoftList(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadSoftList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10)))
            Next
        End If
        ReadSoftList = strTemp
    End Function

    '================================================
'Function name: LoadFlashList
'Use: Load the animation list
'Arguments: ClassID ----Classification ID
ChannelID ----ChannelID
sType  ---Call Type
TopNum  --- Show list count
'           strlen   ---Show title length
ShowClass ----Does the classification be displayed
ShowDate  ---Date is displayed
'          DateMode  ---Show Date Mode
'                 newindow  ----New window opens
    '================================================
    Public Function LoadFlashList(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
        ByVal stype, ByVal TopNum, ByVal strLen, ByVal showclass, _
        ByVal showdate, ByVal DateMode, ByVal newindow, ByVal styles)

        Dim Rs, SQL, i, strContent, foundstr,j
        Dim strTitle, ChildStr, ListStyle
        Dim HtmlFileName, BestCode, BestString,ChannelPath
        Dim ClassName, HtmlFileUrl, addTime, LinkTarget, FlashTopic

        ChannelID = (ChannelID)
        ClassID = (ClassID)
        SpecialID = (SpecialID)
        stype = (stype)

        On Error Resume Next
        (ChannelID)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & ChannelID & " And ClassID = " & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                LoadFlashList = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            
        Else
            ChildStr = 0
        End If
        Select Case CInt(stype)
            Case 0: foundstr = "Order By  Desc , Desc"
            Case 1: foundstr = "And  > 0 Order By  Desc , Desc"
            Case 2: foundstr = "Order By  Desc , Desc"
            Case 3: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 Order By  Desc , Desc"
            Case 5: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
        Case Else
            foundstr = "Order By  Desc , Desc"
        End Select
        If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
            foundstr = "Order By  Desc , Desc"
        End If
        If CLng(SpecialID) <> 0 Then
            foundstr = "And  =" & CLng(SpecialID) & " " & foundstr
        End If
        SQL = " ,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(TopNum) & SQL & " ,,,, FROM [NC_FlashList] A INNER JOIN [NC_Classify] C On = WHERE >0 And =" & ChannelID & " " & foundstr & ""
        Set Rs = (SQL)
        j = 0

        If  And  Then
strContent = "No information was added!"
        Else
            SQL=(-1)
            strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
            For i=0 To Ubound(SQL,2)
                If (j Mod 2) = 0 Then
                    ListStyle = Trim(styles) & 1
                Else
                    ListStyle = Trim(styles) & 2
                End If
                If CInt(SQL(9,i)) <> 0 Then
                    BestCode = 2
BestString = "<font color='" & (3) & "'>Recommended</font>"
                Else
                    BestCode = 1
                    BestString = ""
                End If
                strContent = strContent & (22)
                strTitle = (SQL(4,i), CInt(strLen))
                strTitle = (strTitle, SQL(2,i), SQL(3,i))
                ClassName = (SQL(10,i), SQL(11,i), SQL(12,i))
                HtmlFileName = (SQL(8,i), SQL(0,i), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & SQL(13,i) & (SQL(8,i), ) & HtmlFileName
                    ClassName = "<a href='" &  & SQL(13,i) & "index" &  & "'>" & ClassName & "</a>"
                Else
                    HtmlFileUrl =  & "?<a href='" &  & "?class'>" & ClassName & "</a>"
                End If
                If CInt(showclass) = 0 Then ClassName = ""
                If CInt(showdate) <> 0 Then
                    addTime = (SQL(7,i), CInt(DateMode))
                Else
                    addTime = ""
                End If
                If CInt(newindow) <> 0 Then
                    LinkTarget = " target=""_blank"""
                Else
                    LinkTarget = ""
                End If
FlashTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & & " & " & " & " & " " & StrTitle & "</a>"
                strContent = Replace(strContent, "{$FlashTopic}", FlashTopic)
                strContent = Replace(strContent, "{$FlashID}", Rs("flashid"))
                strContent = Replace(strContent, "{$InstallDir}", )
                strContent = Replace(strContent, "{$FlashTopic}", strTitle)
                strContent = Replace(strContent, "{$Title}", SQL(4,i))
                strContent = Replace(strContent, "{$DateAndTime}", SQL(7,i))
                strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
                strContent = Replace(strContent, "{$ClassName}", ClassName)
                strContent = Replace(strContent, "[]", "")
                strContent = Replace(strContent, "{$Target}", LinkTarget)
                strContent = Replace(strContent, "{$addTime}", addTime)
                strContent = Replace(strContent, "{$FlashHits}", SQL(6,i))
                strContent = Replace(strContent, "{$ListStyle}", ListStyle)
                strContent = Replace(strContent, "{$BestCode}", BestCode)
                strContent = Replace(strContent, "{$BestString}", BestString)
            j = j + 1
            Next
            SQL=Null
            strContent = strContent & "</table>"
        End If
        : Set Rs = Nothing
        LoadFlashList = strContent
    End Function
    '================================================
'Function name: ReadFlashList
'Use: Read the animation list
'Arguments: str ----original string
    '================================================
    Public Function ReadFlashList(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent
        Dim arrTempContent, arrTempContents, ArrayList
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadFlashList(") > 0 Then
            sTempContent = (strTemp, "{$ReadFlashList(", ")}", 1)
            nTempContent = (strTemp, "{$ReadFlashList(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadFlashList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10)))
            Next
        End If
        ReadFlashList = strTemp
    End Function
    '================================================
'Function name: LoadAnnounceContent
'Use: Loading content announcement
'Arguments: str ----original string
    '================================================
    Public Function LoadAnnounceContent(ByVal sTopic, ByVal ChannelID)
        Dim SQL, Rs, strTemp
        strTemp = ""
        sTopic = (sTopic)
        If sTopic <> "" And sTopic <> "0" Then
            SQL = "Select AnnounceID,Content,PostTime,writer From NC_Announce where AnnounceType=1 And title = '" & sTopic & "' Order By PostTime Desc,AnnounceID Desc"
        Else
            SQL = "Select AnnounceID,Content From NC_Announce where AnnounceType=1 And ChannelID in (" & ChannelID & ",999) Order By PostTime Desc,AnnounceID Desc"
        End If
        Set Rs = (SQL)
        If Not ( And ) Then
            strTemp = Rs("Content")
        End If
        : Set Rs = Nothing
        LoadAnnounceContent = strTemp
    End Function
    '================================================
'Function name: ReadAnnounceContent
'Use: Read content announcement
'Arguments: str ----original string
    '================================================
    Public Function ReadAnnounceContent(ByVal str, ByVal ChannelID)
        Dim strTemp, i, sTempContent, nTempContent, strValue
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$AnnounceContent(") > 0 Then
            sTempContent = (strTemp, "{$AnnounceContent(", ")}", 1)
            nTempContent = (strTemp, "{$AnnounceContent(", ")}", 0)
            If nTempContent = "" Then nTempContent = "0"
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                strValue = arrTempContent(i)
                strTemp = Replace(strTemp, arrTempContents(i), LoadAnnounceContent(strValue, ChannelID))
            Next
        End If
        ReadAnnounceContent = strTemp
    End Function
    '================================================
'Function name: LoadAnnounceList
'Use: Loading announcement list
'Arguments: maxnum ----Maximum number of announcements
'               maxlen ----character length
newindow ----If the new window is open 1=Yes, 0=No
showdate ---- Whether to display time 1=Yes, 0=No
DateMode ----Time Mode
showtree ----Tree display
    '================================================
    Public Function LoadAnnounceList(ByVal ChannelID, ByVal maxnum, ByVal maxlen, _
        ByVal newindow, ByVal showdate, ByVal DateMode, ByVal showtree)

        Dim Rs, SQL, strContent
        Dim AnnounceTopic, LinkTarget
        Dim PostTime

        ChannelID = (ChannelID)
        maxnum = (maxnum)
        If maxnum = 0 Then maxnum = 10

        On Error Resume Next
        Set Rs = ("SELECT TOP " & CInt(maxnum) & " AnnounceID,title,Content,PostTime,writer,hits FROM NC_Announce WHERE (ChannelID=" & ChannelID & " Or ChannelID=999) And AnnounceType<>1 ORDER BY PostTime DESC,AnnounceID DESC")
        If  And  Then
            LoadAnnounceList = ""
            Set Rs = Nothing
            Exit Function
        Else
            Do While Not 
                If CInt(newindow) <> 0 Then
                    LinkTarget = " target=""_blank"""
                Else
                    LinkTarget = ""
                End If
                If CInt(showdate) <> 0 Then
                    PostTime = (Rs("PostTime"), CInt(DateMode))
                Else
                    PostTime = ""
                End If
                AnnounceTopic = (Rs("title"), CInt(maxlen))
                AnnounceTopic = "<a href=""" &  & "?AnnounceID=" & Rs("AnnounceID") & """ title=""" & Rs("title") & """" & LinkTarget & ">" & AnnounceTopic & "</a>"
                If CInt(showtree) = 1 Then
                    strContent = strContent & "<div>· " & AnnounceTopic & "</div><div align=""right"" class=""dottedline"">" & PostTime & "</div>" & vbNewLine
                Else
                    strContent = strContent & "· " & AnnounceTopic & "&nbsp;&nbsp;" & PostTime & vbNewLine
                End If
                
            Loop
        End If
        LoadAnnounceList = strContent
    End Function
    '================================================
'Function name: ReadAnnounceList
'Use: Read the announcement list
'Arguments: str ----original string
    '================================================
    Public Function ReadAnnounceList(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent, ArrayList
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadAnnounceList(") > 0 Then
            sTempContent = (strTemp, "{$ReadAnnounceList(", ")}", 1)
            nTempContent = (strTemp, "{$ReadAnnounceList(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadAnnounceList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6)))
            Next
        End If
        ReadAnnounceList = strTemp
    End Function
    '================================================
'Function name: LoadArticlePic
'Use: Load article picture list
'Arguments: ClassID ----Classification ID
ChannelID ----ChannelID
'            sType  ---Calling article type, 0=all latest articles, 1=recommended articles, 2=popular articles, 3=graphic articles, 4= latest articles in categories
TopNum ----Show the number of article lists
'           strlen   ---Show title length
ShowClass ----Does the classification be displayed
'         ShowPic  --- Whether to display the graphic title
ShowDate  ---Date is displayed
'          DateMode  ---Show Date Mode
'                 newindow  ----New window opens
    '================================================
    Public Function LoadArticlePic(ChannelID, ClassID, SpecialID, stype, TopNum, PerRowNum, strLen, newindow, width, height, showtopic)
        Dim Rs, SQL, i, strContent, foundstr
        Dim sTitle, ChildStr, ImageUrl, HtmlFileName
        Dim HtmlFileUrl, WriteTime, LinkTarget

        ChannelID = (ChannelID)
        ClassID = (ClassID)
        SpecialID = (SpecialID)
        stype = (stype)

        On Error Resume Next
        (ChannelID)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & ChannelID & " And ClassID=" & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                LoadArticlePic = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            Set Rs = Nothing
        Else
            ChildStr = 0
        End If
        Select Case CInt(stype)
            Case 0: foundstr = "Order By  Desc , Desc"
            Case 1: foundstr = "And  > 0 Order By  Desc , Desc"
            Case 2: foundstr = "Order By  Desc , Desc"
            Case 3: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 Order By  Desc , Desc"
            Case 5: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
        Case Else
            foundstr = "Order By  Desc , Desc"
        End Select
        If CInt(stype) >= 4 And CLng(ClassID) = 0 Then
            foundstr = "Order By  Desc , Desc"
        End If
        If CLng(SpecialID) <> 0 Then
            foundstr = "And  =" & CLng(SpecialID) & " " & foundstr
        End If
        SQL = " ,,,,,,,,"
        SQL = "select Top " & CInt(TopNum) & SQL & " ,, from [NC_Article] A inner join [NC_Classify] C On = where  > 0 And <>'' And =" & ChannelID & " " & foundstr & ""
        Set Rs = (SQL)
        If  And  Then
            strContent = "<img src='" &  & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>"
        Else
            strContent = "<table width=""100%"" border=0 cellpadding=1 cellspacing=5>" & vbCrLf
            Do While Not 

                strContent = strContent & "<tr>" & vbCrLf
                For i = 1 To CInt(PerRowNum)
                    strContent = strContent & "<td align=""center"" class=""imagelist"">"
                    If Not  Then
                        sTitle = (Rs("title"), CInt(strLen))
                        ImageUrl = (Rs("ImageUrl"), (1))
                        ImageUrl = (ImageUrl, height, width)

                        HtmlFileName = (Rs("HtmlFileDate"), Rs("ArticleID"), , , , "")
                        If CInt() <> 0 Then
                            HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                        Else
                            HtmlFileUrl =  & "?ArticleID")
                        End If

                        If CInt(newindow) <> 0 Then
                            LinkTarget = " target=""_blank"""
                        Else
                            LinkTarget = ""
                        End If
                        strContent = strContent & (18)
                        strContent = Replace(strContent, "{$ArticlePicture}", "<a href='" & HtmlFileUrl & "' title='" & Rs("title") & "'" & LinkTarget & ">" & ImageUrl & "</a>")
                        If CInt(showtopic) = 1 Then
                            strContent = Replace(strContent, "{$ArticleTopic}", "<a href='" & HtmlFileUrl & "' title='" & Rs("title") & "'" & LinkTarget & ">" & sTitle & "</a>")
                        Else
                            strContent = Replace(strContent, "{$ArticleTopic}", vbNullString)
                        End If
                        strContent = strContent & "</td>" & vbCrLf
                    
                End If
            Next
            strContent = strContent & "</tr>" & vbCrLf
            Loop
            strContent = strContent & "</table>" & vbCrLf
        End If
        : Set Rs = Nothing
        LoadArticlePic = strContent
    End Function
    '================================================
'Function name: ReadArticlePic
'Use: Read the list of article pictures
'Arguments: str ----original string
    '================================================
    Public Function ReadArticlePic(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent, ArrayList
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadArticlePic(") > 0 Then
            sTempContent = (strTemp, "{$ReadArticlePic(", ")}", 1)
            nTempContent = (strTemp, "{$ReadArticlePic(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadArticlePic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10)))
            Next
        End If
        ReadArticlePic = strTemp
    End Function
    '================================================
'Function name: LoadSoftPic
'Use: Loading software picture list
'Arguments: ClassID ----Classification ID
ChannelID ----ChannelID
'              sType  ----Calling software type, 0=all latest software, 1=recommended software, 2=popular software
TopNum ----Show the number of software lists
'           strlen   ---Show title length
'                 newindow  ----New window opens
    '================================================
    Public Function LoadSoftPic(ChannelID, ClassID, SpecialID, stype, TopNum, PerRowNum, strLen, newindow, width, height, showtopic)
        Dim Rs, SQL, i, strContent, foundstr
        Dim strSoftName, ChildStr, SoftImage, HtmlFileName
        Dim HtmlFileUrl, SoftTime, LinkTarget

        ChannelID = (ChannelID)
        ClassID = (ClassID)
        SpecialID = (SpecialID)
        stype = (stype)

        On Error Resume Next
        (ChannelID)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "select ChildStr from [NC_Classify] where ChannelID = " & ChannelID & " And ClassID = " & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                LoadSoftPic = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            
        Else
            ChildStr = 0
        End If
        Select Case CInt(stype)
            Case 0: foundstr = "Order By  Desc , Desc"
            Case 1: foundstr = "And  > 0 Order By  Desc , Desc"
            Case 2: foundstr = "Order By  Desc , Desc"
            Case 3: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 Order By  Desc , Desc"
            Case 5: foundstr = "And  in (" & ChildStr & ") Order By  Desc , Desc"
        Case Else
            foundstr = "Order By  Desc , Desc"
        End Select
        If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
            foundstr = "Order By  Desc , Desc"
        End If
        If CLng(SpecialID) <> 0 Then
            foundstr = "And  =" & CLng(SpecialID) & " " & foundstr
        End If
        SQL = " ,,,,,,,,,"
        SQL = "select Top " & CInt(TopNum) & SQL & " ,, from [NC_SoftList] A inner join [NC_Classify] C On = where >0 And <>'' And =" & ChannelID & " " & foundstr & ""
        Set Rs = (SQL)
        If  And  Then
            strContent = "<img src='" &  & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>"
        Else
            strContent = "<table width=""100%"" border=""0"" cellpadding=""1"" cellspacing=""3"">" & vbCrLf
            Do While Not 
                strContent = strContent & "<tr>" & vbCrLf
                For i = 1 To CInt(PerRowNum)
                    strContent = strContent & "<td align=""center"" class=""imagelist"">"
                    If Not  Then
                        strSoftName = (Rs("SoftName") & " " & Rs("SoftVer"), CInt(strLen))
                        SoftImage = (Rs("SoftImage"), (1))
                        SoftImage = (SoftImage, height, width)
                        HtmlFileName = (Rs("HtmlFileDate"), Rs("SoftID"), , , , "")
                        If CInt() <> 0 Then
                            HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                        Else
                            HtmlFileUrl =  & "?SoftID")
                        End If
                        If CInt(newindow) <> 0 Then
                            LinkTarget = " target=""_blank"""
                        Else
                            LinkTarget = ""
                        End If
                        strContent = strContent & (19)
                        strContent = Replace(strContent, "{$SoftPicture}", "<a href='" & HtmlFileUrl & "' title='" & Rs("SoftName") & "'" & LinkTarget & ">" & SoftImage & "</a>")
                        If CInt(showtopic) = 1 Then
                            strContent = Replace(strContent, "{$SoftTopic}", "<a href='" & HtmlFileUrl & "' title='" & Rs("SoftName") & "'" & LinkTarget & ">" & strSoftName & "</a>")
                        Else
                            strContent = Replace(strContent, "{$SoftTopic}", vbNullString)
                        End If
                        strContent = strContent & "</td>" & vbCrLf
                    
                End If
            Next
            strContent = strContent & "</tr>" & vbCrLf
            Loop
            strContent = strContent & "</table>" & vbCrLf
        End If
        : Set Rs = Nothing
        LoadSoftPic = strContent
    End Function
    '================================================
'Function name: ReadSoftPic
'Use: Read the software picture list
'Arguments: str ----original string
    '================================================
    Public Function ReadSoftPic(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent, ArrayList
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadSoftPic(") > 0 Then
            sTempContent = (strTemp, "{$ReadSoftPic(", ")}", 1)
            nTempContent = (strTemp, "{$ReadSoftPic(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadSoftPic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10)))
            Next
        End If
        ReadSoftPic = strTemp
    End Function
    '================================================
'Function name: LoadFlashPic
'Use: Load animated picture list
'Arguments: ClassID ----Classification ID
ChannelID ----ChannelID
'             sType  ---Call animation type, 0=all latest animations, 1=recommended animations, 2=popular animations
TopNum ----Show the number of animation lists
'           strlen   ---Show title length
'                 newindow  ----New window opens
    '================================================
    Public Function LoadFlashPic(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
        ByVal stype, ByVal TopNum, ByVal PerRowNum, ByVal strLen, ByVal newindow, _
        ByVal width, ByVal height, ByVal showtopic)

        Dim Rs, SQL, i, strContent, foundstr
        Dim strtitle, ChildStr, miniature, HtmlFileName
        Dim HtmlFileUrl, addTime, LinkTarget

        ChannelID = (ChannelID)
        ClassID = (ClassID)
        SpecialID = (SpecialID)
        stype = (stype)

        On Error Resume Next
        (ChannelID)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID = " & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                LoadFlashPic = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            
        Else
            ChildStr = 0
        End If

        Select Case CInt(stype)
            Case 0: foundstr = "ORDER BY  DESC , DESC"
            Case 1: foundstr = "And  > 0 ORDER BY  DESC , DESC"
            Case 2: foundstr = "ORDER BY  DESC , DESC"
            Case 3: foundstr = "And  in (" & ChildStr & ") ORDER BY  DESC , DESC"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 ORDER BY  DESC , DESC"
            Case 5: foundstr = "And  in (" & ChildStr & ") ORDER BY  DESC , DESC"
        Case Else
            foundstr = "ORDER BY  DESC , DESC"
        End Select
        If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
            foundstr = "ORDER BY  DESC , DESC"
        End If
        If CLng(SpecialID) <> 0 Then
            foundstr = "And  =" & CLng(SpecialID) & " " & foundstr
        End If
        SQL = " ,,,,,,,,"
        SQL = "SELECT TOP " & CInt(TopNum) & SQL & " ,, FROM [NC_FlashList] A INNER JOIN [NC_Classify] C On = WHERE >0 And <>'' And =" & ChannelID & " " & foundstr & ""
        Set Rs = (SQL)
        If  And  Then
            strContent = "<img src='" &  & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>"
        Else
            strContent = "<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""3"">" & vbCrLf
            Do While Not 
                strContent = strContent & "<tr>" & vbCrLf
                For i = 1 To CInt(PerRowNum)
                    strContent = strContent & "<td align=""center"" class=""imagelist"">"
                    If Not  Then
                        strtitle = (Rs("title"), CInt(strLen))
                        miniature = (Rs("miniature"), (1))
                        miniature = (miniature, height, width)
                        HtmlFileName = (Rs("HtmlFileDate"), Rs("flashid"), , , , "")
                        If CInt() <> 0 Then
                            HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                        Else
                            HtmlFileUrl =  & "?flashid")
                        End If
                        If CInt(newindow) <> 0 Then
                            LinkTarget = " target=""_blank"""
                        Else
                            LinkTarget = ""
                        End If
                        strContent = strContent & (21)
                        strContent = Replace(strContent, "{$Miniature}", "<a href='" & HtmlFileUrl & "' title='" & Rs("title") & "'" & LinkTarget & ">" & miniature & "</a>")
                        If CInt(showtopic) = 1 Then
                            strContent = Replace(strContent, "{$FlashTopic}", "<a href='" & HtmlFileUrl & "' title='" & Rs("title") & "'" & LinkTarget & ">" & strtitle & "</a>")
                        Else
                            strContent = Replace(strContent, "{$FlashTopic}", vbNullString)
                        End If
                        strContent = strContent & "</td>" & vbCrLf
                    
                    End If
                Next
            strContent = strContent & "</tr>" & vbCrLf
            Loop
            strContent = strContent & "</table>" & vbCrLf
        End If
        : Set Rs = Nothing
        LoadFlashPic = strContent
    End Function
    '================================================
'Function name: ReadFlashPic
'Use: Read the animation picture list
'Arguments: str ----original string
    '================================================
    Public Function ReadFlashPic(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent, ArrayList
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadFlashPic(") > 0 Then
            sTempContent = (strTemp, "{$ReadFlashPic(", ")}", 1)
            nTempContent = (strTemp, "{$ReadFlashPic(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadFlashPic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10)))
            Next
        End If
        ReadFlashPic = strTemp
    End Function
    '================================================
'Function name: LoadFriendLink
'Use: Load friendly connection
'Arguments: str ----original string
    '================================================
    Public Function LoadFriendLink(ByVal TopNum, ByVal PerRowNum, ByVal isLogo, ByVal orders)
        Dim Rs, SQL, i, strContent
        Dim strOrder, LinkAddress

        strContent = ""
        If Not IsNumeric(TopNum) Then Exit Function
        If Not IsNumeric(PerRowNum) Then Exit Function
        If Not IsNumeric(isLogo) Then Exit Function
        If Not IsNumeric(orders) Then Exit Function
        On Error Resume Next
        If CInt(orders) = 1 Then
'-- The home page display is arranged in ascending order of time
            strOrder = "And isIndex > 0 Order By LinkTime Desc,LinkID Desc"
        ElseIf CInt(orders) = 2 Then
'-- The home page display is sorted in ascending order by clicks
            strOrder = "And isIndex > 0 Order By LinkHist Desc,LinkID Desc"
        ElseIf CInt(orders) = 3 Then
'-- The home page display is sorted in descending order by clicks
            strOrder = "And isIndex > 0 Order By LinkHist Desc,LinkID Asc"
        ElseIf CInt(orders) = 4 Then
'-- All are sorted in ascending order
            strOrder = "Order By LinkID Desc"
        ElseIf CInt(orders) = 5 Then
'-- All sorted in descending order
            strOrder = "Order By LinkID Asc"
        ElseIf CInt(orders) = 6 Then
'-- All are sorted ascending in clicks
            strOrder = "Order By LinkHist Desc,LinkID Desc"
        ElseIf CInt(orders) = 7 Then
'-- All sorted in descending order by clicks
            strOrder = "Order By LinkHist Desc,LinkID Asc"
        ElseIf CInt(orders) = 8 Then
'-- The home page display is arranged by name
            strOrder = "And isIndex > 0 Order By LinkName Desc,LinkID Desc"
        ElseIf CInt(orders) = 9 Then
'-- All arranged by name
            strOrder = "Order By LinkName Desc,LinkID Desc"
        Else
'-- The home page displays sorted in descending order of time
            strOrder = "And isIndex > 0 Order By LinkTime Asc,LinkID Asc"
        End If
        If CInt(isLogo) = 1 Or CInt(isLogo) = 3 Then
            SQL = "Select Top " & CInt(TopNum) & " LinkID,LinkName,LinkUrl,LogoUrl,Readme,LinkHist,isLogo from [NC_Link] where isLock = 0 And isLogo > 0 " & strOrder & ""
        Else
            SQL = "Select Top " & CInt(TopNum) & " LinkID,LinkName,LinkUrl,LogoUrl,Readme,LinkHist,isLogo from [NC_Link] where isLock = 0 And isLogo = 0 " & strOrder & ""
        End If
        Set Rs = (SQL)
        If Not ( And ) Then
            strContent = "<table width=""100%"" border=0 cellpadding=1 cellspacing=3 class=FriendLink1>" & vbCrLf
            Do While Not 
                strContent = strContent & "<tr>" & vbCrLf
                For i = 1 To CInt(PerRowNum)
                    strContent = strContent & "<td align=center class=FriendLink2>"
                    If Not  Then
                        If CInt(isLogo) < 2 Then
                            LinkAddress =  & "link/?LinkID") & "&url=" & Trim(Rs("LinkUrl"))
                        Else
                            LinkAddress = Trim(Rs("LinkUrl"))
                        End If
                        If Rs("isLogo") = 1 Or CInt(isLogo) = 3 Then
strContent= strContent & "<a href='" & LinkAddress & "' target=_blank title='Homepage name: " & Rs("LinkName") & "&#13;&#10;Number of clicks: " & Rs("LinkHist") & "'><img src='" & (Rs("LogoUrl")) & "' width=88 height=31 border=0></a>"
                        Else
strContent = strContent & "<a href='" & LinkAddress & "' target=_blank title='Homepage name: " & Rs("LinkName") & "& 13;&#10;Number of clicks: " & Rs("LinkHist") & "'>" & Rs("LinkName") & "</a>"
                        End If
                        strContent = strContent & "</td>" & vbCrLf
                        
                    Else
                        If CInt(isLogo) = 1 Or CInt(isLogo) = 3 Then
                            strContent = strContent & "<a href='" &  & "link/' target=_blank><img src='" &  & "images/' width=88 height=31 border=0></a>"
                        Else
strContent= strContent& "<a href='" & & "link/' target=_blank>More Connections</a>"
                        End If
                        strContent = strContent & "</td>" & vbCrLf
                    End If
                Next
                strContent = strContent & "</tr>" & vbCrLf
            Loop
            strContent = strContent & "</table>" & vbCrLf
        End If
        LoadFriendLink = strContent
    End Function
    '================================================
'Function name: ReadFriendLink
'Use: Read friendly connection
'Arguments: str ----original string
    '================================================
    Public Function ReadFriendLink(ByVal str)
        Dim strTemp, i
        Dim sTempContent, nTempContent, ArrayList
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$ReadFriendLink(") > 0 Then
            sTempContent = (strTemp, "{$ReadFriendLink(", ")}", 1)
            nTempContent = (strTemp, "{$ReadFriendLink(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadFriendLink(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
            Next
        End If
        ReadFriendLink = strTemp
    End Function
    '================================================
'Function name: PageRunTime
'Use: page execution time
    '================================================
    Public Function ExecutionTime()
        Dim Endtime
        ExecutionTime = ""
        If CInt() = 1 Then
            Endtime = Timer()
ExecutionTime = "Page execution time: " & FormatNumber(((((Endtime - startime) * 5000) + 0.5) / 10, 3, -1) & "milliseconds"
        Else
            ExecutionTime = ""
        End If
    End Function

    '================================================
'Function name: CurrentStation
'Use: Current location
'Arguments:...
    '================================================
    Public Function CurrentStation(ByVal ChannelID, ByVal ClassID, ByVal ClassName, _
        ByVal ParentID, ByVal strParent, ByVal HtmlFileDir, ByVal Compart)

        Dim rsCurrent, SQL, strContent, ChannelDir

        CurrentStation = ""
        ChannelID = (ChannelID)
        ClassID = (ClassID)
        ParentID = (ParentID)

        On Error Resume Next
        (ChannelID)

        ChannelDir = 

        strContent = "<a href='" & ChannelDir & "'>" &  & "</a>" & Compart & ""
        If ParentID <> 0 And Len(strParent) <> 0 Then
            SQL = "SELECT ClassID,ClassName,HtmlFileDir,UseHtml FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID in(" & strParent & ")"
            Set rsCurrent = (SQL)
            If Not ( And ) Then
                Do While Not 

                    If CInt() <> 0 Then
                        strContent = strContent & "<a href='" & ChannelDir & rsCurrent("HtmlFileDir") & "'>" & rsCurrent("ClassName") & "</a>" & Compart & ""
                    Else
                        strContent = strContent & "<a href='" & ChannelDir & "?classClassID") & "'>" & rsCurrent("ClassName") & "</a>" & Compart & ""
                    End If
                    
                Loop
            End If
            
            Set rsCurrent = Nothing
        End If
        If CInt() <> 0 Then
            strContent = strContent & "<a href='" & ChannelDir & HtmlFileDir & "'>" & ClassName & "</a>"
        Else
            strContent = strContent & "<a href='" & ChannelDir & "?class'>" & ClassName & "</a>"
        End If
        CurrentStation = strContent
    End Function
    '================================================
'Function name: ReadCurrentStation
'Use: read the current location
'Arguments: str ----original string
    '================================================
    Public Function ReadCurrentStation(ByVal str, ByVal ChannelID, ByVal ClassID, _
        ByVal ClassName, ByVal ParentID, ByVal strParent, ByVal HtmlFileDir)

        Dim strTemp, i
        Dim sTempContent, nTempContent
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$CurrentStation(") > 0 Then
            sTempContent = (strTemp, "{$CurrentStation(", ")}", 1)
            nTempContent = (strTemp, "{$CurrentStation(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                strTemp = Replace(strTemp, arrTempContents(i), CurrentStation(ChannelID, ClassID, ClassName, ParentID, strParent, HtmlFileDir, arrTempContent(i)))
            Next
        End If
        ReadCurrentStation = strTemp
    End Function
    '================================================
'Function name: NewsPictureAndText
'Use: Mixed graphic and text list
    '================================================
    Public Function NewsPictureAndText(ByVal chanid, ByVal ClassID, ByVal specid, _
        ByVal stype, ByVal height, ByVal width, ByVal maxlen, _
        ByVal maxline, ByVal hspace, ByVal vspace, ByVal align, _
        ByVal divcss, ByVal target, ByVal start, ByVal showpic, _
        ByVal showclass, ByVal showdate, ByVal dateformat)

        Dim Rs, SQL, i, strContent, foundstr
        Dim ChildStr, HtmlFileUrl, HtmlFileName, strPicture
        Dim PicTopic, NewsTitle, ClassName, ArticleTitle, WriteTime

        chanid = (chanid)
        ClassID = (ClassID)
        specid = (specid)
        stype = (stype)

        On Error Resume Next
        (chanid)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & chanid & " And ClassID = " & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                NewsPictureAndText = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            
        Else
            ChildStr = "0"
        End If
        Select Case CInt(stype)
            Case 0: foundstr = "ORDER BY  DESC , DESC"
            Case 1: foundstr = "And  > 0 ORDER BY  DESC , DESC"
            Case 2: foundstr = " ORDER BY  DESC , DESC"
            Case 3: foundstr = "And  in (" & ChildStr & ") ORDER BY  DESC , DESC"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 ORDER BY  DESC , DESC"
            Case 5: foundstr = "And  in (" & ChildStr & ") And  >  ORDER BY  DESC , DESC"
            Case 6: foundstr = "And  in (" & ChildStr & ") ORDER BY  DESC , DESC"
        Case Else
            foundstr = "ORDER BY  DESC , DESC"
        End Select
        If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
            foundstr = "ORDER BY  DESC , DESC"
        End If
        If CLng(specid) <> 0 Then
            foundstr = "And  =" & CLng(specid) & " " & foundstr
        End If
        SQL = " ,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(maxline) & SQL & " ,,, FROM [NC_Article] A INNER JOIN [NC_Classify] C ON = WHERE >0 And =" & chanid & " " & foundstr & ""
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If  And  Then
strContent = "No content has been added yet!"
        Else
            Do While Not 
                NewsTitle = (Rs("title"), CInt(maxlen))
                NewsTitle = (NewsTitle, Rs("ColorMode"), Rs("FontMode"))
                PicTopic = (Rs("BriefTopic"))
                ClassName = (Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("ArticleID"), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                    ClassName = "[<a href='" &  & Rs("HtmlFileDir") & "index" &  & "'>" & ClassName & "</a>]"
                Else
                    HtmlFileUrl =  & "?ArticleID")
                    ClassName = "[<a href='" &  & "?classClassID") & "'>" & ClassName & "</a>]"
                End If
                If CInt(showclass) = 1 Then
                    ClassName = ClassName
                Else
                    ClassName = ""
                End If
                If CInt(showdate) = 1 Then
                    WriteTime = (Rs("WriteTime"), CInt(dateformat))
                Else
                    WriteTime = ""
                End If
ArticleTitle = "<div " & divcss & ">" & start & ClassName & " <a href=""" & HtmlFileUrl & "" target=""" & target & "" title=""" & & "Title: & Rs("title") & "&#13;&#10;Published time: " & Rs("WriteTime") & "" class=showlist>" & NewsTitle & "</a>  " & WriteTime & "</div>"
                strContent = strContent & ArticleTitle
                
                i = i + 1
            Loop
        End If
        : Set Rs = Nothing
        Dim sExtName, ExtName, ImageUrl
        If CInt(showpic) = 1 Then
            SQL = " ,,,,,,,"
            SQL = "SELECT " & SQL & " ,,,,,,,,,,, FROM ([NC_Article] A INNER JOIN [NC_Classify] C ON =) INNER JOIN [NC_Channel] B On = WHERE >0 And =" & CInt(chanid) & " And <>'' " & foundstr & ""
            Set Rs = (SQL)
            If  And  Then
                strPicture = "<img src='" &  &  & "images/no_pic.gif' width=""" & width & """ height=""" & height & """  hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0"">"
            Else
                HtmlFileName = (Rs("HtmlFileDate"), Rs("ArticleID"), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                Else
                    HtmlFileUrl =  & "?ArticleID")
                End If
                ImageUrl = (Rs("ImageUrl"), (1))
                sExtName = Split(Rs("ImageUrl"), ".")
                ExtName = sExtName(UBound(sExtName))
                Select Case LCase(ExtName)
                Case "swf", "swi"
                    strPicture = "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""/pub/shockwave/cabs/flash/#version=6,0,29,0"" width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """>" & vbNewLine
                    strPicture = strPicture & "     <param name=""movie"" value=""" & ImageUrl & """>" & vbNewLine
                    strPicture = strPicture & "     <param name=""quality"" value=""high"">" & vbNewLine
                    strPicture = strPicture & "     <embed src=""" & ImageUrl & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ quality=""high"" pluginspage=""/go/getflashplayer"" type=""application/x-shockwave-flash""></embed>" & vbNewLine
                    strPicture = strPicture & "</object>" & vbNewLine
                Case Else
strPicture = "<a href=""" & HtmlFileUrl & ""  target=""" & target & "" title=""" & & "Title: " & Rs("title") & "&#13;&#10;Published: " & Rs("WriteTime") & "Number of views: " & Rs( "AllHits") & ""><img src=""" & ImageUrl & "" width=""" & width & "" height=""" & height & "" hspace=""" & hspace & "" vspace=""" & vspace & "" align=""" & align & "" border=""0""></a>"
                End Select
            End If
            : Set Rs = Nothing
        Else
            strPicture = ""
        End If
        NewsPictureAndText = strPicture & strContent
    End Function
    '================================================
'Function name: ReadNewsPicAndText
'Use: Read the mixed-sorting list of pictures and texts
'Arguments: str ----original string
    '================================================
    Public Function ReadNewsPicAndText(ByVal str)
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents
        On Error Resume Next
        strTemp = str
        If InStr(strTemp, "{$NewsPictureAndText(") > 0 Then
            sTempContent = (strTemp, "{$NewsPictureAndText(", ")}", 1)
            nTempContent = (strTemp, "{$NewsPictureAndText(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), NewsPictureAndText(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13), ArrayList(14), ArrayList(15), ArrayList(16), ArrayList(17)))
            Next
        End If
        ReadNewsPicAndText = strTemp
    End Function
    '================================================
'Function name: SoftPictureAndText
'Use: Software graphic and text mixed list
    '================================================
    Public Function SoftPictureAndText(ByVal chanid, ByVal ClassID, ByVal specid, _
        ByVal stype, ByVal height, ByVal width, ByVal maxlen, _
        ByVal maxline, ByVal hspace, ByVal vspace, ByVal align, _
        ByVal divcss, ByVal target, ByVal start, ByVal showpic, _
        ByVal showclass, ByVal showdate, ByVal dateformat)

        Dim Rs, SQL, i, strContent, foundstr
        Dim ChildStr, HtmlFileUrl, HtmlFileName, strPicture
        Dim SoftTopic, ClassName, softname, SoftTime

        chanid = (chanid)
        ClassID = (ClassID)
        specid = (specid)
        stype = (stype)

        On Error Resume Next
        (chanid)

        If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & chanid & " And ClassID = " & ClassID
            Set Rs = (SQL)
            If  And  Then
                Set Rs = Nothing
                SoftPictureAndText = ""
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
            End If
            
        Else
            ChildStr = "0"
        End If
        Select Case CInt(stype)
            Case 0: foundstr = "ORDER BY  DESC , DESC"
            Case 1: foundstr = "And  > 0 ORDER BY  DESC , DESC"
            Case 2: foundstr = "ORDER BY  DESC , DESC"
            Case 3: foundstr = "And  in (" & ChildStr & ") ORDER BY  DESC , DESC"
            Case 4: foundstr = "And  in (" & ChildStr & ") And  > 0 ORDER BY  DESC , DESC"
            Case 5: foundstr = "And  in (" & ChildStr & ") ORDER BY  DESC , DESC"
        Case Else
            foundstr = "ORDER BY  DESC , DESC"
        End Select
        If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
            foundstr = "ORDER BY  DESC , DESC"
        End If
        If CLng(specid) > 0 Then
            foundstr = "And  =" & CLng(specid) & " " & foundstr
        End If
        SQL = " ,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(maxline) & SQL & " ,,, FROM [NC_SoftList] A INNER JOIN [NC_Classify] C ON = WHERE >0 And =" & chanid & " " & foundstr & ""
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If  And  Then
strContent = "No software has been added yet!"
        Else
            Do While Not 
                SoftTopic = (Trim(Rs("SoftName") & " " & Rs("SoftVer")), CInt(maxlen))
                SoftTopic = (SoftTopic, Rs("ColorMode"), Rs("FontMode"))
                ClassName = (Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("softid"), , , , "")
                If CInt() > 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                    ClassName = "[<a href='" &  & Rs("HtmlFileDir") & "index" &  & "'>" & ClassName & "</a>]"
                Else
                    HtmlFileUrl =  & "?softid")
                    ClassName = "[<a href='" &  & "?classClassID") & "'>" & ClassName & "</a>]"
                End If
                If CInt(showclass) = 1 Then
                    ClassName = ClassName
                Else
                    ClassName = ""
                End If
                If CInt(showdate) = 1 Then
                    SoftTime = (Rs("SoftTime"), CInt(dateformat))
                Else
                    SoftTime = ""
                End If
softname = "<div " & divcss & ">" & start & ClassName & " <a href=""" & HtmlFileUrl & "" target=""" & target & "" title=""" & & "Title: " & Rs("SoftNam e") & " " & Rs("SoftVer") & "& 13;& 10;Release time: " & Rs("SoftTime") & "" class=showlist>" & SoftTopic & "</a>  " & SoftTime & "</div>"
                strContent = strContent & softname
                
                i = i + 1
            Loop
        End If
        : Set Rs = Nothing
        Dim sExtName, ExtName, SoftImage
        If CInt(showpic) = 1 Then
            SQL = " ,,,,,,,,"
            SQL = "SELECT " & SQL & " ,,,,,,,,,, FROM ([NC_SoftList] A INNER JOIN [NC_Classify] C ON =) INNER JOIN [NC_Channel] B On = WHERE >0 And =" & CInt(chanid) & " And <>'' " & foundstr & ""
            Set Rs = (SQL)
            If  And  Then
                strPicture = "<img src='" &  &  & "images/no_pic.gif' width=""" & width & """ height=""" & height & """  hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0"">"
            Else
                HtmlFileName = (Rs("HtmlFileDate"), Rs("softid"), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                Else
                    HtmlFileUrl =  & "?softid")
                End If
                SoftImage = (Rs("SoftImage"), (1))
                sExtName = Split(Rs("SoftImage"), ".")
                ExtName = sExtName(UBound(sExtName))
                Select Case LCase(ExtName)
                Case "swf", "swi"
                    strPicture = "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""/pub/shockwave/cabs/flash/#version=6,0,29,0"" width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """>" & vbNewLine
                    strPicture = strPicture & "     <param name=""movie"" value=""" & SoftImage & """>" & vbNewLine
                    strPicture = strPicture & "     <param name=""quality"" value=""high"">" & vbNewLine
                    strPicture = strPicture & "     <embed src=""" & SoftImage & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ quality=""high"" pluginspage=""/go/getflashplayer"" type=""application/x-shockwave-flash""></embed>" & vbNewLine
                    strPicture = strPicture & "</object>" & vbNewLine
                Case Else
strPicture = "<a href=""" & HtmlFileUrl & ""  target=""" & target & "" title=""" & & "Title: " & Rs("SoftName") & " " & Rs("SoftVer") & "& 10;Published: " & Rs("SoftTime") & "& " Number of views: " & Rs("AllHits") & ""><img src=""" & SoftImage & "" width=""" & width & "" height=""" & height & "" hspace=""" & hspace & "" vspace=""" & vspace & "" align=""" & align & "" border=""0""></a>"
                End Select
            End If
            : Set Rs = Nothing
        Else
            strPicture = ""
        End If
        SoftPictureAndText = strPicture & strContent
    End Function
    '================================================
'Function name: ReadSoftPicAndText
'Use: Read the software graphic and text mixed list
'Arguments: str ----original string
    '================================================
    Public Function ReadSoftPicAndText(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$SoftPictureAndText(") > 0 Then
            sTempContent = (strTemp, "{$SoftPictureAndText(", ")}", 1)
            nTempContent = (strTemp, "{$SoftPictureAndText(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), SoftPictureAndText(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13), ArrayList(14), ArrayList(15), ArrayList(16), ArrayList(17)))
            Next
        End If
        ReadSoftPicAndText = strTemp
    End Function
    '================================================
'Function name: LoadGuestList
'Use: Load the message list
'Arguments: maxnum ----Maximum number of messages
'               maxlen ----character length
newindow ----If the new window is open 1=Yes, 0=No
showdate ---- Whether to display time 1=Yes, 0=No
DateMode ----Time Mode
'                      styles -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    '================================================
    Public Function LoadGuestList(ByVal maxnum, ByVal maxlen, ByVal newindow, _
        ByVal showdate, ByVal DateMode, ByVal styles)

        Dim Rs, SQL, strContent
        Dim i, ListStyle, GuestTopic, LinkTarget
        Dim WriteTime, lastime, GuestTitle,strChannelDir

        On Error Resume Next
        Set Rs = ("SELECT TOP " & CInt(maxnum) & " guestid,Topicformat,title,username,WriteTime,lastime,ReplyNum FROM NC_GuestBook WHERE isAccept>0 ORDER BY isTop DESC,lastime DESC,guestid DESC")
        If  And  Then
LoadGuestList = "No comments!"
            Set Rs = Nothing
            Exit Function
        Else
            i = 0
            strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
            strChannelDir = (4)
            Do While Not 
                If (i Mod 2) = 0 Then
                    ListStyle = Trim(styles) & 1
                Else
                    ListStyle = Trim(styles) & 2
                End If
                If CInt(newindow) <> 0 Then
                    LinkTarget = " target=""_blank"""
                Else
                    LinkTarget = ""
                End If
                If CInt(showdate) <> 0 Then
                    WriteTime = (Rs("WriteTime"), CInt(DateMode))
                    lastime = (Rs("lastime"), CInt(DateMode))
                Else
                    WriteTime = ""
                    lastime = ""
                End If
                GuestTitle = (Rs("title"))
                GuestTopic = "<span " & Rs("Topicformat") & ">" & (GuestTitle, CInt(maxlen)) & "</span>"
GuestTopic = "<a href=""" & strChannelDir & "?guestguestid") & ""  title=""Theme: " & GuestTitle & "&#13;&#10;Time: " & Rs("WriteTime") & "& """ & LinkTarget & ">" & GuestTopic & "</a>"
                strContent = strContent & (16)
                strContent = Replace(strContent, "{$GuestID}", Rs("guestid"))
                strContent = Replace(strContent, "{$UserName}", (Rs("username")))
                strContent = Replace(strContent, "{$GuestTopic}", GuestTopic)
                strContent = Replace(strContent, "{$ListStyle}", ListStyle)
                strContent = Replace(strContent, "{$Number}", i)
                strContent = Replace(strContent, "{$WriteTime}", WriteTime)
                strContent = Replace(strContent, "{$lastime}", lastime)
                
                i = i + 1
            Loop
            strContent = strContent & "</table>"
        End If
        LoadGuestList = strContent
    End Function
    '================================================
'Function name: ReadGuestList
'Use: read the message list
'Arguments: str ----original string
    '================================================
    Public Function ReadGuestList(ByVal str)
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$ReadGuestList(") > 0 Then
            sTempContent = (strTemp, "{$ReadGuestList(", ")}", 1)
            nTempContent = (strTemp, "{$ReadGuestList(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadGuestList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5)))
            Next
        End If
        ReadGuestList = strTemp
    End Function
    '================================================
'Function name: LoadPopularSoft
'Use: Loading ranking software list
'Arguments: ClassID ----Classification ID
'           chanid  ----Channel ID
'                stype  ----Call Type
'                 maxline  --- Show the number of lists
'              maxlen   ---Show title length
showhits ---- Whether to display the number of downloads
'           target  ---Connect the target
'                                                                                                                              �
'                styles  ---Style Name
    '================================================
    Public Function LoadPopularSoft(ByVal chanid, ByVal ClassID, ByVal stype, _
        ByVal maxlen, ByVal maxline, ByVal showhits, _
        ByVal target, ByVal start, ByVal styles)

        Dim SQL, Rs, foundsql, strHits
        Dim ChildStr, i, strContent
        Dim HtmlFileName, HtmlFileUrl
        Dim NewsTitle, AllHits, strSoftName
        Dim divstyle

        chanid = (chanid)
        ClassID = (ClassID)
        stype = (stype)
        If chanid = 0 Then chanid = 1

        On Error Resume Next
        (chanid)

        If CLng(ClassID) > 0 And Trim(ClassID) <> "" Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & chanid & " And class"
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
                foundsql = "And  in (" & ChildStr & ")"
            End If
            
        Else
            ChildStr = "0"
            foundsql = ""
        End If

        Select Case CInt(stype)
        Case 1
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "DayHits"
        Case 2
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "WeekHits"
        Case 3
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "MonthHits"
        Case 4
            foundsql = foundsql & " And >0 ORDER BY  DESC , DESC"
            strHits = "AllHits"
        Case Else
            foundsql = foundsql & "ORDER BY  DESC , DESC"
            strHits = "AllHits"
        End Select
        SQL = " ,,,,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(maxline) & SQL & " ,,, FROM [NC_SoftList] A INNER JOIN [NC_Classify] C ON = WHERE >0 And =" & chanid & " " & foundsql
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If  And  Then
strContent = "No content was found yet!"
        Else
            Do While Not 
                If Trim(styles) <> "" And Trim(styles) <> "0" Then
                    If (i Mod 2) = 0 Then
                        divstyle = " class=""" & Trim(styles) & "1"""
                    Else
                        divstyle = " class=""" & Trim(styles) & "2"""
                    End If
                End If

                NewsTitle = (Rs("SoftName") & " " & Rs("SoftVer"), CInt(maxlen))
                NewsTitle = (NewsTitle, Rs("ColorMode"), Rs("FontMode"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("SoftID"), , , , "")
                If CInt() > 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                Else
                    HtmlFileUrl =  & "?softid")
                End If
                If CInt(showhits) > 0 Then
                    AllHits = Rs(strHits)
                Else
                    AllHits = ""
                End If
strSoftName = "<div" & divstyle & ">" & start & " <a href=""" & HtmlFileUrl & "" target=""" & target & "" title=""" & & " Name: " & Rs("SoftName")  & " & Rs("SoftVer") & "&#13;&#10;Published: " & Rs("SoftTime") & "" class=popular>" & NewsTitle & "</a> " & AllHits & "</div>"
                strContent = strContent & strSoftName

                
                i = i + 1
            Loop
        End If
        : Set Rs = Nothing
        LoadPopularSoft = strContent
    End Function
    '================================================
'Function name: ReadPopularSoft
'Use: Read the software ranking list
'Arguments: str ----original string
    '================================================
    Public Function ReadPopularSoft(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$ReadPopularSoft(") > 0 Then
            sTempContent = (strTemp, "{$ReadPopularSoft(", ")}", 1)
            nTempContent = (strTemp, "{$ReadPopularSoft(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadPopularSoft(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
            Next
        End If
        ReadPopularSoft = strTemp
    End Function
    '================================================
'Function name: LoadPopularArticle
'Use: Loading the ranking article list
'Arguments: ClassID ----Classification ID
'           chanid  ----Channel ID
'                stype  ----Call Type
'                 maxline  --- Show the number of lists
'              maxlen   ---Show title length
showhits ---- Whether to display the number of downloads
'           target  ---Connect the target
'                                                                                                                              �
'                styles  ---Style Name
    '================================================
    Public Function LoadPopularArticle(ByVal chanid, ByVal ClassID, ByVal stype, _
        ByVal maxlen, ByVal maxline, ByVal showhits, ByVal target, _
        ByVal start, ByVal styles)

        Dim SQL, Rs, foundsql, strHits
        Dim ChildStr, i, strContent
        Dim HtmlFileName, HtmlFileUrl
        Dim NewsTitle, AllHits, ArticleTitle
        Dim divstyle

        chanid = (chanid)
        ClassID = (ClassID)
        stype = (stype)

        If chanid = 0 Then chanid = 2

        On Error Resume Next
        (chanid)

        If CLng(ClassID) > 0 And Trim(ClassID) <> "" Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & chanid & " And class"
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
                foundsql = "And  in (" & ChildStr & ")"
            End If
            
        Else
            ChildStr = "0"
            foundsql = ""
        End If
        Select Case CInt(stype)
        Case 1
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "DayHits"
        Case 2
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "WeekHits"
        Case 3
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "MonthHits"
        Case 4
            foundsql = foundsql & " And >0 ORDER BY  DESC , DESC"
            strHits = "AllHits"
        Case Else
            foundsql = foundsql & "ORDER BY  DESC , DESC"
            strHits = "AllHits"
        End Select
        SQL = " ,,,,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(maxline) & SQL & " ,,, FROM [NC_Article] A INNER JOIN [NC_Classify] C ON = WHERE >0 And =" & chanid & " " & foundsql
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If  And  Then
strContent = "No software has been found yet!"
        Else
            Do While Not 
                If Trim(styles) <> "" And Trim(styles) <> "0" Then
                    If (i Mod 2) = 0 Then
                        divstyle = " class=""" & Trim(styles) & "1"""
                    Else
                        divstyle = " class=""" & Trim(styles) & "2"""
                    End If
                End If
                NewsTitle = (Rs("title"), CInt(maxlen))
                NewsTitle = (NewsTitle, Rs("ColorMode"), Rs("FontMode"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("ArticleID"), , , , "")
                If CInt() > 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                Else
                    HtmlFileUrl =  & "?ArticleID")
                End If
                If CInt(showhits) > 0 Then
                    AllHits = Rs(strHits)
                Else
                    AllHits = ""
                End If
ArticleTitle = "<div" & divstyle & ">" & start & " <a href=""” & HtmlFileUrl & "" target=""” & target & "" title=""” & & "Title: " & R s("title") & "&#13;&#10;Published time: " & Rs("WriteTime") & "" class=popular>" & NewsTitle & "</a>  " & AllHits & "</div>"
                strContent = strContent & ArticleTitle
                
                i = i + 1
            Loop
        End If
        : Set Rs = Nothing
        LoadPopularArticle = strContent
    End Function
    '================================================
'Function name: ReadPopularSoft
'Use: Read the software ranking list
'Arguments: str ----original string
    '================================================
    Public Function ReadPopularArticle(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$ReadPopularArticle(") > 0 Then
            sTempContent = (strTemp, "{$ReadPopularArticle(", ")}", 1)
            nTempContent = (strTemp, "{$ReadPopularArticle(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadPopularArticle(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
            Next
        End If
        ReadPopularArticle = strTemp
    End Function
    '================================================
'Function name: LoadPopularFlash
'Use: Loading animation list
'Arguments: ClassID ----Classification ID
'           chanid  ----Channel ID
'                stype  ----Call Type
'                 maxline  --- Show the number of lists
'              maxlen   ---Show title length
showhits ---- Whether to display the number of downloads
'           target  ---Connect the target
'                                                                                                                              �
'                styles  ---Style Name
    '================================================
    Public Function LoadPopularFlash(ByVal chanid, ByVal ClassID, ByVal stype, _
        ByVal maxlen, ByVal maxline, ByVal showhits, _
        ByVal target, ByVal start, ByVal styles)

        Dim SQL, Rs, foundsql, strHits
        Dim ChildStr, i, strContent
        Dim HtmlFileName, HtmlFileUrl
        Dim NewsTitle, AllHits, strtitle
        Dim divstyle

        chanid = (chanid)
        ClassID = (ClassID)
        stype = (stype)
        If chanid = 0 Then chanid = 1

        On Error Resume Next
        (chanid)

        If CLng(ClassID) > 0 And Trim(ClassID) <> "" Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & chanid & " And class"
                Exit Function
            Else
                ChildStr = Rs("ChildStr")
                foundsql = "And  in (" & ChildStr & ")"
            End If
            
        Else
            ChildStr = "0"
            foundsql = ""
        End If

        Select Case CInt(stype)
        Case 1
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "DayHits"
        Case 2
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "WeekHits"
        Case 3
            foundsql = foundsql & " ORDER BY  DESC , DESC"
            strHits = "MonthHits"
        Case 4
            foundsql = foundsql & " And >0 ORDER BY  DESC , DESC"
            strHits = "AllHits"
        Case Else
            foundsql = foundsql & "ORDER BY  DESC , DESC"
            strHits = "AllHits"
        End Select
        SQL = " ,,,,,,,,,,,,"
        SQL = "SELECT TOP " & CInt(maxline) & SQL & " ,,, FROM [NC_FlashList] A INNER JOIN [NC_Classify] C ON = WHERE >0 And =" & chanid & " " & foundsql
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If  And  Then
strContent = "No content was found yet!"
        Else
            Do While Not 
                If Trim(styles) <> "" And Trim(styles) <> "0" Then
                    If (i Mod 2) = 0 Then
                        divstyle = " class=""" & Trim(styles) & "1"""
                    Else
                        divstyle = " class=""" & Trim(styles) & "2"""
                    End If
                End If

                NewsTitle = (Rs("title"), CInt(maxlen))
                NewsTitle = (NewsTitle, Rs("ColorMode"), Rs("FontMode"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("flashid"), , , , "")
                If CInt() > 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                Else
                    HtmlFileUrl =  & "?flashid")
                End If
                If CInt(showhits) > 0 Then
                    AllHits = Rs(strHits)
                Else
                    AllHits = ""
                End If
strrtitle = "<div" & divstyle & ">" & start & " <a href=""" & HtmlFileUrl & "" target=""" & target & "" title=""" & & " Name: " & Rs ("title") & "&#13;&#10;Published time: " & Rs("addTime") & "" class=popular>" & NewsTitle & "</a>  " & AllHits & "</div>"
                strContent = strContent & strtitle

                
                i = i + 1
            Loop
        End If
        : Set Rs = Nothing
        LoadPopularFlash = strContent
    End Function
    '================================================
'Function name: ReadPopularFlash
'Use: Read the animation ranking list
'Arguments: str ----original string
    '================================================
    Public Function ReadPopularFlash(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$ReadPopularFlash(") > 0 Then
            sTempContent = (strTemp, "{$ReadPopularFlash(", ")}", 1)
            nTempContent = (strTemp, "{$ReadPopularFlash(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadPopularFlash(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
            Next
        End If
        ReadPopularFlash = strTemp
    End Function
    '================================================
'Function name: LoadSoftType
'Usage: Loading software type list
'Arguments: chanid   ---Channel ID
'             SoftType  ---Soft Type
'                 maxline  --- Show the number of lists
'              maxlen   ---Show title length
'             showclass  --- Whether to display the classification
showdate  --- Whether to display the date
'          DateMode  ---Show Date Mode
'             newindow ---Whether the connection is opened in a new window
'                styles  ---Style Name
    '================================================
    Public Function LoadSoftType(ByVal chanid, ByVal SoftType, ByVal maxlen, _
        ByVal maxline, ByVal showclass, ByVal showdate, _
        ByVal DateMode, ByVal newindow, ByVal styles)

        Dim SQL, Rs, foundsql, strContent, i
        Dim strSoftName, ChildStr, ListStyle, HtmlFileName, BestCode, BestString
        Dim ClassName, HtmlFileUrl, SoftTime, LinkTarget, SoftTopic

        SoftType = (SoftType)
        chanid = (chanid)
        maxline = (maxline)
        If chanid = 0 Then chanid = 2
        If maxline = 0 Then maxline = 10

        On Error Resume Next
        (chanid)

        If Trim(SoftType) <> "" Then
            foundsql = "And ='" & SoftType & "' Order By  Desc , Desc"
        Else
            foundsql = "Order By  Desc , Desc"
        End If

        SQL = " ,,,,,,,,,,,"
        SQL = "SELECT TOP " & maxline & SQL & " ,,,, FROM [NC_SoftList] A INNER JOIN [NC_Classify] C ON = WHERE >0 And =" & chanid & " " & foundsql
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If  And  Then
strContent = "No software has been found yet!"
        Else
            strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
            Do While Not 
                If (i Mod 2) = 0 Then
                    ListStyle = Trim(styles) & 1
                Else
                    ListStyle = Trim(styles) & 2
                End If
                If Rs("isBest") <> 0 Then
                    BestCode = 2
BestString = "<font color='" & (3) & "'>Recommended</font>"
                Else
                    BestCode = 1
                    BestString = ""
                End If
                strContent = strContent & (14)
                strSoftName = (Rs("SoftName") & " " & Rs("SoftVer"), CInt(maxlen))
                strSoftName = (strSoftName, Rs("ColorMode"), Rs("FontMode"))

                ClassName = (Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
                HtmlFileName = (Rs("HtmlFileDate"), Rs("SoftID"), , , , "")
                If CInt() <> 0 Then
                    HtmlFileUrl =  & Rs("HtmlFileDir") & (Rs("HtmlFileDate"), ) & HtmlFileName
                    ClassName = "<a href='" &  & Rs("HtmlFileDir") & "index" &  & "'>" & ClassName & "</a>"
                Else
                    HtmlFileUrl =  & "?SoftID")
                    ClassName = "<a href='" &  & "?classClassID") & "'>" & ClassName & "</a>"
                End If
                If CInt(showclass) = 0 Then ClassName = ""
                If CInt(showdate) <> 0 Then
                    SoftTime = (Rs("SoftTime"), CInt(DateMode))
                Else
                    SoftTime = ""
                End If
                If CInt(newindow) <> 0 Then
                    LinkTarget = " target=""_blank"""
                Else
                    LinkTarget = ""
                End If

SoftTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & & " Name: " & Rs("SoftName") & "&#13;&#10;Published: " & Rs("SoftTime") & " "Number of downloads: " & Rs("AllHits") & "' class=showlist>" & strSoftName & "</a>"
                strContent = Replace(strContent, "{$SoftTopic}", SoftTopic)
                strContent = Replace(strContent, "{$InstallDir}", )
                strContent = Replace(strContent, "{$SoftName}", strSoftName)
                strContent = Replace(strContent, "{$Title}", Rs("SoftName"))
                strContent = Replace(strContent, "{$DateAndTitle}", Rs("SoftTime"))
                strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
                strContent = Replace(strContent, "{$ClassName}", ClassName)
                strContent = Replace(strContent, "[]", "")
                strContent = Replace(strContent, "{$Target}", LinkTarget)
                strContent = Replace(strContent, "{$SoftTime}", SoftTime)
                strContent = Replace(strContent, "{$SoftHits}", Rs("AllHits"))
                strContent = Replace(strContent, "{$ListStyle}", ListStyle)
                strContent = Replace(strContent, "{$BestCode}", BestCode)
                strContent = Replace(strContent, "{$BestString}", BestString)
                
                i = i + 1
            Loop
            strContent = strContent & "</table>"
        End If
        Set Rs = Nothing
        LoadSoftType = strContent
    End Function
    '================================================
'Function name: ReadSoftType
'Use: Read the software type list
'Arguments: str ----original string
    '================================================
    Public Function ReadSoftType(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$ReadSoftType(") > 0 Then
            sTempContent = (strTemp, "{$ReadSoftType(", ")}", 1)
            nTempContent = (strTemp, "{$ReadSoftType(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadSoftType(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
            Next
        End If
        ReadSoftType = strTemp
    End Function
    '================================================
'Function name: LoadUserRank
'Use: Install user ranking list
    '================================================
    Public Function LoadUserRank(ByVal stype,ByVal grade,ByVal maxline,ByVal styles)
        Dim SQL, Rs, foundsql, strContent, i
        Dim ListStyle,username

        stype = (stype)
        grade = (grade)
        maxline = (maxline)
        If maxline = 0 Then maxline = 10
        If stype = 1 Then
            foundsql = "ORDER BY JoinTime DESC,userid DESC"
        ElseIf stype = 2 Then
            foundsql = "ORDER BY LastTime DESC,userid DESC"
        ElseIf stype = 3 Then
            foundsql = "ORDER BY userpoint DESC,userid DESC"
        Else
            foundsql = "ORDER BY userlogin DESC,userid DESC"
        End If
        If grade > 0 Then
            SQL = "SELECT TOP " & maxline & " userid,username,userpoint,userlogin FROM [NC_User] WHERE UserGrade=" & grade & " " & foundsql
        Else
            SQL = "SELECT TOP " & maxline & " userid,username,userpoint,userlogin FROM [NC_User] " & foundsql
        End If
        Set Rs = (SQL)
        i = 0
        strContent = ""
        If Not ( And ) Then
            strContent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>"
            Do While Not 
                If (i Mod 2) = 0 Then
                    ListStyle = Trim(styles) & 1
                Else
                    ListStyle = Trim(styles) & 2
                End If
                username = "<a href=""" &  & "user/?useruserid") & """ target=""_blank"">" & Rs("username") & "</a>"
                strContent = strContent & (23)
                strContent = Replace(strContent, "{$ListStyle}", ListStyle)
                strContent = Replace(strContent, "{$InstallDir}", )
                strContent = Replace(strContent, "{$UserName}", username)
                strContent = Replace(strContent, "{$username}", Rs("username"))
                strContent = Replace(strContent, "{$UserID}", Rs("userid"))
                strContent = Replace(strContent, "{$UserLogin}", Rs("userlogin"))
                strContent = Replace(strContent, "{$UserPoint}", Rs("userpoint"))
                
                i = i + 1
                strContent = Replace(strContent, "{$OrderID}", i)
            Loop
            strContent = strContent & "</table>"
        End If
        : Set Rs = Nothing

        LoadUserRank = strContent
    End Function
    '================================================
'Function name: ReadUserRank
'Use: Read the user ranking list
'Arguments: str ----original string
    '================================================
    Public Function ReadUserRank(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        If InStr(strTemp, "{$ReadUserRank(") > 0 Then
            sTempContent = (strTemp, "{$ReadUserRank(", ")}", 1)
            nTempContent = (strTemp, "{$ReadUserRank(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadUserRank(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
            Next
        End If
        ReadUserRank = strTemp
    End Function
    '================================================
'Function name: LoadStatistic
'Use: Loading channel statistics
'Arguments: moduleid ----Affiliated module
ChannelID ----ChannelID
strClass ----The classification ID or software type called
'            style ---Statistics, 0=all statistics, 1=Today's updated statistics, 2=click count statistics, 3=Software capacity statistics
    '================================================
    Public Function LoadStatistic(ByVal moduleid, ByVal ChannelID, ByVal strClass, ByVal stype)

        moduleid = (moduleid)
        ChannelID = (ChannelID)
        stype = (stype)

        Dim Rs, SQL, StatCount
        Dim foundsql, ClassID, ChildStr

        ClassID = (strClass)
        On Error Resume Next
        LoadStatistic = 0
        If ClassID > 0 Then
            SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID=" & ClassID
            Set Rs = (SQL)
            If  And  Then
                ChildStr = 0
            Else
                ChildStr = Rs("ChildStr")
            End If
            : Set Rs = Nothing
            foundsql = "And ChannelID=" & ChannelID & " And ClassID in (" & ChildStr & ")"
        Else
            foundsql = "And ChannelID=" & ChannelID
        End If
        Select Case moduleid
        Case 1
            If stype = 1 Then
                If isSqlDataBase = 1 Then
                    SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql & " And Datediff(d,WriteTime,GetDate())=0"
                Else
                    SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql & " And WriteTime>=Date()"
                End If
            ElseIf stype = 2 Then
                SQL = "SELECT SUM(AllHits) FROM NC_Article WHERE isAccept>0 " & foundsql
            ElseIf stype = 4 Then
                SQL = "SELECT SUM(DayHits) FROM NC_Article WHERE isAccept>0 " & foundsql
            Else
                SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql
            End If
        Case 2
            If Not IsNumeric(strClass) Then
                foundsql = foundsql & " And SoftType='" & (strClass) & "'"
            End If
            If stype = 1 Then
                If isSqlDataBase = 1 Then
                    SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql & " And Datediff(d,SoftTime,GetDate())=0"
                Else
                    SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql & " And SoftTime>=Date()"
                End If
            ElseIf stype = 2 Then
                SQL = "SELECT SUM(AllHits) FROM NC_SoftList WHERE isAccept>0 " & foundsql
            ElseIf stype = 3 Then
                SQL = "SELECT SUM(SoftSize) FROM NC_SoftList WHERE isAccept>0 " & foundsql
            ElseIf stype = 4 Then
                SQL = "SELECT SUM(DayHits) FROM NC_SoftList WHERE isAccept>0 " & foundsql
            Else
                SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql
            End If
        Case 4
            If stype = 1 Then
                If isSqlDataBase = 1 Then
                    SQL = "SELECT COUNT(GuestID) FROM NC_GuestBook WHERE isAccept>0 And Datediff(d,WriteTime,GetDate())=0"
                Else
                    SQL = "SELECT COUNT(GuestID) FROM NC_GuestBook WHERE isAccept>0 And WriteTime>=Date()"
                End If
            Else
                SQL = "SELECT COUNT(GuestID) FROM NC_GuestBook WHERE isAccept>0"
            End If
        Case 5
            If stype = 1 Then
                If isSqlDataBase = 1 Then
                    SQL = "SELECT COUNT(flashid) FROM NC_FlashList WHERE isAccept>0 " & foundsql & " And Datediff(d,addTime,GetDate())=0"
                Else
                    SQL = "SELECT COUNT(flashid) FROM NC_FlashList WHERE isAccept>0 " & foundsql & " And addTime>=Date()"
                End If
            ElseIf stype = 2 Then
                SQL = "SELECT SUM(AllHits) FROM NC_FlashList WHERE isAccept>0 " & foundsql
            ElseIf stype = 3 Then
                SQL = "SELECT SUM(filesize) FROM NC_FlashList WHERE isAccept>0 " & foundsql
            ElseIf stype = 4 Then
                SQL = "SELECT SUM(DayHits) FROM NC_FlashList WHERE isAccept>0 " & foundsql
            Else
                SQL = "SELECT COUNT(flashid) FROM NC_FlashList WHERE isAccept>0 " & foundsql
            End If
        Case Else
            If stype = 1 Then
                If isSqlDataBase = 1 Then
                    SQL = "SELECT COUNT(userid) FROM NC_User WHERE Datediff(d,JoinTime,GetDate())=0"
                Else
                    SQL = "SELECT COUNT(userid) FROM NC_User WHERE JoinTime>=Date()"
                End If
            Else
                SQL = "SELECT COUNT(userid) FROM NC_User"
            End If
        End Select
        Set Rs = (SQL)
        If  And  Then
            StatCount = 0
        Else
            StatCount = CCur(Rs(0))
            If (moduleid = 2 And stype = 3) Or (moduleid = 5 And stype = 3) Then
                StatCount = Round(StatCount / 1024 / 1024, 3)
                StatCount = FormatNumber(StatCount, 3, -1)
            End If
        End If
        : Set Rs = Nothing
        LoadStatistic = StatCount
    End Function
    '================================================
'Function name: ReadStatistic
'Use: Read channel statistics
'Arguments: str ----original string
    '================================================
    Public Function ReadStatistic(ByVal str)
        On Error Resume Next
        Dim strTemp, i, sTempContent
        Dim nTempContent, ArrayList
        Dim arrTempContent, arrTempContents

        strTemp = str
        On Error Resume Next
        If InStr(strTemp, "{$ReadStatistic(") > 0 Then
            sTempContent = (strTemp, "{$ReadStatistic(", ")}", 1)
            nTempContent = (strTemp, "{$ReadStatistic(", ")}", 0)
            arrTempContents = Split(sTempContent, "|||")
            arrTempContent = Split(nTempContent, "|||")
            For i = 0 To UBound(arrTempContents)
                ArrayList = Split(arrTempContent(i), ",")
                strTemp = Replace(strTemp, arrTempContents(i), LoadStatistic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
            Next
        End If
        ReadStatistic = strTemp
    End Function

    Public Function ShowIndex(ByVal isHtml)
        Dim HtmlContent
         0, 1, 0
        HtmlContent = 
        HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", )
        HtmlContent = Replace(HtmlContent, "{$InstallDir}", )
        If Len((1)) < 2 Then
HtmlContent = Replace(HtmlContent, "{$PageTitle}", "Homepage")
        Else
            HtmlContent = Replace(HtmlContent, "{$PageTitle}", (1))
        End If
        HtmlContent = Replace(HtmlContent, "{$ChannelID}", 0)
        HtmlContent = ReadAnnounceContent(HtmlContent, 0)
        HtmlContent = ReadClassMenu(HtmlContent)
        HtmlContent = ReadClassMenubar(HtmlContent)
        HtmlContent = ReadArticlePic(HtmlContent)
        HtmlContent = ReadSoftPic(HtmlContent)
        HtmlContent = ReadArticleList(HtmlContent)
        HtmlContent = ReadSoftList(HtmlContent)
        HtmlContent = ReadFlashList(HtmlContent)
        HtmlContent = ReadFlashPic(HtmlContent)
        HtmlContent = ReadFriendLink(HtmlContent)
        HtmlContent = ReadNewsPicAndText(HtmlContent)
        HtmlContent = ReadSoftPicAndText(HtmlContent)
        HtmlContent = ReadGuestList(HtmlContent)
        HtmlContent = ReadAnnounceList(HtmlContent)
        HtmlContent = ReadPopularArticle(HtmlContent)
        HtmlContent = ReadPopularSoft(HtmlContent)
        HtmlContent = ReadPopularFlash(HtmlContent)
        HtmlContent = ReadSoftType(HtmlContent)
        HtmlContent = ReadStatistic(HtmlContent)
        HtmlContent = ReadUserRank(HtmlContent)
        HtmlContent = Replace(HtmlContent, "{$SkinPath}", )
        HtmlContent = Replace(HtmlContent, "{$InstallDir}", )
        If isHtml Then
            ShowIndex = HtmlContent
        Else
             HtmlContent
        End If
    End Function

End Class
%>