www.gusucode.com > 艺术签名文章资讯网源代码 > 艺术签名文章资讯网源代码/624/inc/cls_public.asp

    <!--#include file="classmenu.asp"-->
<%
Dim HTML
Set HTML = New NewaspPublic_Cls
Class NewaspPublic_Cls
	Public CurrentClass,ThisHtmlPath,FirstCalss,ParentClass
	Private Cmd
	
	Private Sub Class_Initialize()
		On Error Resume Next
		Newasp.LoadTemplates 0, 0, 0
	End Sub
	'================================================
	'函数名:LoadArticleList
	'作  用:装载文章列表
	'参  数:ClassID   ----分类ID
	'        ChannelID   ----频道ID
	'        SpecialID  ----专题ID
	'        sType   ----调用文章类型,0=所有最新文章,1=推荐文章,2=热门文章,3=图文文章,4=分类最新文章
	'        TopNum   ----显示文章列表数
	'        strlen   ----显示标题长度
	'        ShowClass   ----是否显示分类
	'        ShowPic   ----是否显示图文标题
	'        ShowDate   ----是否显示日期
	'        DateMode   ----显示日期模式
	'        newindow   ----新窗口打开
	'================================================
	Public Function LoadArticleList(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
		ByVal stype, ByVal TopNum, ByVal strLen, _
		ByVal showclass, ByVal showpic, ByVal showdate, _
		ByVal DateMode, ByVal newindow, ByVal styles, ByVal PerRowNum, ByVal strArrow)
		
		Dim Rs, SQL, i, strContent, foundstr,strwidth,w
		Dim sTitle, sTopic, ChildStr, ListStyle, BestCode, BestString, ClassLength
		Dim ArticleTopic, ClassName, HtmlFileUrl, WriteTime, LinkTarget, HtmlFileName

		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		SpecialID = Newasp.ChkNumeric(SpecialID)
		stype = Newasp.ChkNumeric(stype)
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		If strArrow = "0" Then strArrow = ""
		Newasp.LoadChannel(ChannelID)
		
		If 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
				LoadArticleList = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Set Rs = Nothing
		Else
			ChildStr = "0"
		End If
		
		Select Case CInt(stype)
			Case 0,4: foundstr = "ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 1,5: foundstr = "And A.isBest > 0 ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 2,6: foundstr = "ORDER BY A.AllHits DESC ,A.Articleid DESC"
			Case 3,7: foundstr = "And (A.BriefTopic = 1 Or A.BriefTopic = 2) ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 9
			If IsSqlDataBase = 1 Then
				foundstr = "ORDER BY newid()"
			Else
				foundstr = "ORDER BY rnd(A.Articleid)"
			End If
		Case Else
			foundstr = "ORDER BY A.WriteTime DESC ,A.Articleid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If CLng(SpecialID) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		SQL = " A.ArticleID,A.ClassID,A.ColorMode,A.FontMode,A.title,A.BriefTopic,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,"
		SQL = "SELECT Top " & CInt(TopNum) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtml FROM [NC_Article] A INNER JOIn [NC_Classify] C ON A.ClassID=C.ClassID WHERE A.isAccept>0 And A.ChannelID=" & ChannelID & " " & foundstr & ""
		Set Rs = Newasp.Execute(SQL)
		i = 0
		If Rs.BOF And Rs.EOF Then
			strContent = "<li>该分类还没有添加任何内容!</li>"
		Else
			strContent = ""
			Do While Not Rs.EOF
				If (i Mod 2) = 0 Then
					ListStyle = Trim(styles) & 1
				Else
					ListStyle = Trim(styles) & 2
				End If
				If Rs("isBest") <> 0 Then
					BestCode = 2
					BestString = "<font color=""" & Newasp.MainSetting(3) & """>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				If Len(strArrow) > 0 Then
					strContent = strContent & Replace(Replace(Newasp.MainSetting(13), "· ", ""), "·", "")
				Else
					strContent = strContent & Newasp.MainSetting(13)
				End If
				If showclass > 0 Then
					ClassLength = Newasp.strLength(Rs("ClassName"))
				Else
					ClassLength = 0
				End If
				sTopic = Newasp.ReadPicTopic(Rs("BriefTopic"))
				If CInt(showpic) = 0 Then sTopic = ""
				
				If Len(sTopic) = 0 Then
					sTitle = Newasp.GotTopic(Rs("title"), CInt(strLen) - ClassLength)
				Else
					sTitle = Newasp.GotTopic(Rs("title"), CInt(strLen) - 6 - ClassLength)
				End If
				sTitle = Newasp.ReadFontMode(sTitle, Rs("ColorMode"), Rs("FontMode"))
				
				ClassName = Newasp.ReadFontMode(Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
				If CInt(Newasp.ChannelUseHtml) <> 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
					HtmlFileName = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_SortDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
					ClassName = "<a href=""" & HtmlFileName & """>" & ClassName & "</a>"
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("ArticleID") & Newasp.ChannelHtmlExt
						ClassName = "<a href=""" & Newasp.ChannelPath & "list_1_" & Rs("ClassID") & Newasp.ChannelHtmlExt & """>" & ClassName & "</a>"
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
						ClassName = "<a href=""" & Newasp.ChannelPath & "list.asp?classid=" & Rs("ClassID") & """>" & ClassName & "</a>"
					End If
				End If
				
				If CInt(showclass) = 0 Then ClassName = ""
				
				If CInt(showdate) <> 0 Then
					WriteTime = Newasp.ShowDateTime(Rs("WriteTime"), CInt(DateMode))
				Else
					WriteTime = ""
				End If
				If CInt(newindow) <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				ArticleTopic = strArrow & "<a href=""" & HtmlFileUrl & """" & LinkTarget &">" & sTitle & "</a>"
				strContent = Replace(strContent, "{$ArticleTopic}", ArticleTopic)
				strContent = Replace(strContent, "{$ArticleID}", Rs("ArticleID"))
				strContent = Replace(strContent, "{$InstallDir}", Newasp.InstallDir)
				strContent = Replace(strContent, "{$ArticleTitle}", sTitle)
				strContent = Replace(strContent, "{$Title}", Rs("title"))
				strContent = Replace(strContent, "{$DateAndTitle}", Rs("WriteTime"))
				strContent = Replace(strContent, "{$BriefTopic}", sTopic)
				'strContent = Replace(strContent, "{$BriefTopic}", "")
				strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
				strContent = Replace(strContent, "{$ClassName}", ClassName)
				strContent = Replace(strContent, "[]", "")
				strContent = Replace(strContent, "<span class=""listcat""></span>", "")
				strContent = Replace(strContent, "{$Target}", LinkTarget)
				strContent = Replace(strContent, "{$WriteTime}", WriteTime)
				strContent = Replace(strContent, "{$DateTime}", Replace(WriteTime, " globalDate", ""))
				strContent = Replace(strContent, "{$AticleHits}", Rs("AllHits"))
				strContent = Replace(strContent, "{$ListStyle}", ListStyle)
				strContent = Replace(strContent, "{$BestCode}", BestCode)
				strContent = Replace(strContent, "{$BestString}", BestString)
				strContent = Replace(strContent, "{$strwidth}", strwidth)
				strContent = Replace(strContent, "{$w}", w)
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$i}", i)
				strContent = Replace(strContent, "{$OrderID}", i) & vbNewLine
			Loop
		End If
		
		Rs.Close: Set Rs = Nothing
		LoadArticleList = strContent
	End Function
	'================================================
	'函数名:ReadArticleList
	'作  用:读取文章列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadArticleList(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList
		strTemp = str
		If InStr(strTemp, "{$ReadArticleList(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadArticleList(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadArticleList(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i) & ",0,0", ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadArticleList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13)))
			Next
		End If
		ReadArticleList = strTemp
	End Function
	'================================================
	'函数名:LoadSoftList
	'作  用:装载软件列表
	'参  数:ClassID   ----分类ID
	'        ChannelID   ----频道ID
	'        sType   ----调用类型
	'        TopNum   ----显示列表数
	'        strlen   ----显示标题长度
	'        ShowClass   ----是否显示分类
	'        ShowDate   ----是否显示日期
	'        DateMode   ----显示日期模式
	'        newindow   ----新窗口打开
	'================================================
	Public Function LoadSoftList(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
		ByVal stype, ByVal TopNum, ByVal strLen, ByVal showclass, _
		ByVal showdate, ByVal DateMode, ByVal newindow, ByVal styles, ByVal strType,ByVal intDirect, ByVal PerRowNum, ByVal strArrow)
		
		Dim Rs, SQL, i, strContent, foundstr,j,strwidth,w
		Dim strSoftName, ChildStr, ListStyle, ClassLength
		Dim HtmlFileName, BestCode, BestString,ChannelPath
		Dim ClassName, HtmlFileUrl, SoftTime, LinkTarget, SoftTopic,iNewindow
		
		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		SpecialID = Newasp.ChkNumeric(SpecialID)
		stype = Newasp.ChkNumeric(stype)
		intDirect = Newasp.ChkNumeric(intDirect)
		iNewindow = Newasp.ChkNumeric(newindow)
		strType = Replace(Trim(strType), "'", "")
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		If strArrow = "0" Then strArrow = ""
		Newasp.LoadChannel(ChannelID)
		
		If 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
				LoadSoftList = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close
		Else
			ChildStr = 0
		End If
		Select Case CInt(stype)
			Case 0,3: foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
			Case 1,4: foundstr = "And A.isBest>0 ORDER BY A.SoftTime DESC ,A.softid DESC"
			Case 2,5: foundstr = "ORDER BY A.AllHits DESC ,A.softid DESC"
			Case 9
			If IsSqlDataBase = 1 Then
				foundstr = "ORDER BY newid()"
			Else
				foundstr = "ORDER BY rnd(A.softid)"
			End If
		Case Else
			foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If Len(strType) > 1 Then
				foundstr = "And A.SoftType='" & strType & "' " & foundstr
		End If
		If CLng(SpecialID) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		
		SQL = " A.softid,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.OuterLinks,A.Regsite,"
		SQL = "SELECT TOP " & CInt(TopNum) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtml FROM [NC_SoftList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID WHERE A.isAccept>0 And A.ChannelID=" & ChannelID & " " & foundstr & ""
		Set Rs = Newasp.Execute(SQL)
		j = 0
		
		If Rs.BOF And Rs.EOF Then
			strContent = "<li>没有添加任何软件!</li>"
		Else
			SQL=Rs.GetRows(-1)
			strContent = ""
			For i=0 To Ubound(SQL,2)
				If (j Mod 2) = 0 Then
					ListStyle = Trim(styles) & 1
				Else
					ListStyle = Trim(styles) & 2
				End If
				If CInt(SQL(9,i)) <> 0 Then
					BestCode = 2
					BestString = "<font color=""" & Newasp.MainSetting(3) & """>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				If showclass > 0 Then
					ClassLength = Newasp.strLength(SQL(12,i))
				Else
					ClassLength = 0
				End If
				If Len(strArrow) > 0 Then
					strContent = strContent & Replace(Replace(Newasp.MainSetting(14), "· ", ""), "·", "")
				Else
					strContent = strContent & Newasp.MainSetting(14)
				End If
				strSoftName = Newasp.GotTopic(Trim(SQL(4,i) & " " & SQL(5,i)), CInt(strLen) - ClassLength)
				strSoftName = Newasp.ReadFontMode(strSoftName, SQL(2,i), SQL(3,i))
				ClassName = Newasp.ReadFontMode(SQL(12,i), SQL(13,i), SQL(14,i))
				If intDirect = 1 And Len(SQL(11,i) & "") > 5 Then
					If InStr(SQL(11,i), "://") > 0 Then
						HtmlFileUrl = Trim(SQL(11,i))
					Else
						HtmlFileUrl = "http://" & Trim(SQL(11,i))
					End If
					ClassName = "<a href=""" & HtmlFileUrl & """ target=""_blank"">" & ClassName & "</a>"
					iNewindow = 1
				Else
					If CInt(Newasp.ChannelUseHtml) <> 0 Then
						HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, SQL(8,i),SQL(15,i),SQL(1,i),SQL(0,i),1,"")
						HtmlFileName = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_SortDestination, Newasp.m_ChannelDir, SQL(8,i),SQL(15,i),SQL(1,i),SQL(0,i),1,"")
						ClassName = "<a href=""" & HtmlFileName & """>" & ClassName & "</a>"
					Else
						If IsURLRewrite Then
							HtmlFileUrl = Newasp.ChannelPath & SQL(0,i) & Newasp.ChannelHtmlExt
							ClassName = "<a href=""" & Newasp.ChannelPath & "list_1_" & SQL(1,i) & Newasp.ChannelHtmlExt & """>" & ClassName & "</a>"
						Else
							HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & SQL(0,i)
							ClassName = "<a href=""" & Newasp.ChannelPath & "list.asp?classid=" & SQL(1,i) & """>" & ClassName & "</a>"
						End If
					End If
					iNewindow = Newasp.ChkNumeric(newindow)
				End If

				If CInt(showclass) = 0 Then ClassName = ""
				If CInt(showdate) <> 0 Then
					SoftTime = Newasp.ShowDateTime(SQL(7,i), CInt(DateMode))
				Else
					SoftTime = ""
				End If
				If CInt(iNewindow) <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				SoftTopic = strArrow & "<a href=""" & HtmlFileUrl & """" & LinkTarget & LoadRemark(SQL(4,i) & " " & SQL(5,i)) &">" & strSoftName & "</a>"
				strContent = Replace(strContent, "{$SoftTopic}", SoftTopic)
				strContent = Replace(strContent, "{$SoftID}", SQL(0,i))
				strContent = Replace(strContent, "{$InstallDir}", Newasp.InstallDir)
				strContent = Replace(strContent, "{$SoftName}", strSoftName)
				strContent = Replace(strContent, "{$Title}", SQL(4,i))
				strContent = Replace(strContent, "{$DateAndTitle}", SQL(7,i))
				strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
				strContent = Replace(strContent, "{$ClassName}", ClassName)
				strContent = Replace(strContent, "[]", "")
				strContent = Replace(strContent, "<span class=""listcat""></span>", "")
				strContent = Replace(strContent, "{$Target}", LinkTarget)
				strContent = Replace(strContent, "{$SoftTime}", SoftTime)
				strContent = Replace(strContent, "{$DateTime}", Replace(SoftTime, " globalDate", ""))
				strContent = Replace(strContent, "{$SoftHits}", SQL(6,i))
				strContent = Replace(strContent, "{$ListStyle}", ListStyle)
				strContent = Replace(strContent, "{$BestCode}", BestCode)
				strContent = Replace(strContent, "{$BestString}", BestString)
				strContent = Replace(strContent, "{$strwidth}", strwidth)
				strContent = Replace(strContent, "{$w}", w)
				j = j + 1
				strContent = Replace(strContent, "{$i}", j)
				strContent = Replace(strContent, "{$OrderID}", j) & vbNewLine
			Next
			SQL=Null
		End If
		Rs.Close: Set Rs = Nothing
		LoadSoftList = strContent
	End Function
	'================================================
	'函数名:ReadSoftList
	'作  用:读取软件列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadSoftList(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList
		strTemp = str
		If InStr(strTemp, "{$ReadSoftList(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadSoftList(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadSoftList(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i) & ",0,0,0,0", ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadSoftList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13), ArrayList(14)))
			Next
		End If
		ReadSoftList = strTemp
	End Function
	'================================================
	'函数名:LoadFlashList
	'作  用:装载动画列表
	'参  数:ClassID   ----分类ID
	'        ChannelID   ----频道ID
	'        sType   ----调用类型
	'        TopNum   ----显示列表数
	'        strlen   ----显示标题长度
	'        ShowClass   ----是否显示分类
	'        ShowDate   ----是否显示日期
	'        DateMode   ----显示日期模式
	'        newindow   ----新窗口打开
	'================================================
	Public Function LoadFlashList(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
		ByVal stype, ByVal TopNum, ByVal strLen, ByVal showclass, _
		ByVal showdate, ByVal DateMode, ByVal newindow, ByVal styles, ByVal PerRowNum, ByVal strArrow)
		
		Dim Rs, SQL, i, strContent, foundstr,j,strwidth,w
		Dim strTitle, ChildStr, ListStyle, ClassLength
		Dim HtmlFileName, BestCode, BestString,ChannelPath
		Dim ClassName, HtmlFileUrl, addTime, LinkTarget, FlashTopic
		
		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		SpecialID = Newasp.ChkNumeric(SpecialID)
		stype = Newasp.ChkNumeric(stype)
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		If strArrow = "0" Then strArrow = ""
		Newasp.LoadChannel(ChannelID)
		
		If 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
				LoadFlashList = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close
		Else
			ChildStr = 0
		End If
		Select Case CInt(stype)
			Case 0,3: foundstr = "ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 1,4: foundstr = "And A.isBest > 0 ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 2,5: foundstr = "ORDER BY A.AllHits DESC ,A.flashid DESC"
			Case 9
			If IsSqlDataBase = 1 Then
				foundstr = "ORDER BY newid()"
			Else
				foundstr = "ORDER BY  rnd(A.flashid)"
			End If
		Case Else
			foundstr = "ORDER BY A.addTime DESC ,A.flashid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If CLng(SpecialID) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		SQL = " A.flashid,A.ClassID,A.ColorMode,A.FontMode,A.title,A.Author,A.AllHits,A.addTime,A.HtmlFileDate,A.isBest,"
		SQL = "SELECT TOP " & CInt(TopNum) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtml FROM [NC_FlashList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID WHERE A.isAccept>0 And A.ChannelID=" & ChannelID & " " & foundstr & ""
		Set Rs = Newasp.Execute(SQL)
		j = 0
		
		If Rs.BOF And Rs.EOF Then
			strContent = "<li>没有添加任何信息!</li>"
		Else
			SQL=Rs.GetRows(-1)
			strContent = ""
			For i=0 To Ubound(SQL,2)
				If (j Mod 2) = 0 Then
					ListStyle = Trim(styles) & 1
				Else
					ListStyle = Trim(styles) & 2
				End If
				If CInt(SQL(9,i)) <> 0 Then
					BestCode = 2
					BestString = "<font color=""" & Newasp.MainSetting(3) & """>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				If showclass > 0 Then
					ClassLength = Newasp.strLength(SQL(10,i))
				Else
					ClassLength = 0
				End If
				If Len(strArrow) > 0 Then
					strContent = strContent & Replace(Replace(Newasp.MainSetting(22), "· ", ""), "·", "")
				Else
					strContent = strContent & Newasp.MainSetting(22)
				End If
				strTitle = Newasp.GotTopic(SQL(4,i), CInt(strLen) - ClassLength)
				strTitle = Newasp.ReadFontMode(strTitle, SQL(2,i), SQL(3,i))
				ClassName = Newasp.ReadFontMode(SQL(10,i), SQL(11,i), SQL(12,i))
				If CInt(Newasp.ChannelUseHtml) <> 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, SQL(8,i),SQL(13,i),SQL(1,i),SQL(0,i),1,"")
					HtmlFileName = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_SortDestination, Newasp.m_ChannelDir, SQL(8,i),SQL(13,i),SQL(1,i),SQL(0,i),1,"")
					ClassName = "<a href=""" & HtmlFileName & """>" & ClassName & "</a>"
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & SQL(0,i) & Newasp.ChannelHtmlExt
						ClassName = "<a href=""" & Newasp.ChannelPath & "list_1_" & SQL(1,i) & Newasp.ChannelHtmlExt & """>" & ClassName & "</a>"
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & SQL(0,i)
						ClassName = "<a href=""" & Newasp.ChannelPath & "list.asp?classid=" & SQL(1,i) & """>" & ClassName & "</a>"
					End If
				End If
				If CInt(showclass) = 0 Then ClassName = ""
				If CInt(showdate) <> 0 Then
					addTime = Newasp.ShowDateTime(SQL(7,i), CInt(DateMode))
				Else
					addTime = ""
				End If
				If CInt(newindow) <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				FlashTopic = strArrow & "<a href=""" & HtmlFileUrl & """" & LinkTarget & LoadRemark(SQL(4,i)) &">" & strTitle & "</a>"
				strContent = Replace(strContent, "{$FlashTopic}", FlashTopic)
				strContent = Replace(strContent, "{$FlashID}", SQL(0,i))
				strContent = Replace(strContent, "{$InstallDir}", Newasp.InstallDir)
				strContent = Replace(strContent, "{$FlashTitle}", strTitle)
				strContent = Replace(strContent, "{$Title}", SQL(4,i))
				strContent = Replace(strContent, "{$DateAndTime}", SQL(7,i))
				strContent = Replace(strContent, "{$HtmlFileUrl}", HtmlFileUrl)
				strContent = Replace(strContent, "{$ClassName}", ClassName)
				strContent = Replace(strContent, "[]", "")
				strContent = Replace(strContent, "<span class=""listcat""></span>", "")
				strContent = Replace(strContent, "{$Target}", LinkTarget)
				strContent = Replace(strContent, "{$addTime}", addTime)
				strContent = Replace(strContent, "{$DateTime}", Replace(addTime, " globalDate", ""))
				strContent = Replace(strContent, "{$FlashHits}", SQL(6,i))
				strContent = Replace(strContent, "{$ListStyle}", ListStyle)
				strContent = Replace(strContent, "{$BestCode}", BestCode)
				strContent = Replace(strContent, "{$BestString}", BestString)
				strContent = Replace(strContent, "{$strwidth}", strwidth)
				strContent = Replace(strContent, "{$w}", w)
				strContent = Replace(strContent, "{$i}", i+1)
				j = j + 1
				strContent = Replace(strContent, "{$OrderID}", j) & vbNewLine
			Next
			SQL=Null
		End If
		Rs.Close: Set Rs = Nothing
		LoadFlashList = strContent
	End Function
	'================================================
	'函数名:ReadFlashList
	'作  用:读取动画列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadFlashList(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList
		strTemp = str
		If InStr(strTemp, "{$ReadFlashList(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadFlashList(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadFlashList(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i) &",0,0", ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadFlashList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12)))
			Next
		End If
		ReadFlashList = strTemp
	End Function
	'================================================
	'函数名:LoadAnnounceContent
	'作  用:装载内容公告
	'参  数:str ----原字符串
	'================================================
	Public Function LoadAnnounceContent(ByVal sTopic, ByVal ChannelID)
		Dim SQL, Rs, strTemp
		strTemp = ""
		sTopic = Newasp.CheckStr(sTopic)
		If sTopic <> "" And sTopic <> "0" Then
			SQL = "SELECT AnnounceID,Content,PostTime,writer FROM NC_Announce WHERE AnnounceType=1 And title = '" & sTopic & "' ORDER BY PostTime DESC,AnnounceID DESC"
		Else
			SQL = "SELECT AnnounceID,Content FROM NC_Announce WHERE AnnounceType=1 And ChannelID in (" & ChannelID & ",999) ORDER BY PostTime DESC,AnnounceID DESC"
		End If
		Set Rs = Newasp.Execute(SQL)
		If Not (Rs.BOF And Rs.EOF) Then
			strTemp = Rs("Content")
		End If
		Rs.Close: Set Rs = Nothing
		LoadAnnounceContent = strTemp
	End Function
	'================================================
	'函数名:ReadAnnounceContent
	'作  用:读取内容公告
	'参  数:str ----原字符串
	'================================================
	Public Function ReadAnnounceContent(ByVal str, ByVal ChannelID)
		Dim strTemp, i, sTempContent, nTempContent, strValue
		Dim arrTempContent, arrTempContents
		strTemp = str
		If InStr(strTemp, "{$AnnounceContent(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$AnnounceContent(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$AnnounceContent(", ")}", 0)
			If nTempContent = "" Then nTempContent = "0"
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				strValue = arrTempContent(i)
				strTemp = Replace(strTemp, arrTempContents(i), LoadAnnounceContent(strValue, ChannelID))
			Next
		End If
		ReadAnnounceContent = strTemp
	End Function
	'================================================
	'函数名:LoadAnnounceList
	'作  用:装载公告列表
	'参  数:maxnum ----最多公告数
	'        maxlen ----字符长度
	'        newindow ----是否新窗口打开 1=是,0=否
	'        showdate ----是否显示时间 1=是,0=否
	'        DateMode ----时间模式
	'        showtree ----树型显示
	'================================================
	Public Function LoadAnnounceList(ByVal ChannelID, ByVal maxnum, ByVal maxlen, _
		ByVal newindow, ByVal showdate, ByVal DateMode, ByVal showtree)
		
		Dim Rs, SQL, strContent, i
		Dim AnnounceTopic, LinkTarget
		Dim PostTime, AnnounceURL
		
		ChannelID = Newasp.ChkNumeric(ChannelID)
		maxnum = Newasp.ChkNumeric(maxnum)
		If maxnum = 0 Then maxnum = 10
		
		Set Rs = Newasp.Execute("SELECT TOP " & CInt(maxnum) & " AnnounceID,title,Content,PostTime,writer,hits FROM NC_Announce WHERE (ChannelID=" & ChannelID & " Or ChannelID=999) And AnnounceType<>1 ORDER BY PostTime DESC,AnnounceID DESC")
		If Rs.BOF And Rs.EOF Then
			LoadAnnounceList = ""
			Set Rs = Nothing
			Exit Function
		Else
			i = 0
			Do While Not Rs.EOF
				If CInt(newindow) <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				If CInt(showdate) <> 0 Then
					PostTime = Newasp.ShowDateTime(Rs("PostTime"), CInt(DateMode))
				Else
					PostTime = ""
				End If
				AnnounceURL = Newasp.InstallDir & "Announce.Asp?AnnounceID=" & Rs("AnnounceID")
				If Newasp.IsBindDomain = 1 Then AnnounceURL = Newasp.SiteUrl & AnnounceURL
				AnnounceTopic = Newasp.GotTopic(Rs("title"), CInt(maxlen))
				AnnounceTopic = "<a href=""" & AnnounceURL & """ >" & AnnounceTopic & "</a>"
				If CInt(showtree) = 1 Then
					strContent = strContent & Newasp.MainSetting(25)
				Else
					strContent = strContent & Newasp.MainSetting(26)
				End If
				strContent = Replace(strContent, "{$PostTime}", PostTime)
				strContent = Replace(strContent, "{$DateTime}", Replace(PostTime, " globalDate", ""))
				strContent = Replace(strContent, "{$AnnounceTopic}", AnnounceTopic)
				strContent = Replace(strContent, "{$AnnounceURL}", AnnounceURL)
				strContent = Replace(strContent, "{$AnnounceTitle}", Rs("title"))
				strContent = Replace(strContent, "{$AnnounceDate}", FormatDateTime(Rs("PostTime"), 2))
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$OrderID}", i)
				strContent = Replace(strContent, "{$i}", i)
			Loop
		End If
		LoadAnnounceList = strContent
	End Function
	'================================================
	'函数名:ReadAnnounceList
	'作  用:读取公告列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadAnnounceList(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		strTemp = str
		If InStr(strTemp, "{$ReadAnnounceList(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadAnnounceList(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadAnnounceList(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadAnnounceList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6)))
			Next
		End If
		ReadAnnounceList = strTemp
	End Function
	'================================================
	'函数名:LoadArticlePic
	'作  用:装载文章图片列表
	'参  数:ClassID   ----分类ID
	'        ChannelID   ----频道ID
	'        sType   ----调用文章类型,0=所有最新文章,1=推荐文章,2=热门文章,3=图文文章,4=分类最新文章
	'        TopNum   ----显示文章列表数
	'        strlen   ----显示标题长度
	'        ShowClass   ----是否显示分类
	'        ShowPic   ----是否显示图文标题
	'        ShowDate   ----是否显示日期
	'        DateMode   ----显示日期模式
	'        newindow   ----新窗口打开
	'================================================
	Public Function LoadArticlePic(ChannelID, ClassID, SpecialID, stype, TopNum, PerRowNum, strLen, newindow, width, height, showtopic, slide,strmaxlen,id)
		Dim Rs, SQL, i, strContent, foundstr, n
		Dim sTitle, ChildStr, ImageUrl, HtmlFileName
		Dim HtmlFileUrl, WriteTime, LinkTarget,TextContent,m_strid
		Dim XMLDom,xmlNode,Node,XSLT,XMLStyle,proc,strwidth,w
		
		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		SpecialID = Newasp.ChkNumeric(SpecialID)
		stype = Newasp.ChkNumeric(stype)
		height = Newasp.ChkNumeric(height)
		width = Newasp.ChkNumeric(width)
		slide = Newasp.ChkNumeric(slide)
		strmaxlen = Newasp.ChkNumeric(strmaxlen)
		m_strid = Replace(Replace(Trim(id), ";", ","), ";", ",")
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		Newasp.LoadChannel(ChannelID)
		
		If 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
				LoadArticlePic = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Set Rs = Nothing
		Else
			ChildStr = 0
		End If
		Select Case CInt(stype)
			Case 0,3: foundstr = "ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 1,4: foundstr = "And A.isBest > 0 ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 2,5: foundstr = "ORDER BY A.AllHits DESC ,A.Articleid DESC"
			Case 9
				If IsSqlDataBase = 1 Then
					foundstr = "ORDER BY newid()"
				Else
					foundstr = "ORDER BY rnd(A.ArticleID)"
				End If
		Case Else
			foundstr = "ORDER BY A.WriteTime DESC ,A.Articleid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If CLng(SpecialID) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		If m_strid <> "" And m_strid <> "0" Then
			foundstr = "And A.Articleid in (" & m_strid & ") ORDER BY A.Articleid DESC"
		End If
		SQL = " A.ArticleID,A.ClassID,A.title,A.Content,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.SiteUrl & Newasp.InstallDir & "images/no_pic.gif"" width=""" & width & """ height=""" & height & """ border=""0""/>"
		Else
			n = 0
			'-- 是否启用幻灯片效果
			If slide>0 Then
				Set XMLDom=Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
				XMLDom.appendChild(XMLDom.createElement("xml"))
				'-- 幻灯片效果基本设置
				Set Node=XMLDom.createNode(1,"setting","")
				Node.attributes.setNamedItem(XMLDom.createNode(2,"ChannelID","")).text = ChannelID
				Node.attributes.setNamedItem(XMLDom.createNode(2,"width","")).text = width
				Node.attributes.setNamedItem(XMLDom.createNode(2,"height","")).text = height
				If showtopic=1 Then
					Node.attributes.setNamedItem(XMLDom.createNode(2,"text_height","")).text = 20
				Else
					Node.attributes.setNamedItem(XMLDom.createNode(2,"text_height","")).text = 0
				End If
				Node.attributes.setNamedItem(XMLDom.createNode(2,"maxpic","")).text = TopNum
				Node.attributes.setNamedItem(XMLDom.createNode(2,"maxlen","")).text = strLen
				Node.attributes.setNamedItem(XMLDom.createNode(2,"path","")).text = Newasp.SiteUrl & Newasp.InstallDir
				Node.attributes.setNamedItem(XMLDom.createNode(2,"slidetype","")).text = slide
				XMLDom.documentElement.appendChild(Node)
			End If
			Do While Not Rs.EOF
				n = n + 1
				If slide>0 Then
					sTitle = Newasp.GotTopic(Rs("title"), CInt(strLen))
					ImageUrl = Newasp.GetImageUrl(Rs("ImageUrl"), Newasp.ChannelPath)
					If CInt(Newasp.ChannelUseHtml) <> 0 Then
						HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
					Else
						If IsURLRewrite Then
							HtmlFileUrl = Newasp.ChannelPath & Rs("ArticleID") & Newasp.ChannelHtmlExt
						Else
							HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
						End If
					End If
					'-- 装幻灯片信息传递给XML节点
					Set Node=XMLDom.createNode(1,"slide","")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"slideid","")).text = n
					Node.attributes.setNamedItem(XMLDom.createNode(2,"classid","")).text = classid
					Node.attributes.setNamedItem(XMLDom.createNode(2,"title","")).text = Replace(sTitle, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"picurl","")).text = Replace(ImageUrl, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"url","")).text = Replace(HtmlFileUrl, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"addtime","")).text = Rs("WriteTime")
					XMLDom.documentElement.appendChild(Node)
				Else
					TextContent = ""
					For i = 1 To CInt(PerRowNum)
						If Not Rs.EOF Then
							sTitle = Newasp.GotTopic(Rs("title"), CInt(strLen))
							ImageUrl = Newasp.GetImageUrl(Rs("ImageUrl"), Newasp.ChannelPath)
							ImageUrl = Newasp.GetFlashAndPic(ImageUrl, height, width)

							If CInt(Newasp.ChannelUseHtml) <> 0 Then
								HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
							Else
								If IsURLRewrite Then
									HtmlFileUrl = Newasp.ChannelPath & Rs("ArticleID") & Newasp.ChannelHtmlExt
								Else
									HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
								End If
							End If
							
							If CInt(newindow) <> 0 Then
								LinkTarget = " target=""_blank"""
							Else
								LinkTarget = ""
							End If
							'--文章内容
							If strmaxlen > 5 Then
								TextContent = Newasp.CutString(Rs("content"),strmaxlen)
								TextContent = Newasp.GotTopic(TextContent,strmaxlen)
								'TextContent = "<a href=""" & HtmlFileUrl & """" & LinkTarget & ">" & TextContent & "</a>"
							End If

							strContent = strContent & Newasp.MainSetting(18)
							strContent = Replace(strContent, "{$ArticlePicture}", "<a href=""" & HtmlFileUrl & """ >" & ImageUrl & "</a>")
							If CInt(showtopic) = 1 Then
								strContent = Replace(strContent, "{$ArticleTopic}", "<a href=""" & HtmlFileUrl & """ >" & sTitle & "</a>")
							Else
								strContent = Replace(strContent, "{$ArticleTopic}", vbNullString)
							End If
							strContent = Replace(strContent, "{$TextContent}", TextContent)
							strContent = Replace(strContent, "{$OrderID}", i)
							strContent = Replace(strContent, "{$i}", i)
							strContent = Replace(strContent, "{$strwidth}", strwidth)
							strContent = Replace(strContent, "{$w}", w)
							Rs.MoveNext
						End If
					Next
				End If
				If slide>0 Then Rs.MoveNext
			Loop
			If slide>0 Then
				Set xmlNode = XMLDom.cloneNode(True)
				Set XSLT = Server.CreateObject("Msxml2.XSLTemplate" & MsxmlVersion)
				Set XMLStyle = Server.CreateObject("Msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
				If XMLStyle.load(Server.MapPath(Newasp.InstallDir & "inc/xslt/NC_slide.xslt")) Then
					XSLT.stylesheet = XMLStyle
					Set proc = XSLT.createProcessor()
					proc.input = xmlNode
					proc.transform()
					strContent = proc.output
					Set proc = Nothing
				Else
					strContent = vbNullString
				End If
				Set XMLStyle = Nothing
				Set XSLT = Nothing:Set xmlNode = Nothing
				Set Node = Nothing:Set XMLDom = Nothing
			End If
		End If
		Rs.Close: Set Rs = Nothing
		LoadArticlePic = strContent
	End Function
	'================================================
	'函数名:ReadArticlePic
	'作  用:读取文章图片列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadArticlePic(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		strTemp = str
		If InStr(strTemp, "{$ReadArticlePic(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadArticlePic(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadArticlePic(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i) & ",0,0,0", ",")
				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),ArrayList(11),ArrayList(12),ArrayList(13)))
			Next
		End If
		ReadArticlePic = strTemp
	End Function
	'================================================
	'函数名:LoadSoftPic
	'作  用:装载软件图片列表
	'参  数:ClassID   ----分类ID
	'        ChannelID   ----频道ID
	'        sType   ----调用软件类型,0=所有最新软件,1=推荐软件,2=热门软件
	'        TopNum   ----显示软件列表数
	'        strlen   ----显示标题长度
	'        newindow   ----新窗口打开
	'================================================
	Public Function LoadSoftPic(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, ByVal stype, ByVal TopNum, ByVal PerRowNum, _
		ByVal strLen, ByVal newindow, ByVal width, ByVal height, ByVal showtopic, ByVal slide,ByVal strmaxlen,ByVal id,ByVal strType,ByVal intDirect)
		
		Dim Rs, SQL, i, strContent, foundstr, n
		Dim strSoftName, ChildStr, SoftImage, HtmlFileName
		Dim HtmlFileUrl, SoftTime, LinkTarget,TextContent,m_strid
		Dim XMLDom,xmlNode,Node,XSLT,XMLStyle,proc,iNewindow,strwidth,w
		
		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		SpecialID = Newasp.ChkNumeric(SpecialID)
		stype = Newasp.ChkNumeric(stype)
		height = Newasp.ChkNumeric(height)
		width = Newasp.ChkNumeric(width)
		slide = Newasp.ChkNumeric(slide)
		intDirect = Newasp.ChkNumeric(intDirect)
		iNewindow = Newasp.ChkNumeric(newindow)
		strmaxlen = Newasp.ChkNumeric(strmaxlen)
		m_strid = Replace(Replace(Trim(id), ";", ","), ";", ",")
		strType = Replace(Trim(strType), "'", "")
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		Newasp.LoadChannel(ChannelID)
		
		If 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,3: foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
			Case 1,4: foundstr = "And A.isBest > 0 ORDER BY A.SoftTime DESC ,A.softid DESC"
			Case 2,5: foundstr = "ORDER BY A.AllHits DESC ,A.softid DESC"
			Case 9
				If IsSqlDataBase = 1 Then
					foundstr = "ORDER BY newid()"
				Else
					foundstr = "ORDER BY rnd(A.SoftID)"
				End If
		Case Else
			foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If Len(strType) > 1 Then
			foundstr = "And A.SoftType='" & strType & "' " & foundstr
		End If
		If CLng(SpecialID) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		If m_strid <> "" And m_strid <> "0" Then
			foundstr = "And A.softid in (" & m_strid & ") ORDER BY A.softid DESC"
		End If
		
		SQL = " A.SoftID,A.ClassID,A.SoftName,A.SoftVer,A.content,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.SoftImage,A.OuterLinks,A.Regsite,"
		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.SiteUrl & Newasp.InstallDir & "images/no_pic.gif"" width=""" & width & """ height=""" & height & """ border=""0""/>"
		Else
			n = 0
			'-- 是否启用幻灯片效果
			If slide>0 Then
				Set XMLDom=Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
				XMLDom.appendChild(XMLDom.createElement("xml"))
				'-- 幻灯片效果基本设置
				Set Node=XMLDom.createNode(1,"setting","")
				Node.attributes.setNamedItem(XMLDom.createNode(2,"ChannelID","")).text = ChannelID
				Node.attributes.setNamedItem(XMLDom.createNode(2,"width","")).text = width
				Node.attributes.setNamedItem(XMLDom.createNode(2,"height","")).text = height
				If showtopic=1 Then
					Node.attributes.setNamedItem(XMLDom.createNode(2,"text_height","")).text = 20
				Else
					Node.attributes.setNamedItem(XMLDom.createNode(2,"text_height","")).text = 0
				End If
				Node.attributes.setNamedItem(XMLDom.createNode(2,"maxpic","")).text = TopNum
				Node.attributes.setNamedItem(XMLDom.createNode(2,"maxlen","")).text = strLen
				Node.attributes.setNamedItem(XMLDom.createNode(2,"path","")).text = Newasp.SiteUrl & Newasp.InstallDir
				Node.attributes.setNamedItem(XMLDom.createNode(2,"slidetype","")).text = slide
				XMLDom.documentElement.appendChild(Node)
			End If
			Do While Not Rs.EOF
				n = n + 1
				If slide>0 Then
					strSoftName = Newasp.GotTopic(Trim(Rs("SoftName") & " " & Rs("SoftVer")), CInt(strLen))
					SoftImage = Newasp.GetImageUrl(Rs("SoftImage"), Newasp.ChannelPath)
					If intDirect = 1 And Len(Rs("Regsite") & "") > 5 Then
						If InStr(Rs("Regsite"), "://") > 0 Then
							HtmlFileUrl = Trim(Rs("Regsite"))
						Else
							HtmlFileUrl = "http://" & Trim(Rs("Regsite"))
						End If
					Else
						If CInt(Newasp.ChannelUseHtml) <> 0 Then
							HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("softid"),1,"")
						Else
							If IsURLRewrite Then
								HtmlFileUrl = Newasp.ChannelPath & Rs("softid") & Newasp.ChannelHtmlExt
							Else
								HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("softid")
							End If
						End If
					End If
					'-- 装幻灯片信息传递给XML节点
					Set Node=XMLDom.createNode(1,"slide","")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"slideid","")).text = n
					Node.attributes.setNamedItem(XMLDom.createNode(2,"classid","")).text = classid
					Node.attributes.setNamedItem(XMLDom.createNode(2,"title","")).text = Replace(strSoftName, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"picurl","")).text = Replace(SoftImage, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"url","")).text = Replace(HtmlFileUrl, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"addtime","")).text = Rs("SoftTime")
					XMLDom.documentElement.appendChild(Node)
				Else
					TextContent = ""
					For i = 1 To CInt(PerRowNum)
						If Not Rs.EOF Then
							strSoftName = Newasp.GotTopic(Trim(Rs("SoftName") & " " & Rs("SoftVer")), CInt(strLen))
							SoftImage = Newasp.GetImageUrl(Rs("SoftImage"), Newasp.ChannelPath)
							SoftImage = Newasp.GetFlashAndPic(SoftImage, height, width)
							If intDirect = 1 And Len(Rs("Regsite") & "") > 5 Then
								If InStr(Rs("Regsite"), "://") > 0 Then
									HtmlFileUrl = Trim(Rs("Regsite"))
								Else
									HtmlFileUrl = "http://" & Trim(Rs("Regsite"))
								End If
								iNewindow = 1
							Else
								If CInt(Newasp.ChannelUseHtml) <> 0 Then
									HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("softid"),1,"")
								Else
									If IsURLRewrite Then
										HtmlFileUrl = Newasp.ChannelPath & Rs("softid") & Newasp.ChannelHtmlExt
									Else
										HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("softid")
									End If
								End If
								iNewindow = Newasp.ChkNumeric(newindow)
							End If
							If CInt(newindow) <> 0 Then
								LinkTarget = " target=""_blank"""
							Else
								LinkTarget = ""
							End If
							If strmaxlen > 5 Then
								TextContent = Newasp.CutString(Rs("content"),strmaxlen)
								TextContent = Newasp.GotTopic(TextContent,strmaxlen)
								'TextContent = "<a href=""" & HtmlFileUrl & """" & LinkTarget & ">" & TextContent & "</a>"
							End If
							strContent = strContent & Newasp.MainSetting(19)
							strContent = Replace(strContent, "{$SoftPicture}", "<a href=""" & HtmlFileUrl & """ title=""" & Trim(Rs("SoftName") & " " & Rs("SoftVer")) & """" & LinkTarget & ">" & SoftImage & "</a>")
							If CInt(showtopic) = 1 Then
								strContent = Replace(strContent, "{$SoftTopic}", "<a href=""" & HtmlFileUrl & """ title=""" & Trim(Rs("SoftName") & " " & Rs("SoftVer")) & """" & LinkTarget & ">" & strSoftName & "</a>")
							Else
								strContent = Replace(strContent, "{$SoftTopic}", vbNullString)
							End If
							strContent = Replace(strContent, "{$TextContent}", TextContent)
							strContent = Replace(strContent, "{$OrderID}", i)
							strContent = Replace(strContent, "{$i}", i)
							strContent = Replace(strContent, "{$strwidth}", strwidth)
							strContent = Replace(strContent, "{$w}", w)
						Rs.MoveNext
						End If
					Next
				End If
				If slide>0 Then Rs.MoveNext
			Loop
			If slide>0 Then
				Set xmlNode = XMLDom.cloneNode(True)
				Set XSLT = Server.CreateObject("Msxml2.XSLTemplate" & MsxmlVersion)
				Set XMLStyle = Server.CreateObject("Msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
				If XMLStyle.load(Server.MapPath(Newasp.InstallDir & "inc/xslt/NC_slide.xslt")) Then
					XSLT.stylesheet = XMLStyle
					Set proc = XSLT.createProcessor()
					proc.input = xmlNode
					proc.transform()
					strContent = proc.output
					Set proc = Nothing
				Else
					strContent = vbNullString
				End If
				Set XMLStyle = Nothing
				Set XSLT = Nothing:Set xmlNode = Nothing
				Set Node = Nothing:Set XMLDom = Nothing
			End If
		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
		
		strTemp = str
		If InStr(strTemp, "{$ReadSoftPic(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadSoftPic(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadSoftPic(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i) & ",0,0,0,0,0", ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadSoftPic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13), ArrayList(14), ArrayList(14)))
			Next
		End If
		ReadSoftPic = strTemp
	End Function
	'================================================
	'函数名:LoadFlashPic
	'作  用:装载动画图片列表
	'参  数:ClassID   ----分类ID
	'        ChannelID   ----频道ID
	'        sType   ----调用动画类型,0=所有最新动画,1=推荐动画,2=热门动画
	'        TopNum   ----显示动画列表数
	'        strlen   ----显示标题长度
	'        newindow   ----新窗口打开
	'================================================
	Public Function LoadFlashPic(ByVal ChannelID, ByVal ClassID, ByVal SpecialID, _
		ByVal stype, ByVal TopNum, ByVal PerRowNum, ByVal strLen, ByVal newindow, _
		ByVal width, ByVal height, ByVal showtopic, ByVal slide, ByVal strmaxlen, ByVal id)
		
		Dim Rs, SQL, i, strContent, foundstr, n
		Dim strtitle, ChildStr, miniature, HtmlFileName
		Dim HtmlFileUrl, addTime, LinkTarget,TextContent,m_strid
		Dim XMLDom,xmlNode,Node,XSLT,XMLStyle,proc,strwidth,w
		
		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		SpecialID = Newasp.ChkNumeric(SpecialID)
		stype = Newasp.ChkNumeric(stype)
		height = Newasp.ChkNumeric(height)
		width = Newasp.ChkNumeric(width)
		slide = Newasp.ChkNumeric(slide)
		strmaxlen = Newasp.ChkNumeric(strmaxlen)
		m_strid = Replace(Replace(Trim(id), ";", ","), ";", ",")
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		Newasp.LoadChannel(ChannelID)
		
		If 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
				LoadFlashPic = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close
		Else
			ChildStr = 0
		End If
		
		Select Case CInt(stype)
			Case 0,3: foundstr = "ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 1,4: foundstr = "And A.isBest > 0 ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 2,5: foundstr = "ORDER BY A.AllHits DESC ,A.flashid DESC"
			Case 9
				If IsSqlDataBase = 1 Then
					foundstr = "ORDER BY newid()"
				Else
					foundstr = "ORDER BY rnd(A.flashid)"
				End If
		Case Else
			foundstr = "ORDER BY A.addTime DESC ,A.flashid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If CLng(SpecialID) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		If m_strid <> "" And m_strid <> "0" Then
			foundstr = "And A.flashid in (" & m_strid & ") ORDER BY A.flashid DESC"
		End If
		SQL = " A.flashid,A.ClassID,A.title,A.Introduce,A.AllHits,A.addTime,A.HtmlFileDate,A.isBest,A.miniature,"
		SQL = "SELECT TOP " & CInt(TopNum) & SQL & " C.ClassName,C.HtmlFileDir,C.UseHtml FROM [NC_FlashList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID WHERE A.isAccept>0 And A.miniature<>'' And A.ChannelID=" & ChannelID & " " & foundstr & ""
		Set Rs = Newasp.Execute(SQL)
		If Rs.BOF And Rs.EOF Then
			strContent = "<img src=""" & Newasp.SiteUrl & Newasp.InstallDir & "images/no_pic.gif"" width=""" & width & """ height=""" & height & """ border=""0""/>"
		Else
			n = 0
			'-- 是否启用幻灯片效果
			If slide>0 Then
				Set XMLDom=Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
				XMLDom.appendChild(XMLDom.createElement("xml"))
				'-- 幻灯片效果基本设置
				Set Node=XMLDom.createNode(1,"setting","")
				Node.attributes.setNamedItem(XMLDom.createNode(2,"ChannelID","")).text = ChannelID
				Node.attributes.setNamedItem(XMLDom.createNode(2,"width","")).text = width
				Node.attributes.setNamedItem(XMLDom.createNode(2,"height","")).text = height
				If showtopic=1 Then
					Node.attributes.setNamedItem(XMLDom.createNode(2,"text_height","")).text = 20
				Else
					Node.attributes.setNamedItem(XMLDom.createNode(2,"text_height","")).text = 0
				End If
				Node.attributes.setNamedItem(XMLDom.createNode(2,"maxpic","")).text = TopNum
				Node.attributes.setNamedItem(XMLDom.createNode(2,"maxlen","")).text = strLen
				Node.attributes.setNamedItem(XMLDom.createNode(2,"path","")).text = Newasp.SiteUrl & Newasp.InstallDir
				Node.attributes.setNamedItem(XMLDom.createNode(2,"slidetype","")).text = slide
				XMLDom.documentElement.appendChild(Node)
			End If
			Do While Not Rs.EOF
				n = n + 1
				If slide>0 Then
					strtitle = Newasp.GotTopic(Rs("title"), CInt(strLen))
					miniature = Newasp.GetImageUrl(Rs("miniature"), Newasp.ChannelPath)
					If CInt(Newasp.ChannelUseHtml) <> 0 Then
						HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("flashid"),1,"")
					Else
						If IsURLRewrite Then
							HtmlFileUrl = Newasp.ChannelPath & Rs("flashid") & Newasp.ChannelHtmlExt
						Else
							HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("flashid")
						End If
					End If
					'-- 装幻灯片信息传递给XML节点
					Set Node=XMLDom.createNode(1,"slide","")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"slideid","")).text = n
					Node.attributes.setNamedItem(XMLDom.createNode(2,"classid","")).text = classid
					Node.attributes.setNamedItem(XMLDom.createNode(2,"title","")).text = Replace(strtitle, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"picurl","")).text = Replace(miniature, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"url","")).text = Replace(HtmlFileUrl, "|", "")
					Node.attributes.setNamedItem(XMLDom.createNode(2,"addtime","")).text = Rs("addTime")
					XMLDom.documentElement.appendChild(Node)
				Else
					TextContent = ""
					For i = 1 To CInt(PerRowNum)
						If Not Rs.EOF Then
							strtitle = Newasp.GotTopic(Rs("title"), CInt(strLen))
							miniature = Newasp.GetImageUrl(Rs("miniature"), Newasp.ChannelPath)
							miniature = Newasp.GetFlashAndPic(miniature, height, width)
							If CInt(Newasp.ChannelUseHtml) <> 0 Then
								HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("flashid"),1,"")
							Else
								If IsURLRewrite Then
									HtmlFileUrl = Newasp.ChannelPath & Rs("flashid") & Newasp.ChannelHtmlExt
								Else
									HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("flashid")
								End If
							End If
							If CInt(newindow) <> 0 Then
								LinkTarget = " target=""_blank"""
							Else
								LinkTarget = ""
							End If
							If strmaxlen > 5 Then
								TextContent = Newasp.CutString(Rs("Introduce"),strmaxlen)
								TextContent = Newasp.GotTopic(TextContent,strmaxlen)
								'TextContent = "<a href=""" & HtmlFileUrl & """" & LinkTarget & ">" & TextContent & "</a>"
							End If
							strContent = strContent & Newasp.MainSetting(21)
							strContent = Replace(strContent, "{$Miniature}", "<a href=""" & HtmlFileUrl & """ >" & miniature & "</a>")
							If CInt(showtopic) = 1 Then
								strContent = Replace(strContent, "{$FlashTopic}", "<a href=""" & HtmlFileUrl & """ >" & strtitle & "</a>")
							Else
								strContent = Replace(strContent, "{$FlashTopic}", vbNullString)
							End If
							strContent = Replace(strContent, "{$TextContent}", TextContent)
							strContent = Replace(strContent, "{$OrderID}", i)
							strContent = Replace(strContent, "{$i}", i)
							strContent = Replace(strContent, "{$strwidth}", strwidth)
							strContent = Replace(strContent, "{$w}", w)
						Rs.MoveNext
						End If
					Next
				End If
				If slide>0 Then Rs.MoveNext
			Loop
			If slide>0 Then
				Set xmlNode = XMLDom.cloneNode(True)
				Set XSLT = Server.CreateObject("Msxml2.XSLTemplate" & MsxmlVersion)
				Set XMLStyle = Server.CreateObject("Msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
				If XMLStyle.load(Server.MapPath(Newasp.InstallDir & "inc/xslt/NC_slide.xslt")) Then
					XSLT.stylesheet = XMLStyle
					Set proc = XSLT.createProcessor()
					proc.input = xmlNode
					proc.transform()
					strContent = proc.output
					Set proc = Nothing
				Else
					strContent = vbNullString
				End If
				Set XMLStyle = Nothing
				Set XSLT = Nothing:Set xmlNode = Nothing
				Set Node = Nothing:Set XMLDom = Nothing
			End If
		End If
		Rs.Close: Set Rs = Nothing
		LoadFlashPic = strContent
	End Function
	'================================================
	'函数名:ReadFlashPic
	'作  用:读取动画图片列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadFlashPic(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadFlashPic(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadFlashPic(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadFlashPic(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i) & ",0,0,0,0,0", ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadFlashPic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13)))
			Next
		End If
		ReadFlashPic = strTemp
	End Function
	
	'================================================
	'函数名:LoadFriendLink
	'作  用:装载友情连接
	'参  数:str ----原字符串
	'================================================
	Public Function LoadFriendLink(ByVal TopNum, ByVal PerRowNum, ByVal isLogo, ByVal orders)
		Dim Rs, SQL, i, strContent
		Dim strOrder, LinkAddress,strwidth,w
		Dim FriendLinks, LinksUrl, LinksText,strLogUrl
		
		strContent = ""
		TopNum = Newasp.ChkNumeric(TopNum)
		If TopNum = 0 Then TopNum = 16
		PerRowNum = Newasp.ChkNumeric(PerRowNum)
		If PerRowNum = 0 Then PerRowNum = 8
		isLogo = Newasp.ChkNumeric(isLogo)
		orders = Newasp.ChkNumeric(orders)
		If PerRowNum < 2 Then
			strwidth = ""
			w = 100
		Else
			w = 100\PerRowNum
			If w = 0 Then w = 20
			strwidth = "float:left;width:"&w-0.1&"%;"
		End If
		If CInt(orders) = 1 Then
			'-- 首页显示按时间升序排列
			strOrder = "And isIndex > 0 ORDER BY LinkTime DESC,LinkID DESC"
		ElseIf CInt(orders) = 2 Then
			'-- 首页显示按点击数升序排列
			strOrder = "And isIndex > 0 ORDER BY LinkHist DESC,LinkID DESC"
		ElseIf CInt(orders) = 3 Then
			'-- 首页显示按点击数降序排列
			strOrder = "And isIndex > 0 ORDER BY LinkHist DESC,LinkID Asc"
		ElseIf CInt(orders) = 4 Then
			'-- 所有按升序排列
			strOrder = "ORDER BY LinkID DESC"
		ElseIf CInt(orders) = 5 Then
			'-- 所有按降序排列
			strOrder = "ORDER BY LinkID Asc"
		ElseIf CInt(orders) = 6 Then
			'-- 所有按点击数升序排列
			strOrder = "ORDER BY LinkHist DESC,LinkID DESC"
		ElseIf CInt(orders) = 7 Then
			'-- 所有按点击数降序排列
			strOrder = "ORDER BY LinkHist DESC,LinkID Asc"
		ElseIf CInt(orders) = 8 Then
			'-- 首页显示按名称排列
			strOrder = "And isIndex > 0 ORDER BY LinkName DESC,LinkID DESC"
		ElseIf CInt(orders) = 9 Then
			'-- 所有按名称排列
			strOrder = "ORDER BY LinkName DESC,LinkID DESC"
		Else
			'-- 首页显示按时间降序排列
			strOrder = "And isIndex > 0 ORDER BY LinkTime Asc,LinkID Asc"
		End If
		If CInt(isLogo) = 1 Or CInt(isLogo) = 3 Then
			SQL = "SELECT TOP " & CInt(TopNum) & " LinkID,LinkName,LinkUrl,LogoUrl,Readme,LinkHist,isLogo FROM [NC_Link] WHERE isLock = 0 And isLogo > 0 " & strOrder & ""
		Else
			SQL = "SELECT TOP " & CInt(TopNum) & " LinkID,LinkName,LinkUrl,LogoUrl,Readme,LinkHist,isLogo FROM [NC_Link] WHERE isLock = 0 And isLogo = 0 " & strOrder & ""
		End If
		Set Rs = Newasp.Execute(SQL)
		If Not (Rs.BOF And Rs.EOF) Then
			Do While Not Rs.EOF
				For i = 1 To CInt(PerRowNum)
					If Not Rs.EOF Then
						LinksText = Rs("LinkName")
						If CInt(isLogo) < 2 Then
							LinksUrl = Newasp.InstallDir & "link/link.asp?id=" & Rs("LinkID") & "&url=" & Trim(Rs("LinkUrl"))
							If Newasp.IsBindDomain = 1 Then LinksUrl = Newasp.SiteUrl & LinksUrl
							LinkAddress = "<a href=""" & LinksUrl & """ target=""_blank"" title=""主页名称:" & Rs("LinkName") & "&#13;&#10;点击次数:" & Rs("LinkHist") & """>"
						Else
							LinksUrl = Trim(Rs("LinkUrl"))
							LinkAddress = "<a href=""" & LinksUrl & """ target=""_blank"" title=""" & Rs("Readme") & """>"
						End If
						If Rs("isLogo") = 1 Or CInt(isLogo) = 3 Then
							strLogUrl = Trim(Rs("LogoUrl"))
							FriendLinks = LinkAddress & "<img src=""" & Newasp.ReadFileUrl(strLogUrl) & """ width=""88"" height=""31"" border=""0"" /></a>"
						Else
							FriendLinks = LinkAddress & Rs("LinkName") & "</a>"
						End If
						
						Rs.MoveNext
					Else
						LinksUrl = Newasp.InstallDir & "link/"
						If Newasp.IsBindDomain = 1 Then LinksUrl = Newasp.SiteUrl & LinksUrl
						LinksText = "您的位置"
						If CInt(isLogo) = 1 Or CInt(isLogo) = 3 Then
							FriendLinks = "<a href=""" & LinksUrl & """ target=""_blank'""><img src=""" & LinksUrl & "link.gif"" width=""88"" height=""31"" border=""0"" /></a>"
						Else
							FriendLinks = "<a href=""" & LinksUrl & """ target=""_blank"">更多连接</a>"
						End If
					End If
					If CInt(isLogo) = 1 Or CInt(isLogo) = 3 Then
						strContent = strContent & Newasp.MainSetting(28)
					Else
						strContent = strContent & Newasp.MainSetting(27)
					End If
					strContent = Replace(strContent, "{$FriendLinks}", FriendLinks)
					strContent = Replace(strContent, "{$LinksUrl}", LinksUrl)
					strContent = Replace(strContent, "{$LinksText}", LinksText)
					strContent = Replace(strContent, "{$strwidth}", strwidth)
					strContent = Replace(strContent, "{$w}", w)
					strContent = Replace(strContent, "{$i}", i)
					strContent = Replace(strContent, "{$OrderID}", i) & vbNewLine
				Next
			Loop
		End If
		LoadFriendLink = strContent
	End Function
	'================================================
	'函数名:ReadFriendLink
	'作  用:读取友情连接
	'参  数:str ----原字符串
	'================================================
	Public Function ReadFriendLink(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadFriendLink(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadFriendLink(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadFriendLink(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadFriendLink(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
			Next
		End If
		ReadFriendLink = strTemp
	End Function
	'================================================
	'函数名:PageRunTime
	'作  用:页面执行时间
	'================================================
	Public Function ExecutionTime()
		Dim Endtime
		ExecutionTime = ""
		If CInt(Newasp.IsRunTime) = 1 Then
			Endtime = Timer()
			ExecutionTime = "页面执行时间:" & FormatNumber((((Endtime - startime) * 5000) + 0.5) / 10, 3, -1) & "毫秒"
		Else
			ExecutionTime = ""
		End If
	End Function
	
	'================================================
	'函数名:CurrentStation
	'作  用:当前位置
	'参  数:...
	'================================================
	Public Function CurrentStation(ByVal ChannelID, ByVal ClassID, ByVal ClassName, _
		ByVal ParentID, ByVal strParent, ByVal HtmlFileDir, ByVal Compart)
		
		Dim rsCurrent, SQL, strContent, ChannelDir,HtmlFileUrl
		
		CurrentStation = ""
		ChannelID = Newasp.ChkNumeric(ChannelID)
		ClassID = Newasp.ChkNumeric(ClassID)
		ParentID = Newasp.ChkNumeric(ParentID)
		
		
		Newasp.LoadChannel(ChannelID)
		
		ChannelDir = Newasp.ChannelPath
		CurrentClass = ""
		ParentClass = ClassName
		strContent = ""'"<a href='" & ChannelDir & "'>" & Newasp.ChannelName & "</a>" & Compart & ""
		If ParentID <> 0 And Len(strParent) <> 0 Then
			SQL = "SELECT ClassID,ClassName,HtmlFileDir,UseHtml FROM [NC_Classify] WHERE ChannelID=" & ChannelID & " And ClassID in(" & strParent & ") ORDER BY orders"
			Set rsCurrent = Newasp.Execute(SQL)
			If Not (rsCurrent.EOF And rsCurrent.BOF) Then
				Do While Not rsCurrent.EOF
					ParentClass = Trim(rsCurrent("ClassName"))
					If CInt(Newasp.IsCreateHtml) <> 0 Then
						HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.SortDestination, Newasp.ChannelDir, "",rsCurrent("HtmlFileDir"),rsCurrent("ClassID"),0,1,"")
						strContent = strContent & "<a href=""" & HtmlFileUrl & """>" & rsCurrent("ClassName") & "</a>" & Compart & ""
					Else
						If IsURLRewrite Then
							strContent = strContent & "<a href=""" & ChannelDir & "list_1_" & rsCurrent("ClassID") & Newasp.ChannelHtmlExt & """>" & rsCurrent("ClassName") & "</a>" & Compart & ""
						Else
							strContent = strContent & "<a href=""" & ChannelDir & "list.asp?classid=" & rsCurrent("ClassID") & """>" & rsCurrent("ClassName") & "</a>" & Compart & ""
						End If
					End If
					CurrentClass = CurrentClass & rsCurrent("ClassName") & " - "
					rsCurrent.MoveNext
				Loop
			End If
			rsCurrent.Close
			Set rsCurrent = Nothing
		End If
		If CInt(Newasp.IsCreateHtml) <> 0 Then
			HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.SortDestination, Newasp.ChannelDir, "",HtmlFileDir,ClassID,0,1,"")
			strContent = strContent & "<a href=""" & HtmlFileUrl & """>" & ClassName & "</a>"
		Else
			If IsURLRewrite Then
				strContent = strContent & "<a href=""" & ChannelDir & "list_1_" & ClassID & Newasp.ChannelHtmlExt & """>" & ClassName & "</a>"
			Else
				strContent = strContent & "<a href=""" & ChannelDir & "list.asp?classid=" & ClassID & """>" & ClassName & "</a>"
			End If
		End If
		CurrentClass = CurrentClass & ClassName
		CurrentStation = strContent
	End Function
	'================================================
	'函数名:ReadCurrentStation
	'作  用:读取当前位置
	'参  数:str ----原字符串
	'================================================
	Public Function ReadCurrentStation(ByVal str, ByVal ChannelID, ByVal ClassID, _
		ByVal ClassName, ByVal ParentID, ByVal strParent, ByVal HtmlFileDir)
		
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$CurrentStation(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$CurrentStation(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$CurrentStation(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				strTemp = Replace(strTemp, arrTempContents(i), CurrentStation(ChannelID, ClassID, ClassName, ParentID, strParent, HtmlFileDir, arrTempContent(i)))
			Next
		End If
		ReadCurrentStation = strTemp
	End Function
	'================================================
	'函数名:NewsPictureAndText
	'作  用:图文混排列表
	'================================================
	Public Function NewsPictureAndText(ByVal chanid, ByVal ClassID, ByVal specid, _
		ByVal stype, ByVal height, ByVal width, ByVal maxlen, _
		ByVal maxline, ByVal hspace, ByVal vspace, ByVal align, _
		ByVal divcss, ByVal target, ByVal start, ByVal showpic, _
		ByVal showclass, ByVal showdate, ByVal dateformat)
		
		Dim Rs, SQL, i, strContent, foundstr
		Dim ChildStr, HtmlFileUrl, HtmlFileName, strPicture
		Dim PicTopic, NewsTitle, ClassName, ArticleTitle, WriteTime
		
		chanid = Newasp.ChkNumeric(chanid)
		ClassID = Newasp.ChkNumeric(ClassID)
		specid = Newasp.ChkNumeric(specid)
		stype = Newasp.ChkNumeric(stype)
		
		
		Newasp.LoadChannel(chanid)
		
		If 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
				NewsPictureAndText = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close
		Else
			ChildStr = "0"
		End If
		Select Case CInt(stype)
			Case 0,3: foundstr = "ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 1,4: foundstr = "And A.isBest > 0 ORDER BY A.WriteTime DESC ,A.Articleid DESC"
			Case 2,5: foundstr = " ORDER BY A.AllHits DESC ,A.Articleid DESC"
		Case Else
			foundstr = "ORDER BY A.WriteTime DESC ,A.Articleid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		End If
		If CLng(specid) > 0 Then
			foundstr = "And A.SpecialID =" & CLng(specid) & " " & foundstr
		End If
		SQL = " A.ArticleID,A.ClassID,A.ColorMode,A.FontMode,A.title,A.BriefTopic,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,"
		SQL = "SELECT TOP " & CInt(maxline) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir FROM [NC_Article] 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 = "<li>还没有添加任何内容!</li>"
		Else
			Do While Not Rs.EOF
				NewsTitle = Newasp.GotTopic(Rs("title"), CInt(maxlen))
				NewsTitle = Newasp.ReadFontMode(NewsTitle, Rs("ColorMode"), Rs("FontMode"))
				PicTopic = Newasp.ReadPicTopic(Rs("BriefTopic"))
				ClassName = Newasp.ReadFontMode(Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
				If CInt(Newasp.ChannelUseHtml) <> 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
					HtmlFileName = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_SortDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
					ClassName = "[<a href=""" & HtmlFileName & """>" & ClassName & "</a>]"
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("ArticleID") & Newasp.ChannelHtmlExt
						ClassName = "[<a href=""" & Newasp.ChannelPath & "list_1_" & Rs("ClassID") & Newasp.ChannelHtmlExt & """>" & ClassName & "</a>]"
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
						ClassName = "[<a href=""" & Newasp.ChannelPath & "list.asp?classid=" & Rs("ClassID") & """>" & ClassName & "</a>]"
					End If
				End If
				If CInt(showclass) = 1 Then
					ClassName = ClassName
				Else
					ClassName = ""
				End If
				If CInt(showdate) = 1 Then
					WriteTime = Newasp.ShowDateTime(Rs("WriteTime"), CInt(dateformat))
				Else
					WriteTime = ""
				End If
				ArticleTitle = "<div " & divcss & ">" & start & ClassName & " <a href=""" & HtmlFileUrl & """ target=""" & target & """" & LoadRemark(Rs("title")) & ">" & NewsTitle & "</a>  " & WriteTime & "</div>"
				strContent = strContent & ArticleTitle
				Rs.MoveNext
				i = i + 1
			Loop
		End If
		Rs.Close: Set Rs = Nothing
		Dim sExtName, ExtName, ImageUrl
		If CInt(showpic) = 1 Then
			SQL = " A.ArticleID,A.ClassID,A.title,A.AllHits,A.WriteTime,A.HtmlFileDate,A.ImageUrl,"
			SQL = "SELECT " & SQL & " C.HtmlFileDir,B.ChannelDir,B.StopChannel,B.ModuleName,B.BindDomain,B.DomainName,B.IsCreateHtml,B.HtmlExtName,B.LeastHotHist FROM ([NC_Article] A INNER JOIN [NC_Classify] C ON A.ClassID=C.ClassID) INNER JOIN [NC_Channel] B On A.ChannelID=B.ChannelID WHERE A.isAccept>0 And A.ChannelID=" & CInt(chanid) & " And A.ImageUrl<>'' " & foundstr & ""
			Set Rs = Newasp.Execute(SQL)
			If Rs.BOF And Rs.EOF Then
				strPicture = "<img src='" & Newasp.SiteUrl & Newasp.InstallDir & "images/no_pic.gif' width=""" & width & """ height=""" & height & """  hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0"">"
			Else
				If CInt(Newasp.ChannelUseHtml) <> 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("ArticleID") & Newasp.ChannelHtmlExt
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
					End If
				End If
				ImageUrl = Newasp.GetImageUrl(Rs("ImageUrl"), Newasp.ChannelPath)
				sExtName = Split(Rs("ImageUrl"), ".")
				ExtName = sExtName(UBound(sExtName))
				Select Case LCase(ExtName)
				Case "swf", "swi"
					strPicture = "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """>" & vbNewLine
					strPicture = strPicture & "     <param name=""movie"" value=""" & ImageUrl & """>" & vbNewLine
					strPicture = strPicture & "     <param name=""quality"" value=""high"">" & vbNewLine
					strPicture = strPicture & "     <embed src=""" & ImageUrl & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash""></embed>" & vbNewLine
					strPicture = strPicture & "</object>" & vbNewLine
				Case Else
					strPicture = "<a href=""" & HtmlFileUrl & """  target=""" & target & """ title=""" & Newasp.ChannelModule & "标题:" & Rs("title") & "&#13;&#10;发布时间:" & Rs("WriteTime") & "&#13;&#10;阅览次数:" & Rs("AllHits") & """><img src=""" & ImageUrl & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0""></a>"
				End Select
			End If
			Rs.Close: Set Rs = Nothing
		Else
			strPicture = ""
		End If
		NewsPictureAndText = strPicture & strContent
	End Function
	'================================================
	'函数名:ReadNewsPicAndText
	'作  用:读取图文混排列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadNewsPicAndText(ByVal str)
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$NewsPictureAndText(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$NewsPictureAndText(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$NewsPictureAndText(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), NewsPictureAndText(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13), ArrayList(14), ArrayList(15), ArrayList(16), ArrayList(17)))
			Next
		End If
		ReadNewsPicAndText = strTemp
	End Function
	'================================================
	'函数名:SoftPictureAndText
	'作  用:软件图文混排列表
	'================================================
	Public Function SoftPictureAndText(ByVal chanid, ByVal ClassID, ByVal specid, _
		ByVal stype, ByVal height, ByVal width, ByVal maxlen, _
		ByVal maxline, ByVal hspace, ByVal vspace, ByVal align, _
		ByVal divcss, ByVal target, ByVal start, ByVal showpic, _
		ByVal showclass, ByVal showdate, ByVal dateformat)
				
		Dim Rs, SQL, i, strContent, foundstr
		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)
		
		
		Newasp.LoadChannel(chanid)
		
		If 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,3: foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
			Case 1,4: foundstr = "And A.isBest > 0 ORDER BY A.SoftTime DESC ,A.softid DESC"
			Case 2,5: foundstr = "ORDER BY A.AllHits DESC ,A.softid DESC"
		Case Else
			foundstr = "ORDER BY A.SoftTime DESC ,A.softid DESC"
		End Select
		If CLng(ClassID) > 0 Then
			foundstr = "And A.ClassID in (" & ChildStr & ") " & foundstr
		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 = "<li>还没有添加任何软件!</li>"
		Else
			Do While Not Rs.EOF
				SoftTopic = Newasp.GotTopic(Trim(Rs("SoftName") & " " & Rs("SoftVer")), CInt(maxlen))
				SoftTopic = Newasp.ReadFontMode(SoftTopic, Rs("ColorMode"), Rs("FontMode"))
				ClassName = Newasp.ReadFontMode(Rs("ClassName"), Rs("ColorModes"), Rs("FontModes"))
				If CInt(Newasp.ChannelUseHtml) > 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("softid"),1,"")
					HtmlFileName = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_SortDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("softid"),1,"")
					ClassName = "[<a href=""" & HtmlFileName & """>" & ClassName & "</a>]"
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("softid") & Newasp.ChannelHtmlExt
						ClassName = "[<a href=""" & Newasp.ChannelPath & "list_1_" & Rs("ClassID") & Newasp.ChannelHtmlExt & """>" & ClassName & "</a>]"
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("softid")
						ClassName = "[<a href=""" & Newasp.ChannelPath & "list.asp?classid=" & Rs("ClassID") & """>" & ClassName & "</a>]"
					End If
				End If
				If CInt(showclass) = 1 Then
					ClassName = ClassName
				Else
					ClassName = ""
				End If
				If CInt(showdate) = 1 Then
					SoftTime = Newasp.ShowDateTime(Rs("SoftTime"), CInt(dateformat))
				Else
					SoftTime = ""
				End If
				softname = "<div " & divcss & ">" & start & ClassName & " <a href=""" & HtmlFileUrl & """ target=""" & target & """" & LoadRemark(Trim(Rs("SoftName") & " " & Rs("SoftVer"))) & ">" & SoftTopic & "</a>  " & SoftTime & "</div>"
				strContent = strContent & softname
				Rs.MoveNext
				i = i + 1
			Loop
		End If
		Rs.Close: Set Rs = Nothing
		Dim sExtName, ExtName, SoftImage
		If CInt(showpic) = 1 Then
			SQL = " A.softid,A.ClassID,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.SoftImage,"
			SQL = "SELECT " & SQL & " C.HtmlFileDir,B.ChannelDir,B.ModuleName,B.BindDomain,B.DomainName,B.IsCreateHtml,B.HtmlExtName,B.LeastHotHist FROM ([NC_SoftList] A INNER JOIN [NC_Classify] C ON A.ClassID=C.ClassID) INNER JOIN [NC_Channel] B On A.ChannelID=B.ChannelID WHERE A.isAccept>0 And A.ChannelID=" & CInt(chanid) & " And A.SoftImage<>'' " & foundstr & ""
			Set Rs = Newasp.Execute(SQL)
			If Rs.BOF And Rs.EOF Then
				strPicture = "<img src='" & Newasp.SiteUrl & Newasp.InstallDir & "images/no_pic.gif' width=""" & width & """ height=""" & height & """  hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0"">"
			Else
				If CInt(Newasp.ChannelUseHtml) <> 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("softid"),1,"")
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("softid") & Newasp.ChannelHtmlExt
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("softid")
					End If
				End If
				SoftImage = Newasp.GetImageUrl(Rs("SoftImage"), Newasp.ChannelPath)
				sExtName = Split(Rs("SoftImage"), ".")
				ExtName = sExtName(UBound(sExtName))
				Select Case LCase(ExtName)
				Case "swf", "swi"
					strPicture = "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """>" & vbNewLine
					strPicture = strPicture & "     <param name=""movie"" value=""" & SoftImage & """>" & vbNewLine
					strPicture = strPicture & "     <param name=""quality"" value=""high"">" & vbNewLine
					strPicture = strPicture & "     <embed src=""" & SoftImage & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash""></embed>" & vbNewLine
					strPicture = strPicture & "</object>" & vbNewLine
				Case Else
					strPicture = "<a href=""" & HtmlFileUrl & """  target=""" & target & """ title=""" & Newasp.ChannelModule & "名称:" & Rs("SoftName") & " " & Rs("SoftVer") & "&#13;&#10;发布时间:" & Rs("SoftTime") & "&#13;&#10;下载次数:" & Rs("AllHits") & """><img src=""" & SoftImage & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0""></a>"
				End Select
			End If
			Rs.Close: Set Rs = Nothing
		Else
			strPicture = ""
		End If
		SoftPictureAndText = strPicture & strContent
	End Function
	'================================================
	'函数名:ReadSoftPicAndText
	'作  用:读取软件图文混排列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadSoftPicAndText(ByVal str)
		
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$SoftPictureAndText(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$SoftPictureAndText(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$SoftPictureAndText(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), SoftPictureAndText(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9), ArrayList(10), ArrayList(11), ArrayList(12), ArrayList(13), ArrayList(14), ArrayList(15), ArrayList(16), ArrayList(17)))
			Next
		End If
		ReadSoftPicAndText = strTemp
	End Function
	'================================================
	'函数名:LoadGuestList
	'作  用:装载留言列表
	'参  数:maxnum ----最多留言数
	'        maxlen ----字符长度
	'        newindow ----是否新窗口打开 1=是,0=否
	'        showdate ----是否显示时间 1=是,0=否
	'        DateMode ----时间模式
	'        styles ----风格名称
	'================================================
	Public Function LoadGuestList(ByVal maxnum, ByVal maxlen, ByVal newindow, _
		ByVal showdate, ByVal DateMode, ByVal styles)
		
		Dim Rs, SQL, strContent
		Dim i, ListStyle, GuestTopic, LinkTarget
		Dim WriteTime, lastime, GuestTitle,strChannelDir
		
		Set Rs = Newasp.Execute("SELECT TOP " & CInt(maxnum) & " guestid,Topicformat,title,username,WriteTime,lastime,ReplyNum FROM NC_GuestBook WHERE isAccept>0 ORDER BY isTop DESC,lastime DESC,guestid DESC")
		If Rs.BOF And Rs.EOF Then
			LoadGuestList = "<li>没有任何留言!</li>"
			Set Rs = Nothing
			Exit Function
		Else
			Newasp.LoadChannel(4)
			i = 0
			strContent = ""
			strChannelDir = Newasp.ChannelPath
			Do While Not Rs.EOF
				If (i Mod 2) = 0 Then
					ListStyle = Trim(styles) & 1
				Else
					ListStyle = Trim(styles) & 2
				End If
				If CInt(newindow) <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				If CInt(showdate) <> 0 Then
					WriteTime = Newasp.ShowDateTime(Rs("WriteTime"), CInt(DateMode))
					lastime = Newasp.ShowDateTime(Rs("lastime"), CInt(DateMode))
				Else
					WriteTime = ""
					lastime = ""
				End If
				GuestTitle = Newasp.HTMLEncode(Rs("title"))
				GuestTopic = "<span " & Rs("Topicformat") & ">" & Newasp.GotTopic(GuestTitle, CInt(maxlen)) & "</span>"
				GuestTopic = "<a href=""" & strChannelDir & "showreply.asp?guestid=" & Rs("guestid") & """" & LinkTarget & LoadRemark(GuestTitle) &">" & GuestTopic & "</a>"
				strContent = strContent & Newasp.MainSetting(16)
				strContent = Replace(strContent, "{$GuestID}", Rs("guestid"))
				strContent = Replace(strContent, "{$UserName}", Newasp.HTMLEncode(Rs("username")))
				strContent = Replace(strContent, "{$GuestTopic}", GuestTopic)
				strContent = Replace(strContent, "{$ListStyle}", ListStyle)
				strContent = Replace(strContent, "{$Number}", i)
				strContent = Replace(strContent, "{$WriteTime}", WriteTime)
				strContent = Replace(strContent, "{$DateTime}", Replace(WriteTime, " globalDate", ""))
				strContent = Replace(strContent, "{$lastime}", lastime) & vbNewLine
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$OrderID}", i)
			Loop
		End If
		LoadGuestList = strContent
	End Function
	'================================================
	'函数名:ReadGuestList
	'作  用:读取留言列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadGuestList(ByVal str)
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadGuestList(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadGuestList(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadGuestList(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadGuestList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5)))
			Next
		End If
		ReadGuestList = strTemp
	End Function
	'================================================
	'函数名:LoadPopularSoft
	'作  用:装载排行软件列表
	'参  数:ClassID   ----分类ID
	'        chanid   ----频道ID
	'        stype   ----调用类型
	'        maxline   ----显示列表数
	'        maxlen   ----显示标题长度
	'        showhits   ----是否显示下载数
	'        target   ----连接目标
	'        start   ----标题头标记
	'        styles   ----样式名称
	'================================================
	Public Function LoadPopularSoft(ByVal chanid, ByVal ClassID, ByVal stype, _
		ByVal maxlen, ByVal maxline, ByVal showhits, _
		ByVal target, ByVal start, ByVal styles)
		
		Dim SQL, Rs, foundsql, strHits
		Dim ChildStr, i, strContent
		Dim HtmlFileName, HtmlFileUrl
		Dim NewsTitle, AllHits, strSoftName
		Dim divstyle
		
		chanid = Newasp.ChkNumeric(chanid)
		ClassID = Newasp.ChkNumeric(ClassID)
		stype = Newasp.ChkNumeric(stype)
		If chanid = 0 Then chanid = 1

		Newasp.LoadChannel(chanid)
		
		If CLng(ClassID) > 0 And Trim(ClassID) <> "" 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
				LoadPopularSoft = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
				foundsql = "And A.ClassID in (" & ChildStr & ")"
			End If
			Rs.Close
		Else
			ChildStr = "0"
			foundsql = ""
		End If
		
		Select Case CInt(stype)
		Case 1
			foundsql = foundsql & " ORDER BY A.DayHits DESC ,A.softid DESC"
			strHits = "DayHits"
		Case 2
			foundsql = foundsql & " ORDER BY A.WeekHits DESC ,A.softid DESC"
			strHits = "WeekHits"
		Case 3
			foundsql = foundsql & " ORDER BY A.MonthHits DESC ,A.softid DESC"
			strHits = "MonthHits"
		Case 4
			foundsql = foundsql & " And A.isBest>0 ORDER BY A.AllHits DESC ,A.softid DESC"
			strHits = "AllHits"
		Case Else
			foundsql = foundsql & "ORDER BY A.AllHits DESC ,A.softid DESC"
			strHits = "AllHits"
		End Select
		SQL = " A.softid,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.DayHits,A.WeekHits,A.MonthHits,"
		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 & " " & foundsql
		Set Rs = Newasp.Execute(SQL)
		i = 0
		strContent = ""
		If Rs.BOF And Rs.EOF Then
			strContent = "<li>还没有找到任何内容!</li>"
		Else
			Do While Not Rs.EOF
				If Trim(styles) <> "" And Trim(styles) <> "0" Then
					If (i Mod 2) = 0 Then
						divstyle = " class=""" & Trim(styles) & "1"""
					Else
						divstyle = " class=""" & Trim(styles) & "2"""
					End If
				End If
				
				NewsTitle = Newasp.GotTopic(Trim(Rs("SoftName") & " " & Rs("SoftVer")), CInt(maxlen))
				NewsTitle = Newasp.ReadFontMode(NewsTitle, Rs("ColorMode"), Rs("FontMode"))
				If CInt(Newasp.ChannelUseHtml) > 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("softid"),1,"")
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("softid") & Newasp.ChannelHtmlExt
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("softid")
					End If
				End If
				If CInt(showhits) > 0 Then
					AllHits = Rs(strHits)
					strSoftName = "<li" & divstyle & ">" & start & "<a href=""" & HtmlFileUrl & """ target=""" & target & """"& LoadRemark(Trim(Rs("SoftName") & " " & Rs("SoftVer"))) &">" & NewsTitle & "</a>  " & AllHits & "</li>" & vbNewLine
				Else
					strSoftName = "<li" & divstyle & ">" & start & "<a href=""" & HtmlFileUrl & """ target=""" & target & """"& LoadRemark(Trim(Rs("SoftName") & " " & Rs("SoftVer"))) &">" & NewsTitle & "</a></li>" & vbNewLine
				End If
				strContent = strContent & strSoftName
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$OrderID}", i)
			Loop
		End If
		Rs.Close: Set Rs = Nothing
		LoadPopularSoft = strContent
	End Function
	'================================================
	'函数名:ReadPopularSoft
	'作  用:读取软件排行列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadPopularSoft(ByVal str)
		
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadPopularSoft(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadPopularSoft(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadPopularSoft(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadPopularSoft(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
			Next
		End If
		ReadPopularSoft = strTemp
	End Function
	'================================================
	'函数名:LoadPopularArticle
	'作  用:装载排行文章列表
	'参  数:ClassID   ----分类ID
	'        chanid   ----频道ID
	'        stype   ----调用类型
	'        maxline   ----显示列表数
	'        maxlen   ----显示标题长度
	'        showhits   ----是否显示下载数
	'        target   ----连接目标
	'        start   ----标题头标记
	'        styles   ----样式名称
	'================================================
	Public Function LoadPopularArticle(ByVal chanid, ByVal ClassID, ByVal stype, _
		ByVal maxlen, ByVal maxline, ByVal showhits, ByVal target, _
		ByVal start, ByVal styles)

		Dim SQL, Rs, foundsql, strHits
		Dim ChildStr, i, strContent
		Dim HtmlFileName, HtmlFileUrl
		Dim NewsTitle, AllHits, ArticleTitle
		Dim divstyle

		chanid = Newasp.ChkNumeric(chanid)
		ClassID = Newasp.ChkNumeric(ClassID)
		stype = Newasp.ChkNumeric(stype)

		If chanid = 0 Then chanid = 2
		Newasp.LoadChannel(chanid)
		
		If CLng(ClassID) > 0 And Trim(ClassID) <> "" Then
			SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & chanid & " And classid=" & CLng(ClassID)
			Set Rs = Newasp.Execute(SQL)
			If Rs.BOF And Rs.EOF Then
				Set Rs = Nothing
				LoadPopularArticle = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
				foundsql = "And A.ClassID in (" & ChildStr & ")"
			End If
			Rs.Close
		Else
			ChildStr = "0"
			foundsql = ""
		End If
		Select Case CInt(stype)
		Case 1
			foundsql = foundsql & " ORDER BY A.DayHits DESC ,A.Articleid DESC"
			strHits = "DayHits"
		Case 2
			foundsql = foundsql & " ORDER BY A.WeekHits DESC ,A.Articleid DESC"
			strHits = "WeekHits"
		Case 3
			foundsql = foundsql & " ORDER BY A.MonthHits DESC ,A.Articleid DESC"
			strHits = "MonthHits"
		Case 4
			foundsql = foundsql & " And A.isBest>0 ORDER BY A.AllHits DESC ,A.Articleid DESC"
			strHits = "AllHits"
		Case Else
			foundsql = foundsql & "ORDER BY A.AllHits DESC ,A.Articleid DESC"
			strHits = "AllHits"
		End Select
		SQL = " A.ArticleID,A.ClassID,A.ColorMode,A.FontMode,A.title,A.BriefTopic,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,A.DayHits,A.WeekHits,A.MonthHits,"
		SQL = "SELECT TOP " & CInt(maxline) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir FROM [NC_Article] A INNER JOIN [NC_Classify] C ON A.ClassID=C.ClassID WHERE A.isAccept>0 And A.ChannelID=" & chanid & " " & foundsql
		Set Rs = Newasp.Execute(SQL)
		i = 0
		strContent = ""
		If Rs.BOF And Rs.EOF Then
			strContent = "<li>还没有找到任何信息!</li>"
		Else
			Do While Not Rs.EOF
				If Trim(styles) <> "" And Trim(styles) <> "0" Then
					If (i Mod 2) = 0 Then
						divstyle = " class=""" & Trim(styles) & "1"""
					Else
						divstyle = " class=""" & Trim(styles) & "2"""
					End If
				End If
				NewsTitle = Newasp.GotTopic(Rs("title"), CInt(maxlen))
				NewsTitle = Newasp.ReadFontMode(NewsTitle, Rs("ColorMode"), Rs("FontMode"))
				If CInt(Newasp.ChannelUseHtml) > 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("ArticleID"),1,"")
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("ArticleID") & Newasp.ChannelHtmlExt
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("ArticleID")
					End If
				End If
				If CInt(showhits) > 0 Then
					AllHits = Rs(strHits)
					ArticleTitle = "<li" & divstyle & ">" & start & "<a href=""" & HtmlFileUrl & """ target=""" & target & """>" & NewsTitle & "</a>  " & AllHits & "</li>" & vbNewLine
				Else
					ArticleTitle = "<li" & divstyle & ">" & start & "<a href=""" & HtmlFileUrl & """ target=""" & target & """>" & NewsTitle & "</a></li>" & vbNewLine
				End If
				strContent = strContent & ArticleTitle
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$OrderID}", i)
			Loop
		End If
		Rs.Close: Set Rs = Nothing
		LoadPopularArticle = strContent
	End Function
	'================================================
	'函数名:ReadPopularSoft
	'作  用:读取软件排行列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadPopularArticle(ByVal str)
		
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadPopularArticle(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadPopularArticle(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadPopularArticle(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadPopularArticle(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
			Next
		End If
		ReadPopularArticle = strTemp
	End Function
	'================================================
	'函数名:LoadPopularFlash
	'作  用:装载排行动画列表
	'参  数:ClassID   ----分类ID
	'        chanid   ----频道ID
	'        stype   ----调用类型
	'        maxline   ----显示列表数
	'        maxlen   ----显示标题长度
	'        showhits   ----是否显示下载数
	'        target   ----连接目标
	'        start   ----标题头标记
	'        styles   ----样式名称
	'================================================
	Public Function LoadPopularFlash(ByVal chanid, ByVal ClassID, ByVal stype, _
		ByVal maxlen, ByVal maxline, ByVal showhits, _
		ByVal target, ByVal start, ByVal styles)
		
		Dim SQL, Rs, foundsql, strHits
		Dim ChildStr, i, strContent
		Dim HtmlFileName, HtmlFileUrl
		Dim NewsTitle, AllHits, strtitle
		Dim divstyle
		
		chanid = Newasp.ChkNumeric(chanid)
		ClassID = Newasp.ChkNumeric(ClassID)
		stype = Newasp.ChkNumeric(stype)
		If chanid = 0 Then chanid = 1

		
		Newasp.LoadChannel(chanid)
		
		If CLng(ClassID) > 0 And Trim(ClassID) <> "" 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
				LoadPopularFlash = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
				foundsql = "And A.ClassID in (" & ChildStr & ")"
			End If
			Rs.Close
		Else
			ChildStr = "0"
			foundsql = ""
		End If
		
		Select Case CInt(stype)
		Case 1
			foundsql = foundsql & " ORDER BY A.DayHits DESC ,A.flashid DESC"
			strHits = "DayHits"
		Case 2
			foundsql = foundsql & " ORDER BY A.WeekHits DESC ,A.flashid DESC"
			strHits = "WeekHits"
		Case 3
			foundsql = foundsql & " ORDER BY A.MonthHits DESC ,A.flashid DESC"
			strHits = "MonthHits"
		Case 4
			foundsql = foundsql & " And A.isBest>0 ORDER BY A.AllHits DESC ,A.flashid DESC"
			strHits = "AllHits"
		Case Else
			foundsql = foundsql & "ORDER BY A.AllHits DESC ,A.flashid DESC"
			strHits = "AllHits"
		End Select
		SQL = " A.flashid,A.ClassID,A.ColorMode,A.FontMode,A.title,A.AllHits,A.addTime,A.HtmlFileDate,A.isBest,A.DayHits,A.WeekHits,A.MonthHits,"
		SQL = "SELECT TOP " & CInt(maxline) & SQL & " C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir FROM [NC_FlashList] A INNER JOIN [NC_Classify] C ON A.ClassID=C.ClassID WHERE A.isAccept>0 And A.ChannelID=" & chanid & " " & foundsql
		Set Rs = Newasp.Execute(SQL)
		i = 0
		strContent = ""
		If Rs.BOF And Rs.EOF Then
			strContent = "<li>还没有找到任何内容!</li>"
		Else
			Do While Not Rs.EOF
				If Trim(styles) <> "" And Trim(styles) <> "0" Then
					If (i Mod 2) = 0 Then
						divstyle = " class=""" & Trim(styles) & "1"""
					Else
						divstyle = " class=""" & Trim(styles) & "2"""
					End If
				End If
				
				NewsTitle = Newasp.GotTopic(Rs("title"), CInt(maxlen))
				NewsTitle = Newasp.ReadFontMode(NewsTitle, Rs("ColorMode"), Rs("FontMode"))
				If CInt(Newasp.ChannelUseHtml) > 0 Then
					HtmlFileUrl = Newasp.ChannelDomain & Newasp.ReadDestination(Newasp.m_InfoDestination, Newasp.m_ChannelDir, Rs("HtmlFileDate"),Rs("HtmlFileDir"),Rs("ClassID"),Rs("flashid"),1,"")
				Else
					If IsURLRewrite Then
						HtmlFileUrl = Newasp.ChannelPath & Rs("flashid") & Newasp.ChannelHtmlExt
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("flashid")
					End If
				End If
				If CInt(showhits) > 0 Then
					AllHits = Rs(strHits)
					strtitle = "<li" & divstyle & ">" & start & "<a href=""" & HtmlFileUrl & """ target=""" & target & """>" & NewsTitle & "</a>  " & AllHits & "</li>" & vbNewLine
				Else
					strtitle = "<li" & divstyle & ">" & start & "<a href=""" & HtmlFileUrl & """ target=""" & target & """>" & NewsTitle & "</a></li>" & vbNewLine
				End If
				
				strContent = strContent & strtitle
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$OrderID}", i)
			Loop
		End If
		Rs.Close: Set Rs = Nothing
		LoadPopularFlash = strContent
	End Function
	'================================================
	'函数名:ReadPopularFlash
	'作  用:读取动画排行列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadPopularFlash(ByVal str)
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadPopularFlash(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadPopularFlash(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadPopularFlash(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadPopularFlash(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
			Next
		End If
		ReadPopularFlash = strTemp
	End Function
	
	Public Function LoadCommentGrade(ByVal strHTML,ByVal chanid,ByVal id)
		Dim AverageGrade, TotalGrade, TotalComment
		Dim Rs,SQL
		chanid = Newasp.CheckNumeric(chanid)
		id = Newasp.CheckNumeric(id)
		AverageGrade=0: TotalGrade=0: TotalComment=0
		If InStr(strHTML, "{$AverageGrade}") = 0 And InStr(strHTML, "{$AverageGrade}") = 0 And InStr(strHTML, "{$AverageGrade}") = 0 Then
			LoadCommentGrade = strHTML
			Exit Function
		End If
		If chanid > 0 And id > 0 Then
			SQL = "SELECT COUNT(CommentID) As TotalComment, AVG(Grade) As avgGrade,SUM(Grade) As TotalGrade FROM NC_Comment WHERE ChannelID=" & chanid & " And postid = " & id
			Set Rs = Newasp.Execute(SQL)
			TotalComment = Rs("TotalComment")
			AverageGrade = Rs("avgGrade")
			TotalGrade = Rs("TotalGrade")
			If IsNull(AverageGrade) Then AverageGrade = 0
			If IsNull(TotalComment) Then TotalComment = 0
			If IsNull(TotalGrade) Then TotalGrade = 0
			AverageGrade = Round(AverageGrade)
			Rs.Close: Set Rs = Nothing
		End If
		strHTML = Replace(strHTML, "{$TotalComment}", TotalComment)
		strHTML = Replace(strHTML, "{$AverageGrade}", AverageGrade)
		strHTML = Replace(strHTML, "{$TotalGrade}", TotalGrade)
		LoadCommentGrade = strHTML
	End Function

	'================================================
	'函数名:LoadUserRank
	'作  用:装用户排行列表
	'标  签:{$ReadUserRank(1,0,12,showlist)}
	'================================================
	Public Function LoadUserRank(ByVal stype,ByVal grade,ByVal maxline,ByVal styles)
		Dim SQL, Rs, foundsql, strContent, i
		Dim ListStyle,username
		
		stype = Newasp.CheckNumeric(stype)
		grade = Newasp.CheckNumeric(grade)
		maxline = Newasp.CheckNumeric(maxline)
		If maxline = 0 Then maxline = 10
		If stype = 1 Then
			foundsql = "ORDER BY JoinTime DESC,userid DESC"
		ElseIf stype = 2 Then
			foundsql = "ORDER BY LastTime DESC,userid DESC"
		ElseIf stype = 3 Then
			foundsql = "ORDER BY userpoint DESC,userid DESC"
		Else
			foundsql = "ORDER BY userlogin DESC,userid DESC"
		End If
		If grade > 0 Then
			SQL = "SELECT TOP " & maxline & " userid,username,userpoint,userlogin FROM [NC_User] WHERE UserGrade=" & grade & " " & foundsql
		Else
			SQL = "SELECT TOP " & maxline & " userid,username,userpoint,userlogin FROM [NC_User] " & foundsql
		End If
		Set Rs = Newasp.Execute(SQL)
		i = 0
		strContent = ""
		If Not (Rs.BOF And Rs.EOF) Then
			Do While Not Rs.EOF
				If (i Mod 2) = 0 Then
					ListStyle = Trim(styles) & 1
				Else
					ListStyle = Trim(styles) & 2
				End If
				username = "<a href=""" & Newasp.InstallDir & "user/userlist.asp?userid=" & Rs("userid") & """ target=""_blank"">" & Rs("username") & "</a>"
				strContent = strContent & Newasp.MainSetting(23)
				strContent = Replace(strContent, "{$ListStyle}", ListStyle)
				strContent = Replace(strContent, "{$InstallDir}", Newasp.InstallDir)
				strContent = Replace(strContent, "{$UserName}", username)
				strContent = Replace(strContent, "{$username}", Rs("username"))
				strContent = Replace(strContent, "{$UserID}", Rs("userid"))
				strContent = Replace(strContent, "{$UserLogin}", Rs("userlogin"))
				strContent = Replace(strContent, "{$UserPoint}", Rs("userpoint"))
				Rs.MoveNext
				i = i + 1
				strContent = Replace(strContent, "{$OrderID}", i)
			Loop
		End If
		Rs.Close: Set Rs = Nothing
		
		LoadUserRank = strContent
	End Function
	'================================================
	'函数名:ReadUserRank
	'作  用:读取用户排行列表
	'参  数:str ----原字符串
	'================================================
	Public Function ReadUserRank(ByVal str)
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadUserRank(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadUserRank(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadUserRank(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadUserRank(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
			Next
		End If
		ReadUserRank = strTemp
	End Function
	'================================================
	'函数名:LoadStatistic
	'作  用:装载频道统计
	'参  数:moduleid ----所属模块
	'        ChannelID ----频道ID
	'        strClass ----所调用的分类ID或者软件类型
	'        stype ----统计类型,0=全部统计,1=今日更新统计,2=点击数统计,3=软件容量统计
	'================================================
	Public Function LoadStatistic(ByVal moduleid, ByVal ChannelID, ByVal strClass, ByVal stype)
		moduleid = Newasp.CheckNumeric(moduleid)
		ChannelID = Newasp.CheckNumeric(ChannelID)
		stype = Newasp.CheckNumeric(stype)
		
		Dim Rs, SQL, StatCount
		Dim foundsql, ClassID, ChildStr
		
		ClassID = Newasp.CheckNumeric(strClass)
		LoadStatistic = 0
		If 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
				ChildStr = 0
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close: Set Rs = Nothing
			foundsql = "And ChannelID=" & ChannelID & " And ClassID in (" & ChildStr & ")"
		Else
			If ChannelID > 0 Then
				foundsql = "And ChannelID=" & ChannelID
			Else
				foundsql = ""
			End If
		End If
		Select Case moduleid
		Case 1
			If stype = 1 Then
				If isSqlDataBase = 1 Then
					SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql & " And Datediff(d,WriteTime,GetDate())=0"
				Else
					SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql & " And WriteTime>=Date()"
				End If
			ElseIf stype = 2 Then
				SQL = "SELECT SUM(AllHits) FROM NC_Article WHERE isAccept>0 " & foundsql
			ElseIf stype = 4 Then
				SQL = "SELECT SUM(DayHits) FROM NC_Article WHERE isAccept>0 " & foundsql
			Else
				SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql
			End If
		Case 2
			If Not IsNumeric(strClass) Then
				foundsql = foundsql & " And SoftType='" & Newasp.CheckStr(strClass) & "'"
			End If
			If stype = 1 Then
				If isSqlDataBase = 1 Then
					SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql & " And Datediff(d,SoftTime,GetDate())=0"
				Else
					SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql & " And SoftTime>=Date()"
				End If
			ElseIf stype = 2 Then
				SQL = "SELECT SUM(AllHits) FROM NC_SoftList WHERE isAccept>0 " & foundsql
			ElseIf stype = 3 Then
				SQL = "SELECT SUM(SoftSize) FROM NC_SoftList WHERE isAccept>0 " & foundsql
			ElseIf stype = 4 Then
				SQL = "SELECT SUM(DayHits) FROM NC_SoftList WHERE isAccept>0 " & foundsql
			Else
				SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql
			End If
		Case 4
			If stype = 1 Then
				If isSqlDataBase = 1 Then
					SQL = "SELECT COUNT(GuestID) FROM NC_GuestBook WHERE isAccept>0 And Datediff(d,WriteTime,GetDate())=0"
				Else
					SQL = "SELECT COUNT(GuestID) FROM NC_GuestBook WHERE isAccept>0 And WriteTime>=Date()"
				End If
			Else
				SQL = "SELECT COUNT(GuestID) FROM NC_GuestBook WHERE isAccept>0"
			End If
		Case 5
			If stype = 1 Then
				If isSqlDataBase = 1 Then
					SQL = "SELECT COUNT(flashid) FROM NC_FlashList WHERE isAccept>0 " & foundsql & " And Datediff(d,addTime,GetDate())=0"
				Else
					SQL = "SELECT COUNT(flashid) FROM NC_FlashList WHERE isAccept>0 " & foundsql & " And addTime>=Date()"
				End If
			ElseIf stype = 2 Then
				SQL = "SELECT SUM(AllHits) FROM NC_FlashList WHERE isAccept>0 " & foundsql
			ElseIf stype = 3 Then
				SQL = "SELECT SUM(filesize) FROM NC_FlashList WHERE isAccept>0 " & foundsql
			ElseIf stype = 4 Then
				SQL = "SELECT SUM(DayHits) FROM NC_FlashList WHERE isAccept>0 " & foundsql
			Else
				SQL = "SELECT COUNT(flashid) FROM NC_FlashList WHERE isAccept>0 " & foundsql
			End If
		Case Else
			If stype = 1 Then
				If isSqlDataBase = 1 Then
					SQL = "SELECT COUNT(userid) FROM NC_User WHERE Datediff(d,JoinTime,GetDate())=0"
				Else
					SQL = "SELECT COUNT(userid) FROM NC_User WHERE JoinTime>=Date()"
				End If
			Else
				SQL = "SELECT COUNT(userid) FROM NC_User"
			End If
		End Select
		Set Rs = Newasp.Execute(SQL)
		If Rs.BOF And Rs.EOF Then
			StatCount = 0
		Else
			If  IsNull(Rs(0)) Then
				StatCount = 0
			Else
				StatCount = CCur(Rs(0))
				If (moduleid = 2 And stype = 3) Or (moduleid = 5 And stype = 3) Then
				'If moduleid = 2 And stype = 3 Then
					StatCount = Round(StatCount / 1024 / 1024, 3)
					StatCount = FormatNumber(StatCount, 3, -1)
				End If
			End If
		End If
		Rs.Close: Set Rs = Nothing
		LoadStatistic = StatCount
	End Function
	'================================================
	'函数名:ReadStatistic
	'作  用:读取频道统计
	'参  数:str ----原字符串
	'================================================
	Public Function ReadStatistic(ByVal str)
		Dim strTemp, i, sTempContent
		Dim nTempContent, ArrayList
		Dim arrTempContent, arrTempContents
		
		strTemp = str
		If InStr(strTemp, "{$ReadStatistic(") > 0 Then
			sTempContent = Newasp.CutMatchContent(strTemp, "{$ReadStatistic(", ")}", 1)
			nTempContent = Newasp.CutMatchContent(strTemp, "{$ReadStatistic(", ")}", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
				strTemp = Replace(strTemp, arrTempContents(i), LoadStatistic(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
			Next
		End If
		ReadStatistic = strTemp
	End Function

	Public Function ShowIndex(ByVal isHtml)
		Dim HtmlContent
		Newasp.m_intChannelID = 0
		Newasp.LoadTemplates 0, 1, 0
		HtmlContent = Newasp.HtmlContent
		HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", Newasp.InstallDir)
		HtmlContent = Replace(HtmlContent, "{$InstallDir}", Newasp.InstallDir)
		If Len(Newasp.HtmlSetting(1)) < 2 Then
			HtmlContent = Replace(HtmlContent, "{$PageTitle}", "首页")
		Else
			HtmlContent = Replace(HtmlContent, "{$PageTitle}", Newasp.HtmlSetting(1))
		End If
		HtmlContent = Replace(HtmlContent, "{$IndexTitle}", "首页")
		HtmlContent = Replace(HtmlContent, "{$ChannelID}", 0)
		HtmlContent = ReadAnnounceContent(HtmlContent, 0)
		HtmlContent = ReadClassMenu(HtmlContent)
		HtmlContent = ReadClassMenubar(HtmlContent)
		HtmlContent = ReadArticlePic(HtmlContent)
		HtmlContent = ReadSoftPic(HtmlContent)
		HtmlContent = ReadArticleList(HtmlContent)
		HtmlContent = ReadSoftList(HtmlContent)
		HtmlContent = ReadFlashList(HtmlContent)
		HtmlContent = ReadFlashPic(HtmlContent)
		HtmlContent = ReadFriendLink(HtmlContent)
		HtmlContent = ReadNewsPicAndText(HtmlContent)
		HtmlContent = ReadSoftPicAndText(HtmlContent)
		HtmlContent = ReadGuestList(HtmlContent)
		HtmlContent = ReadAnnounceList(HtmlContent)
		HtmlContent = ReadPopularArticle(HtmlContent)
		HtmlContent = ReadPopularSoft(HtmlContent)
		HtmlContent = ReadPopularFlash(HtmlContent)
		HtmlContent = ReadStatistic(HtmlContent)
		HtmlContent = ReadUserRank(HtmlContent)
		HtmlContent = Replace(HtmlContent, "{$SkinPath}", Newasp.SkinPath)
		HtmlContent = Replace(HtmlContent, "{$InstallDir}", Newasp.InstallDir)
		If isHtml Then
			ShowIndex = HtmlContent
		Else
			Response.Write HtmlContent
		End If
	End Function

End Class
%>