Case 1: foundstr = "And A.isBest > 0 Order By A.Writetime Desc ,A.Articleid Desc"
Case 2: foundstr = "Order By A.AllHits Desc ,A.Articleid Desc"
Case 3: foundstr = "And A.ClassID in (" & ChildStr & ") Order By A.Writetime Desc ,A.Articleid Desc"
Case 4: foundstr = "And A.ClassID in (" & ChildStr & ") And A.isBest > 0 Order By A.Writetime Desc ,A.Articleid Desc"
Case 5: foundstr = "And A.ClassID in (" & ChildStr & ") Order By A.AllHits Desc ,A.Articleid Desc"
Case Else
foundstr = "Order By A.Writetime Desc ,A.Articleid Desc"
End Select
If CInt(stype) >= 4 And CLng(ClassID) = 0 Then
foundstr = "Order By A.Writetime Desc ,A.Articleid Desc"
End If
If CLng(SpecialID) <> 0 Then
foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
End If
SQL = " A.ArticleID,A.ClassID,A.title,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,A.ImageUrl,"
SQL = "select Top " & CInt(TopNum) & SQL & " C.ClassName,C.HtmlFileDir,C.UseHtml from [NC_Article] A inner join [NC_Classify] C On A.ClassID=C.ClassID where A.isAccept > 0 And A.ImageUrl<>'''' And A.ChannelID=" & ChannelID & " " & foundstr & ""
Set Rs = Newasp.Execute(SQL)
If Rs.BOF And Rs.EOF Then
strContent = "<img src=''" & Newasp.InstallDir & "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 Rs.EOF
strContent = strContent & "<tr>" & vbCrLf
For i = 1 To CInt(PerRowNum)
strContent = strContent & "<td align=""center"" class=""imagelist"">"
If Not Rs.EOF Then
sTitle = Newasp.GotTopic(Rs("title"), CInt(strLen))
ImageUrl = Newasp.GetImageUrl(Rs("ImageUrl"), Newasp.ChannelData(1))
ImageUrl = Newasp.GetFlashAndPic(ImageUrl, height, width)
HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("ArticleID"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
If CInt(Newasp.ChannelUseHtml) <> 0 Then
HtmlFileUrl = Newasp.ChannelPath & Rs("HtmlFileDir") & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
Else
HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
End If
If CInt(newindow) <> 0 Then
LinkTarget = " target=""_blank"""
Else
LinkTarget = ""
End If
strContent = strContent & Newasp.MainSetting(18)