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

📄 cl_function_product.asp

📁 正版创力4.1SQL商业版!!!ASP版。
💻 ASP
📖 第 1 页 / 共 4 页
字号:
		end If
		if ShowHits=True or ShowDateType>0 then
			sTemp = sTemp & "<span class=""other"">("
			if ShowHits=True then
				sTemp=sTemp & "市场价:<strike>¥" & SqlInfo(18,i) &"</strike>&nbsp;会员价:¥<span style=""color:#ff0033;"">"&SqlInfo(19,i)&"</span>"
			end if
			if ShowDateType>0 then
				if ShowHits=True or ShowAuthor=True then
					sTemp=sTemp & ","
				end if
				if CDate(FormatDateTime(SqlInfo(11,i),2))=date() then
					sTemp = sTemp & "<span style=""color:#ff0033;"">"
				else
					sTemp = sTemp & "<span style=""color:#999999;"">"
				end if
				sTemp = sTemp & Cl.Format_Time(SqlInfo(11,i),ShowDateType) & "</font>"
			end if
			sTemp = sTemp & ")</span>"
		end If
		if ShowAuthor=True then
			sTemp = sTemp & "<span class=""buy"">"
			sTemp = sTemp & "<a href="""&Cl.WebDir & "User/Cart.asp?InfoID=" & SqlInfo(0,i) & """ target=""_blank""><img src=""" & Cl.WebDir & "images/Product/Buy.gif"" border=""0"" /></a>&nbsp;&nbsp;<a href=""" & LinkUrl & """ title=""" & SqlInfo(8,i) & """ target=""_blank""><img src=""" & Cl.WebDir & "images/Product/Content.gif"" border=""0""/></a></span>"
		end if
		sTemp = sTemp & "</li>" & VbCrlf
	Next
	ShowProduct=sTemp & "</ul>"
	SqlInfo=Empty
End Function

