📄 delpost.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Response.Buffer = True
Dim rsSTDelete
Dim intForumID
Dim strMode
Dim lngTopicID
Dim lngMessageID
Dim lngDelMsgAuthorID
Dim lngNumOfPosts
If bannedIP() Then
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("nopermission.asp?M=IP")
End If
lngMessageID = CLng(Request.QueryString("pid"))
strSQL = "SELECT timestopic.topicid, timestopic.bbsid "
strSQL = strSQL & "FROM timestopic, timespost "
strSQL = strSQL & "WHERE timestopic.topicid = timespost.topicid AND timespost.postid=" & lngMessageID & ";"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
lngTopicID = CLng(rsConn("topicid"))
intForumID = CInt(rsConn("bbsid"))
End If
rsConn.Close
strSQL = "SELECT timesbbs.* FROM timesbbs WHERE bbsid = " & intForumID & ";"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
Call forumPermisisons(intForumID, intGroupID, 0, 0, 0, 0, CInt(rsConn("delpost")), 0, 0, 0, 0, 0)
End If
rsConn.Close
strSQL = "SELECT timespost.* FROM timespost WHERE timespost.postid =" & lngMessageID & ";"
rsConn.CursorType = 2
rsConn.LockType = 3
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then lngDelMsgAuthorID = CLng(rsConn("userid"))
If (lngDelMsgAuthorID = lngLoggedInUserID OR blnAdmin = True OR blnModerator = True) AND (blnDelete = True OR blnAdmin = True) Then
strSQL = "DELETE FROM timesguest WHERE timesguest.postid=" & lngMessageID & ";"
adoCon.Execute(strSQL)
rsConn.Delete
rsConn.Requery
rsConn.Close
strSQL = "SELECT timesuser.postnum "
strSQL = strSQL & "FROM timesuser "
strSQL = strSQL & "WHERE timesuser.userid= " & lngDelMsgAuthorID & ";"
rsConn.CursorType = 2
rsConn.LockType = 3
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
lngNumOfPosts = CLng(rsConn("postnum"))
lngNumOfPosts = lngNumOfPosts - 1
rsConn.Fields("postnum") = lngNumOfPosts
rsConn.Update
End If
rsConn.Close
strSQL = "SELECT timespost.postid, timespost.msgdtm FROM timespost WHERE timespost.topicid =" & lngTopicID & " ORDER BY timespost.msgdtm ASC;"
rsConn.Open strSQL, adoCon
Set rsSTDelete = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT timestopic.* FROM timestopic WHERE timestopic.topicid =" & lngTopicID & ";"
rsSTDelete.CursorType = 2
rsSTDelete.LockType = 3
rsSTDelete.Open strSQL, adoCon
If NOT rsConn.EOF Then
rsSTDelete("startdtm") = CDate(rsConn("msgdtm"))
rsSTDelete.MoveLast
rsSTDelete("lastdtm") = CDate(rsConn("msgdtm"))
rsSTDelete.Update
Else
rsSTDelete.Delete
Call updateTopicPostCount(intForumID)
rsConn.Close
Set rsConn = Nothing
rsSTDelete.Close
Set rsSTDelete = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect "topic.asp?fid=" & intForumID & "&pn=" & Request.QueryString("pn")
End If
rsSTDelete.Close
Set rsSTDelete = Nothing
End If
Call updateTopicPostCount(intForumID)
rsConn.Close
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect "post.asp?fid=" & intForumID & "&tid=" & lngTopicID & "&pn=" & Request.QueryString("pn") & "&tpn=" & Request.QueryString("tpn")
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -