⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cls_public.asp

📁 采用的是新云内核
💻 ASP
📖 第 1 页 / 共 5 页
字号:
			SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID=" & ChannelID & " And ClassID=" & ClassID
			Set Rs = Newasp.Execute(SQL)
			If Rs.BOF And Rs.EOF Then
				Set Rs = Nothing
				LoadSoftPic = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close
		Else
			ChildStr = 0
		End If
		Select Case CInt(stype)
			Case 0: foundstr = "Order By A.SoftTime Desc ,A.SoftID Desc"
			Case 1: foundstr = "And A.isBest > 0 Order By A.SoftTime Desc ,A.SoftID Desc"
			Case 2: foundstr = "Order By A.AllHits Desc ,A.SoftID Desc"
			Case 3: foundstr = "And A.ClassID in (" & ChildStr & ") Order By A.SoftTime Desc ,A.SoftID Desc"
			Case 4: foundstr = "And A.ClassID in (" & ChildStr & ") And A.isBest > 0 Order By A.SoftTime Desc ,A.SoftID Desc"
			Case 5: foundstr = "And A.ClassID in (" & ChildStr & ") Order By A.AllHits Desc ,A.SoftID Desc"
			Case 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 CInt(stype) >= 3 And CLng(ClassID) = 0 Then
			foundstr = "Order By A.SoftTime Desc ,A.SoftID Desc"
		End If
		If CLng(SpecialID) <> 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		SQL = " A.SoftID,A.ClassID,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.SoftImage,"
		SQL = "select Top " & CInt(TopNum) & SQL & " C.ClassName,C.HtmlFileDir,C.UseHtml from [NC_SoftList] A inner join [NC_Classify] C On A.ClassID=C.ClassID where A.isAccept>0 And A.SoftImage<>'' And A.ChannelID=" & ChannelID & " " & foundstr & ""
		Set Rs = Newasp.Execute(SQL)
		If Rs.BOF And Rs.EOF Then
			strContent = "<img src='" & Newasp.InstallDir & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>"
		Else
			strContent = "<table width=""100%"" border=""0"" cellpadding=""1"" cellspacing=""3"">" & vbCrLf
			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.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(Rs("SoftName") & " " & Rs("SoftVer"), CInt(strLen))
					SoftImage = Newasp.GetImageUrl(Rs("SoftImage"), Newasp.ChannelData(1))
					If CInt(Newasp.ChannelUseHtml) <> 0 Then
						HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("SoftID"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
						HtmlFileUrl = ShowChannelPath(Newasp.ChannelPath, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("SoftID")
					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
					strContent = strContent & "<tr>" & vbCrLf
					For i = 1 To CInt(PerRowNum)
						strContent = strContent & "<td align=""center"" class=""imagelist"">"
						If Not Rs.EOF Then
							strSoftName = Newasp.GotTopic(Rs("SoftName") & " " & Rs("SoftVer"), CInt(strLen))
							SoftImage = Newasp.GetImageUrl(Rs("SoftImage"), Newasp.ChannelData(1))
							SoftImage = Newasp.GetFlashAndPic(SoftImage, height, width)
							HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("SoftID"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
							If CInt(Newasp.ChannelUseHtml) <> 0 Then
								HtmlFileUrl = ShowChannelPath(Newasp.ChannelPath, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
							Else
								HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("SoftID")
							End If
							If CInt(newindow) <> 0 Then
								LinkTarget = " target=""_blank"""
							Else
								LinkTarget = ""
							End If
							strContent = strContent & Newasp.MainSetting(19)
							strContent = Replace(strContent, "{$SoftPicture}", "<a href='" & HtmlFileUrl & "' title='" & Rs("SoftName") & " " & Rs("SoftVer") & "'" & LinkTarget & ">" & SoftImage & "</a>")
							If CInt(showtopic) = 1 Then
								strContent = Replace(strContent, "{$SoftTopic}", "<a href='" & HtmlFileUrl & "' title='" & Rs("SoftName") & " " & Rs("SoftVer") & "'" & LinkTarget & ">" & strSoftName & "</a>")
							Else
								strContent = Replace(strContent, "{$SoftTopic}", vbNullString)
							End If
							strContent = strContent & "</td>" & vbCrLf
						Rs.MoveNext
						End If
					Next
				End If
				strContent = strContent & "</tr>" & vbCrLf
				If slide>0 Then Rs.MoveNext
			Loop
			strContent = strContent & "</table>" & vbCrLf
			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", ",")
				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)))
			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)
		
		Dim Rs, SQL, i, strContent, foundstr, n
		Dim strtitle, ChildStr, miniature, HtmlFileName
		Dim HtmlFileUrl, addTime, LinkTarget
		Dim XMLDom,xmlNode,Node,XSLT,XMLStyle,proc
		
		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)
		
		
		Newasp.LoadChannel(ChannelID)
		
		If CInt(stype) >= 3 And CLng(ClassID) <> 0 Then
			SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID = " & ClassID
			Set Rs = Newasp.Execute(SQL)
			If Rs.BOF And Rs.EOF Then
				Set Rs = Nothing
				LoadFlashPic = ""
				Exit Function
			Else
				ChildStr = Rs("ChildStr")
			End If
			Rs.Close
		Else
			ChildStr = 0
		End If
		
		Select Case CInt(stype)
			Case 0: foundstr = "ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 1: foundstr = "And A.isBest > 0 ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 2: foundstr = "ORDER BY A.AllHits DESC ,A.flashid DESC"
			Case 3: foundstr = "And A.ClassID in (" & ChildStr & ") ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 4: foundstr = "And A.ClassID in (" & ChildStr & ") And A.isBest > 0 ORDER BY A.addTime DESC ,A.flashid DESC"
			Case 5: foundstr = "And A.ClassID in (" & ChildStr & ") 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 CInt(stype) >= 3 And CLng(ClassID) = 0 Then
			foundstr = "ORDER BY A.addTime DESC ,A.flashid DESC"
		End If
		If CLng(SpecialID) <> 0 Then
			foundstr = "And A.SpecialID =" & CLng(SpecialID) & " " & foundstr
		End If
		SQL = " A.flashid,A.ClassID,A.title,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.InstallDir & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>"
		Else
			strContent = "<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""3"">" & vbCrLf
			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.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.ChannelData(1))
					If CInt(Newasp.ChannelUseHtml) <> 0 Then
						HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("flashid"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
						HtmlFileUrl = ShowChannelPath(Newasp.ChannelPath, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
					Else
						HtmlFileUrl = Newasp.ChannelPath & "show.asp?id=" & Rs("flashid")
					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
					strContent = strContent & "<tr>" & vbCrLf
					For i = 1 To CInt(PerRowNum)
						strContent = strContent & "<td align=""center"" class=""imagelist"">"
						If Not Rs.EOF Then
							strtitle = Newasp.GotTopic(Rs("title"), CInt(strLen))
							miniature = Newasp.GetImageUrl(Rs("miniature"), Newasp.ChannelData(1))
							miniature = Newasp.GetFlashAndPic(miniature, height, width)
							HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("flashid"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
							If CInt(Newasp.ChannelUseHtml) <> 0 Then
								HtmlFileUrl = ShowChannelPath(Newasp.ChannelPath, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
							Else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -