|
发表于 2006-10-3 00:08:05
|
显示全部楼层
") 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 '================================================ '函数名:LoadSoftPic '作 用:装载软件图片列表 '参 数:ClassID ----分类ID ' ChannelID ----频道ID ' sType ----调用软件类型,0=所有最新软件,1=推荐软件,2=热门软件 ' TopNum ----显示软件列表数 ' strlen ----显示标题长度 ' newindow ----新窗口打开 '================================================ 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 = Newasp.ChkNumeric(ChannelID) ClassID = Newasp.ChkNumeric(ClassID) SpecialID = Newasp.ChkNumeric(SpecialID) stype = Newasp.ChkNumeric(stype)
On Error Resume Next Newasp.LoadChannel(ChannelID)
If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then SQL = "select ChildStr from [NC_Classify] where ChannelID = " & ChannelID & " And ClassID = " & ClassID Set Rs = Newasp.Execute(SQL) If Rs.BOF And Rs.EOF Then Set Rs = Nothing LoadSoftPic = "" 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(SpecialID) <> 0 Then foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr End If SQL = " A.SoftID,A.ClassID,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.SoftImage," SQL = "select Top " & CInt(TopNum) & SQL & " C.ClassName,C.HtmlFileDir,C.UseHtml from [NC_SoftList] A inner join [NC_Classify] C On A.ClassID=C.ClassID where A.isAccept>0 And A.SoftImage<>'' 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=""3"">" & 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 strSoftName = Newasp.GotTopic(Rs("SoftName") & " " & Rs("SoftVer"), CInt(strLen)) SoftImage = Newasp.GetImageUrl(Rs("SoftImage"), Newasp.ChannelData(1)) SoftImage = Newasp.GetFlashAndPic(SoftImage, height, width) HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("SoftID"), 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("SoftID") End If If CInt(newindow) <> 0 Then LinkTarget = " target=""_blank""" Else LinkTarget = "" End If strContent = strContent & Newasp.MainSetting(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 Rs.MoveNext End If Next strContent = strContent & "</tr>" & vbCrLf Loop strContent = strContent & "</table>" & vbCrLf End If Rs.Close: Set Rs = Nothing LoadSoftPic = strContent End Function '================================================ '函数名:ReadSoftPic '作 用:读取软件图片列表 '参 数:str ----原字符串 '================================================ 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 = Newasp.CutMatchContent(strTemp, "{$ReadSoftPic(", ")}", 1) nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadSoftPic(", ")}", 0) arrTempContents = Split(sTempContent, " |
|