Asp生成RSS的类_给网站加上RSS第1/2页(2)


'SetWebName 必填 网站名称
'SetWebUrl 必填 网站的地址
'SetWebDes 非必填 网站的描述信息
'SetPageType 必填 信息显示页的链接类型 1 为动态页面Id 0为静态页面
'SetMaxInfo 非必填 强制显示信息的数目,若取数据>SetMaxInfo 则显示SetMaxInfo条数据。强烈建议使用在Sql语句中使用Top关键字
'setContentShow 非必填 信息简介设置。注意:该参数为数组(ShowContentType,ShowContentLen)
' ShowContentType [数字类型] 为内容显示方式[参数(0,1)0为按百分比就算显示信息,1为按字数]
' ShowContentLen 内容显示的长度 由ShowContentType 决定实际长度
'*****************输出参数********************
'ShowRss 显示Rss
'======================================================
'例如
'Set NewRss=New Rss
' Set NewRss.SetConn=article_conn
' NewRss.SetSql="select top 30 newsid,title,content,dateandtime,N_fname from article where typeid=1 order by newsid Desc"
' NewRss.SetWebName="测试中"
' NewRss.SetWebUrl="//www.jb51.net"
' NewRss.SetMaxInfo=10
' NewRss.SetInfourl="//www.jb51.net"
' NewRss.SetPageType="0"
' NewRss.setContentShow="1,200"
' NewRss.ShowRss()
'Set NewRss=Nothing
'======================================================
Private Conn,Sql,WebName,WebUrl,WebDes,Er,MaxInfo,i,Infourl,PageType
Private ShowContentType,ShowContentLen
Private AllContent,AllContentLen
Private Sub Class_initialize()
MaxInfo=20
'PageType=1
ShowContentType=0
ShowContentLen=20
Er=false
End Sub
Private Sub Class_terminate()
If isObject(Rs) then Set Rs=Nothing
End Sub
Public Property Let Errmsg(msg)
If Er then
Response.Clear()
Response.Write(msg)
Response.End()
End If
End Property
Public Property Let SetWebName(WebName_)
WebName=WebName_
End Property
Public Property Let SetWebUrl(WebUrl_)
WebUrl=WebUrl_
End Property
Public Property Let SetWebDes(webDes_)
WebDes=WebDes_
End Property
Public Property Let SetInfoUrl(Infourl_)
Infourl=Infourl_
End Property
Public Property Let SetPageType(PageType_)
PageType=PageType_
End Property
Public Property Let SetMaxInfo(MaxInfo_)
MaxInfo=MaxInfo_
End Property
Public Property Let setContentShow(ContentShow_)
Dim ArrContentShow
ArrContentShow=Split(ContentShow_,",")
If Ubound(ArrContentShow)<>1 Then Er=True:Errmsg="信息显示参数设置有误!!"
ShowContentType=ArrContentShow(0)
ShowContentLen=ArrContentShow(1)
If Not isnumeric(ShowContentType) or ShowContentType="" Then ShowContentType=0
If Not isnumeric(ShowContentLen) or ShowContentLen="" Then
If ShowContentType=0 Then ShowContentLen=20 Else ShowContentLen=200
Else
If ShowContentType=0 and (ShowContentLen>100 or ShowContentLen<10) Then ShowContentLen=20
End If
End Property
Public Property Set SetConn(Conn_)
If TypeName(Conn_)="Connection" Then

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2763.html