<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<%
Dim Rs, SQL, stype, i, DownloadClass_Ads
Dim Style_CSS, HtmlTempStr, NowStats, HtmlTitle
Dim SoftTypeSrt, SoftSize, SoftTime, SoftName, SortName, isCommend
Set DownloadClass_Ads = New Adcolumn_Cls
stype = Replace(Request("type"), "'", "''")
Response.Write NewSoftInfo(stype)
Set DownloadClass_Ads = Nothing
CloseConn

Private Function NewSoftInfo(stype)
	DownsysClass.LoadTemplates ("")
	Style_CSS = Replace(Replace(DownsysClass.Style_CSS, "{$SetupDir}", DownsysClass.SetupDir), "{$PicUrl}", DownsysClass.TempDir)
	HtmlTempStr = DownsysClass.mainhtml(0) & DownsysClass.mainhtml(1) & DownsysClass.mainhtml(2) & DownsysClass.mainhtml(3)
	HtmlTempStr = Replace(HtmlTempStr, "{$NavMenu}", DownsysClass.SortingMenu)
	HtmlTempStr = Replace(HtmlTempStr, "{$Style_CSS}", Style_CSS)
	Set Rs = Server.CreateObject("adodb.recordset")
	If stype <> "" Then
		SQL = "select top " & CInt(DownsysClass.mainset(29)) & " * from [NC_Softinfo] where isLock=0 and SoftType='" & stype & "' order by SoftTime desc,SoftID desc"
		SoftTypeSrt = stype
	Else
		SQL = "select top " & CInt(DownsysClass.mainset(29)) & " * from [NC_Softinfo] where isLock=0 order by SoftTime desc,SoftID desc"
		SoftTypeSrt = "最近更新软件"
	End If
	NowStats = SoftTypeSrt
	HtmlTitle = SoftTypeSrt
	HtmlTempStr = HtmlTempStr & DownsysClass.mainhtml(6)
	If CInt(DownsysClass.Setting(5)) = 0 Then
		HtmlTempStr = Replace(HtmlTempStr, "{$NewAllName}", "Latenew.html")
	Else
		HtmlTempStr = Replace(HtmlTempStr, "{$NewAllName}", "Latenew.Asp")
	End If
	Dim SoftType, NewFileName
	SoftType = Split(DownsysClass.Setting(35), ",")
	For i = 0 To UBound(SoftType)
		HtmlTempStr = HtmlTempStr & DownsysClass.mainhtml(7)
		If CInt(DownsysClass.Setting(5)) = 0 Then
			NewFileName = "Latenew" & i & ".html"
		Else
			NewFileName = "?type=" & Trim(SoftType(i))
		End If
		If Trim(SoftType(i)) = stype Then HtmlTempStr = Replace(HtmlTempStr, "{$Selected}", "selected")
		HtmlTempStr = Replace(HtmlTempStr, "{$SoftTypeName}", Trim(SoftType(i)))
		HtmlTempStr = Replace(HtmlTempStr, "{$NewFileName}", NewFileName)

	Next
	HtmlTempStr = HtmlTempStr & DownsysClass.mainhtml(8)
	Rs.Open SQL, Conn, 1, 1
	If Rs.bof And Rs.EOF Then
		HtmlTempStr = HtmlTempStr & "<tr><td colspan=5 class=Border2>还没有找到任何软件！</td></tr>"
	Else
		Do While Not Rs.EOF
			HtmlTempStr = HtmlTempStr & DownsysClass.mainhtml(9)
			If Rs("SoftSize") > 1024 Then
				SoftSize = Round(Rs("SoftSize") / 1024, 2) & " MB"
			Else
				SoftSize = Rs("SoftSize") & " KB "
			End If
			If Rs("SoftTime") >= Date Then
				SoftTime = "<FONT color=red>" & FormatDateTime(Rs("SoftTime"), 2) & "</FONT >"
			Else
				SoftTime = FormatDateTime(Rs("SoftTime"), 2)
			End If
			If CInt(Rs("isCommend")) = 0 Then
				isCommend = ""
			Else
				isCommend = "&nbsp;<img src='images/jing.gif' align='absmiddle'>"
			End If
			If CInt(DownsysClass.Setting(5)) = 0 Then
				SoftName = "<a href='" & DownsysClass.SetupDir & "Software/Catalog" & Rs("sortid") & "/" & Rs("softid") & ".html'>" & Rs("SoftName") & Rs("SoftVer") & "</A>"
				SortName = "<a href='" & DownsysClass.SetupDir & "Sorting/Catalog" & Rs("sortid") & "/Sorting_Indate_Desc_1.html'>" & Rs("SortName") & "</a>"
			Else
				SoftName = "<a href='" & DownsysClass.SetupDir & "Software.Asp?id=" & Rs("softid") & "'>" & Rs("SoftName") & Rs("SoftVer") & "</A>"&isCommend
				SortName = "<a href='" & DownsysClass.SetupDir & "Sorting.Asp?sortid=" & Rs("sortid") & "'>" & Rs("SortName") & "</a>"
			End If
			HtmlTempStr = Replace(HtmlTempStr, "{$Grades}", Rs("Grades"))
			HtmlTempStr = Replace(HtmlTempStr, "{$SoftSize}", SoftSize)
			HtmlTempStr = Replace(HtmlTempStr, "{$SoftName}", SoftName)
			HtmlTempStr = Replace(HtmlTempStr, "{$SoftTime}", SoftTime)
			HtmlTempStr = Replace(HtmlTempStr, "{$SortName}", SortName)
			Rs.movenext
		Loop
	End If
	Rs.Close
	Set Rs = Nothing
	HtmlTempStr = HtmlTempStr & DownsysClass.mainhtml(10)
	HtmlTempStr = HtmlTempStr & DownsysClass.mainhtml(4)
	HtmlTempStr = Replace(HtmlTempStr, "{$TopMeun}", DownsysClass.mainset(10))
	HtmlTempStr = Replace(HtmlTempStr, "{$NowStats}", NowStats)
	HtmlTempStr = Replace(HtmlTempStr, "{$Title}", HtmlTitle)
	HtmlTempStr = Replace(HtmlTempStr, "{$Width}", DownsysClass.mainset(0))
	HtmlTempStr = Replace(HtmlTempStr, "{$FootMeun}", DownsysClass.mainset(11))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(0)}", DownloadClass_Ads.RunScriptAds(7))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(1)}", DownloadClass_Ads.BannerAds(7))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(2)}", DownloadClass_Ads.AdsColumn(7, 2))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(3)}", DownloadClass_Ads.AdsColumn(7, 3))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(6)}", DownloadClass_Ads.AdsColumn(7, 7))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(4)}", DownloadClass_Ads.ScriptFloatAds(7))
	HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(5)}", DownloadClass_Ads.ScriptFixedAds(7))
	NewSoftInfo = HtmlTempStr
End Function
%>