'================================================================
'过程名:ShowTopProduct(sChannelID,sClassID,TopNum,TitleLen,ShowType,ShowHits)
'		sChannelID	----频道ID
'		sClassID	----栏目ID
'		TopNum		----下载TOP
'		TitleLen	----标题最多字符数,一个汉字=两个英文字符
'		ShowType	----- 1(本日),2(本周),3(本月),4(累计)
'		ShowHits	------	(是否显示点击数,True为是)
'================================================================
Function ShowTopProduct(Byval sChannelID,Byval sClassID,Byval TopNum, _
	Byval TitleLen,Byval ShowType,Byval ShowHits)
	dim sqlTop,rsTop,LinkUrl
	On Error ReSume Next
	sChannelID	= Clng(sChannelID)	: sClassID = Clng(sClassID)
	TopNum		= Clng(TopNum)		: TitleLen = Clng(TitleLen)
	ShowType	= Clng(ShowType)	: ShowHits = CBool(ShowHits)
	if Err then Err.Clear : ShowTopProduct="ShowTopProduct参数错误。" : Exit Function
	On Error GoTo 0
	if TopNum>0 then
		sqlTop="select top " & TopNum & " "
	else
		sqlTop="select top 10 "
	end if
	sqlTop=sqlTop & " InfoID,ChannelID,ChannelDir,ClassID,ProductName,Prefixion,ProductSn,Producer,Trademark,MarketPrice,MemberPrice,TruePrice,Discount,OnTop,Hot,Elite,Stars,Hits,BuyTimes,UpdateTime,Editor,IsHtml,HtmlFileUrl from Cl_Product where Deleted="&FalseType&" and Status=1"
	if sChannelID>0 then sqlTop=sqlTop & " and ChannelID="&sChannelID&" "
	if sClassID>0 then
		Dim tClass
		Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID)
		if not(tClass.bof and tClass.eof) then
			if tClass(1)>0 then
				sqlTop=sqlTop & " and ClassID in (" & tClass(3) & ")"
			else
				sqlTop=sqlTop & " and ClassID=" & sClassID
			end if
		else
			sqlTop=sqlTop & " and ClassID=" & sClassID
		end if
		Set tClass=Nothing
	end if
	Select Case ShowType
	Case 1
		if IsSqlDataBase=1 then
		sqlTop=sqlTop & " And datediff(D,LastHitTime,getdate())<=0 order by DayHits desc,InfoID desc"
		else
		sqlTop=sqlTop & " And datediff('D',LastHitTime,now())<=0 order by DayHits desc,InfoID desc"
		end if
	Case 2
		if IsSqlDataBase=1 then
		sqlTop=sqlTop & " And datediff(ww,LastHitTime,getdate())<=0 order by WeekHits desc,InfoID desc"
		else
		sqlTop=sqlTop & " And datediff('ww',LastHitTime,now())<=0 order by WeekHits desc,InfoID desc"
		end if
	Case 3
		if IsSqlDataBase=1 then
		sqlTop=sqlTop & " And datediff(m,LastHitTime,getdate())<=0 order by MonthHits desc,InfoID desc"
		else
		sqlTop=sqlTop & " And datediff('m',LastHitTime,now())<=0 order by MonthHits desc,InfoID desc"
		end if
	Case Else
		sqlTop=sqlTop & " order by Hits desc,InfoID desc"
	end Select
	Set rsTop= Cl.Execute(sqlTop)
	if rsTop.bof and rsTop.eof then 
		ShowTopProduct = "<li>当前没有记录!</li>"
		rsTop.Close:Set rsTop=Nothing:Exit Function
	End if
	Dim i,sTemp
	sqlTop=rsTop.GetRows(-1)
	rsTop.Close:Set rsTop=Nothing
	'sTemp = "<ul>"
	For i=0 to Ubound(sqlTop,2)
		if sqlTop(21,i)=True then
			LinkUrl=Cl.WebDir & sqlTop(22,i)
		else
			LinkUrl=Cl.WebDir & sqlTop(2,i) & "/ShowInfo.asp?InfoID=" & sqlTop(0,i)
		end if
		sTemp = sTemp & "<li><span class='title'><a href='" & LinkUrl & "' title='" & sqlTop(4,i) & " target='_blank'>" & Cl.GotTopic(sqlTop(5,i) & sqlTop(4,i),TitleLen) & "</a></span>"
		if ShowHits=True then
			sTemp=sTemp & "(<span class='hits'>" & sqlTop(17,i) & "</span>)"
		end if
		sTemp=sTemp & "</li>"
	Next
	ShowTopProduct=sTemp' & "</ul>"
	sqlTop=Empty
End Function

