📄 delpostschk.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Session.Timeout = 1000
Dim intNoOfDays
Dim intForumID
Dim lngNumberOfTopics
Dim lngPollID
Dim rsRD
lngNumberOfTopics = 0
intNoOfDays = CInt(Request.Form("days"))
intForumID = CInt(Request.Form("fid"))
strSQL = "SELECT timestopic.topicid, timestopic.pollid FROM timestopic "
If intForumID = 0 Then
strSQL = strSQL & "WHERE timestopic.lastdtm < " & strDatabaseDateFunction & " - " & intNoOfDays & ";"
Else
strSQL = strSQL & "WHERE (timestopic.lastdtm < " & strDatabaseDateFunction & " - " & intNoOfDays & ") AND (timestopic.bbsid=" & intForumID & ");"
End If
rsConn.Open strSQL, adoCon
Set rsRD = Server.CreateObject("ADODB.Recordset")
Do While NOT rsConn.EOF
lngNumberOfTopics = lngNumberOfTopics + 1
lngPollID = CLng(rsConn("pollid"))
strSQL = "SELECT timespost.postid FROM timespost WHERE timespost.topicid=" & rsConn("topicid") & ";"
rsRD.Open strSQL, adoCon
Do While NOT rsRD.EOF
strSQL = "DELETE FROM timesguest WHERE timesguest.postid=" & CLng(rsRD("postid")) & ";"
adoCon.Execute(strSQL)
rsRD.MoveNext
Loop
rsRD.Close
strSQL = "DELETE FROM timespost WHERE timespost.topicid =" & rsConn("topicid") & ";"
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
rsConn.MoveNext
Loop
strSQL = "DELETE FROM timestopic "
If intForumID = 0 Then
strSQL = strSQL & "WHERE timestopic.lastdtm < " & strDatabaseDateFunction & " - " & intNoOfDays & ";"
Else
strSQL = strSQL & "WHERE (timestopic.lastdtm < " & strDatabaseDateFunction & " - " & intNoOfDays & ") AND (timestopic.bbsid=" & intForumID & ");"
End If
adoCon.Execute(strSQL)
updateTopicPostCount(intForumID)
Set rsRD = Nothing
rsConn.Close
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>批量删除主题</title>
<link href="includes/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p class="text"><span class="heading">批量删除主题<br>
</span><br />
<a href="menu.asp" target="_self">返回到管理主菜单</a><br />
<br>
<br>
<br>
<br>
<br />
<% = lngNumberOfTopics %>
主题已经被删除<br />
</p>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -