r
Dim ChildStr, HtmlFileUrl, HtmlFileName, strPicture
Dim SoftTopic, ClassName, softname, SoftTime
chanid = Newasp.ChkNumeric(chanid)
ClassID = Newasp.ChkNumeric(ClassID)
specid = Newasp.ChkNumeric(specid)
stype = Newasp.ChkNumeric(stype)
On Error Resume Next
Newasp.LoadChannel(chanid)
If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & chanid & " And ClassID = " & ClassID
Set Rs = Newasp.Execute(SQL)
If Rs.BOF And Rs.EOF Then
Set Rs = Nothing
SoftPictureAndText = ""
Exit Function
Else
ChildStr = Rs("ChildStr")
End If
Rs.Close
Else
ChildStr = "0"
End If
Select Case CInt(stype)
Case 0: foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
Case 1: foundstr = "And A.isBest > 0 ORDER BY A.SoftTime DESC ,A.softid DESC"
Case 2: foundstr = "ORDER BY A.AllHits DESC ,A.softid DESC"
Case 3: foundstr = "And A.ClassID in (" & ChildStr & ") ORDER BY A.SoftTime DESC ,A.softid DESC"
Case 4: foundstr = "And A.ClassID in (" & ChildStr & ") And A.isBest > 0 ORDER BY A.SoftTime DESC ,A.softid DESC"
Case 5: foundstr = "And A.ClassID in (" & ChildStr & ") ORDER BY A.AllHits DESC ,A.softid DESC"
Case Else
foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
End Select
If CInt(stype) >= 3 And CLng(ClassID) = 0 Then
foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
End If
If CLng(specid) > 0 Then
foundstr = "And A.SpecialID =" & CLng(specid) & " " & foundstr
End If
SQL = " A.softid,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,"
SQL = "SELECT TOP " & CInt(maxline) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir FROM [NC_SoftList] A INNER JOIN [NC_Classify] C ON A.ClassID=C.ClassID WHERE A.isAccept>0 And A.ChannelID=" & chanid & " " & foundstr & ""
Set Rs = Newasp.Execute(SQL)
i = 0
strContent = ""
If Rs.BOF And Rs.EOF Then
strContent = "还没有添加任何软件!"
Else
Do While Not Rs.EOF
SoftTopic = Newasp.ReadTopic(Trim(Rs("SoftName") & " " & Rs("SoftVer")), CInt(maxlen))
SoftTopic = Newasp.ReadFontMode(SoftTopic, Rs("ColorMode"), Rs("FontMode"))
ClassName = Newasp.ReadFontMode(Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("softid"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
If CInt(Newasp.ChannelUseHtml) > 0 Then
HtmlFileUrl = Newasp.ChannelPath & Rs("HtmlFil