?? rss.asp
字號:
<%response.expires=0
Response.ContentType = "text/xml"
%>
<!--#include file="../conn.asp" -->
<!--#include file="../webconfig.asp" -->
<!--#include file="../fuction.asp"-->
<%'a ------大類編號 ------bigclassid
'b ------調(diào)用數(shù) ------tmp_dys
'c ------截取的字數(shù) ------tmp_zs
''調(diào)試好了之后返回所有的值
if isChkInteger(request("a")) then '大類
bigclassid=nosql(request("a"))
end if
if isChkInteger(request("d")) then '大類
d=nosql(request("d"))
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 d="" and bigclassid<>"" then
rsslink=tohtml(""&weburl&"/" & "Diary/list.asp?id=" & bigclassid )
sql="select top " & tmp_dys & " * from [shop_rj] where classid=" & bigclassid & " order by id desc"
elseif d<>"" then
rsslink=tohtml(""&weburl&"/" & "Diary/rj_show.asp?id=" & d )
sql="select top " & tmp_dys & " * from [shop_rj] where id=" & d & " order by id desc"
else
rsslink=tohtml(""&weburl&"/" & "Diary/index.asp" )
sql="select top " & tmp_dys & " * from [shop_rj] order by id desc"
end if
set rs=Conn.execute(sql)
if not rs.eof then
chtitle= tohtml(rs("rjname"))
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
'''連接地址是
newsname=tohtml(rs("rjname"))
adddate=tohtml(rs("rjdate"))
fbr=tohtml(rs("rjuser"))
viewcount=tohtml(rs("rjhot"))
newscontent=tohtml(htmltotext(rs("rjnr")))
%>
<item>
<title><%=newsname%></title>
<link><%=rsslink%></link>
<author>發(fā)布人:<%=fbr%></author>
<pubDate>時間:<%=adddate%></pubDate>
<shop>瀏覽:<%=viewcount%></shop>
<description><%=newscontent%></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 判斷數(shù)字是否整形
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,"&","&")
tempstr=replace(tempstr,">",">")
tempstr=replace(tempstr,"<","<")
tohtml=tempstr
end function
function htmltotext(byval nr)
''過濾html字符的
pa=""
strContent=nr
Set regex = New RegExp
regEx.Global = True
regEx.IgnoreCase = False ' 設(shè)置是否區(qū)分大小寫。<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," ","")
if len(strContent)>1000 then
strContent=left(strContent,1000) & "......"
end if
htmltotext=strContent
end function
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -