<%
Class Create_ArticleIndex_Cls
	Private ErrMsg
	Private SucMsg
	Private Founderr
	Private NC_Admin, Rs, SQL

	Private Sub Class_Initialize()
		Founderr = False
		Set Rs = Server.CreateObject("ADODB.Recordset")
		DownsysClass.LoadTemplates ("infoindex")
	End Sub

	Private Sub Class_Terminate()
		If IsObject(Conn) Then
			Conn.Close
			Set Conn = Nothing
		End If
		If IsObject(NC_Admin) Then
			Set NC_Admin = Nothing
		End If
	End Sub

	Public Sub Init_ArticleIndexHtml()
		Response.Buffer = True
		Dim CreateHtml, FSO, Fout
		Set NC_Admin = New Check
		NC_Admin.AdminChk = "34"
		NC_Admin.Check
		DownsysClass.admin_header
		If Not(DownsysClass.IsObjectFSO(DownsysClass.Script_FSO) And CInt(DownsysClass.Setting(5)) = 0 ) Then
			NC_Admin.Error_Msg ("<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)或你后台没有选择为html方式</font></b>")
			DownsysClass.admin_footer
			Response.End
		End If
		Set FSO = Server.CreateObject("ADODB.STREAM")
		CreateHtml = Server.MapPath(DownsysClass.SetupDir & "Article/index.html")
		With FSO
			.Open
			.Charset = "GB2312"
			.WriteText GetArticleIndex
			.SaveToFile CreateHtml,2
			.Close
		End With
		Set FSO = Nothing
		NC_Admin.Succeed_Msg ("生成文章首页成功!")
		DownsysClass.admin_footer
	End Sub

	Public Sub ArticleIndexHtml()
		If CInt(DownsysClass.Setting(5)) = 0 Then
			Response.redirect (DownsysClass.SetupDir & "Article/index.html")
		Else
			Response.Write GetArticleIndex
		End If
	End Sub

	Public Function GetArticleIndex()
		Dim DownloadClass_Ads
		Set DownloadClass_Ads = New Adcolumn_Cls
		Dim temphtml, NowStats, HtmlTitle
		Dim TempTopStr, TempFootStr
		NowStats = "文章首页"
		HtmlTitle = "文章首页"
		If Len(DownsysClass.temphtml(0)) < 50 Then
			TempTopStr = DownsysClass.mainhtml(0) & DownsysClass.mainhtml(1) & DownsysClass.mainhtml(2) & DownsysClass.mainhtml(3)
		Else
			TempTopStr = DownsysClass.temphtml(0)
		End If
		If Len(DownsysClass.temphtml(4)) = 0 Then
			TempFootStr = DownsysClass.mainhtml(4)
		Else
			TempFootStr = DownsysClass.temphtml(4)
		End If
		temphtml = TempTopStr & DownsysClass.temphtml(1) & DownsysClass.temphtml(2) & DownsysClass.temphtml(3) & TempFootStr
		temphtml = Replace(temphtml, "{$NavMenu}", DownsysClass.ClassMenu)
		temphtml = Replace(temphtml, "{$Width}", DownsysClass.mainset(0))
		If CInt(DownsysClass.Setting(5)) = 0 Then
			temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(9))
		Else
			temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(10))
		End If
		If CInt(DownsysClass.Setting(5)) = 1 Then
			temphtml = Replace(temphtml, "{$FootMeun}", DownsysClass.mainset(11))
		Else 
			temphtml = Replace(temphtml, "{$FootMeun}", DownsysClass.mainset(44))
		End If
		temphtml = Replace(temphtml, "{$Style_CSS}", DownsysClass.Style_CSS)
		temphtml = Replace(temphtml, "{$NowStats}", NowStats)
		temphtml = Replace(temphtml, "{$Title}", HtmlTitle)
		temphtml = Replace(temphtml, "{$NewArticle}", NewArticle)
		temphtml = Replace(temphtml, "{$BestArticle}", BestArticle)
		temphtml = Replace(temphtml, "{$Message}", WebMessage(2))
		temphtml = Replace(temphtml, "{$Statistic}", Statistics)
		temphtml = Replace(temphtml, "{$ArticleType}", CreateArticleType)
		temphtml = Replace(temphtml, "{$NewPic}", SingleImage("InfoTime"))
		temphtml = Replace(temphtml, "{$HotPic}", SingleImage("Hits"))
		temphtml = Replace(temphtml, "{$ArticleImage}", ArticleImage)
		temphtml = Replace(temphtml, "{$PicNews}", PictureNews)
		temphtml = Replace(temphtml, "{$Adcolumn(0)}", DownloadClass_Ads.RunScriptAds(4))
		temphtml = Replace(temphtml, "{$Adcolumn(1)}", DownloadClass_Ads.BannerAds(4))
		temphtml = Replace(temphtml, "{$Adcolumn(2)}", DownloadClass_Ads.AdsColumn(4, 2))
		temphtml = Replace(temphtml, "{$Adcolumn(3)}", DownloadClass_Ads.AdsColumn(4, 3))
		temphtml = Replace(temphtml, "{$Adcolumn(6)}", DownloadClass_Ads.AdsColumn(4, 7))
		temphtml = Replace(temphtml, "{$Adcolumn(7)}", DownloadClass_Ads.AdsColumn(4, 8))
		temphtml = Replace(temphtml, "{$Adcolumn(4)}", DownloadClass_Ads.ScriptFloatAds(4))
		temphtml = Replace(temphtml, "{$Adcolumn(5)}", DownloadClass_Ads.ScriptFixedAds(4))
		Set DownloadClass_Ads = Nothing
		GetArticleIndex = temphtml
	End Function
	'*************************************************************
	'函数作用：最新加入文章
	'*************************************************************
	Private Function NewArticle()
		Dim Rs, SQL, HtmlString, ArticleTitle, ClassName, InfoTime, InfoDate
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(DownsysClass.TempSet(14)) & " id,classid,Title, ClassName,InfoTime,Hits from NC_Article where isLock = 0 order by InfoTime desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有最新文章!"
		Else
			Do While Not Rs.EOF
				If Rs("InfoTime") >= Date Then
					InfoTime = "<FONT color=red>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=red>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				Else
					InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				End If
				If CInt(DownsysClass.Setting(5)) = 0 Then
					ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题：" & Rs(2) & "<BR>更新时间：" & Rs(4) & "<BR>浏览次数：" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.mainset(20))) & "</A>"
					ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(1) & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
				Else
					ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题：" & Rs(2) & "<BR>更新时间：" & Rs(4) & "<BR>浏览次数：" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.mainset(20))) & "</A>"
					ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.asp?classid=" & Rs(1) & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
				End If
				HtmlString = HtmlString & DownsysClass.mainset(21)
				HtmlString = Replace(HtmlString, "{$ArticleTitle}", ArticleTitle)
				HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
				HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
				HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
				HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		NewArticle = HtmlString
	End Function
	'*************************************************************
	'函数作用：推荐文章
	'*************************************************************
	Private Function BestArticle()
		Dim Rs, SQL, HtmlString, ArticleTitle, ClassName, InfoTime, InfoDate
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(DownsysClass.TempSet(14)) & " id,classid,Title, ClassName,InfoTime,Hits,isTop from NC_Article where isLock = 0 And isCommend = 1 order by isTop desc, InfoTime desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有推荐文章!"
		Else
			Do While Not Rs.EOF
				If Rs("InfoTime") >= Date Then
					InfoTime = "<FONT color=red>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=red>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				Else
					InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				End If
				If CInt(DownsysClass.Setting(5)) = 1 Then
				ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题：" & Rs(2) & "<BR>更新时间：" & Rs(4) & "<BR>浏览次数：" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(15))) & "</A>"
				ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.asp?classid=" & Rs(1) & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
				Else
				ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题：" & Rs(2) & "<BR>更新时间：" & Rs(4) & "<BR>浏览次数：" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(15))) & "</A>"
				ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(1) & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
				End If
				HtmlString = HtmlString & DownsysClass.TempSet(16)
				HtmlString = Replace(HtmlString, "{$BestTopic}", ArticleTitle)
				HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
				HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
				HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
				HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		BestArticle = HtmlString
	End Function
	'*************************************************************
	'函数作用：图文
	'*************************************************************
	Private Function PictureNews()
		Dim Rs, SQL, HtmlString, ArticleTitle, ClassName, InfoTime, InfoDate
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(DownsysClass.TempSet(17)) & " id,classid,Title, ClassName,InfoTime,Hits from NC_Article where isLock = 0 And isImg = 1 order by InfoTime desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有图文信息!"
		Else
			Do While Not Rs.EOF
				If Rs("InfoTime") >= Date Then
					InfoTime = "<FONT color=red>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=red>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				Else
					InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				End If
				If CInt(DownsysClass.Setting(5)) = 1 Then
				ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题：" & Rs(2) & "<BR>更新时间：" & Rs(4) & "<BR>浏览次数：" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(18))) & "</A>"
				ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.asp?classid=" & Rs(1) & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
				Else
				ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题：" & Rs(2) & "<BR>更新时间：" & Rs(4) & "<BR>浏览次数：" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(18))) & "</A>"
				ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(1) & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
				End If
				HtmlString = HtmlString & DownsysClass.TempSet(19)
				HtmlString = Replace(HtmlString, "{$Topic}", ArticleTitle)
				HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
				HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
				HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
				HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		PictureNews = HtmlString
	End Function
	'*************************************************************
	'函数作用：站内公告
	'*************************************************************
	Private Function WebMessage(statid)
		Dim Rs, SQL, HtmlString, MsgTitle, PostTime
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(DownsysClass.TempSet(0)) & " * from NC_Message where statid in (0, " & statid & ") order by isTop desc, Postime desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "没有公告!"
		Else
			Do While Not Rs.EOF
				If Rs("Postime") >= Date Then
					PostTime = "<FONT color=red>" & FormatDateTime(Rs("Postime"), 2) & "</FONT >"
				Else
					PostTime = "<FONT color=#999999>" & FormatDateTime(Rs("Postime"), 2) & "</FONT >"
				End If
				MsgTitle = "<A HREF=""javascript:openScript('" & DownsysClass.SetupDir & "message.asp?id=" & Rs("id") & "',500,400)"" title='" & Rs("title") & "'>" & DownsysClass.gotTopic(Rs("title"), CInt(DownsysClass.TempSet(1))) & "</A>"
				HtmlString = HtmlString & DownsysClass.TempSet(2)
				HtmlString = Replace(HtmlString, "{$MsgTitle}", MsgTitle)
				HtmlString = Replace(HtmlString, "{$PostTime}", PostTime)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		WebMessage = HtmlString
	End Function
	'*************************************************************
	'函数作用：统计信息
	'*************************************************************
	Private Function Statistics()
		Dim Rs, SQL, HtmlString
		Dim AllSoft, DayUpdateSoft, AllDownNum, AllSoftSize
		Dim AllArticle, DayUpdateArt, AllArticleHits, AllUserNum
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "Select count(SoftID) from NC_SoftInfo"
		Rs.Open SQL, Conn, 1, 1
		AllSoft = Rs(0)
		If IsNull(AllSoft) Then AllSoft = 0
		Rs.Close

		If isSqlDataBase = 1 Then
			SQL = "Select count(SoftID) from NC_SoftInfo Where datediff(d,SoftTime,GetDate())=0"
		Else
			SQL = "Select count(SoftID) from NC_SoftInfo Where softTime>=Date()"
		End If
		Rs.Open SQL, Conn, 1, 1
		DayUpdateSoft = Rs(0)
		If IsNull(DayUpdateSoft) Then DayUpdateSoft = 0
		Rs.Close

		SQL = "Select sum(Hits) from NC_SoftInfo"
		Rs.Open SQL, Conn, 1, 1
		AllDownNum = Rs(0)
		If IsNull(AllDownNum) Then AllDownNum = 0
		Rs.Close

		SQL = "Select sum(SoftSize) from NC_SoftInfo"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			AllSoftSize = 0
		Else
			If IsNull(Rs(0)) Then
				AllSoftSize = 0
			Else
				AllSoftSize = Round(Rs(0) / 1024 / 1024, 3)
			End If
		End If
		Rs.Close

		SQL = "Select count(ID) from NC_Article"
		Rs.Open SQL, Conn, 1, 1
		AllArticle = Rs(0)
		If IsNull(AllArticle) Then AllArticle = 0
		Rs.Close

		If DownsysClass.isSqlDataBase = 1 Then
			SQL = "Select count(ID) from NC_Article Where datediff(d,infoTime,GetDate())=0"
		Else
			SQL = "Select count(ID) from NC_Article Where infoTime >= Date()"
		End If
		Rs.Open SQL, Conn, 1, 1
		DayUpdateArt = Rs(0)
		If IsNull(DayUpdateArt) Then DayUpdateArt = 0
		Rs.Close

		SQL = "Select sum(Hits) from NC_Article"
		Rs.Open SQL, Conn, 1, 1
		AllArticleHits = Rs(0)
		If IsNull(AllArticleHits) Then AllArticleHits = 0
		Rs.Close

		SQL = "Select count(userid) from NC_User"
		Rs.Open SQL, Conn, 1, 1
		AllUserNum = Rs(0)
		If IsNull(AllUserNum) Then AllUserNum = 0
		Rs.Close
		HtmlString = DownsysClass.mainset(12)
		HtmlString = Replace(HtmlString, "{$AllSoft}", AllSoft)
		HtmlString = Replace(HtmlString, "{$DayUpdateSoft}", DayUpdateSoft)
		HtmlString = Replace(HtmlString, "{$AllDownNum}", AllDownNum)
		HtmlString = Replace(HtmlString, "{$AllSoftSize}", AllSoftSize)
		HtmlString = Replace(HtmlString, "{$AllArticle}", AllArticle)
		HtmlString = Replace(HtmlString, "{$DayUpdateArt}", DayUpdateArt)
		HtmlString = Replace(HtmlString, "{$AllArticleHits}", AllArticleHits)
		HtmlString = Replace(HtmlString, "{$AllUserNum}", AllUserNum)
		Set Rs = Nothing
		Statistics = HtmlString
	End Function
	'*************************************************************
	'函数作用：文章类型
	'*************************************************************
	Private Function CreateArticleType()
		Dim Rs, SQL, InfoTime, Title, HtmlString, Topic, ClassName, i, TypeUrl, InfoDate
		Set Rs = Server.CreateObject("adodb.recordset")
		HtmlString = HtmlString & "<TABLE width=""100%"" cellSpacing=5 cellPadding=1 border=0>" & vbCrLf
		HtmlString = HtmlString & " <TR vAlign=top>" & vbCrLf
		Dim ArticleType
		ArticleType = Split(DownsysClass.Setting(36), ",")
		For i = 0 To UBound(ArticleType)
			HtmlString = HtmlString & "    <TD vAlign=top width=""50%"">" & vbCrLf
			SQL = "SELECT top " & CInt(DownsysClass.TempSet(3)) & " ID,Classid,Title,ClassName,ArticleType,InfoTime,Hits FROM NC_Article where ArticleType='" & Trim(ArticleType(i)) & "' order by InfoTime desc,ID desc"
			Rs.Open SQL, Conn, 1, 1
			HtmlString = HtmlString & DownsysClass.TempSet(6)
			If CInt(DownsysClass.Setting(5)) = 1 Then
				TypeUrl = DownsysClass.SetupDir & "NewArticle.Asp?type=" & Trim(ArticleType(i))
			Else
				TypeUrl = DownsysClass.SetupDir & "Article/NewArticle_" & i & ".html"
			End IF
			HtmlString = Replace(HtmlString, "{$TypeName}", Trim(ArticleType(i)))
			HtmlString = Replace(HtmlString, "{$ArticleTypeUrl}", TypeUrl)
			If Rs.EOF And Rs.bof Then
				HtmlString = HtmlString & "<p align=center>还没有任何文章！</p>"
			Else
				Do While Not Rs.EOF
					HtmlString = HtmlString & DownsysClass.TempSet(7)
					If Rs("InfoTime") >= Date Then
						InfoTime = "<FONT color=red>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
						InfoDate = "<FONT color=red>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
					Else
						InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
						InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
					End If
					If CInt(DownsysClass.Setting(5)) = 1 Then
					Topic = "<A HREF='" & DownsysClass.SetupDir & "Article.Asp?id=" & Rs("id") & "' title='文章标题:" & Rs("Title") & "<BR>更新时间: " & Rs("InfoTime") & "<BR>浏览次数: " & Rs("Hits") & "' class='TableLink'>" & DownsysClass.gotTopic(Rs("Title"), CInt(DownsysClass.TempSet(4))) & "</A>"
					ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.Asp?ClassID=" & Rs("ClassID") & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
					Else
					Topic = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs("ClassID") &"/" & Rs("id") & ".html' title='文章标题:" & Rs("Title") & "<BR>更新时间: " & Rs("InfoTime") & "<BR>浏览次数: " & Rs("Hits") & "' class='TableLink'>" & DownsysClass.gotTopic(Rs("Title"), CInt(DownsysClass.TempSet(4))) & "</A>"
					ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs("ClassID") & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
					End If
					HtmlString = Replace(HtmlString, "{$Topic}", Topic)
					HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
					HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
					HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
					Rs.movenext
				Loop
			End If
			HtmlString = HtmlString & DownsysClass.TempSet(8)
			Rs.Close

			HtmlString = HtmlString & "</TD>" & vbCrLf
			If (i Mod CInt(DownsysClass.TempSet(5))) = (CInt(DownsysClass.TempSet(5)) - 1) Then HtmlString = HtmlString & "</tr><tr>"
		Next
		HtmlString = HtmlString & " </TR>" & vbCrLf
		HtmlString = HtmlString & "</TABLE>" & vbCrLf
		Set Rs = Nothing
		CreateArticleType = HtmlString
	End Function
	'*************************************************************
	'函数作用：图片推荐
	'*************************************************************
	Private Function ArticleImage()
		Dim Rs, SQL, HtmlString, Topic, images
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(DownsysClass.TempSet(9)) & " id,ClassID,title,images from NC_Article where isLock = 0 And images <>'' order by InfoTime desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "<img src=""" & DownsysClass.SetupDir & "images/NoPic.jpg"" width='" & DownsysClass.TempSet(20) & "' height='" & DownsysClass.TempSet(21) & "' border=0>"
		Else
			HtmlString = DownsysClass.TempSet(11)
			Do While Not Rs.EOF
				If CInt(DownsysClass.Setting(5)) = 1 Then
				Topic = "<A HREF='" & DownsysClass.SetupDir & "Article.Asp?id=" & Rs("id") & "' title='" & Rs("title") & "'>" & DownsysClass.gotTopic(Rs("title"), CInt(DownsysClass.TempSet(10))) & "</A>"
				images = "<A HREF='" & DownsysClass.SetupDir & "Article.Asp?id=" & Rs("id") & "' title='" & Rs("title") & "'><img src='" & Rs("images") & "' width='" & DownsysClass.TempSet(20) & "' height='" & DownsysClass.TempSet(21) & "' border='0'></A>"
				Else 
				Topic = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs("ClassID") &"/" & Rs("id") & ".html' title='" & Rs("title") & "'>" & DownsysClass.gotTopic(Rs("title"), CInt(DownsysClass.TempSet(10))) & "</A>"
				images = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs("ClassID") &"/" & Rs("id") & ".html' title='" & Rs("title") & "'><img src='" & Rs("images") & "' width='" & DownsysClass.TempSet(20) & "' height='" & DownsysClass.TempSet(21) & "' border='0'></A>"
				End If
				HtmlString = HtmlString & DownsysClass.TempSet(12)
				HtmlString = Replace(HtmlString, "{$Images}", images)
				HtmlString = Replace(HtmlString, "{$Topic}", Topic)
				Rs.movenext
			Loop
			HtmlString = HtmlString & DownsysClass.TempSet(13)
		End If
		Rs.Close
		Set Rs = Nothing
		ArticleImage = HtmlString
	End Function

	Private Function SingleImage(orders)
		Dim Rs, SQL, HtmlString, Topic, images, OrderName
		Set Rs = Server.CreateObject("adodb.recordset")
		If orders = "Hits" Then
			OrderName = "Hits"
		Else
			OrderName = "InfoTime"
		End If
		SQL = "select Top 1 id,classid,title,images from NC_Article where isLock = 0 And images <>'' order by " & OrderName & " desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "<img src=""" & DownsysClass.SetupDir & "images/NoPic.jpg"" width='" & DownsysClass.TempSet(20) & "' height='" & DownsysClass.TempSet(21) & "' border=0>"
		Else
			If CInt(DownsysClass.Setting(5)) = 1 Then
			images = "<A HREF='" & DownsysClass.SetupDir & "Article.Asp?id=" & Rs("id") & "' title='" & Rs("title") & "'><img src='" & Rs("images") & "' width='" & DownsysClass.TempSet(20) & "' height='" & DownsysClass.TempSet(21) & "' border='0'></A>"
			Else
			images = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs("ClassID") &"/" & Rs("id") & ".html' title='" & Rs("title") & "'><img src='" & Rs("images") & "' width='" & DownsysClass.TempSet(20) & "' height='" & DownsysClass.TempSet(21) & "' border='0'></A>"
			End If
			HtmlString = images
		End If
		Rs.Close
		Set Rs = Nothing
		SingleImage = HtmlString
	End Function

End Class
%>
