⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alldel.asp

📁 公司企业网站管理系统全站源码,用于企业内部对网站的管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../conn.asp"-->
<!-- #include file="inc/const.asp" -->
<%
Head()
Server.ScriptTimeout=9999999
dim iboardid(2000),idepth(2000),iboardname(2000)
dim k,n,i
dim admin_flag
admin_flag="24"
CheckAdmin(admin_flag)
Dim body
Call main()
Footer()

Erase iboardid
Erase idepth
Erase iboardname

sub main()
Dim rs
i=0
set rs=Dvbbs.Execute("select boardid,depth,boardtype from dv_board order by rootid,orders")
if rs.eof and rs.bof then
	iboardid(0)=0
	idepth(0)=0
	iboardname(0)="没有论坛"
else
	do while not rs.eof
		iboardid(i)=rs(0)
		idepth(i)=rs(1)
		iboardname(i)=rs(2)
		i=i+1
		rs.movenext
	loop
end if
set rs=nothing
select case request("action")
case "alldel"
	call alldel()
case "userdel"
	call del()
case "alldelTopic"
	call alldelTopic()
case "delUser"
	call deluser()
case "moveinfo"
	call moveinfo()
case "MoveUserTopic"
	call moveusertopic()
case "MoveDateTopic"
	call movedatetopic()
case else
%>
<table cellpadding=3 cellspacing=1 border=0 width=100% align="center">
	<tr>
    <td width="100%" valign=top class=td1>
<B>注意</B>:下面操作将大批量删除论坛帖子,<font color=red>并且所有操作不可恢复!</font>如果您确定这样做,请仔细检查您输入的信息。
</td>
</tr>
</table><BR>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
<form action="alldel.asp?action=alldel" method="post">
	<th valign=middle colspan=2>删除指定日期内帖子</b>(本功能不扣除用户帖子数和积分)</th>
	<tr>
	<td valign=middle width=40% class=td1>删除多少天前的帖子(填写数字)</td><td class=td1><input name="TimeLimited" value=100 size=30>&nbsp;<input type=submit class="button" name="submit" value="提 交"></td></tr>
	<tr>
	<td valign=middle width=40%  class=td1>论坛版面</td>
	<td class=td1>
		<select name="delboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			elseif k=0 then
				response.write "<option value=all>全部论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
</form>
<form action="alldel.asp?action=alldelTopic" method="post">
	<th valign=middle colspan=2>删除指定日期内没有回复的主题(本功能不扣除用户帖子数和积分)</th>
	<tr>
	<td valign=middle width=40% class=td1>删除多少天前的帖子(填写数字)</td><td class=td1><input name="TimeLimited" value=100 size=30>&nbsp;<input type=submit class="button" name="submit" value="提 交"></td></tr>
	<tr>
	<td valign=middle width=40% class=td1>论坛版面</td>
	<td class=td1>
		<select name="delboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			elseif k=0 then
				response.write "<option value=all>全部论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
</form>
<form action="alldel.asp?action=userdel" method="post">
	<th valign=middle colspan=2>删除某用户的所有帖子</th>
	<tr>
	<td valign=middle width=40% class=td1>请输入用户名</td><td class=td1><input type=text name="username" size=30>&nbsp;<input type=submit class="button" name="submit" value="提 交"></td></tr>
	<tr>
	<td valign=middle width=40%  class=td1>论坛版面</td><td class=td1>
		<select name="delboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			elseif k=0 then
				response.write "<option value=all>全部论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
</form>

<form action="alldel.asp?action=delUser" method="post">
	<th valign=middle colspan=2>删除指定日期内没有登录的用户</th>
	<tr>
	<td class=td1 valign=middle>指定日期</td>
	<td class=td1 valign=middle>
		<select name=TimeLimited size=1> 
		<option value=1>删除一天前的
		<option value=2>删除两天前的
		<option value=7>删除一星期前的
		<option value=15>删除半个月前的
		<option value=30>删除一个月前的
		<option value=60>删除两个月前的
		<option value=180>删除半年前的
		</select>
		<input type=submit class="button" name="submit" value="提 交">
	</td></tr>
</form>

</table>
<%end select%>
<%if founderr then Call dvbbs_error()%>
<%
end sub

