📄 deltopic.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Response.Buffer = True
Dim rsNumOfPosts
Dim rsBBS
Dim strMode
Dim lngTopicID
Dim intForumID
Dim lngPollID
Dim lngDelMsgAuthorID
Dim lngNumOfPosts
If bannedIP() Then
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("nopermission.asp?M=IP")
End If
lngTopicID = CLng(Request.Form("tid"))
strSQL = "SELECT timestopic.bbsid "
strSQL = strSQL & "FROM timestopic "
strSQL = strSQL & "WHERE timestopic.topicid = " & lngTopicID & ";"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then
intForumID = CInt(rsConn("bbsid"))
End If
rsConn.Close
If blnAdmin = False Then blnModerator = isModerator(intForumID, intGroupID)
If blnAdmin = True OR blnModerator = True Then
strSQL = "SELECT timestopic.pollid "
strSQL = strSQL & "FROM timestopic "
strSQL = strSQL & "WHERE timestopic.topicid=" & lngTopicID & ";"
rsConn.Open strSQL, adoCon
If NOT rsConn.EOF Then lngPollID = CLng(rsConn("pollid"))
rsConn.Close
strSQL = "SELECT timespost.* "
strSQL = strSQL & "FROM timespost "
strSQL = strSQL & "WHERE timespost.topicid= " & lngTopicID & ";"
rsConn.Open strSQL, adoCon
Set rsNumOfPosts = Server.CreateObject("ADODB.Recordset")
Do While NOT rsConn.EOF
strSQL = "DELETE FROM timesguest WHERE timesguest.postid=" & CLng(rsConn("postid")) & ";"
adoCon.Execute(strSQL)
strSQL = "SELECT timesuser.userid, timesuser.postnum FROM timesuser WHERE timesuser.userid = " & CLng(rsConn("userid")) & ";"
rsNumOfPosts.Open strSQL, adoCon
If NOT rsNumOfPosts.EOF Then
lngNumOfPosts = CLng(rsNumOfPosts("postnum"))
If NOT lngNumOfPosts = 0 Then
lngNumOfPosts = lngNumOfPosts - 1
strSQL = "UPDATE timesuser SET "
strSQL = strSQL & "timesuser.postnum = " & lngNumOfPosts
strSQL = strSQL & " WHERE timesuser.userid= " & CLng(rsConn("userid")) & ";"
adoCon.Execute(strSQL)
End If
End If
rsNumOfPosts.Close
rsConn.MoveNext
Loop
strSQL = "DELETE FROM timespost WHERE timespost.topicid=" & lngTopicID & ";"
adoCon.Execute(strSQL)
If lngPollID > 0 Then
strSQL = "DELETE FROM timeschoice WHERE timeschoice.pollid=" & lngPollID & ";"
adoCon.Execute(strSQL)
strSQL = "DELETE FROM timespoll WHERE timespoll.pollid=" & lngPollID & ";"
adoCon.Execute(strSQL)
End If
strSQL = "DELETE FROM timestopic WHERE timestopic.topicid=" & lngTopicID & ";"
adoCon.Execute(strSQL)
rsConn.Close
Set rsNumOfPosts = Nothing
End If
Call updateTopicPostCount(intForumID)
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
%>
<html>
<head>
<script language="JavaScript">
window.opener.location.href = "topic.asp?fid=<% = intForumID %>&DL=1"
window.close();
</script>
</head>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -