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

📄 admin_postings.asp

📁 应用于高等院校党团思想教育
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>

<!-- #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">
<%
	if session("masterlogin")="" then
		Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=elogin.asp>登陆管理</a>后进入。"
		call Error()
	else
%>
<!--#include file="conn.asp"-->
<%
	dim founderr
	dim errmsg
	dim sql,rs
	dim sql1,rs1,sql2
	dim id,boardid,rootid
	dim Maxid
	founderr=false
	errmsg=""
	if session("masterlogin")="superadmin" then
		if request("boardid")="" then
			founderr=true
			Errmsg=Errmsg+"<br>"+"<li>请指定论坛版面。"
		elseif not isInteger(request("boardid")) then
			founderr=true
			Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"
		else
			boardid=request("boardid")
		end if
	else
		boardid=session("manageboard")
	end if
	if request("id")="" then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
	elseif not isInteger(request("id")) then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
	else
		id=request("id")
	end if
	if request("rootid")="" then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
	elseif not isInteger(request("rootid")) then
		founderr=true
		Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
	else
		rootid=request("rootid")
	end if
	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()
	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 delete()
	dim username
	sql="select username,announceid from bbs1 where boardid="&boardid&" and rootid="&cstr(rootid)
	rs.open sql,conn,1,1
	do while not rs.eof
	username=rs("username")
	sql1="delete from bbs1 where announceid="&rs("announceid")
	conn.Execute(sql1)
	sql2="update [user] set article=article-1 where username='"&username&"'"
	conn.Execute(sql2)
	rs.movenext
	loop
	rs.close
	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
				sql="update bbs1 set boardid="&newboardid&" where rootid="&rootid
				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 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="admin_bbs.asp?boardid=<%=request("boardid")%>"> << 返回论坛管理</a>
      </td>
    </tr>  
    </table>   </td></tr></table>
<%
end sub
end if
%>

</body>

⌨️ 快捷键说明

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