1cls_public.asp

来自「小游戏网站演示www.4399.io 拥有4万条游戏数据」· ASP 代码 · 共 1,477 行 · 第 1/5 页

ASP
1,477
字号
						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 = "<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, "{$target}", linktarget)
				strcontent = replace(strcontent, "{$softtime}", softtime)
				strcontent = replace(strcontent, "{$softhits}", sql(6,i))
				strcontent = replace(strcontent, "{$liststyle}", liststyle)
				strcontent = replace(strcontent, "{$bestcode}", bestcode)
				strcontent = replace(strcontent, "{$beststring}", beststring)
				j = j + 1
				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", ",")
				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)))
			next
		end if
		readsoftlist = strtemp
	end function

	'================================================
	'函数名:loadshoplist
	'作  用:装载商品列表
	'参  数:classid   ----分类id
	'        channelid   ----频道id
	'        stype   ----调用类型
	'        topnum   ----显示列表数
	'        strlen   ----显示标题长度
	'        showclass   ----是否显示分类
	'        showdate   ----是否显示日期
	'        datemode   ----显示日期模式
	'        newindow   ----新窗口打开
	'================================================
	public function loadshoplist(byval channelid, byval classid, byval specialid, _
		byval stype, byval topnum, byval strlen, byval showclass, _
		byval showdate, byval datemode, byval newindow, byval styles)
		
		dim rs, sql, i, strcontent, foundstr, classlength
		dim stradename, childstr, liststyle, htmlfilename, bestcode, beststring
		dim classname, htmlfileurl, addtime, linktarget, tradetopic, pastprice, nowprice
		
		channelid = newasp.chknumeric(channelid)
		classid = newasp.chknumeric(classid)
		specialid = newasp.chknumeric(specialid)
		stype = newasp.chknumeric(stype)
		
		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
				loadshoplist = ""
				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.shopid desc"
			case 1,4: foundstr = "and a.isbest > 0 order by a.addtime desc ,a.shopid desc"
			case 2,5: foundstr = "order by a.allhits desc ,a.shopid desc"
			case 9
				if issqldatabase = 1 then
					foundstr = "order by newid()"
				else
					foundstr = "order by rnd(a.shopid)"
				end if
		case else
			foundstr = "order by a.addtime desc ,a.shopid 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.shopid,a.classid,a.tradename,a.pastprice,a.nowprice,a.addtime,a.allhits,a.htmlfiledate,a.isbest,"
		sql = "select top " & cint(topnum) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir,c.usehtml from [nc_shoplist] 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 showclass > 0 then
					classlength = newasp.strlength(rs("classname"))
				else
					classlength = 0
				end if
				strcontent = strcontent & newasp.mainsetting(15)
				stradename = newasp.gottopic(rs("tradename"), cint(strlen) - classlength)
				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("shopid"),1,"")
					htmlfilename = newasp.channeldomain & newasp.readdestination(newasp.m_sortdestination, newasp.m_channeldir, rs("htmlfiledate"),rs("htmlfiledir"),rs("classid"),rs("shopid"),1,"")
					classname = "<a href=""" & htmlfilename & """>" & classname & "</a>"
				else
					if isurlrewrite then
						htmlfileurl = newasp.channelpath & rs("shopid") & newasp.channelhtmlext
						classname = "<a href=""" & newasp.channelpath & "list_1_" & rs("classid") & newasp.channelhtmlext & """>" & classname & "</a>"
					else
						htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("shopid")
						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
					addtime = newasp.showdatetime(rs("addtime"), cint(datemode))
				else
					addtime = ""
				end if
				if cint(newindow) <> 0 then
					linktarget = " target=""_blank"""
				else
					linktarget = ""
				end if
				pastprice = formatcurrency(rs("pastprice"), , -1)
				nowprice = formatcurrency(rs("nowprice"), , -1)
				tradetopic = "<a href=""" & htmlfileurl & """" & linktarget & " class=""showlist"""& loadremark(rs("tradename")) &">" & stradename & "</a>"
				strcontent = replace(strcontent, "{$tradetopic}", tradetopic)
				strcontent = replace(strcontent, "{$shopid}", rs("shopid"))
				strcontent = replace(strcontent, "{$installdir}", newasp.installdir)
				strcontent = replace(strcontent, "{$tradename}", stradename)
				strcontent = replace(strcontent, "{$title}", rs("tradename"))
				strcontent = replace(strcontent, "{$dateandtitle}", rs("addtime"))
				strcontent = replace(strcontent, "{$htmlfileurl}", htmlfileurl)
				strcontent = replace(strcontent, "{$classname}", classname)
				strcontent = replace(strcontent, "[]", "")
				strcontent = replace(strcontent, "{$target}", linktarget)
				strcontent = replace(strcontent, "{$addtime}", addtime)
				strcontent = replace(strcontent, "{$shophits}", rs("allhits"))
				strcontent = replace(strcontent, "{$liststyle}", liststyle)
				strcontent = replace(strcontent, "{$bestcode}", bestcode)
				strcontent = replace(strcontent, "{$beststring}", beststring)
				strcontent = replace(strcontent, "{$pastprice}", pastprice)
				strcontent = replace(strcontent, "{$nowprice}", nowprice)
			rs.movenext
			i = i + 1
			strcontent = replace(strcontent, "{$orderid}", i) & vbnewline
			loop
		end if
		rs.close: set rs = nothing
		loadshoplist = strcontent
	end function
	'================================================
	'函数名:readshoplist
	'作  用:读取商品列表
	'参  数:str ----原字符串
	'================================================
	public function readshoplist(byval str)
		dim strtemp, i
		dim stempcontent, ntempcontent
		dim arrtempcontent, arrtempcontents, arraylist
		strtemp = str
		if instr(strtemp, "{$readshoplist(") > 0 then
			stempcontent = newasp.cutmatchcontent(strtemp, "{$readshoplist(", ")}", 1)
			ntempcontent = newasp.cutmatchcontent(strtemp, "{$readshoplist(", ")}", 0)
			arrtempcontents = split(stempcontent, "|||")
			arrtempcontent = split(ntempcontent, "|||")
			for i = 0 to ubound(arrtempcontents)
				arraylist = split(arrtempcontent(i), ",")
				strtemp = replace(strtemp, arrtempcontents(i), loadshoplist(arraylist(0), arraylist(1), arraylist(2), arraylist(3), arraylist(4), arraylist(5), arraylist(6), arraylist(7), arraylist(8), arraylist(9), arraylist(10)))
			next
		end if
		readshoplist = strtemp
		exit function
	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)
		
		dim rs, sql, i, strcontent, foundstr,j
		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)
		
		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()"

⌨️ 快捷键说明

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