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

📄 admin_postings.asp

📁 论坛源码
💻 ASP
📖 第 1 页 / 共 5 页
字号:
end if
call dvbbs_suc()
end sub

sub dele()
dim todaynum
set rs=conn.execute("select topic,username,postuserid,DateAndTime from "&TotalUseTable&" where Announceid="&replyid)
if rs.eof and rs.bof then
	Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
	founderr=true
	exit sub
else
	topic=rs(0)
	topicusername=rs(1)
	topicuserid=rs(2)
	if topic="" then
		topic="本帖子为回复帖子"
	end if

	if datediff("d",rs(3),now())=0 then
	todaynum=1
	else
	todaynum=0
	end if
end if
set rs=nothing

'判断用户是否有删除帖子权限
if (Cint(GroupSetting(11))=1 and TopicUsername=membername) then
	candeltopic=true
end if
if FoundUserPer and Cint(GroupSetting(11))=1 and TopicUsername=membername then
	candeltopic=true
elseif FoundUserPer and Cint(GroupSetting(11))=0 and TopicUsername=membername then
	candeltopic=false
end if
if FoundUserPer and Cint(GroupSetting(18))=1 and TopicUsername<>membername then
	candeltopic=true
elseif FoundUserPer and Cint(GroupSetting(18))=0 and TopicUsername<>membername then
	candeltopic=false
end if
if not candeltopic then
	Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
	founderr=true
	exit sub
end if

title=CheckStr(htmlencode(request.form("title")))
content=CheckStr(htmlencode(request.form("content")))
content="原因:" & title & content
if htmlencode(request.form("title"))="" and htmlencode(request.form("content"))="" then
	Errmsg=Errmsg+"<br><li>请写明操作原因。"
	founderr=true
	exit sub
end if

Dim LastPostime
sql="update "&TotalUseTable&" set locktopic=2 where boardid="&boardid&" and announceid="&replyid
conn.Execute(sql)
sql="select Max(dateandtime) from "&TotalUseTable&" where boardid="&boardid&" and rootid="&id&" and  locktopic<2"
set rs=conn.Execute(sql)
LastPostime=rs(0)

isLastPost

call LastCount(boardid)
call BoardNumSub(boardid,0,1,todaynum)

call AllboardNumSub(todaynum,1,0)

sql="update topic set child=child-1,LastPostTime='"&LastPostime&"' where boardid="&boardid&" and topicid="&id
conn.execute(sql)
	
sql="insert into log (l_announceid,l_boardid,l_touser,l_username,l_content,l_ip) values ("&id&","&boardid&",'"&topicusername&"','"&membername&"','删除帖子《"&topic&"》,"&content& ","&allmsg&"','"&ip&"')"
conn.execute(sql)
if allmsg<>"" then
	conn.execute("update [user] set userWealth=userWealth+"&doWealth&",userCP=userCP+"&douserCP&",userEP=userEP+"&douserEP&",article=article-1,userDel=userDel-1 where userid="&topicuserid)
end if
sucmsg="删除帖子《"&topic&"》,"&content& ","&allmsg&""
if request("ismsg")="1" then
	msgcontent="您发表的帖子《[url=dispbbs.asp?boardid="&boardid&"&ID="&ID&"&replyID="&replyID&"&skin=1]"&topic&"[/url]》因"&replace(Content,"原因:","")&"而删除帖子,且进行了"&replace(allmsg,"用户操作:","")&"的操作"
	if request("msg")<>"" then
	msgContent=msgContent & chr(10) & "以下为操作者给您的附言:" & request("msg")
	end if
	conn.Execute("insert into message(incept,sender,title,content,sendtime,flag,issend) values('"&TopicUsername&"','"&membername&"','系统消息','"&checkSTR(msgContent)&"',Now(),0,1)")
end if
call dvbbs_suc()
end sub

sub delete()
Dim voteid,isvote
set rs=conn.execute("select title,postusername,postuserid,PollID,isvote from topic where topicid="&id)
if rs.eof and rs.bof then
	Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
	founderr=true
	exit sub
else
	topic=rs(0)
	topicusername=rs(1)
	topicuserid=rs(2)
	voteid=rs(3)
	isvote=rs(4)
	if topic="" then
		topic="本帖子为回复帖子"
	end if
end if
set rs=nothing

title=CheckStr(htmlencode(request.form("title")))
content=CheckStr(htmlencode(request.form("content")))
content="原因:" & title & content
if htmlencode(request.form("title"))="" and htmlencode(request.form("content"))="" then
	Errmsg=Errmsg+"<br><li>请写明操作原因。"
	founderr=true
	exit sub
end if
	
Dim todaynum,postnum
sql="select count(*) from "&TotalUseTable&" where rootid="&id
set rs=conn.execute(sql)
postNum=rs(0)
sql="select count(*) from "&TotalUseTable&" where rootid="&id&" and dateandtime>#"&date()&"#"
set rs=conn.execute(sql)
todayNum=rs(0)
		
if allmsg<>"" then
	sql="select postuserid from "&TotalUseTable&" where rootid="&id
	set rs=conn.execute(sql)
	do while not rs.eof
	conn.execute("update [user] set userWealth=userWealth+"&doWealth&",userCP=userCP+"&douserCP&",userEP=userEP+"&douserEP&",article=article-1,userDel=userDel-1 where userid="&rs(0))
	rs.movenext
	loop
end if
set rs=nothing
	
sql="update "&TotalUseTable&" set locktopic=2 where rootid="&id
conn.Execute(sql)
if isvote=1 then
	conn.execute("update topic set locktopic=2,isvote=0,VoteTotal=0 where topicid="&id)
	conn.execute("delete from vote where voteid="&voteid)
	conn.execute("delete from voteuser where voteid="&voteid)
else
	conn.execute("update topic set locktopic=2 where topicid="&id)
end if
	
call LastCount(boardid)
call BoardNumSub(boardid,1,postNum,todayNum)
call AllboardNumSub(todayNum,postNum,1)

sql="insert into log (l_announceid,l_boardid,l_touser,l_username,l_content,l_ip) values ("&id&","&boardid&",'"&topicusername&"','"&membername&"','删除主题《"&topic&"》,"&content& ","&allmsg&"','"&ip&"')"
conn.execute(sql)
sucmsg="删除主题《"&topic&"》,"&content& ","&allmsg&""
if request("ismsg")="1" then
	msgcontent="您发表的帖子《[url=dispbbs.asp?boardid="&boardid&"&ID="&ID&"]"&topic&"[/url]》因"&replace(Content,"原因:","")&"而被删除,且进行了"&replace(allmsg,"用户操作:","")&"的操作"
	if request("msg")<>"" then
	msgContent=msgContent & chr(10) & "以下为操作者给您的附言:" & request("msg")
	end if
	conn.Execute("insert into message(incept,sender,title,content,sendtime,flag,issend) values('"&TopicUsername&"','"&membername&"','系统消息','"&checkSTR(msgContent)&"',Now(),0,1)")
end if
call dvbbs_suc()
end sub

sub Tmove()
Dim reBoard_Setting
title=CheckStr(htmlencode(request.form("title")))
content=CheckStr(htmlencode(request.form("content")))
content="原因:" & title & content
if htmlencode(request.form("title"))="" and htmlencode(request.form("content"))="" then
	Errmsg=Errmsg+"<br><li>请写明操作原因。"
	founderr=true
	exit sub
end if
Dim newboardid,newParentID,nrs
Dim newtopic
set rs=server.createobject("adodb.recordset")
if request("checked")="yes" then
	if request("boardid")=request("newboardid") then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>不能在相同版面内进行转移操作。"
		exit sub
	elseif not isInteger(request("newboardid")) then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"
		exit sub
	else
		newboardid=request("newboardid")
	end if

	'目标论坛和其上级论坛ID
	set rs=conn.execute("select ParentStr,Board_Setting from board where boardid="&newboardid)
	UpdateBoardID_1=rs(0) & "," & newboardid
	reBoard_Setting=split(rs(1),",")
	if Cint(reBoard_Setting(43))=1 then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>本论坛作为分类论坛不允许转移。"
		exit sub
	end if
	sql="select * from topic where boardid="&boardid&" and topicid="&id
	set rs=conn.execute(sql)
	if rs.eof and rs.bof then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>您选择的贴子并不存在。"
		exit sub
	else
		if request.form("isdispmove")="yes" then
			newtopic=CheckStr(request.form("topic")) & "-->" & membername & "转移"
		else
			newtopic=CheckStr(request.form("topic"))
		end if
		if request("leavemessage")="yes" then
			sql="insert into topic (Title,Boardid,PostUsername,PostUserid,DateAndTime,Expression,LastPost,LastPostTime,child,hits,isvote,isbest,votetotal,PostTable) values ('"&newtopic&"',"&newboardid&",'"&rs("postusername")&"',"&rs("postuserid")&",'"&rs("dateandtime")&"','"&rs("Expression")&"','"&rs("LastPost")&"','"&rs("LastPosttime")&"',"&rs("child")&","&rs("hits")&","&rs("isvote")&","&rs("isbest")&","&rs("votetotal")&",'"&NowUseBBS&"')"
			conn.execute(sql)
		end if
	end if
	
	if request("leavemessage")="yes" then
		conn.execute("update topic set locktopic=1 where topicid="&id)
		set rs=conn.execute("select top 1 topicid from topic order by topicid desc")
		newparentid=rs(0)
		sql="select * from "&TotalUseTable&" where rootid="&id&" and locktopic<2 order by Announceid"
		set rs=conn.execute(sql)
		do while not rs.eof
			Sql="insert into "&NowUseBBS&"(Boardid,ParentID,username,topic,body,DateAndTime,length,rootid,layer,orders,ip,Expression,locktopic,signflag,emailflag,isbest,postuserid) values "&_
				"("&_
				newboardid&","&rs("parentid")&",'"&_
				rs("username")&"','"&_
				rs("topic")&"','"&_
				checkstr(rs("body"))&"','"&_
				rs("DateAndTime")&"','"&_
				rs("length")&"',"&newParentID&","&rs("layer")&","&rs("orders")&",'"&rs("ip")&"','"&_
				rs("Expression")&"',"&rs("locktopic")&","&rs("signflag")&","&rs("emailflag")&","&rs("isbest")&","&rs("postuserid")&")"
				'response.write sql
				conn.execute(sql)
		rs.movenext
		loop
		
	elseif request("leavemessage")="no" then
		if request.form("isdispmove")="yes" then
			newtopic=CheckStr(request.form("topic")) & "-->" & membername & "转移"
		else
			newtopic=CheckStr(request.form("topic"))
		end if
		conn.execute("update topic set title='"&newtopic&"',boardid="&newboardid&" where topicid="&id)
		sql="update "&TotalUseTable&" set topic='"&newtopic&"' where announceid="&replyid
		conn.execute(sql)
		sql="update "&TotalUseTable&" set boardid="&newboardid&" where rootid="&id
		conn.Execute(sql)							
	else
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>请选择相应操作。"
		exit sub
	end if
	Dim postNum,todayNum
	'计算该帖子的回复数量,用来统计对应版面帖子数
	sql="select count(*) from "&TotalUseTable&" where rootid="&id
	set rs=conn.execute(sql)
	postNum=rs(0)
	'计算该帖子中今日回复的数量
	sql="select count(*) from "&TotalUseTable&" where rootid="&id&" and dateandtime>=#"&date()&"#"
	set rs=conn.execute(sql)
	todayNum=rs(0)
	set rs=nothing
	'更新论坛贴子数据
	call LastCount(boardid)
	call BoardNumSub(boardid,1,postNum,todayNum)
	UpdateBoardID=UpdateBoardID_1
	call LastCount(newboardid)
	call BoardNumAdd(newboardid,1,postNum,todayNum)
	'更新论坛数据结束
	sql="insert into log (l_announceid,l_boardid,l_touser,l_username,l_content,l_ip) values ("&id&","&boardid&",'"&topicusername&"','"&membername&"','转移主题《"&topic&"》,"&content& ","&allmsg&"','"&ip&"')"
	conn.execute(sql)
	sucmsg="转移主题《"&topic&"》,"&content& ","&allmsg&""

	if request("ismsg")="1" then
	msgcontent="您发表的帖子《<a href=dispbbs.asp?boardid="&newboardid&"&ID="&ID&" target=_blank>"&topic&"</a>》因"&replace(Content,"原因:","")&"而被转移,且进行了"&replace(allmsg,"用户操作:","")&"的操作"
	if request("msg")<>"" then
	msgContent=msgContent & chr(10) & "以下为操作者给您的附言:" & request("msg")
	end if
	conn.Execute("insert into message(incept,sender,title,content,sendtime,flag,issend) values('"&TopicUsername&"','"&membername&"','系统消息','"&checkSTR(msgContent)&"',Now(),0,1)")
	end if
	call dvbbs_suc()
else
%>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
                        <tr>
                        <th valign=middle colspan=2>
                        <form action="admin_postings.asp" method="post">
                        <input type=hidden name="action" value="move">
                        <input type=hidden name="checked" value="yes">
                        <input type=hidden name="boardid" value="<%=request("boardid")%>">
                        <input type=hidden name="replyid" value="<%=request("replyid")%>">
                        <input type=hidden name="id" value="<%=request("id")%>">
						<input type=hidden value="<%=CheckStr(htmlencode(request.form("title")))%>" name="title">
						<input type=hidden value="<%=CheckStr(htmlencode(request.form("content")))%>" name="content">
						<input type=hidden value="<%=doWealth%>" name="doWealth">
						<input type=hidden value="<%=dousercp%>" name="dousercp">
						<input type=hidden value="<%=douserep%>" name="douserep">
<input type=hidden value="<%=request.form("msg")%>" name="msg">
<input type=hidden value="<%=request.form("ismsg")%>" name="ismsg">
                        移动主题</th></tr>

                                    <tr>
                                    <td class=tablebody1 valign=middle>
                                    <b>移动选项</td>
                                    <td class=tablebody1 valign=middle>
                                    <input name="leavemessage" type="radio" value="yes"> 移动并保留一个已经锁定的主题在原论坛<br>
									<input name="leavemessage" type="radio" value="no" checked> 移动并将此主题从原论坛中删除<br>
									<input name="isdispmove" type="checkbox" value="yes"> 移动后的主题是否显示操作者名称
                                    </td>
                                    </tr>
                                    <tr>
                                    <td class=tablebody1 valign=middle>
                                    <b>帖子主题</td>
                                    <td class=tablebody1 valign=middle>
   <input name="topic" value="<%=topic%>" size=50>
                                    </td>
                                    </tr>
                            <tr>
                        <td class=tablebody1 valign=top><b>移动到:</b></td>
                        <td class=tablebody1 valign=top>
<%
response.write "<select name=newboardid size=1><option selected>移动帖子请选择</option>"
set rs=conn.execute("select boardid,boardtype,depth,Board_Setting from board order by rootid,orders")
do while not rs.EOF
reBoard_Setting=split(rs(3),",")
response.write "<option value="""&rs(0)&""" "
response.write ">"

select case rs(2)
case 0
response.write "╋"
case 1
response.write "&nbsp;&nbsp;├"
case 2
response.write "&nbsp;&nbsp;│&nbsp;&nbsp;├"
case 3
response.write "&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;├"
case 4
response.write "&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;├"
case 5
response.write "&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;├"
case 6
response.write "&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;│&nbsp;&nbsp;├"
case 7

⌨️ 快捷键说明

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