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

📄 recycle.asp

📁 现在好了
💻 ASP
📖 第 1 页 / 共 2 页
字号:
	'on error resume next
	Response.Write " "&_
	FormatDateTime(rs(5),2)&" "&FormatDateTime(rs(5),4)&_
	" | ------"

	response.write "</TD></TR>"

	 page_count = page_count + 1
         rs.movenext
        wend
End sub


Sub listPages3()
	
	dim endpage
	'on error resume next
	Pcount=rs.PageCount
	if Dvbbs.master and totalrec >0 then
	
		response.write "<TR><TD height=27 width=""100%"" class=tablebody2 colspan=4><input type=checkbox name=chkall value=on onclick=""CheckAll(this.form)"">选中所有显示帖子&nbsp;<input type=submit name=action onclick=""{if(confirm('确定还原选定的纪录吗?')){this.document.recycle.submit();return true;}return false;}"" value=还原>"

		If session("flag")<>"" then
		response.write "&nbsp;<input type=submit name=action onclick=""{if(confirm('确定删除选定的纪录吗?')){this.document.recycle.submit();return true;}return false;}"" value=删除>&nbsp;<input type=submit name=action onclick=""{if(confirm('确定清除回收站所有的纪录吗?')){this.document.recycle.submit();return true;}return false;}"" value=清空回收站>"
		End if
		response.write "</TD></TR></form>"
	end if
	Response.Write "</TBODY></TABLE>"
	Response.Write "<table border=0 cellpadding=0 cellspacing=3 width="""&Dvbbs.mainsetting(0)&""" align=center>"&_
			"<tr><td valign=middle nowrap>"&_
			"页次:<b>"&currentpage&"</b>/<b>"&Pcount&"</b>页"&_
			"每页<b>"&Dvbbs.Forum_Setting(11)&"</b> 贴数<b>"&totalrec&"</b></td>"&_
			"<td valign=middle nowrap><div align=right><p>分页: <b>"

	if currentpage > 4 then
	response.write "<a href=""?tablename="&tablename&"&page=1"">[1]</a> ..."
	end if
	if Pcount>currentpage+3 then
	endpage=currentpage+3
	else
	endpage=Pcount
	end if
	for i=currentpage-3 to endpage
	if not i<1 then
		if i = clng(currentpage) then
        response.write " <font color="&dvbbs.mainsetting(1)&">["&i&"]</font>"
		else
        response.write " <a href=""?tablename="&tablename&"&page="&i&""">["&i&"]</a>"
		end if
	end if
	next
	if currentpage+3 < Pcount then 
	response.write "... <a href=""?tablename="&tablename&"&page="&Pcount&""">["&Pcount&"]</a></b>"
	end if
	response.write "</p></div></td></tr></table>"
	rs.close
	set rs=Nothing
End sub 

Sub showEmptyBoard1()
	Response.Write "<TABLE class=tableborder1 cellPadding=4 cellSpacing=1 align=center>"&_
			"<TBODY>"&_
			"<TR align=middle>"&_
			"<Th height=25>状态</Th>"&_
			"<Th>主 题</Th>"&_
			"<Th>作 者</Th> "&_
			"<Th>回复/人气</Th> "&_
			"<Th>最新回复</Th></TR> "&_
			"<tr><td colSpan=5 width=100% class=tablebody1>论坛回收站暂无内容。</td></tr>"&_
			"</TBODY></TABLE>"
End Sub

'删除回收站内容
sub delete()
	If InStr(tablename,"bbs")>0 Then 
		Dvbbs.Execute("delete from "&tablename&" where boardid=444 and Announceid in ("&TopicID&")")
	ElseIf tablename="dv_topic" then
		For i=0 to UBound(AllPostTable)
			Dvbbs.Execute("delete from "&allposttable(i)&" where boardid=444 and rootid in ("&TopicID&")")
		Next 
		Dvbbs.Execute("delete from dv_topic where boardid=444 and topicid in ("&TopicID&")")
	End If
	Dvbbs.Dvbbs_Suc("<li>帖子操作成功。<li>您的操作信息已经记录在案.")
End sub

'还原回收站内容
Sub redel()
	Dim tempnum,todaynum,lasttime,myrs,upchild,F_Announceid
	upchild=false
	If InStr(tablename,"bbs")>0 then
		sql="update "&tablename&" set boardid=locktopic,locktopic=0 where Announceid in ("&TopicID&")"
		Dvbbs.Execute(sql)
		'如果该回复帖对应主题已删除,则同时还原该主题帖
		set rs=Dvbbs.Execute("select topicid,posttable,boardid from dv_topic where boardid=444 and topicid in (select distinct rootid from "&tablename&" where Announceid in ("&TopicID&"))")
		do while not rs.eof
			Dvbbs.Execute("update "&rs(1)&" set boardid=locktopic,locktopic=0 where parentid=0 and rootid="&rs(0))
			set trs=Dvbbs.Execute("select count(*) from "&rs(1)&" where (not boardid=444) and not parentid=0 and rootid="&rs(0))
			set myrs=Dvbbs.Execute("select top 1 dateandtime from "&rs(1)&" where (not boardid=444) and rootid="&rs(0)&" order by announceid desc")
			Dvbbs.Execute("update dv_topic set boardid=locktopic,child="&trs(0)&",locktopic=0,lastposttime='"&myrs(0)&"' where topicid="&rs(0))
			Dvbbs.Execute("update dv_board set TopicNum=TopicNum+1 where boardid="&rs(2))
			upchild=true
		rs.movenext
		loop
		set rs=Dvbbs.Execute("select PostUserID,BoardID,DateAndtime,ParentID,rootid,Announceid,IsUpload from "&tablename&" where Announceid in ("&TopicID&")")
		do while not rs.eof
			sql="update [dv_user] set userpost=userpost+1,userWealth=userWealth+"&Dvbbs.Forum_user(3)&",userEP=userEP+"&Dvbbs.Forum_user(8)&",userdel=userdel-1 where userid="&rs(0)
			Dvbbs.Execute(sql)
			if not upchild then
			'更新被删除跟贴的主题回复数和最后更新时间
			set trs=dvbbs.execute("select top 1 dateandtime from "&tablename&" where (not boardid=444) and rootid="&rs("rootid")&" order by announceid desc")
			dvbbs.execute("update dv_topic set child=child+1,lastposttime='"&trs(0)&"' where topicid="&rs("rootid"))
			end if
			set trs=Dvbbs.Execute("select ParentStr,LastPost from dv_board where boardid="&rs(1))
			lasttime=split(trs(1),"$")(2)
			if not isdate(lasttime) then lasttime=dateadd("d",-3,Now())
			if datediff("d",rs(2),lasttime)=0 then
				todaynum=1
			else
				todaynum=0
			end if
			call AllboardNumAdd(todayNum,1,0)
			UpdateBoardID=trs(0) & "," & rs(1)
			Dvbbs.Execute("update dv_board set todaynum=todaynum+"&todaynum&",PostNum=PostNum+1 where boardid in ("&UpdateBoardID&")")
			LastCount(rs(1))
			'还原所含附件数据
			If rs(6)=1 Then
				F_Announceid=rs(4)&"|"&rs(5)
				Dvbbs.Execute("update DV_Upfile set F_flag=0 where F_boardid="&rs(1)&" and F_announceID = '"& F_Announceid&"'")
			End If
		rs.movenext
		loop
		set rs=nothing
	ElseIf tablename="dv_topic" then
		dim TotalUseTable,LastPost_a
		i=0
		todaynum=0
		sql="update dv_topic set boardid=locktopic,locktopic=0 where topicid in ("&TopicID&")"
		Dvbbs.Execute(sql)
		set rs=Dvbbs.Execute("select topicid,posttable,boardid from dv_topic where topicid in ("&topicid&")")
		do while not rs.eof
			set trs=Dvbbs.Execute("select ParentStr,LastPost from dv_board where boardid="&rs(2))
			UpdateBoardID=trs(0) & "," & rs(2)
			LastPost_a=split(trs(1),"$")(2)
			Dvbbs.Execute("update "&rs(1)&" set boardid=locktopic,locktopic=0 where rootid="&rs(0))
			set trs=Dvbbs.Execute("select postuserid,dateandtime from "&rs(1)&" where rootid="&rs(0))
			do while not trs.eof
				i=i+1
				sql="update [dv_user] set userpost=userpost+1,userWealth=userWealth+"&Dvbbs.Forum_user(3)&",userEP=userEP+"&Dvbbs.Forum_user(8)&",userdel=userdel-1 where userid="&trs(0)
				Dvbbs.Execute(sql)
				if datediff("d",trs(1),now())=0 then
					todaynum=todaynum+1
				else
					todaynum=todaynum
				end if
			trs.movenext
			loop
			call AllboardNumAdd(todayNum,i,1)
			Dvbbs.Execute("update dv_board set todaynum=todaynum+"&todaynum&",postNum=postNum+"&i&",TopicNum=TopicNum+1 where boardid in ("&UpdateBoardID&")")
			LastCount(rs(2))
			i=0
			todaynum=0
		rs.movenext
		loop
		set rs=nothing
		set trs=nothing
	End If
	Dvbbs.ReloadBoardInfo(UpdateBoardID)
	Dvbbs.Dvbbs_Suc("<li>帖子操作成功。<li>您的操作信息已经记录在案.")
End Sub 

'全部删除回收站内容 2004-5-3 Dvbbs.YangZheng
Sub AllDel()
	Dim Bn
	Sql = "SELECT TopicId, PostTable From Dv_Topic Where BoardId = 444 ORDER BY TopicId"
	Set Rs = Dvbbs.Execute(Sql)
	If Not (Rs.Eof And Rs.Bof) Then
		Sql = Rs.GetRows(-1)
		Rs.Close:Set Rs = Nothing
		For i = 0 To Ubound(Sql,2)
			Dvbbs.Execute("DELETE FROM " & Sql(1,i) & " WHERE RootId = " & Sql(0,i))
			Dvbbs.Execute("DELETE From Dv_Topic WHERE TopicId = " & Sql(0,i))
		Next
	End If
	For i = 0 To Ubound(Allposttable)
		Sql = "SELECT AnnounceId From " & Allposttable(i) & " WHERE BoardId = 444 ORDER BY AnnounceId"
		Set Rs = Dvbbs.Execute(Sql)
		If Not (Rs.Eof And Rs.Bof) Then
			Sql = Rs.GetRows(-1)
			Rs.Close:Set Rs = Nothing
			For Bn = 0 To Ubound(Sql,2)
				Dvbbs.Execute("DELETE FROM " & Allposttable(i) & " WHERE AnnounceId = " & Sql(0,Bn))
			Next
		End If
	Next
	Dvbbs.Dvbbs_Suc("<li>帖子操作成功。<li>您的操作信息已经记录在案.")
End Sub

Function LastCount(boardid)
	Dim LastTopic,body,LastRootid,LastPostTime,LastPostUser
	Dim LastPost,uploadpic_n,Lastpostuserid,Lastid
	set trs=Dvbbs.Execute("select top 1 T.title,b.Announceid,b.dateandtime,b.username,b.postuserid,b.rootid from "&DVbbs.NowUseBBS&" b inner join dv_Topic T on b.rootid=T.TopicID where b.boardid="&boardid&" order by b.announceid desc")
	if not(trs.eof and trs.bof) then
		Lasttopic=replace(left(trs(0),15),"$","")
		LastRootid=trs(1)
		LastPostTime=trs(2)
		LastPostUser=trs(3)
		LastPostUserid=trs(4)
		Lastid=trs(5)
	else
		LastTopic="无"
		LastRootid=0
		LastPostTime=now()
		LastPostUser="无"
		LastPostUserid=0
		Lastid=0
	end if
	set trs=nothing

	LastPost=LastPostUser & "$" & LastRootid & "$" & LastPostTime & "$" & LastTopic & "$" & uploadpic_n & "$" & LastPostUserID & "$" & LastID & "$" & BoardID
	Dim SplitUpBoardID,SplitLastPost
	SplitUpBoardID=split(UpdateBoardID,",")
	For i=0 to ubound(SplitUpBoardID)
		set trs=Dvbbs.Execute("select LastPost from dv_board where boardid="&SplitUpBoardID(i))
		if not (trs.eof and trs.bof) then
			SplitLastPost=split(trs(0),"$")
			if ubound(SplitLastPost)=7 and clng(LastRootID)<>clng(SplitLastPost(1)) then
				Dvbbs.Execute("update dv_board set LastPost='"&LastPost&"' where boardid="&SplitUpBoardID(i))
			end if
		end if
	Next
	Set Trs=Nothing
End Function


'当还原时,所有论坛发帖数增加
Function AllboardNumAdd(todayNum,postNum,topicNum)
	sql="update dv_setup set forum_TodayNum=forum_todayNum+"&todaynum&",forum_postNum=forum_postNum+"&postNum&",forum_TopicNum=forum_topicNum+"&TopicNum
	Dvbbs.Execute(sql)
End Function
%>
<script language="JavaScript">
<!--
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
//-->
</script>

⌨️ 快捷键说明

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