'=======================================================================
'显示相关软件
'ShowCorrelativeProduct(sChannelID,TopNum,TitleLen,ShowType,Cols,ImgWidth,ImgHeight,ContentLen)
'	sChannelID	------	(频道ID)
'	TopNum		------	(文章数量)
'	TitleLen	------	(标题字符数)
'	ShowType    ------  显示方式。0(图),1(图+标),2(图+标+内)
'	Cols        ------  列数。超过此列数就换行
'	ImgWidth    ------  图片宽度
'	ImgHeight   ------  图片高度
'	ContentLen  ------  内容最多字符数
'=======================================================================
Function ShowCorrelativeProduct(Byval sChannelID,Byval TopNum,Byval TitleLen, _
	Byval ShowType,Byval Cols,Byval ImgWidth,Byval ImgHeight,Byval ContentLen)
	dim rsC,SQL,sTemp,strPic,FileType,TitleStr
	dim strKey,arrKey,i,LinkUrl
	On Error Resume Next
	sChannelID	= Clng(sChannelID)	: TopNum	= Clng(TopNum)
	TitleLen	= Clng(TitleLen)	: ShowType	= Clng(ShowType)
	Cols		= Clng(Cols)		: ImgWidth	= Clng(ImgWidth)
	ImgHeight	= Clng(ImgHeight)	: ContentLen= Clng(ContentLen)
	if Err then Err.Clear : ShowCorrelativeProduct="ShowCorrelativeProduct参数错误。" : Exit Function
	On Error GoTo 0
	strKey		= rs("Keyword")
	if instr(strkey,"|")>1 then
		arrKey=split(strKey,"|")
		strKey="((Keyword like '%" & arrKey(0) & "%')"
		for i=1 to ubound(arrKey)
			strKey=strKey & " or (Keyword like '%" & arrKey(i) & "%')"
		next
		strKey=strKey & ")"
	else
		strKey="(Keyword like '%" & strKey & "%')"
	end if
	if TopNum=0 then TopNum=5
	SQL="select top " & TopNum & " InfoID,ChannelID,ChannelDir,ClassID,ProductName,Prefixion,ProductSn,Producer,Trademark,Intro,MarketPrice,MemberPrice,TruePrice,Discount,InfoPoint,StockNum,PresentExp,PicUrl,OnTop,Hot,Elite,Stars,Hits,BuyTimes,UpdateTime,Editor,IsHtml,HtmlFileUrl from Cl_Product Where  ChannelID="&sChannelID&" and Deleted="&FalseType&" and Status=1 and " & strKey & " and InfoID<>" & InfoID & " Order by UpdateTime desc,InfoID desc"
	Set rsC = Cl.Execute(SQL)
	if rsC.bof and rsC.Eof then
		sTemp = "当前没有记录!"
	else
		SQL = rsC.GetRows(-1)
		strPic= "<table width=""100%"" cellpadding=""0"" cellspacing=""0"" border=""0"" align=""center""><tr valign=""top"">"
		Select Case ShowType
		Case 0
			for i=0 to Ubound(SQL,2)
				if SQL(26,i) then
					LinkUrl=Cl.WebDir & SQL(27,i)
				else
					LinkUrl=Cl.WebDir & SQL(2,i) & "/ShowInfo.asp?InfoID=" & SQL(0,i)
				end if
				strPic = strPic & "<td align=""center"">"
				FileType=right(lcase(SQL(17,i)),3)
				strPic = strPic & "<a href=""" & LinkUrl & """ title=""名 称:" & SQL(4,i) & vbcrlf & "生产商:" & SQL(7,i) & vbcrlf & "品牌:" & SQL(8,i) & vbcrlf & "上 架:" & SQL(24,i) & """ target=""_blank"">"
				SQL(17,i)=Cl.ReplaceDir(SQL(17,i))
				Select Case FileType
				Case "swf"
					strPic = strPic & "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"" width=""" & ImgWidth & """ height=""" & ImgHeight & """><param name=""movie"" value=""" & SQL(17,i) & """><param name=""quality"" value=""high""><embed src=""" & SQL(17,i) & """ pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" width=""" & ImgWidth & """ height=""" & ImgHeight & """></embed></object>"
				Case "jpg", "bmp", "png", "gif"
					strPic = strPic & "<img src=""" & SQL(17,i) & """ width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0"">"
				Case else
					strPic = strPic & "<img src=""" & Cl.WebDir & "images/NoPic.gif"" width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0"">"
				end Select
				strPic = strPic & "</a></td>"
				if (i+1) Mod Cols=0 then strPic = strPic & "</tr><tr valign=""top"">"
			Next
		Case 1
			for i=0 to Ubound(SQL,2)
				if SQL(26,i) then
					LinkUrl=Cl.WebDir & SQL(27,i)
				else
					LinkUrl=Cl.WebDir & SQL(2,i) & "/ShowInfo.asp?InfoID=" & SQL(0,i)
				end if
				strPic = strPic & "<td align=""center"">"
				FileType=right(lcase(SQL(17,i)),3)
				TitleStr=Cl.GotTopic(SQL(4,i),TitleLen)
				strPic = strPic & "<a href=""" & LinkUrl & """ title=""名 称:" & SQL(4,i) & vbcrlf & "生产商:" & SQL(7,i) & vbcrlf & "品牌:" & SQL(8,i) & vbcrlf & "上 架:" & SQL(24,i) & """ target=""_blank"">"
				SQL(17,i)=Cl.ReplaceDir(SQL(17,i))
				Select Case FileType
				Case "swf"
					strPic = strPic & "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"" width=""" & ImgWidth & """ height=""" & ImgHeight & """><param name=""movie"" value=""" & SQL(17,i) & """><param name=""quality"" value=""high""><embed src=""" & SQL(17,i) & """ pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" width=""" & ImgWidth & """ height=""" & ImgHeight & """></embed></object>"
				Case "jpg", "bmp", "png", "gif"
					strPic = strPic & "<img src=""" & SQL(17,i) & """ width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0"">"
				Case else
					strPic = strPic & "<img src=""" & Cl.WebDir & "images/NoPic.gif"" width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0"">"
				end Select
				strPic = strPic & "<br />" & TitleStr & "</a>"
				strPic = strPic & "</td>"
				if (i+1) Mod Cols=0 then strPic = strPic & "</tr><tr valign=""top"">"
			Next
		Case Else
			for i=0 to Ubound(SQL,2)
				if SQL(26,i) then
					LinkUrl=Cl.WebDir & SQL(27,i)
				else
					LinkUrl=Cl.WebDir & SQL(2,i) & "/ShowInfo.asp?InfoID=" & SQL(0,i)
				end if
				FileType=right(lcase(SQL(17,i)),3)
				TitleStr=Cl.GotTopic(SQL(4,i),TitleLen)
				strPic = strPic & "<td align=""center""><table width=""100%"" cellspacing=""2"" border=""0"">"
				strPic = strPic & "		<tr><td align=""center"" width="""&ImgWidth+2&""">"
				strPic = strPic & "<a href=""" & LinkUrl & """ title=""名 称:" & SQL(4,i) & vbcrlf & "生产商:" & SQL(7,i) & vbcrlf & "品牌:" & SQL(8,i) & vbcrlf & "上 架:" & SQL(24,i) & """ target=""_blank"">"
				SQL(17,i)=Cl.ReplaceDir(SQL(17,i))
				Select Case FileType
				Case "swf"
					strPic = strPic & "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"" width=""" & ImgWidth & """ height=""" & ImgHeight & """><param name=""movie"" value=""" & SQL(17,i) & """><param name=""quality"" value=""high""><embed src=""" & SQL(17,i) & """ pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" width=""" & ImgWidth & """ height=""" & ImgHeight & """></embed></object>"
				Case "jpg", "bmp", "png", "gif"
					strPic = strPic & "<img src=""" & SQL(17,i) & """ width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0"">"
				Case else
					strPic = strPic & "<img src=""" & Cl.WebDir & "images/NoPic.gif"" width=""" & ImgWidth & """ height=""" & ImgHeight & """ border=""0"">"
				end Select
				strPic = strPic & "<br />" & TitleStr & "</a>"
				strPic = strPic & "</td><td valign=""top"" algin=""left"" class=""left"">简 介:"&left(SQL(9,i),ContentLen) & "……</a><br /><br />"
				strPic = strPic & "市场价:<STRIKE>¥" & SQL(10,i) &"</STRIKE><br />"
				strPic = strPic & "会员价:<font class=""price"">¥" & Cl.FormatColor(SQL(11,i),"#ff0033") &"</font><br />" &"</font><br />"
				strPic = strPic & "<a href="""&Cl.WebDir & "User/Cart.asp?InfoID=" & SQL(0,i) & """ target=""_blank""><img src=""" & Cl.WebDir & "images/Product/Buy.gif"" border=0></a>&nbsp;&nbsp;<a href=""" & LinkUrl & """ title=""" & SQL(2,i) & """ target=""_blank""><img src=""" & Cl.WebDir & "images/Product/Content.gif"" border=0></a></td></tr>"
				strPic = strPic & "</table></td>"
				if (i+1) Mod Cols=0 then strPic = strPic & "</tr><tr valign=""top"">"
			Next
		End Select
		sTemp = strPic & "</tr></table>"
	end if
	rsC.Close : set rsC=Nothing
	ShowCorrelativeProduct=sTemp
	SQL = Empty : strPic = Empty
End Function
%>

⌨️ 快捷键说明

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