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

📄 rss_class.asp

📁 购物系统(本版为正式商业版
💻 ASP
字号:
<%response.expires=0
Response.ContentType = "text/xml" 
%>
<!--#include file="conn.asp" -->
<!--#include file="webconfig.asp" -->
<!--#include file="fuction.asp"-->
<%'a		------大类编号		------bigclassid
'b		------调用数	 		------tmp_dys
'c		------截取的字数 		------tmp_zs
''调试好了之后返回所有的值
if request("lx")<>"" then '大类
	lx=request("lx")
else
	lx="new"
end if
if isChkInteger(request("a")) then '大类
	bigclassid=nosql(request("a"))
else
	bigclassid=1
end if
if isChkInteger(request("n")) then
	nclassid=nosql(request("n"))
end if
if isChkInteger(request("b")) then
	tmp_dys=nosql(request("b"))
else
	tmp_dys=88
end if
if isChkInteger(request("c")) then
	tmp_zs=nosql(request("c"))
else
	tmp_zs=26
end if%>
<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<%
if lx="big" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=big&anid=" & bigclassid )
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate],[anclass] from [shop_snsn],[shop_anclass] where [shop_snsn].anclassid="&bigclassid&" and [shop_anclass].[anclassid]=" & bigclassid & " order by shopid desc"

elseif lx="small" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=small&anid="&bigclassid&"&nid=" & nclassid )
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate],[anclass] from [shop_snsn],[shop_anclass] where [shop_snsn].anclassid="&bigclassid&" and [shop_snsn].nclassid="&nclassid&" and [shop_anclass].[anclassid]=" & bigclassid & " order by shopid desc"

elseif lx="tj" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=tj")
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate] from [shop_snsn] where bestshop=1 order by shopid desc"

elseif lx="tejia" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=tejia")
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate] from [shop_snsn] where tejiashop=1 order by shopid desc"

elseif lx="cx" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=cx")
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate] from [shop_snsn] where cxiaoshop=1 order by shopid desc"

elseif lx="news" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=news")
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate] from [shop_snsn] where newsshop=1 order by shopid desc"
elseif lx="news" then

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=news")
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate] from [shop_snsn] where newsshop=1 order by shopid desc"

else

rsslink=tohtml(""&weburl&"/" & "class.asp?lx=news")
sql="select top " & tmp_dys & " shopid,[shopname], [shopcontent], [shichangjia], [huiyuanjia], [vipjia], [pifajia],[kucun],[adddate] from [shop_snsn] order by shopid desc"

end if

set rs=Conn.execute(sql)
	if not rs.eof then
if lx="big" or lx="smal" then
chtitle= tohtml(rs("anclass"))
elseif lx="tj" then
chtitle= "推荐商品"
elseif lx="tejia" then
chtitle= "特价商品"
elseif lx="cx" then
chtitle= "畅销商品"
else
chtitle= "新品上架"
end if
	end if
		%>
		  <channel>
    <title><%=webname%>-<%=chtitle%></title>
    <description><%=webname%>-<%=chtitle%></description>
    <link><%=weburl%></link>
    <language>zh-cn</language>
    <docs>欢迎您使用<%=webname%>!</docs>
    <generator>欢迎您使用<%=webname%>!</generator>
		<%
		do
			if rs.eof then exit do

'''连接地址是

if rs("kucun")>0 then
kucun="上架"
else
kucun="缺货"
end if
shopname=tohtml(rs("shopname"))
adddate=tohtml(rs("adddate"))
shichangjia=tohtml(rs("shichangjia"))
huiyuanjia=tohtml(rs("huiyuanjia"))
vipjia=tohtml(rs("vipjia"))
pifajia=tohtml(rs("pifajia"))
shopcontent=tohtml(htmltotext(rs("shopcontent")))
%>
<item>
<title><%=chtitle%></title>
<link><%=rsslink%></link>
<author>商品名称:<%=shopname%></author>
<pubDate>时间:<%=adddate%></pubDate>
<shop>市场价:<%=shichangjia%>元</shop>
<shop>会员价:<%=huiyuanjia%>元</shop>
<shop>VIP价:<%=vipjia%>元</shop>
<shop>批发价:<%=pifajia%>元</shop>
<shop>商品状态:<%=kucun%></shop>
<description><%=shopcontent%></description> 
</item>
<%
rs.movenext		
loop
%>
 </channel>
</rss>
<%
Rem 截取文字
function cutStr(str,strlen)
	dim l,t,c
	l=len(str)
	t=0
	for i=1 to l
	c=Abs(Asc(Mid(str,i,1)))
	if c>255 then
	t=t+2
	else
	t=t+1
	end if
	if t>=strlen then
	cutStr=left(str,i)&".."
	exit for
	else
	cutStr=str
	end if
	next
	cutStr=replace(cutStr,chr(10),"")
end function

Rem 判断数字是否整形
function isChkInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isChkInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isChkInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isChkInteger=false 
              exit function
           end if
       next
       isChkInteger=true
       if err.number<>0 then err.clear
end function
'response.write tohtml("<>&")
function tohtml(byval str1)
tempstr=str1
tempstr=replace(tempstr,"<br>"," ")
tempstr=replace(tempstr,"&","&amp;")
tempstr=replace(tempstr,">","&gt;")
tempstr=replace(tempstr,"<","&lt;")
tohtml=tempstr
end function

function htmltotext(byval nr)
''过滤html字符的
pa=""
strContent=nr

Set regex = New RegExp 
regEx.Global = True

regEx.IgnoreCase = False ' 设置是否区分大小写。<BR>

'去掉换行
regEx.Pattern = "\n"
strContent = regEx.Replace(strContent,"")

regEx.Pattern = "<[a-zA-Z]+([ ]|[^\n>]|[%$#@!'])*>"
strContent = regEx.Replace(strContent,"")
regEx.Pattern = "</[a-zA-Z]+>"
strContent = regEx.Replace(strContent,"")
regEx.Pattern = "[ ]+"
strContent = regEx.Replace(strContent," ")

strContent=replace(strContent,"&nbsp;","")

if len(strContent)>1000 then
strContent=left(strContent,1000) & "......"
end if

htmltotext=strContent

end function

%>

⌨️ 快捷键说明

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