📄 dispbbs.asp
字号:
UserGroupID=7
Else
UserGroupID=postuserlist.documentElement.selectSingleNode("user[@userid="&Node.selectSingleNode("@postuserid").text&"]/@usergroupid").text
End If
'过滤标题HTML
If TopicInfo.documentElement.firstChild.selectSingleNode("@topicmode").text <> "1" Then
Node.selectSingleNode("@topic").text=replace(Node.selectSingleNode("@topic").text,"<","<")
Else
If Node.selectSingleNode("@parentid").text<>"0" Then
Node.selectSingleNode("@topic").text=replace(Node.selectSingleNode("@topic").text,"<","<")
End If
End If
postbody=Node.selectSingleNode("@body").text
'过滤脏字
postbody=Dvbbs.ChkBadWords(postbody)
Topic=Node.selectSingleNode("@topic").text
Node.selectSingleNode("@topic").text=Dvbbs.ChkBadWords(Topic)
UserName=Node.selectSingleNode("@username").text
PostBuyUser=Node.selectSingleNode("@postbuyuser").text
ReplyID_a=Node.selectSingleNode("@announceid").text
RootID_a=Node.selectSingleNode("@rootid").text
AnnounceID_a=ReplyID_a
Node.selectSingleNode("@username").text=Dvbbs.ChkBadWords(username)
'Ubb转换
If InStr(Ubblists,",39,") > 0 Then
Node.selectSingleNode("@body").text = dv_ubb.Dv_UbbCode(postbody,UserGroupID,1,0)
Else
Node.selectSingleNode("@body").text = dv_ubb.Dv_UbbCode(postbody,UserGroupID,1,1)
End If
'利用ubblist节点传送广告数据
If Dvbbs.Forum_ads(7)="1" Then
Node.selectSingleNode("@ubblist").text=Topic_Ads(14)
Else
Node.selectSingleNode("@ubblist").text=""
End If
Node.selectSingleNode("@topic").text=Dvbbs.Replacehtml(Node.selectSingleNode("@topic").text)
Next
For Each Node In postuserlist.documentElement.SelectNodes("user")
Rem 分解userIM数组
UserIM=Split(Node.selectSingleNode("@userim").text,"|||")
Node.attributes.setNamedItem(postuserlist.createNode(2,"homepage","")).text=UserIM(0)
Node.attributes.setNamedItem(postuserlist.createNode(2,"oicq","")).text=UserIM(1)
Node.attributes.setNamedItem(postuserlist.createNode(2,"icq","")).text=UserIM(2)
Node.attributes.setNamedItem(postuserlist.createNode(2,"msn","")).text=UserIM(3)
Node.attributes.setNamedItem(postuserlist.createNode(2,"aim","")).text=UserIM(4)
Node.attributes.setNamedItem(postuserlist.createNode(2,"yahoo","")).text=UserIM(5)
Node.selectSingleNode("@userim").text=UserIM(6)
userface=Dv_FilterJS(Node.selectSingleNode("@userface").text)
Node.selectSingleNode("@userface").text=userface
If Dvbbs.forum_setting(42) = "0" Then '关闭签名的判断 2005-5-17 Dv.Yz
Node.selectSingleNode("@usersign").text=""
Else
If canusersign(Node.selectSingleNode("@usergroupid").text) = 1 Then
Node.selectSingleNode("@usersign").text=Dvbbs.ChkBadWords(Dv_ubb.Dv_SignUbbCode(Node.selectSingleNode("@usersign").text,Node.selectSingleNode("@usergroupid").text))
Else
Node.selectSingleNode("@usersign").text=""
End If
End If
Node.selectSingleNode("@joindate").text=Formatdatetime(Node.selectSingleNode("@joindate").text,1)
If Node.selectSingleNode("@userhidden").text = "2" Then
If IsDate(Node.selectSingleNode("@lastlogin").text) Then
If DateDiff("s",Node.selectSingleNode("@lastlogin").text,Now())>(cCur(dvbbs.Forum_Setting(8))*60) Then
Node.selectSingleNode("@userhidden").text = "1"
End If
Else
Node.selectSingleNode("@userhidden").text = "1"
End If
Else
Node.selectSingleNode("@userhidden").text = "1"
End If
'获取自己用户组的名字样式前后标记,并生成节点
namestyle=Split(Application(Dvbbs.CacheName &"_groupsetting").documentElement.selectSingleNode("usergroup[@usergroupid='"& Node.selectSingleNode("@usergroupid").text &"']/@groupsetting").text,",")(58)
Node.attributes.setNamedItem(postuserlist.createNode(2,"namestyle","")).text=namestyle
'修正显示用户组光晕效果 2005.10.13 By Winder.F
UserGroupID=Node.selectSingleNode("@usergroupid").text
If UserGroupID < 9 Then
Node.attributes.setNamedItem(postuserlist.createNode(2,"nameglow","")).text=nameglow(UserGroupID-1)
Else
Node.attributes.setNamedItem(postuserlist.createNode(2,"nameglow","")).text=Dvbbs.mainsetting(5)
End If
Next
'合并数据
XMLDom.documentElement.appendChild(postuserlist.documentElement)
End If
Else
Set XMLDom=Server.CreateObject("Msxml2.FreeThreadedDOMDocument" & MsxmlVersion)
XMLDom.appendChild(XMLDom.createElement("post"))
End If
'插入门派数据节点,避免不三不四的门派名称出现
Load_GroupName XMLDom
Else
Set XMLDom=Server.CreateObject("Msxml2.FreeThreadedDOMDocument" & MsxmlVersion)
XMLDom.appendChild(XMLDom.createElement("post"))
End If
Rem 主贴信息节点的插入 节点名称postinfo
Set Node = XMLDom.documentElement.appendChild(TopicInfo.documentElement.firstChild)
Node.attributes.setNamedItem(XMLDom.createNode(2,"pagecount","")).text=PageCount
Node.attributes.setNamedItem(XMLDom.createNode(2,"boardtype","")).text=Dvbbs.Replacehtml(Dvbbs.Boardtype)
Rem 传送客户端浏览器信息节点
XMLDom.documentElement.appendChild(Dvbbs.UserSession.documentElement.lastChild.cloneNode(True))
Rem 传送用户信息节点
Set Node=XMLDom.documentElement.appendChild(Dvbbs.UserSession.documentElement.firstChild.cloneNode(True))
Rem 附加一些需要用到的用户权限数据
If CanRead Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"canread","")).text=1
End If
If CanReply Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"canreply","")).text=1
End If
If Dvbbs.Board_Setting(68)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"cananony","")).text=1
End If
If dvbbs.boardmaster Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"boardmaster","")).text=1
End If
If TrueMaster Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"truemaster","")).text=1
End If
If Dvbbs.GroupSetting(41)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"canreadbest","")).text=1
End If
If Dvbbs.GroupSetting(30) ="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"canlookip","")).text=1
End If
If Dvbbs.VipGroupUser Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"vipgroupuser","")).text=1
End If
Rem GroupSetting(10) 可以编辑自己的文章 GroupSetting(11) 可以删除自己的文章 GroupSetting(12) 可以移动自己的主题 GroupSetting(13) 可以打开关闭自己的主题
If Dvbbs.GroupSetting(10)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"caneditmypost","")).text=1
End If
If Dvbbs.GroupSetting(11)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"candelmypost","")).text=1
End If
If Dvbbs.GroupSetting(12)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"canmovemypost","")).text=1
End If
If Dvbbs.GroupSetting(13)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"canlockmypost","")).text=1
End If
Rem 传送用于快速回复的发贴表情图标数据和em心情图标数据
If Not IsObject(Application(Dvbbs.CacheName & "_postface")) Then LoadForum_PostFace()
XMLDom.documentElement.appendChild(Application(Dvbbs.CacheName & "_postface").documentElement.cloneNode(True))
If Not IsObject(Application(Dvbbs.CacheName & "_emot")) Then LoadForum_emot()
XMLDom.documentElement.appendChild(Application(Dvbbs.CacheName & "_emot").documentElement.cloneNode(True))
Rem 相关设置节点,一个个手工添加:(
Set Node = XMLDom.documentElement.appendChild(XMLDom.createNode(1,"setting",""))
Node.attributes.setNamedItem(XMLDom.createNode(2,"isapi_write","")).text=isUrlreWrite
Node.attributes.setNamedItem(XMLDom.createNode(2,"pagesize","")).text=Dvbbs.Board_Setting(27)
Node.attributes.setNamedItem(XMLDom.createNode(2,"maxpostlen","")).text=Dvbbs.Board_Setting(16)
Node.attributes.setNamedItem(XMLDom.createNode(2,"leastpostlen","")).text=Dvbbs.Board_Setting(52)
Node.attributes.setNamedItem(XMLDom.createNode(2,"piccheck","")).text=Dvbbs.Board_Setting(4)
Node.attributes.setNamedItem(XMLDom.createNode(2,"picurl","")).text=Dvbbs.Forum_PicUrl
Node.attributes.setNamedItem(XMLDom.createNode(2,"fontsize","")).text=Dvbbs.Board_setting(28)
Node.attributes.setNamedItem(XMLDom.createNode(2,"postalipay","")).text=Dvbbs.Board_setting(67)
Node.attributes.setNamedItem(XMLDom.createNode(2,"upostalipay","")).text=Dvbbs.Forum_setting(89)
Node.attributes.setNamedItem(XMLDom.createNode(2,"isboke","")).text=Dvbbs.Forum_setting(99)
Rem 如果要恢复行距设置请把下面一行屏蔽掉
Dvbbs.Board_setting(29)="normal"
Node.attributes.setNamedItem(XMLDom.createNode(2,"lineheight","")).text=Dvbbs.Board_setting(29)
Node.attributes.setNamedItem(XMLDom.createNode(2,"indent","")).text=Dvbbs.Board_setting(69)
Node.attributes.setNamedItem(XMLDom.createNode(2,"usertitle","")).text=Dvbbs.forum_setting(6)
Node.attributes.setNamedItem(XMLDom.createNode(2,"menpai","")).text=Dvbbs.forum_setting(32)
If Dvbbs.Forum_Setting(90)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"usetools","")).text=1
End If
If Dvbbs.Forum_ChanSetting(0)="1" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"useray","")).text=1
End If
If Dvbbs.forum_setting(2)<>"0" Then
Node.attributes.setNamedItem(XMLDom.createNode(2,"cansendmail","")).text=1
End If
Rem 虚拟形象设置插入
Node.attributes.setNamedItem(XMLDom.createNode(2,"avatarsetting","")).text=Dvbbs.Forum_Setting(82)
Node.attributes.setNamedItem(XMLDom.createNode(2,"avatarmode","")).text=Dvbbs.board_Setting(59)
'插入验证码
Node.setAttribute "dvgetcode",DvCodeFile
'插入投票节点
Dim votexml,votearray,voteitem,votearray1,node1,node2,votetype,votchilds,votchilds_title,votchilds_ep,vChildItem
If isVote = 1 Then
Set Rs=Nothing
Set Rs=Dvbbs.Execute("Select * From Dv_Vote Where VoteID="&PollID)
If Not Rs.EOF Then
votetype = Rs("votetype")
Set votexml=Dvbbs.RecordsetToxml(rs,"voteinfo","vote")
Set Node=votexml.documentElement.firstChild
votearray1=split(Node.selectSingleNode("@vote").text,"|")
votearray=split(Node.selectSingleNode("@votenum").text,"|")
Node.selectSingleNode("@vote").text=""
Node.selectSingleNode("@votenum").text=""
i=0
For Each voteitem in votearray1
Set node1 = Node.appendChild(votexml.createNode(1,"voteitem",""))
'问卷类型
votchilds = Split(voteitem,"@@")
If votetype = 2 and Ubound(votchilds)>=3 Then
votchilds_title = Split(votchilds(2),"$$")
votchilds_ep = Split(votchilds(3),"$$")
j = 0
For Each vChildItem in votchilds_title
If Trim(vChildItem)<>"" Then
Set node2 = Node1.appendChild(votexml.createNode(1,"votechilds",""))
node2.text= vChildItem
If votchilds(1)<>"2" Then
Node2.attributes.setNamedItem(votexml.createNode(2,"ep","")).text=votchilds_ep(j)
End If
j = j+1
End If
Next
Node1.attributes.setNamedItem(votexml.createNode(2,"title","")).text = votchilds(0)
Node1.attributes.setNamedItem(votexml.createNode(2,"vtype","")).text = votchilds(1)
Else
Node1.attributes.setNamedItem(votexml.createNode(2,"title","")).text = voteitem
'Node1.text=voteitem
End If
Node1.attributes.setNamedItem(votexml.createNode(2,"num","")).text=votearray(i)
i=i+1
Next
'投票过期限制判断
If datediff("d",Node.selectSingleNode("@timeout").text,Now()) > 0 Then
Node.attributes.setNamedItem(votexml.createNode(2,"istimeout","")).text=1
Else
'检查此人是否已经投过票了
If Dvbbs.UserID > 0 and Locktopic =0 Then
If Not Dvbbs.Execute("Select * From Dv_voteuser Where voteid="& PollID &" And userid="& Dvbbs.userid).EOF Then
Node.attributes.setNamedItem(votexml.createNode(2,"alreadyvote","")).text=1
End If
End If
End If
XMLDom.documentElement.appendChild(node)
End If
End If
Dim xslt,proc,XMLStyle
If IsObject(Application(Dvbbs.CacheName&"_dispbbsemplate_"&Dvbbs.SkinID)) Then
Set XSLT=Application(Dvbbs.CacheName&"_dispbbsemplate_"&Dvbbs.SkinID)
Else
Set XMLStyle=Server.CreateObject("Msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
XMLStyle.loadxml template.html(0)
'XMLStyle.load Server.MapPath("dispbbs.xslt")
Set XSLT=Server.CreateObject("Msxml2.XSLTemplate" & MsxmlVersion)
XSLT.stylesheet=XMLStyle
Set Application(Dvbbs.CacheName&"_dispbbsemplate_"&Dvbbs.SkinID)=XSLT
End If
'XMLDom.save Server.MapPath("dispbbs.asp.xml")
Set proc = XSLT.createProcessor()
proc.input = XMLDom
proc.transform()
Response.Write proc.output
Set XMLDOM=Nothing
Set XSLt=Nothing
Set proc=Nothing
End Sub
Sub LoadForum_emot()
Dim emot,emotXML,i
emot=split(Dvbbs.Forum_emot,"|||")
Set emotXML=Server.CreateObject("Msxml2.FreeThreadedDOMDocument" & MsxmlVersion)
emotXML.appendChild(emotXML.createElement("emot"))
emotXML.documentElement.attributes.setNamedItem(emotXML.createNode(2,"path","")).text=emot(0)
For i= 1 to UBound(emot)-1
emotXML.documentElement.appendChild(emotXML.createNode(1,"em","")).text=emot(i)
Next
Set Application(Dvbbs.CacheName & "_emot")=emotXML.cloneNode(True)
End Sub
Sub LoadForum_PostFace()
Dim PostFace,PostFaceXML,i
PostFace=split(Dvbbs.Forum_PostFace,"|||")
Set PostFaceXML=Server.CreateObject("Msxml2.FreeThreadedDOMDocument" & MsxmlVersion)
PostFaceXML.appendChild(PostFaceXML.createElement("postface"))
PostFaceXML.documentElement.attributes.setNamedItem(PostFaceXML.createNode(2,"path","")).text=PostFace(0)
For i= 1 to UBound(PostFace)-1
PostFaceXML.documentElement.appendChild(PostFaceXML.createNode(1,"face","")).text=PostFace(i)
Next
Set Application(Dvbbs.CacheName & "_postface")=PostFaceXML.cloneNode(True)
End Sub
Function GetFormID()
Dim i,sessionid
sessionid = Session.SessionID
For i=1 to Len(sessionid)
GetFormID=GetFormID&Chr(Mid(sessionid,i,1)+97)
Next
End Function
Function canusersign(GroupID)
If Application(Dvbbs.CacheName &"_groupsetting").documentElement.selectSingleNode("usergroup[@usergroupid='"& GroupID &"']/@groupsetting") Is Nothing Then GroupID=7
canusersign = Split(Application(Dvbbs.CacheName &"_groupsetting").documentElement.selectSingleNode("usergroup[@usergroupid='"& GroupID &"']/@groupsetting").text,",")(55)
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -