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

📄 admin_postings.asp

📁 JSP ACCESS版的论坛源码 深圳盈盈通
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %><!--#include file="conn.asp"--><!-- #include file="inc/const.asp" --><!--#include file="inc/char.asp"--><title><%=ForumName%>--管理页面</title><link rel="stylesheet" type="text/css" href="forum.css"><BODY bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="20"><!--#include file="chkmanage.asp"--><%	if founderr=true then		call Error()	else	set rs=server.createobject("adodb.recordset")	if request("action")="lock" then		call lock()	elseif request("action")="unlock" then		call unlock()	elseif request("action")="delete" then		call delete()	elseif request("action")="move" then		call move()	elseif request("action")="copy" then		call copy()	elseif request("action")="istop" then		call istop()	elseif request("action")="notop" then		call notop()	elseif request("action")="dele" then		call dele()	elseif request("action")="isbest" then		call isbest()	elseif request("action")="nobest" then		call nobest()	else		founderr=true		Errmsg=Errmsg+"<br>"+"<li>请选择相应操作。"	end if	if founderr=true then		call error()	end if	set rs=nothing	conn.close	set conn=nothing	sub lock()	sql="update bbs1 set locktopic=1 where boardid="&boardid&" and rootid="&cstr(rootid)	conn.Execute(sql)	call success()	end sub	sub unlock()	sql="update bbs1 set locktopic=0 where boardid="&boardid&" and rootid="&cstr(rootid)	conn.Execute(sql)	call success()	end sub	sub istop()	sql="update bbs1 set istop=1 where boardid="&boardid&" and rootid="&cstr(rootid)	conn.Execute(sql)	call success()	end sub	sub notop()	sql="update bbs1 set istop=0 where boardid="&boardid&" and rootid="&cstr(rootid)	conn.Execute(sql)	call success()	end sub	sub isbest()	sql="update bbs1 set isbest=1 where boardid="&boardid&" and announceid="&cstr(id)	conn.Execute(sql)	call success()	end sub	sub nobest()	sql="update bbs1 set isbest=0 where boardid="&boardid&" and announceid="&cstr(id)	conn.Execute(sql)	call success()	end sub	sub dele()	dim NewAnnounceNum,lastpostime	sql="delete from bbs1 where boardid="&boardid&" and ParentID<>0 and announceid="&cstr(id)	conn.Execute(sql)	sql="select count(announceid) from bbs1 where boardid="&boardid	set rs=conn.Execute(sql)	NewAnnounceNum=rs(0)	sql="select Max(announceid) from bbs1 where rootid="&rootid&" and boardid="&boardid	set rs=conn.Execute(sql)	LastPostime=rs(0)	sql="update board set lastbbsnum="&NewAnnounceNum&" where boardid="&boardid	conn.execute(sql)	sql="update bbs1 set times="&LastPostime&" where rootid="&rootid&" and boardid="&boardid	conn.execute(sql)	sql="update bbs1 set child=child-1 where announceid="&rootid&" and boardid="&boardid	conn.execute(sql)	sql="update [user] set article=article-1,userWealth=userWealth-"&wealthDel&",userEP=userEP-"&epDel&" where username='"&request.querystring("username")&"'"	conn.execute (sql)	call success()	end sub	sub delete()	dim NewAnnounceNum,NewTopicNum	sql="delete from bbs1 where boardid="&boardid&" and rootid="&cstr(rootid)	conn.Execute(sql)	sql="select count(announceid) from bbs1 where boardid="&boardid	set rs=conn.Execute(sql)	NewAnnounceNum=rs(0)	sql="select count(announceid) from bbs1 where ParentID=0 and boardid="&boardid	set rs=conn.Execute(sql)	NewTopicNum=rs(0)	sql="update board set lastbbsnum="&NewAnnounceNum&",lasttopicnum="&NewTopicNum&" where boardid="&boardid	conn.execute(sql)	sql="update [user] set article=article-1,userWealth=userWealth-"&wealthDel&",userEP=userEP-"&epDel&" where username='"&request.querystring("username")&"'"	conn.execute (sql)	call success()	end sub	sub move()	dim newboardid	if request("checked")="yes" then		if request("boardid")=request("newboardid") then		founderr=true		Errmsg=Errmsg+"<br>"+"<li>不能在相同版面内进行转移操作。"		elseif not isInteger(request("newboardid")) then			founderr=true			Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"			exit sub		else			newboardid=request("newboardid")			sql="select boardid,announceid,Parentid from bbs1 where announceid="&id&" and boardid="&cstr(boardid)			rs.open sql,conn,1,1			if rs.eof and rs.bof then				founderr=true				Errmsg=Errmsg+"<br>"+"<li>您选择的贴子并不存在。"			else				if rs("Parentid")<>0 then				founderr=true				Errmsg=Errmsg+"<br>"+"<li>您必须选择一个主题,而不是贴子。"				end if			end if			rs.close		end if		if founderr=false then			if request("leavemessage")="yes" then				'ON ERROR RESUME NEXT			elseif request("leavemessage")="no" then				dim newtopic				sql="select topic from bbs1 where announceid="&rootid				set rs=conn.execute(sql)				newtopic=rs("topic") & "-->" & membername & "转移"				sql="update bbs1 set topic='"&newtopic&"' where announceid="&rootid				conn.execute(sql)				sql="update bbs1 set boardid="&newboardid&" where rootid="&rootid				conn.Execute(sql)'更新论坛贴子数据	dim NewAnnounceNum,NewTopicNum	sql="select count(announceid) from bbs1 where boardid="&boardid	set rs=conn.Execute(sql)	NewAnnounceNum=rs(0)	sql="select count(announceid) from bbs1 where ParentID=0 and boardid="&boardid	set rs=conn.Execute(sql)	NewTopicNum=rs(0)	sql="update board set lastbbsnum="&NewAnnounceNum&",lasttopicnum="&NewTopicNum&" where boardid="&boardid	conn.execute(sql)	dim MoveAnnounceNum,MoveTopicNum	sql="select count(announceid) from bbs1 where boardid="&newboardid	set rs=conn.Execute(sql)	MoveAnnounceNum=rs(0)	sql="select count(announceid) from bbs1 where ParentID=0 and boardid="&newboardid	set rs=conn.Execute(sql)	MoveTopicNum=rs(0)	sql="update board set lastbbsnum="&MoveAnnounceNum&",lasttopicnum="&MoveTopicNum&" where boardid="&newboardid	conn.execute(sql)'更新论坛数据结束				call success()			else				founderr=true				Errmsg=Errmsg+"<br>"+"<li>请选择相应操作。"			end if		end if	else%>            <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTablebackcolor%> align=center>                <tr>                    <td>                    <table cellpadding=6 cellspacing=1 border=0 width=100%>                        <tr>                        <td bgcolor=<%=aTabletitlecolor%> valign=middle align=center 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="rootid" value="<%=request("rootid")%>">                        <input type=hidden name="id" value="<%=request("id")%>">                        <b>移动主题</b></td></tr>                                    <tr>                                    <td bgcolor=<%=Tablebodycolor%> valign=middle>                                    <b>移动选项</td>                                    <td bgcolor=<%=Tablebodycolor%> valign=middle>                                    <!--<input name="leavemessage" type="radio" value="yes"> 移动并保留一个已经锁定的主题在原论坛<br>--><input name="leavemessage" type="radio" value="no" checked> 移动并将此主题从原论坛中删除                                    </td>                                    </tr>                            <tr>                        <td bgcolor=<%=Tablebodycolor%> valign=top><b>移动到:</b></td>                        <td bgcolor=<%=Tablebodycolor%> valign=top><%   sql="select boardid,boardtype from board"   rs.open sql,conn,1,1%><select name="newboardid" size="1"><option value="">选择一个论坛</option><%	do while not rs.eof        response.write "<option value='"+CStr(rs("BoardID"))+"'>"+rs("Boardtype")+"</option>"+chr(13)+chr(10)	rs.movenext	loop	rs.close%>                  </select>			</td>                        </tr>                    <tr>                <td bgcolor=<%=aTabletitlecolor%> valign=middle colspan=2 align=center><input type=submit name="submit" value="提 交"></td></tr></form></table></td></tr></table>            </table>            </td></tr>            </table><%	end if	end sub	sub copy()	dim newboardid	if request("checked")="yes" then		if request("boardid")=request("newboardid") then		founderr=true		Errmsg=Errmsg+"<br>"+"<li>不能在相同版面内进行转移操作。"		elseif not isInteger(request("newboardid")) then			founderr=true			Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"			exit sub		else			newboardid=request("newboardid")			sql="select boardid,announceid,Parentid from bbs1 where announceid="&id&" and boardid="&cstr(boardid)			rs.open sql,conn,1,1			if rs.eof and rs.bof then				founderr=true				Errmsg=Errmsg+"<br>"+"<li>您选择的贴子并不存在。"			end if			rs.close		end if		if founderr=false then			'ON ERROR RESUME NEXT			dim newtopic,username,body,dateandtime,length,ip,Expression			dim announceid			sql="select * from bbs1 where announceid="&id			set rs=conn.execute(sql)			newtopic=rs("topic") & "-->" & membername & "添加"			username=rs("username")			body=rs("body")			DateAndTime=rs("DateAndTime")			length=rs("length")			ip=rs("ip")			Expression=rs("Expression")			rs.close			sql="select * from bbs1"			rs.open sql,conn,1,3	     		rs.AddNew			rs("BoardID")=newboardID	     		rs("ParentID")=0         		rs("Child")=0	     		rs("UserName")=UserName	     		rs("Topic")=newTopic	     		rs("Body")=Body	     		rs("DateAndTime")=DateAndTime	     		rs("hits")=0	     		rs("length")=length	     		rs("rootID")=0	     		rs("layer")=1	     		rs("orders")=0         		rs("ip")=ip         		rs("Expression")=Expression         		rs("locktopic")=0         		rs("signflag")=0         		rs("emailflag")=0	     		rs.Update			rs.MoveLast         		announceid=rs("AnnounceID")         		rs("RootID")= announceid	     		rs("Times")= announceid	     		rs.Update 	    		rs.close'更新论坛贴子数据	sql="update board set lastbbsnum=lastbbsnum+1,lasttopicnum=lasttopicnum+1,lastpostuser='"&username&"',lastposttime='"&DateAndTime&"' where boardid="&newboardid	conn.execute(sql)'更新论坛数据结束			call success()		end if	else%>            <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTablebackcolor%> align=center>                <tr>                    <td>                    <table cellpadding=6 cellspacing=1 border=0 width=100%>                        <tr>                        <td bgcolor=<%=aTabletitlecolor%> valign=middle align=center colspan=2>                        <form action="admin_postings.asp" method="post">                        <input type=hidden name="action" value="copy">                        <input type=hidden name="checked" value="yes">                        <input type=hidden name="boardid" value="<%=request("boardid")%>">                        <input type=hidden name="rootid" value="<%=request("rootid")%>">                        <input type=hidden name="id" value="<%=request("id")%>">                        <b>复制贴子</b></td></tr>                                    <tr>                                    <td bgcolor=<%=Tablebodycolor%> valign=middle>                                    <b>操作说明</td>                                    <td bgcolor=<%=Tablebodycolor%> valign=middle>贴子将复制到别的论坛,成为新的贴子,并保留在原来论坛                                    </td>                                    </tr>                            <tr>                        <td bgcolor=<%=Tablebodycolor%> valign=top><b>移动到:</b></td>                        <td bgcolor=<%=Tablebodycolor%> valign=top><%   sql="select boardid,boardtype from board"   rs.open sql,conn,1,1%><select name="newboardid" size="1"><option value="">选择一个论坛</option><%	do while not rs.eof        response.write "<option value='"+CStr(rs("BoardID"))+"'>"+rs("Boardtype")+"</option>"+chr(13)+chr(10)	rs.movenext	loop	rs.close%>                  </select>			</td>                        </tr>                    <tr>                <td bgcolor=<%=aTabletitlecolor%> valign=middle colspan=2 align=center><input type=submit name="submit" value="提 交"></td></tr></form></table></td></tr></table>            </table>            </td></tr>            </table><%	end if	end subsub success()%>    <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTablebackcolor%> align=center>        <tr>            <td>                <table cellpadding=3 cellspacing=1 border=0 width=100%>    <tr align="center">       <td width="100%" bgcolor=<%=aTabletitlecolor%>>成功:贴子操作</td>    </tr>    <tr>       <td width="100%" bgcolor=<%=Tablebodycolor%>><li><b>贴子操作成功</b><br>      </td>    </tr>    <tr align="center">       <td width="100%" bgcolor=<%=aTabletitlecolor%>><a href="list.asp?boardid=<%=request("boardid")%>"> << 返回论坛</a>      </td>    </tr>      </table>   </td></tr></table><%end subend if%></body>

⌨️ 快捷键说明

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