📄 dv_rss.asp
字号:
ChildNode.removeAttribute "expression"
ChildNode.removeAttribute "getmoney"
ChildNode.removeAttribute "getmoneytype"
ChildNode.removeAttribute "usetools"
ChildNode.removeAttribute "issmstopic"
ChildNode.removeAttribute "hidename"
ChildNode.removeAttribute "lastpost"
ChildNode.removeAttribute "title"
ChildNode.removeAttribute "postusername"
ChildNode.removeAttribute "lastposttime"
Root.appendChild ChildNode
Next
End If
Root.setAttribute "page",Page
Root.setAttribute "pagesize",PageSize
Root.setAttribute "count",Count
Root.setAttribute "pagecount",PageCount
End Sub
'帖子显示
Sub PostList(id)
Dvbbs.LoadTemplates("")
Dim Star,Sql,Rs,Page,TopicMode,Count,PageCount,PageSize
Dim CantRead,TopicTitle,Topicinfo,PostInfo,ChildNode
Dim IsTop,IsVote,Pollid,PostUserName,Locktopic,PostUserid,T_GetMoneyType
Star = Dvbbs.CheckNumeric(Request("star")) '帖子分页
Page = Dvbbs.CheckNumeric(Request("page")) '主题列表分页
Count = Dvbbs.CheckNumeric(Request("Count"))
If Star<1 Then Star = 1
If Page<1 Then Page = 1
Set Rs = Server.CreateObject("Adodb.RecordSet")
SQL="Select title,istop,isbest,PostUserName,PostUserid,hits,isvote,child,pollid,LockTopic,PostTable,BoardID,TopicMode,GetMoney,UseTools,GetMoneyType,dateandtime From DV_topic where topicID="&ID
If Not IsObject(Conn) Then ConnectionDatabase
Rs.Open SQL,Conn,1,3
Dvbbs.SqlQueryNum=Dvbbs.SqlQueryNum+1
'Set Rs=Dvbbs.Execute(SQL)
If Not(Rs.BOF and Rs.EOF) then
If Rs(11)<>Dvbbs.BoardID Then Dvbbs.AddErrCode(29)
PostUserid = Rs(4)
Rs(5) = Rs(5)+1
Rs.Update
TopicTitle = Rs(0)
IsTop = Rs(1)
IsVote = Rs(6)
Count = Rs(7)+1
'pollid = Rs(8)
'T_GetMoney = cCur(Rs(13))
'T_UseTools = Rs(14)
T_GetMoneyType = Cint(Rs(15))
PostUserName = Rs(3)
TotalUseTable = Rs(10)
'锁定多少天前的帖子判断 2004-9-16 Dv.Yz
If Not Ubound(Dvbbs.Board_Setting) > 70 Then
Locktopic = Rs(9)
Else
If (Not Clng(Dvbbs.Board_Setting(71)) = 0) And Datediff("d", Rs("dateandtime"), Now()) > Clng(Dvbbs.Board_Setting(71)) And Rs(9)=0 Then
Locktopic = 1
Rs(9)=Locktopic
Rs.Update
Else
Locktopic = Rs(9)
End If
End If
TopicTitle=Dvbbs.ChkBadWords(TopicTitle)
If Not Rs("topicmode")=1 Then
TopicTitle=replace(TopicTitle,"<","<")
End If
Dvbbs.Stats=TopicTitle
'Set Topicinfo=Dvbbs.RecordsetToxml(Rs,"item","post")
Else
Dvbbs.AddErrcode(32)
End If
Rs.Close
Set Rs=Nothing
CantRead = True
If Dvbbs.BoardMaster Then CantRead=False
Dvbbs.ShowErr()
PageSize = Dvbbs.CheckNumeric(Dvbbs.Board_Setting(27))
If Count mod PageSize=0 then
PageCount= Count \ PageSize
Else
PageCount= Count \ PageSize+1
End If
If Star > PageCount Then star = PageCount
If Star < 1 Then star = 1
Rem 如果是原版论坛,没经过转换的建议使用这行,可以减少消耗
SQL="Select AnnounceID,B.UserName,Topic,dateandtime,body,RootID,isbest,PostUserid,Ubblist,LockTopic,PostBuyUser,ParentID,GetMoneyType,U.UserGroupID,U.LockUser From "& TotalUseTable &" B Inner Join [dv_user] U On U.UserID=B.PostUserID where RootID="& id &" and Boardid="& Dvbbs.Boardid&" Order By Announceid"
Rem 如果你的论坛是从别的论坛转换过来的,如出现楼层错误,则可以把下面的注释去掉,避免错误.
Rem SQL="Select AnnounceID,UserName,Topic,dateandtime,body,Expression,ip,RootID,signflag,isbest,PostUserid,layer,isagree,GetMoneyType,IsUpload,Ubblist,LockTopic,GetMoney,UseTools,PostBuyUser,ParentID From "& TotalUseTable &" where RootID="& id &" and Boardid="& Dvbbs.Boardid&" Order By dateandtime"
Set Rs=Dvbbs.Execute(SQL)
If Star >1 Then
Rs.Move (Star-1) * PageSize
End If
If Not Rs.Eof Then
Sql = Rs.GetRows(PageSize)
Set PostInfo = Dvbbs.ArrayToxml(sql,rs,"item","post")
Else
Set PostInfo = Nothing
End If
Rs.Close
Set Rs = Nothing
Dim Postbody
EmotPath=Split(Dvbbs.Forum_emot,"|||")(0) 'em心情路径
If Not PostInfo Is Nothing Then
For Each ChildNode in PostInfo.documentElement.SelectNodes("item")
CantRead = True
'过滤脏字
If Int(ChildNode.getAttribute("postuserid")) = Dvbbs.UserID Then
Postbody = Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
CantRead = False
End If
If CantRead Then
If ChildNode.getAttribute("parentid") = "0" and T_GetMoneyType=3 Then
If Dvbbs.BoardMaster Then
Postbody = Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "金币购买帖,请进入完整模式浏览!"
CantRead = False
End If
Else
Postbody = Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
End If
End If
If CantRead Then
If ChildNode.getAttribute("locktopic")=1 Then
If Dvbbs.BoardMaster Then
Postbody = "帖子已锁定!<hr/>" & Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "帖子已锁定!"
CantRead = False
End If
ElseIf ChildNode.getAttribute("locktopic")=2 Then
If Dvbbs.BoardMaster Then
Postbody = "帖子已屏蔽!<hr/>" & Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "帖子已屏蔽!"
CantRead = False
End If
ElseIf ChildNode.getAttribute("locktopic")=3 Then
If Dvbbs.BoardMaster Then
Postbody = "帖子待审核!<hr/>" & Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "帖子待审核!"
CantRead = False
End If
End If
End If
If CantRead Then
If ChildNode.getAttribute("lockuser")=1 Then
If Dvbbs.BoardMaster Then
Postbody = "用户已锁定!<hr/>" & Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "用户已锁定!"
CantRead = False
End If
ElseIf ChildNode.getAttribute("lockuser")=2 Then
If Dvbbs.BoardMaster Then
Postbody = "用户已屏蔽!<hr/>" & Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "用户已屏蔽!"
CantRead = False
End If
End If
End If
If CantRead Then
If ChildNode.getAttribute("isbest")="1" Then
If Dvbbs.GroupSetting(41)="1" Then
Postbody = Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
Else
Postbody = "精华帖子,目前你无权浏览!"
CantRead = False
End If
Else
Postbody = Dvbbs.ChkBadWords(ChildNode.getAttribute("body"))
End If
End If
'UBB需要变量
Announceid = ChildNode.getAttribute("announceid")
UserName = ChildNode.getAttribute("username")
PostBuyUser = ChildNode.getAttribute("postbuyuser")
ReplyID_a = ChildNode.getAttribute("announceid")
RootID_a = ChildNode.getAttribute("rootid")
AnnounceID_a = ReplyID_a
'建立item节点信息
ChildNode.setAttribute "type","post"
If ChildNode.getAttribute("parentid")=0 Then
ChildNode.appendChild(XmlDom.createNode(1,"title","")).text =TopicTitle
Else
ChildNode.appendChild(XmlDom.createNode(1,"title","")).text = Dvbbs.ChkBadWords(ChildNode.getAttribute("topic"))
End If
ChildNode.appendChild(XmlDom.createNode(1,"author","")).text = ChildNode.getAttribute("username")
ChildNode.appendChild(XmlDom.createNode(1,"pubDate","")).text = ChildNode.getAttribute("dateandtime")
'ChildNode.appendChild(XmlDom.createNode(1,"description","")).text = Postbody
'Ubb转换
If CantRead = False Then
ChildNode.appendChild(XmlDom.createNode(1,"description","")).text = postbody
Else
Ubblists = ChildNode.getAttribute("ubblist")
If InStr(Ubblists,",39,") > 0 Then
ChildNode.appendChild(XmlDom.createNode(1,"description","")).text = Dv_ubb.Dv_UbbCode(postbody,Cint(ChildNode.getAttribute("usergroupid")),1,0)
Else
ChildNode.appendChild(XmlDom.createNode(1,"description","")).text = Dv_ubb.Dv_UbbCode(postbody,Cint(ChildNode.getAttribute("usergroupid")),1,1)
End If
End If
'ChildNode.appendChild(XmlDom.createNode(1,"link","")).text = PageUrl&"&boardid="&Dvbbs.Boardid&"&id="&ChildNode.getAttribute("rootid")&"&page="&Page&"&star="&Star
If IsUrlreWrite = 1 Then
ChildNode.appendChild(XmlDom.createNode(1,"link","")).text = Forum_url&"dv_rss_"&VisitType&"_"&Dvbbs.Boardid&"_"&ChildNode.getAttribute("rootid")&"_"&Page&"_"&Star&".html"
ChildNode.appendChild(XmlDom.createNode(1,"bbslink","")).text = Forum_url & "dispbbs_"&Dvbbs.Boardid&"_"&ChildNode.getAttribute("rootid")&"_"&Page&"_"&Star&".html"
Else
ChildNode.appendChild(XmlDom.createNode(1,"link","")).text = PageUrl&"&boardid="&Dvbbs.Boardid&"&id="&ChildNode.getAttribute("rootid")&"&page="&Page&"&star="&Star
ChildNode.appendChild(XmlDom.createNode(1,"bbslink","")).text = Forum_url & "dispbbs.asp?boardid="&Dvbbs.Boardid&"&id="&ChildNode.getAttribute("rootid")&"page="&page&"&star="&Star
End If
'清理不需要的属性
ChildNode.removeAttribute "lockuser"
ChildNode.removeAttribute "getmoneytype"
ChildNode.removeAttribute "postbuyuser"
ChildNode.removeAttribute "usergroupid"
ChildNode.removeAttribute "ubblist"
ChildNode.removeAttribute "topic"
ChildNode.removeAttribute "username"
ChildNode.removeAttribute "dateandtime"
ChildNode.removeAttribute "body"
Root.appendChild ChildNode
Next
End If
Root.setAttribute "topic",TopicTitle
Root.setAttribute "id",id
Root.setAttribute "page",Page
Root.setAttribute "star",Star
Root.setAttribute "pagesize",PageSize
Root.setAttribute "count",Count
Root.setAttribute "pagecount",PageCount
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -