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

📄 admindelete.asp

📁 一个不错的论坛原代码
💻 ASP
字号:
<!--#include file="Connections.asp" -->
<!--#include file="adminaccess.asp" -->

<body  <%=background%> >

<%if  Request.QueryString("action") = "deluser" then
	dtt = chktopic(cint(Request.Form("date")))
	ii=0
	sql5="select username from user   where (send < " & chktopic(Request.Form("num")) & ") and (time < #" & dateadd("d", -dtt, nowtime) & "#)"
set rs5=conn.execute(sql5)
do while not rs5.eof 
ii=ii+1
sql="update total set n_num=n_num-1"
conn.execute(sql)
sql="delete from pm  where q_receive='"&username&"'"
conn.execute(sql)
rs5.movenext
loop
set rs5=nothing	

		strsql = "delete from user where (send < " & chktopic(Request.Form("num")) & ") and (time < #" & dateadd("d", -dtt, nowtime) & "#)"
		conn.Execute (strsql)
		Response.Write "<div class=tdc align=center>批量删除用户完毕!共删除用户数 "&ii&" 人</div>"
		response.end
		
	elseif  Request.QueryString("action") = "deltopic" then
	dtt = chktopic(cint(Request.Form("date")))
ii=0
i=0
	sql5="select t_id,t_replynum,l_id from topic  where (t_time < #" & dateadd("d", -dtt, nowtime) & "#)"
	if chktopic(Request.Form("jinghu"))="t_jinghu" then sql5 = sql5 & " and t_jinhua <> 1"
set rs5=conn.execute(sql5)
do while not rs5.eof 
ii=ii+1'主题数
i=i+rs5("t_replynum")'回复数
conn.execute("update total set t_num=t_num-1, r_num=r_num-"&rs5("t_replynum")&"")
conn.execute("update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&rs5("t_replynum")&" where l_id="&rs5("l_id")&"")
conn.execute("delete from reply where t_id="&rs5("t_id"))
conn.execute("delete from vote where v_num="&rs5("t_id"))
rs5.movenext
loop
set rs5=nothing	

		strsql = "delete  from topic where (t_time < #" & dateadd("d", -dtt, nowtime) & "#)"
		if chktopic(Request.Form("jinghu"))="t_jinghu" then strsql = strsql & " and t_jinhua <> 1"
		conn.Execute (strsql)
		
	Response.Write "<div class=tdc align=center>批量删除帖子完毕!共删除主题数 "&ii&" 篇,回复数 "&i&" 篇</div>"
	response.end
	'移动
		elseif  Request.QueryString("action") = "movetopic" then
	dtt = chktopic(cint(Request.Form("date")))
	id1=chktopic(request.form("id1"))
id2=chktopic(request.form("id2"))
if id1=0 or id2=0 then
response.write "<div class=tdc>错误:请选择好论坛后再提交,请不要选择带+的</div>"
response.end
end if

ii=0
i=0

sql5="select t_id,l_id,t_replynum from topic   where l_id="&id1&" and (t_time < #" & dateadd("d", -dtt, nowtime) & "#)"
set rs5=conn.execute(sql5)
do while not rs5.eof 
ii=ii+1
i=i+rs5("t_replynum")'回复数
conn.execute("update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&rs5("t_replynum")&" where l_id="&rs5("l_id")&"")
conn.execute("update lanmu set l_topiccount=l_topiccount+1,l_count=l_count+"&rs5("t_replynum")&" where l_id="&id2&"")
conn.execute("update reply set l_id="&id2&"  where t_id="&rs5("t_id"))
rs5.movenext
loop
set rs5=nothing
strsql = "update topic set l_id="&id2&" where l_id="&id1&" and (t_time < #" & dateadd("d", -dtt, nowtime) & "#)"
conn.Execute (strsql)
	
	Response.Write "<div class=tdc align=center>批量移动帖子完毕!共移动主题数 "&ii&" 篇,回复数 "&i&" 篇</div>"
	response.end
	
	elseif  Request.QueryString("action") = "moveuser" then
	username =chktopic(trim(Request.Form("username")))
	if username="" then
response.write "<div class=tdc>错误:请输入用户名</div>"
response.end
end if
	id1=chktopic(request.form("id1"))
id2=chktopic(request.form("id2"))
if id1=0 or id2=0 then
response.write "<div class=tdc>错误:请选择好论坛后再提交,请不要选择带+的</div>"
response.end
end if

ii=0
i=0
sql5="select t_id,l_id,t_replynum from topic  where l_id="&id1&"  and t_username='"&username&"'"
set rs5=conn.execute(sql5)
do while not rs5.eof 
ii=ii+1
i=i+rs5("t_replynum")'回复数
conn.execute("update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&rs5("t_replynum")&" where l_id="&rs5("l_id")&"")
conn.execute("update lanmu set l_topiccount=l_topiccount+1,l_count=l_count+"&rs5("t_replynum")&" where l_id="&id2&"")
conn.execute("update reply set l_id="&id2&"  where t_id="&rs5("t_id"))
rs5.movenext
loop
set rs5=nothing

		strsql = "update topic set l_id="&id2&" where l_id="&id1&" and t_username='"&username&"'"
		conn.Execute (strsql)
	
	Response.Write "<div class=tdc align=center>批量移动帖子完毕!共移动主题数 "&ii&" 篇,回复数 "&i&" 篇</div>"
	response.end

elseif Request.QueryString("action")="user" then
%>
 <table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
    
<tr><td <%=tColor%> class=tdc1 align="center" colspan=4>批量删除用户</td></tr>
<form method="post" action="?action=deluser">
<tr><td bgcolor=<%=tColor2%> class=tdc>注册时间</td><td bgcolor=<%=tColor2%> class=tdc>
<SELECT NAME="date">
<OPTION value="0">所有时间
<OPTION value="7">1周前
<OPTION value="14">2周前
<OPTION value="30">1月前
<OPTION value="180">半年前
<OPTION value="365" selected>1年前
<OPTION value="730">2年前
</SELECT>
</td>
<td  bgcolor=<%=tColor2%> class=tdc>发帖量</td><td bgcolor=<%=tColor2%> class=tdc>
<SELECT NAME="num">
<OPTION value="10">10帖以下
<OPTION value="20">20帖以下
<OPTION value="50">50帖以下
<OPTION value="200">200帖以下
<OPTION value="500">500帖以下
<OPTION value="1" selected>没有发过帖
</SELECT>
</td></tr><tr ><td align="center" colspan=4 bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="submit" value="删 除" class=bdtj></td></tr></table></form>
<%
elseif Request.QueryString("action")="" then
%>
 <table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
    

<tr><td <%=tColor%> class=tdc1 align="center" colspan=4>批量删除帖子</td></tr>
<form method="post" action="?action=deltopic">
<tr><td bgcolor=<%=tColor2%> class=tdc>发表日期</td><td bgcolor=<%=tColor2%> class=tdc>
<SELECT NAME="date">
<OPTION value="0">所有时间
<OPTION value="7">1周前
<OPTION value="14">2周前
<OPTION value="30">1月前
<OPTION value="60">2月前
<OPTION value="180">半年前
<OPTION value="365">1年前
<OPTION value="730" selected>2年前
</SELECT>
</td>
<td bgcolor=<%=tColor2%> class=tdc><input name="jinghu" type="checkbox" value="t_jinghu" checked>保留精华帖
</td></tr><tr><td align="center" colspan=4 bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="submit" value="删 除" class=bdtj></td></tr></table></form>
<%
elseif Request.QueryString("action")="move" then
%>
 <table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
    

<tr><td <%=tColor%> class=tdc1 align="center" colspan=4>批量移动帖子(按日期)</td></tr>
<form method="post" action="?action=movetopic">
<tr><td bgcolor=<%=tColor2%> class=tdc>
  <p align="center">移动多少天前的帖子</td><td bgcolor=<%=tColor2%> class=tdc>
<SELECT NAME="date">
<OPTION value="0">所有时间
<OPTION value="7">1周前
<OPTION value="14">2周前
<OPTION value="30">1月前
<OPTION value="60">2月前
<OPTION value="180">半年前
<OPTION value="365">1年前
<OPTION value="7" selected>2年前
</SELECT>
</td>
</tr>

<tr>
            <td width="40%"  align="center" bgcolor=<%=tColor2%> class=tdc><p align="center">
            原论坛</td>
            <td width="80%" bgcolor=<%=tColor2%> class=tdc>
          
              <select size="1" name="id1">
              <option selected value="0">请选择论坛</option>
              <% sqlfen="select f_id,f_title from fenlei order by f_num asc"
set rsfen=conn.execute(sqlfen)
do while not rsfen.eof%>
           <option value="0"> ++<%=rsfen("f_title")%>++</option>
            <%sql_lanmu1="select * from lanmu where f_id="&rsfen("f_id")&""
set rs_lanmu1=conn.execute(sql_lanmu1)
%>
               <% do while not rs_lanmu1.Eof %>
      
      <option value="<%=rs_lanmu1("l_id")%>">&nbsp;&nbsp;├<%=rs_lanmu1("l_title")%></option>
      
      <%rs_lanmu1.MoveNext 
        Loop
        set rs_lanmu1=nothing
       
        rsfen.movenext
			loop
			set rsfen=nothing
			 %>          
              </select>(请不要选择带+的)</td>
                 </tr>



          <tr > 
            <td width="40%"  align="center" bgcolor=<%=tColor2%> class=tdc><p align="center">
            目标论坛</td>
            <td width="80%" bgcolor=<%=tColor2%> class=tdc>
            <select size="1" name="id2">
          <option selected value="0">请选择论坛</option>
              <% sqlfen="select f_id,f_title from fenlei order by f_num asc"
set rsfen=conn.execute(sqlfen)
do while not rsfen.eof%>
           <option value="0"> ++<%=rsfen("f_title")%>++</option>
            <%sql_lanmu1="select * from lanmu where f_id="&rsfen("f_id")&""
set rs_lanmu1=conn.execute(sql_lanmu1)
%>
               <% do while not rs_lanmu1.Eof %>
      
      <option value="<%=rs_lanmu1("l_id")%>">&nbsp;&nbsp;├<%=rs_lanmu1("l_title")%></option>
      
      <%rs_lanmu1.MoveNext 
        Loop
        set rs_lanmu1=nothing
       
        rsfen.movenext
			loop
			set rsfen=nothing
			 %>          

            </select>(请不要选择带+的)</td>
       
          </tr>
<tr><td align="center" colspan=4 bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="submit" value="移 动" class=bdtj></td></tr></table></form>
 <table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
    
<tr><td <%=tColor%> class=tdc1 align="center" colspan=4>批量移动帖子(按用户)</td></tr>
<form method="post" action="?action=moveuser">
<tr><td bgcolor=<%=tColor2%> class=tdc>
  <p align="center">请输入用户名</td><td bgcolor=<%=tColor2%> class=tdc>
&nbsp;<input type="text" name="username" size="20"></td>
</tr>

<tr>
            <td width="40%"  align="center" bgcolor=<%=tColor2%> class=tdc><p align="center">
            原论坛</td>
            <td width="80%" bgcolor=<%=tColor2%> class=tdc>
          
              <select size="1" name="id1">
              <option selected value="0">请选择论坛</option>
              <% sqlfen="select f_id,f_title from fenlei order by f_num asc"
set rsfen=conn.execute(sqlfen)
do while not rsfen.eof%>
           <option value="0"> ++<%=rsfen("f_title")%>++</option>
            <%sql_lanmu1="select * from lanmu where f_id="&rsfen("f_id")&""
set rs_lanmu1=conn.execute(sql_lanmu1)
%>
               <% do while not rs_lanmu1.Eof %>
      
      <option value="<%=rs_lanmu1("l_id")%>">&nbsp;&nbsp;├<%=rs_lanmu1("l_title")%></option>
      
      <%rs_lanmu1.MoveNext 
        Loop
        set rs_lanmu1=nothing
       
        rsfen.movenext
			loop
			set rsfen=nothing
			 %>          
              </select>(请不要选择带+的)</td>
                 </tr>



          <tr > 
            <td width="40%"  align="center" bgcolor=<%=tColor2%> class=tdc><p align="center">
            目标论坛</td>
            <td width="80%" bgcolor=<%=tColor2%> class=tdc>
            <select size="1" name="id2">
          <option selected value="0">请选择论坛</option>
              <% sqlfen="select f_id,f_title from fenlei order by f_num asc"
set rsfen=conn.execute(sqlfen)
do while not rsfen.eof%>
           <option value="0"> ++<%=rsfen("f_title")%>++</option>
            <%sql_lanmu1="select * from lanmu where f_id="&rsfen("f_id")&""
set rs_lanmu1=conn.execute(sql_lanmu1)
%>
               <% do while not rs_lanmu1.Eof %>
      
      <option value="<%=rs_lanmu1("l_id")%>">&nbsp;&nbsp;├<%=rs_lanmu1("l_title")%></option>
      
      <%rs_lanmu1.MoveNext 
        Loop
        set rs_lanmu1=nothing
       
        rsfen.movenext
			loop
			set rsfen=nothing
			 %>          

            </select>(请不要选择带+的)</td>
       
          </tr>
<tr><td align="center" colspan=4 bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="submit" value="移 动" class=bdtj></td></tr></table></form>




<%
end if
%>

⌨️ 快捷键说明

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