Sub Moveinfo()
%>
<table cellpadding=3 cellspacing=1 border=0 width=100% align=center>
	<tr>
    <td width="100%" valign=top>
<B>注意</B>:这里只是移动帖子,而不是拷贝或者删除!
            <br>下面操作将删除原论坛帖子,并移动到您指定的论坛中。如果您确定这样做,请仔细检查您输入的信息。<BR>您可以将一个论坛下属论坛的帖子移动到上级论坛,也可以将上级论坛的帖子移动到下级论坛,但作为分类的论坛由于论坛设置很可能不能发布帖子(只能浏览)
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
<form action="alldel.asp?action=MoveDateTopic" method="post">
	<th valign=middle colspan=2>按日期移动</th>
	<tr>
	<td valign=middle width=40% class=td1>移动多少天前的帖子(填写数字)<li>填写为0,即分版所有帖子。</td><td class=td1><input name="TimeLimited" value=0 size=30>天&nbsp;<input type=submit class="button" name="submit" value="提 交"></td></tr>
	<tr>
	<td valign=middle width=40% class=td1>原论坛</td><td class=td1>
		<select name="outboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
	<tr>
	<td valign=middle width=40% class=td1>目标论坛</td><td class=td1>
		<select name="inboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
</form>
<form action="alldel.asp?action=MoveUserTopic" method="post">
	<th valign=middle colspan=2>按用户移动</th>
	<tr>
	<td valign=middle width=40% class=td1>请填写用户名</td><td class=td1><input name="username" size=30>&nbsp;<input type=submit class="button" name="submit" value="提 交"></td></tr>
	<tr>
	<td valign=middle width=40% class=td1>原论坛</td><td class=td1>
		<select name="outboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
	<tr>
	<td valign=middle width=40% class=td1>目标论坛</td><td class=td1>
		<select name="inboardid" size=1>
		<%
		for k=0 to i-1
			if iboardid(k)=0 then
				response.write "<option value=0>没有论坛</option>"
			end if
			response.write "<option value="&iboardid(k)&">"
			if idepth(k)>0 then
			for n=1 to idepth(k)
			response.write "-"
			next
			end if
			response.write iboardname(k)&"</option>"
		next
		%>
		</select>
	</td></tr>
</form>
</table>
<%
	end sub

'删除某用户的所有帖子
Sub Del()
	dim titlenum,delboardid,PostUserID,delboardida,rs,sql,i
	Dim Dnum '删除帖子数 2005-10-30 Dv.Yz
	If request("delboardid")="0" then
		founderr=true
		Errmsg=ErrMsg + "<BR><li>非法的版面参数。"
		exit sub
	Elseif request("delboardid")="all" then
		delboardid=""
		delboardida=""
	Else
		delboardid=" boardid="&request("delboardid")&" and "
		delboardida=" F_boardid="&request("delboardid")&" and "
	End if
	If Request("username")="" then
		founderr=true
		Errmsg=ErrMsg + "<BR><li>请输入被帖子删除用户名。"
		exit sub
	End If
	Set Rs=Dvbbs.Execute("Select UserID,UserGroupID From Dv_User Where UserName='"&replace(request("username"),"'","")&"'")
	If Rs.Eof And Rs.Bof Then
		founderr=true
		Errmsg=ErrMsg + "<BR><li>目标用户不存在,请重新输入。"
		exit sub
	End If
	If Rs(1)=1 Or Rs(1)=2 Or Rs(1)=3 Then
		founderr=true
		Errmsg=ErrMsg + "<BR><li>对管理员、超级版主、版主的贴子不能进行批量删除操作。"
		exit sub
	End If
		PostUserID=Rs(0)
		Set Rs=Nothing
		titlenum=0
		for i=0 to ubound(allposttable)
		set rs=Dvbbs.Execute("Select Count(*) from "&allposttable(i)&" where "&delboardid&" PostUserID="&PostUserID) 
   		titlenum=titlenum+rs(0)

		sql="Delete From "&allposttable(i)&" where "&delboardid&" PostUserID="&PostUserID
		Dvbbs.Execute(sql)
		next
		Set Rs=Nothing
		'精华
		Dvbbs.Execute("delete from dv_besttopic where "&delboardid&" PostUserID="&PostUserID)
		'上传

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -