📄 pop_delete.asp
字号:
my_Conn.Execute strSql
'## Forum_SQL - Delete the actual forums
strSql = "DELETE FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & cint(delAr(i))
my_Conn.Execute strSql
'## Forum_SQL - count total number of replies in Reply table
set rs = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT count(" & strTablePrefix & "REPLY.REPLY_ID) AS cnt "
strSql = strSql & " FROM " & strTablePrefix & "REPLY "
rs.Open strSql, my_Conn
risreply = rs("cnt")
rs.close
set rs = nothing
set rs = Server.CreateObject("ADODB.Recordset")
'## Forum_SQL - count total number of Topics in Topics table
strSql = "SELECT count(" & strTablePrefix & "TOPICS.TOPIC_ID) AS cnt "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
rs.Open strSql, my_Conn
rispost = rs("cnt")
rs.close
set rs = nothing
'## Forum_SQL - Update total topics and posts in Totals table
strSql = "UPDATE " & strTablePrefix & "TOTALS "
strSql = strSql & " SET " & strTablePrefix & "TOTALS.P_COUNT = " & cint(risreply + rispost)
strSql = strSql & ", " & strTablePrefix & "TOTALS.T_COUNT = " & cint(rispost)
my_Conn.Execute strSql
next
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>论坛已删除!</b></font></p>
<% Else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>你不是管理员不能删除论坛</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1) ">返回重新认证</a></font></p>
<% end if %>
<% Else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>你不是管理员不能删除论坛</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">返回重新认证</a></font></p>
<%
end if
else
if Request.QueryString("mode") = "DeleteCategory" then
mLev = cint(ChkUser2(strDBNTUserName, Request.Form("Pass")))
if mLev > 0 then '## is Member
if mLev = 4 then
delAr = split(Request.Form("CAT_ID"), ",")
for i = 0 to ubound(delAr)
'## Forum_SQL - Delete all replys related to the topics
strSql = "DELETE FROM " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strTablePrefix & "REPLY.CAT_ID = " & cint(delAr(i))
my_Conn.Execute strSql
'## Forum_SQL - Delete the actual topics
strSql = "DELETE FROM " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.CAT_ID = " & cint(delAr(i))
my_Conn.Execute strSql
'## Forum_SQL - Delete the actual forums
strSql = "DELETE FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.CAT_ID = " & cint(delAr(i))
my_Conn.Execute strSql
'## Forum_SQL - Delete the actual category
strSql = "DELETE FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & cint(delAr(i))
my_Conn.Execute strSql
'## Forum_SQL - count total number of replies in Reply table
set rs = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT count(" & strTablePrefix & "REPLY.REPLY_ID) AS cnt "
strSql = strSql & " FROM " & strTablePrefix & "REPLY "
rs.Open strSql, my_Conn
risreply = rs("cnt")
rs.close
set rs = nothing
'## Forum_SQL - count total number of Topics in Topics table
set rs = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT count(" & strTablePrefix & "TOPICS.TOPIC_ID) AS cnt "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
rs.Open strSql, my_Conn
rispost = rs("cnt")
rs.close
P_Count = cint(risreply + rispost)
T_Count = cint(rispost)
'## Forum_SQL - Update total topics and posts in Totals table
strSql = "UPDATE " & strTablePrefix & "TOTALS "
strSql = strSql & " SET " & strTablePrefix & "TOTALS.P_COUNT = " & P_Count & " "
strSql = strSql & ", " & strTablePrefix & "TOTALS.T_COUNT = " & T_Count & " "
my_Conn.Execute strSql
next
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>分类已删除!</b></font></p>
<% else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>你不是管理员不能删除分类</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1) ">返回重新认证</a></font></p>
<% end if %>
<% else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>你不是管理员不能删除分类</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">返回重新认证</a></font></p>
<%
end if
else
if Request.QueryString("mode") = "DeleteMember" then
mLev = cint(ChkUser2(STRdbntUserName, Request.Form("Pass")))
if mLev > 0 then '## is Member
if mLev = 4 then
'## Forum_SQL - Remove the member from the moderator table
strSql = "DELETE FROM " & strTablePrefix & "MODERATOR "
strSql = strSql & " WHERE " & strTablePrefix & "MODERATOR.MEMBER_ID = " & Request.Form("MEMBER_ID")
my_Conn.Execute (strSql)
'## Forum_SQL - Select postcount
strSql = "SELECT COUNT(T_AUTHOR) AS POSTCOUNT "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
strSql = strSql & " WHERE T_AUTHOR = " & Request.Form("MEMBER_ID")
set rs = my_Conn.Execute (strSql)
if not rs.eof then
intPostcount = rs("POSTCOUNT")
else
intPostcount = 0
end if
rs.close
'## Forum_SQL - Select postcount
strSql = "SELECT COUNT(R_AUTHOR) AS REPLYCOUNT "
strSql = strSql & " FROM " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE R_AUTHOR = " & Request.Form("MEMBER_ID")
set rs = my_Conn.Execute (strSql)
if not rs.eof then
intReplycount = rs("REPLYCOUNT")
else
intReplycount = 0
end if
rs.close
if ((intReplycount + intPostCount) = 0) then
'## Forum_SQL - Delete the Member - Member has no posts
strSql = "DELETE FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("MEMBER_ID")
my_Conn.Execute strSql
else
'## Forum_SQL - disable account - Member has posts, cannot delete just disable account
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " SET " & strMemberTablePrefix & "MEMBERS.M_STATUS = " & 0
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_EMAIL = ' '"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_LEVEL = " & 1
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_NAME = 'n/a'"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY = ' '"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE = 'deleted'"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE = ' '"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM = ' '"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO = ' '"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ = ' '"
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("MEMBER_ID")
my_Conn.Execute strSql
end if
'## Forum_SQL - Update total of Members in Totals table
strSql = "UPDATE " & strTablePrefix & "TOTALS "
strSql = strSql & " SET " & strTablePrefix & "TOTALS.U_COUNT = " & strTablePrefix & "TOTALS.U_COUNT - " & 1
my_Conn.Execute strSql
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>会员已删除!</b></font></p>
<% else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>你不是管理员不能删除会员</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1) ">返回重新认证</a></font></p>
<% end if %>
<% else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>你不是管理员不能删除会员</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">返回重新认证</a></font></p>
<%
end if
else
%>
<P><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Delete
<% if Request.QueryString("mode") = "Member" then %>
Member
<% else %>
<% if Request.QueryString("mode") = "Category" then %>
Category
<% else %>
<% if Request.QueryString("mode") = "Forum" then %>
Forum
<% else %>
<% if Request.QueryString("mode") = "Topic" then %>
Topic
<% else %>
<% if Request.QueryString("mode") = "Reply" then %>
Reply
<% end if %>
<% end if %>
<% end if %>
<% end if %>
<% end if %>
</font></p>
<p><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b><font color=red>注意:</font></b>
<% if Request.QueryString("mode") = "Member" then %>
只有管理员才能删除会员。
<% else %>
<% if Request.QueryString("mode") = "Category" then %>
只有管理员才能删除分类。
<% else %>
<% if Request.QueryString("mode") = "Forum" then %>
只有管理员才能删除论坛。
<% else %>
<% if Request.QueryString("mode") = "Topic" then %>
只有版主和管理员才能删除主题。
<% else %>
<% if Request.QueryString("mode") = "Reply" then %>
只有版主和管理者才能删除回复。
<% end if %>
<% end if %>
<% end if %>
<% end if %>
<% end if %>
</font></p>
<form action="pop_delete.asp?mode=<% if Request.QueryString("mode") = "Member" then Response.Write("DeleteMember")%><% if Request.QueryString("mode") = "Category" then Response.Write("DeleteCategory")%><% if Request.QueryString("mode") = "Forum" then Response.Write("DeleteForum")%><% if Request.QueryString("mode") = "Topic" then Response.Write("DeleteTopic")%><%if Request.QueryString("mode") = "Reply" then Response.Write("DeleteReply")%>" method=post id=Form1 name=Form1>
<input type=hidden name="REPLY_ID" value="<% =Request.QueryString("REPLY_ID") %>">
<input type=hidden name="TOPIC_ID" value="<% =Request.QueryString("TOPIC_ID") %>">
<input type=hidden name="FORUM_ID" value="<% =Request.QueryString("FORUM_ID") %>">
<input type=hidden name="CAT_ID" value="<% =Request.QueryString("CAT_ID") %>">
<input type=hidden name="MEMBER_ID" value="<% =Request.QueryString("MEMBER_ID") %>">
<table border="0" width="75%" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="<% =strPopUpBorderColor %>">
<table border="0" width="100%" cellspacing="1" cellpadding="1">
<% if strAuthType="db" then %>
<tr>
<td bgColor=<% =strPopUpTableColor %> align=right nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">用户名:</font></b></td>
<td bgColor=<% =strPopUpTableColor %>><input type=text name="User" value="<% =Request.Cookies(strUniqueID & "User")("Name")%>" size=20></td>
</tr>
<tr>
<td bgColor=<% =strPopUpTableColor %> align=right nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">密码:</FONT></b></td>
<td bgColor=<% =strPopUpTableColor %>><input type=Password name="Pass" value="<% =Request.Cookies(strUniqueID & "User")("Pword")%>" size=20></td>
</tr>
<% else %>
<% if strAuthType="nt" then %>
<tr>
<td bgColor=<% =strPopUpTableColor %> align=right nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">NT 帐号:</font></b></td>
<td bgColor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><%=Session(strCookieURL & "userid")%></font></td>
</tr>
<% end if %>
<% end if %>
<tr>
<td bgColor=<% =strPopUpTableColor %> colspan=2 align=center><Input type=Submit value="提交" id=Submit1 name=Submit1></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%
end if
end if
end if
end if
end if
%>
<!--#INCLUDE FILE="inc_footer_short.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -