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

📄 cl_clstemplate.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
📖 第 1 页 / 共 5 页
字号:
				Case "module"		: sModule	= TempValue(i)(1)
				Case "topnum"		: sTopNum	= Cl.GetCLng(TempValue(i)(1))
				Case "channelid"	: sChannelID= Cl.GetEval(TempValue(i)(1))
				Case "classid"		: sClassID	= Cl.GetEval(TempValue(i)(1))
				Case "arrclassid"	: arrClassID= Trim(TempValue(i)(1))
				Case "specialid"	: sSpecialID= Cl.GetEval(TempValue(i)(1))
				Case "ishot"		: sIsHot	= Cl.GetCLng(TempValue(i)(1))
				Case "iselite"		: sIsElite	= Cl.GetCLng(TempValue(i)(1))
				Case "where"		: sWhere	= Trim(TempValue(i)(1))
				Case "order"		: sOrder	= Trim(TempValue(i)(1)) & ",InfoID Desc"
				Case "rows"			: Rows		= Trim(TempValue(i)(1))
				Case "cols"			: Cols		= Cl.GetCLng(TempValue(i)(1))
				Case "coltemplate"	: ColTemplate = Trim(TempValue(i)(1))
				Case "name"			: sUserName = Trim(TempValue(i)(1))
				End Select
			Next
			TempValue = Empty
			If sTopNum < 1 Or sTopNum > 100 Then sTopNum = 5
			SQL = "Select Top "&sTopNum&" InfoID, ChannelID, ChannelDir, ClassID, Prefixion, "
			Select Case LCase(sModule)
			Case "article"
			SQL = SQL & "Title, FontColor, FontType, TitleIntact, Author, CopyFrom, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, PicUrl, Intro, Receive, ReceiveType, IsLink, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Article "
			Case "soft"
			SQL = SQL & "SoftName, FontColor, FontType, SoftVersion, Author, AuthorEmail, AuthorHomepage, DemoUrl, RegUrl, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, Intro, PicUrl, SoftPassword, OperatingSystem, SoftSize, SoftType, SoftLanguage, CopyrightType, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Soft "
			Case "photo"
			SQL = SQL & "PhotoName, FontColor, FontType, Author, AuthorEmail, AuthorHomepage, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, Intro, PicUrl, IsDownLoad, DownLoadNum, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Photo "
			Case "movie"
			SQL = SQL & "MovieName, FontColor, FontType, Director, ActName, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, DownNums, InfoGroup, InfoPoint, InfoMoney, IsOnLine, IsDownLoad, Intro, PicUrl, MovieFormat, MovieLong, MovieCorner, MovieLanguage, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Movie "
			Case "product"
			SQL = SQL & "ProductName, FontColor, FontType, ProductSn, Keyword, Producer, Trademark, ProductModel, ProductUnit, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, MarketPrice, MemberPrice, TruePrice, Discount, PresentExp, Intro, PicUrl, ProductType, CardPoint, StockNum, BuyTimes, BeginDate, EndDate, NoOver, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Product "
			Case "supply"
			SQL = SQL & "Title, FontColor, FontType, SupplyType, CompanyName, LinkMan, LinkAddress, LinkZipCode, LinkPhone, LinkFax, LinkMobile, LinkEmail, LinkQQ, ValidTime, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, PicUrl, Intro, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Supply "
			Case Else
			SQL = SQL & "Title, FontColor, FontType, TitleIntact, Author, CopyFrom, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, PicUrl, Intro, Content, Receive, ReceiveType, IsLink, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Article "
			End Select
			SQL = SQL & " where Deleted="&FalseType&" and Status=1"
			If sChannelID>0 Then SQL = SQL & " and ChannelID="&sChannelID&""
			If sClassID>0 Then 
				Dim tClass
				Set tClass = Cl.Execute("select ClassID, Child, arrChildID From Cl_Class where ClassID=" & sClassID)
				If Not tClass.eof Then
					If tClass(1) > 0 Then 
					SQL = SQL & " and ClassID in (" & tClass(2) & ")"
					Else
					SQL = SQL & " and ClassID = " & sClassID & ""
					End If 
				End If 
				Set tClass = Nothing
			ElseIf arrClassID<>"" Then
				SQL = SQL & " and ClassID in (" & Cl.CheckStr(arrClassID) & ")"
			End If
			If sSpecialID>0 Then SQL = SQL & " and SpecialID like '%," & sSpecialID & ",%'"
			If sIsHot=1 Then SQL = SQL & " and Hot="&TrueType&""
			If sIsElite=1 Then SQL = SQL & " and Elite="&TrueType&""
			If sWhere<>"" Then SQL = SQL & " and " & sWhere & " "
			SQL = SQL & " Order By " & sOrder
			Set Rs = Cl.Execute(SQL)
			If Not Rs.Eof then
				Set XMLData = Cl.RecordsetToxml(Rs,"info","infolist")
				sContent = Replace(sContent,Match.Value,ReplaceSuperLoopInfoList(sModule,Rows,Cols,LoopTemplate,ColTemplate,XMLData))
				Set XMLData = Nothing
			Else
				sContent = Replace(sContent,Match.Value,"当前无记录!")
			End If
			Set Rs = Nothing
		Next
		Set Matches	= Nothing
		ReplaceSuperLoop = sContent
	End Function

	Public Function ReplaceSuperLoopInfoList(ByVal sModule,ByVal Rows,ByVal Cols,ByVal LoopTemplate,Byval ColTemplate,Byval XmlData)
		Dim Node,i,j,n,Trows,TNums
		Dim sTemp
		i = 0 : j = 0 : n = 0
		LoopTemplate	= Split(LoopTemplate,"||")
		Rows			= Split(Rows,"|")
		TNums			= UBound(LoopTemplate)
		For Each Node In XMLData.DocumentElement.SelectNodes("info")
			If TNums > 0 And j>0 Then
				If j >= CLng(Rows(n)) Then
					j = 0 : n = n + 1
					If n > TNums Then n = 0
				End If
				sTemp		= LoopTemplate(n)
			Else 
				sTemp		= LoopTemplate(0)
			End If
			i = i+1 : j = j+1
			ReplaceSuperLoopInfoList = ReplaceSuperLoopInfoList & ReplaceInfoContent(sModule,sTemp,Node)
			If i mod Cols = 0 then ReplaceSuperLoopInfoList = ReplaceSuperLoopInfoList & ColTemplate
			sTemp		= Empty
		Next
		Set Node = Nothing
	End Function

	Public Function ReplaceSuperClassLoop(Byval sContent)
		On Error Resume next
		Dim Matches,Match,TempValue
		regEx.Pattern	= "【Cl_ClassLoop\((.[^\)]*)\)】(.[^\【]*)\[ColTemplate\](.[^\[]*)\[\/ColTemplate\](.[^\[]*)\[RowTemplate\](.[^\[]*)\[\/RowTemplate\](.[^\[]*)【\/Cl_ClassLoop】"
		'"【Cl_ClassLoop\((.[^\)]*)\)】(.[^\[]*)\[RowTemplate\](.[^\[]*)\[\/RowTemplate\](.[^\[]*)\[ColTemplate\](.[^\[]*)\[\/ColTemplate\](.[^\[]*)【\/Cl_ClassLoop】"
		Set Matches		= regEx.Execute(sContent)
		For Each Match in Matches
			'Response.write "OK"
			Rem 定义变量
			Dim sModule,sTopNum,sInfoNum,sChannelID,sClassID,sArrClassID
			Dim Rows,RowTemplate,Cols,ColTemplate,LoopTemplate
			Dim Rs,SQL,XMLData,i
			Rem 设置初始值
			sModule		= "article"
			sTopNum		= 6
			sInfoNum	= 8
			sChannelID	= ChannelID
			sClassID	= 0
			Rows		= "5"
			Cols		= 2
			sArrClassID	= "0"
			Rem End
			TempValue	= regEx.Replace(Match.Value,"$1")
			LoopTemplate= regEx.Replace(Match.Value,"$2")
			ColTemplate=  regEx.Replace(Match.Value,"$3")
			RowTemplate	= regEx.Replace(Match.Value,"$5")
			TempValue	= Split(TempValue,";")
			For i=0 To UBound(TempValue)
				TempValue(i)=Split(TempValue(i),":")
				Select Case LCase(TempValue(i)(0))
				Case "module"		: sModule	= TempValue(i)(1)
				Case "topnum"		: sTopNum	= Cl.GetCLng(TempValue(i)(1))
				Case "infonum"		: sInfoNum	= Cl.GetCLng(TempValue(i)(1))
				Case "channelid"	: sChannelID= Cl.GetEval(TempValue(i)(1))
				Case "classid"		: sClassID	= Cl.GetEval(TempValue(i)(1))
				Case "arrclassid"	: sArrClassID= Trim(TempValue(i)(1))
				Case "rows"			: Rows		= Cl.GetCLng(TempValue(i)(1))
				Case "cols"			: Cols		= Cl.GetCLng(TempValue(i)(1))
				End Select
			Next
			TempValue = Empty
			SQL="select Top "&sTopNum&" ClassID,ClassName,arrChildID,Readme From Cl_Class "
			if sClassID>0 then
				SQL=SQL & " where ChannelID="&sChannelID&" and ParentID="&sClassID&" and IsElite="&TrueType&" and IsOuter=0 order by RootID,OrderID"
			ElseIf sArrClassID<>"0" then
				SQL=SQL & " where ChannelID="&sChannelID&" and IsElite="&TrueType&" and IsOuter=0 and ClassID In ("&Replace(sArrClassID,"|",",")&") order by RootID,OrderID"
			Else
				SQL=SQL & " where ChannelID="&sChannelID&" and ParentID=0 and IsElite="&TrueType&" and IsOuter=0 order by RootID,OrderID"
			End If
			Set Rs= Server.CreateObject("Adodb.RecordSet")
			OpenConn : Rs.Open SQL,Conn,1,1
			if Rs.bof and Rs.eof then
				TempValue = "找不到符合条件的栏目。"
			Else
				Dim sTemp
				i=0
				'Response.write Cols
				For i=1 To Rs.RecordCount
				'Do While Not Rs.Eof
					sTemp = LoopTemplate
					sTemp = Replace(sTemp,"{$classid}",Rs("ClassID"))
					sTemp = Replace(sTemp,"{$classtitle}",Rs("Readme")&"")
					sTemp = Replace(sTemp,"{$classname}",Rs("ClassName"))
					sTemp = Replace(sTemp,"{$classlinkurl}",Cl.GetClassLinkUrl(Rs("ClassID")))
					sTemp = ReplaceSuperClassLoopInfoList(sModule,Rs("arrChildID"),sInfoNum,sTemp)
					TempValue = TempValue & sTemp
					Rs.MoveNext
					If Rs.Eof Then
						Exit For
					Else
						If i mod Cols = 0 then
						TempValue = TempValue & RowTemplate
						Else
						TempValue = TempValue & ColTemplate
						End if
					End if
				'Loop
				Next
			End If
			Rs.Close : Set Rs=Nothing
			sContent = Replace(sContent,Match.Value,TempValue)
		Next
		Set Matches	= Nothing
		ReplaceSuperClassLoop = sContent
	End Function

	Public Function ReplaceSuperClassLoopInfoList(ByVal sModule,ByVal sClassID,ByVal sTopNum,ByVal sLoopTemplate)
		Dim tSQL,tRs
		tSQL = "Select Top "&sTopNum&" InfoID, ChannelID, ChannelDir, ClassID, Prefixion, "
		Select Case LCase(sModule)
		Case "article"
		tSQL = tSQL & "Title, FontColor, FontType, TitleIntact, Author, CopyFrom, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, PicUrl, Intro, Receive, ReceiveType, IsLink, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Article "
		Case "soft"
		tSQL = tSQL & "SoftName, FontColor, FontType, SoftVersion, Author, AuthorEmail, AuthorHomepage, DemoUrl, RegUrl, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, Intro, PicUrl, SoftPassword, OperatingSystem, SoftSize, SoftType, SoftLanguage, CopyrightType, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Soft "
		Case "photo"
		tSQL = tSQL & "PhotoName, FontColor, FontType, Author, AuthorEmail, AuthorHomepage, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, Intro, PicUrl, IsDownLoad, DownLoadNum, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Photo "
		Case "movie"
		tSQL = tSQL & "MovieName, FontColor, FontType, Director, ActName, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, DownNums, InfoGroup, InfoPoint, InfoMoney, IsOnLine, IsDownLoad, Intro, PicUrl, MovieFormat, MovieLong, MovieCorner, MovieLanguage, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Movie "
		Case "product"
		tSQL = tSQL & "ProductName, FontColor, FontType, ProductSn, Producer, Trademark, ProductModel, ProductUnit, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, MarketPrice, MemberPrice, TruePrice, Discount, PresentExp, Intro, PicUrl, ProductType, CardPoint, StockNum, BuyTimes, BeginDate, EndDate, NoOver, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Product "
		Case "supply"
		tSQL = tSQL & "Title, FontColor, FontType, Keyword, SupplyType, CompanyName, LinkMan, LinkAddress, LinkZipCode, LinkPhone, LinkFax, LinkMobile, LinkEmail, LinkQQ, ValidTime, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, PicUrl, Intro, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Supply "
		Case Else
		tSQL = tSQL & "Title, FontColor, FontType, TitleIntact, Author, CopyFrom, Editor, UpdateTime, Censor, CensorTime, Stars, OnTop, Hot, Elite, Hits, DayHits, WeekHits, MonthHits, InfoGroup, InfoPoint, InfoMoney, PicUrl, Intro, Content, Receive, ReceiveType, IsLink, IsHtml, HtmlFileUrl, LastHitTime, CommentCount from Cl_Article "
		End Select
		tSQL = tSQL & " where Deleted="&FalseType&" and Status=1"
		If InStr(sClassID,",")>0 Then 
			tSQL = tSQL & " and ClassID in (" & sClassID & ")"
		Else
			tSQL = tSQL & " and ClassID = " & CLng(sClassID) & ""
		End If 
		tSQL = tSQL & " Order By InfoID Desc"
		Set tRs = Cl.Execute(tSQL)
		Dim ReplaceStr,LoopStr,ContentStr
		LoopStr = GetPartContent(sLoopTemplate,"[Cl_Loop]","[/Cl_Loop]")
		ReplaceStr = "[Cl_Loop]" & LoopStr & "[/Cl_Loop]"
		If Not tRs.Eof Then
			Dim XMLData,Node
			Set XMLData = Cl.RecordsetToxml(tRs,"info","infolist")
			For Each Node In XMLData.DocumentElement.SelectNodes("info")
				ContentStr = ContentStr & ReplaceInfoContent(sModule,LoopStr,Node)
			Next
			Set Node = Nothing
			Set XMLData = Nothing
		End If
		Set tRs = Nothing
		tSQL = Empty
		ReplaceSuperClassLoopInfoList = Replace(sLoopTemplate,ReplaceStr,ContentStr)
	End Function


	Public Function ReplaceParameter(Byval sContent)
		'On Error Resume next
		Dim Matches,Match,TempValue,ArrayStr,DataStr
		regEx.Pattern	=	"{\$.[^{\$}]*}"
		Rem {\$([^{\$}])*}
		Set Matches		= regEx.Execute(sContent)
		For Each Match in Matches
			TempValue	= Match.Value
			TempValue	= Replace(TempValue,"{$","")
			TempValue	= Replace(TempValue,"}","")
			TempValue	= Replace(TempValue,"(",",")
			TempValue	= Replace(TempValue,")","")
			TempValue	= Replace(TempValue,Chr(34),"")
			ArrayStr	= Split(TempValue,",")
			Select Case LCase(ArrayStr(0))
			'Rem 文章部分
			Case "showarticle"
				DataStr = ShowArticle(Cl.GetEval(ArrayStr(1)),Cl.GetEval(ArrayStr(2)),Cl.GetEval(ArrayStr(3)),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
			Case "showarticlezhuti"
				DataStr = ShowArticlezhuti(Cl.GetEval(ArrayStr(1)),Cl.GetEval(ArrayStr(2)),Cl.GetEval(ArrayStr(3)),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
			Case "showarticlezuixin"
				DataStr = ShowArticlezuixin(Cl.GetEval(ArrayStr(1)),Cl.GetEval(ArrayStr(2)),Cl.GetEval(ArrayStr(3)),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16))
			
			Case "showpicarticle"
				DataStr = ShowPicArticle(Cl.GetEval(ArrayStr(1)),Cl.GetEval(ArrayStr(2)),Cl.GetEval(ArrayStr(3)),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12))
			Case "showclassarticle"
				DataStr = ShowClassArticle(Cl.GetEval(ArrayStr(1)),Cl.GetEval(ArrayStr(2)),ArrayStr(3),ArrayStr(4))
			Case "showtoparticle"

⌨️ 快捷键说明

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