📄 bbs_admin.asp
字号:
<!--#include file="../conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="UserPost_Const.asp"-->
<!--#include file="BtBBS_Fun.asp"-->
<%
filename=Request.QueryString ("filename")
cz=Request.QueryString ("cz")
if cz="" or filename="" or request.Cookies("username")="" or Request.Cookies("login")<>"Y" or instr(1,Application(BBSname&"Online"),Request.Cookies("username"))<1 or Request.Cookies("bbsgl")="reguser" then
Response.Write "<br><br><br>你尚未登陆,或者你没有这个权限,或者其它参数有误!<br><br><br><br>"
else
Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT top 1 * FROM BT_Topic WHERE FileName='"&filename&"' "
rs.open sql,conn,1,3
if rs.BOF and rs.EOF then
Response.Write "没有找到这个文件"
else
boardname=rs("BoardName")
select case cz
case 1
rs("IsBest")="Y"
rs.Update
Response.Write "已经设置为精华"
Application.Lock
Application(BBSname&"Bs")=Application(BBSname&"Bs")+1
Application(BBSname&"indexjh")=""
Application.UnLock
case 2
rs("IsBest")=""
rs.Update
Response.Write "已经解除精华"
Application.Lock
Application(BBSname&"Bs")=Application(BBSname&"Bs")+1
Application(BBSname&"indexjh")=""
Application.UnLock
case 3
rs("IsTop")=1
rs.Update
Response.Write "已经固顶"
Application.Lock
Application(BBSname&"Bs")=Application(BBSname&"Bs")+1
Application.UnLock
case 4
rs("IsTop")=0
rs.Update
Response.Write "已经解除固顶"
Application.Lock
Application(BBSname&"Bs")=Application(BBSname&"Bs")+1
Application.UnLock
case 5
rs("IsTop")=2
rs.Update
Response.Write "已经设为总固顶"
Application.Lock
Application(BBSname&"Bs")=Application(BBSname&"Bs")+1
Application.UnLock
case 6
rs("IsTop")=0
rs.Update
Response.Write "已经解除总固顶"
Application.Lock
Application(BBSname&"Bs")=Application(BBSname&"Bs")+1
Application.UnLock
case 7
DIM myFile
pathfilename="bbs"+cstr(rs("BoardID"))+"/"+filename myFile = Server.MapPath(pathfilename) SET fileStreamObj = CreateObject("Scripting.FileSystemObject") fileStreamObj.DeleteFile (myFile)
set fileStreamObj=nothing
'下面一句,删除投票项目中的选项,如果是投票主题的话
if rs("PollID")<>"file" and rs("PollID")<>"" then conn.Execute ("delete * FROM 投票项目 where id="&rs("PollID")&" or 主题ID="&rs("PollID")&" ") end if '---------结束------
'下面语句减去发贴用户的积分等------------------------------
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1="SELECT top 1 * FROM 用户资料 WHERE 用户名='"&rs("PostUser")&"' "
rs1.open sql1,conn,1,3
if not (rs1.BOF and rs1.EOF) then
rs1("主题数")=rs1("主题数")-1
rs1("积分")=rs1("积分")-userjf_dz
rs1("经验")=rs1("经验")-userjy_dz
rs1("声望")=rs1("声望")-usersw_dz
rs1("金钱")=rs1("金钱")-usermoney_dz
rs1.Update
end if
rs1.Close
set rs1=nothing
'----------------------------
BoardID=rs("BoardID")
BoardName=rs("BoardName")
PostNum=rs("PostNum")
rs.Delete '删除主题
rs.Update
rs.close
'下面语句计算最后的帖子
Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT ID,BoardID,LastPostTime FROM BT_Topic where BoardID="&BoardID&" ORDER BY LastPostTime desc "
rs.open sql,conn,1,1
if not(rs.BOF and rs.EOF) then
lastpostid=rs("ID")
else
lastpostid=""
end if
rs.close
'下面语句,减去版面分类中的主题总数和回复总数
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1="SELECT top 1 * FROM 版面分类 WHERE ID="&BoardID&" "
rs1.open sql1,conn,1,3
if not (rs1.BOF and rs1.EOF) then
rs1("主题总数")=rs1("主题总数")-1
rs1("回复总数")=rs1("回复总数")-PostNum
if lastpostid<>"" then rs1("版面最后发帖")=lastpostid end if
rs1.Update
end if
rs1.Close
set rs1=nothing
'-------------------------------------------
Application.Lock
Application(BBSname&boardname+"bs")=Application(BBSname&boardname+"bs")+1
Application(BBSname&"index")=""
Application(BBSname&boardname)=""
Application(BBSname&"indexnew")=""
Application(BBSname&"indexjh")=""
Application(BBSname&"indexhot")=""
Application(BBSname&"indexgginfo")=""
Application.UnLock
Set rs=conn.execute("select id,所属分类ID,所属分类,版面名称,版面状态,访问控制,版面介绍,版主,主题总数,回复总数,版面标记图片,版面最后发帖,认证论坛用户 from 版面分类 ")
if not (rs.bof and rs.eof) then Application(BBSname&"BT_Board")=rs.GetRows(-1) end if
Response.Write "文章已经被删除"
case 8
Response.Write "<form name=jlf method=post action=bbs_adminsave.asp?cz=1&user="&rs("PostUser")&">"
Response.Write "<center><table border=0 width=400 cellspacing=0 cellpadding=0 align=center class=table1><tr height=27><td class=tbhead align=center>奖励类型</td><td class=tbhead align=center>分值操作</td><td class=tbhead align=center>操作理由</td></tr>"
Response.Write "<tr height=35><td class=light> <SELECT name=jl><option value=1>积分</option><option value=2>经验</option><option value=3>声望</option><option value=4>金钱</option></select></td>"
Response.Write "<td class=light align=center><SELECT name=fc><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option></select></td>"
Response.Write "<td class=light><input type=text size=45 name=qu></td></tr>"
Response.Write "<tr height=35><td colspan=3 align=center class=light><input type=Submit name=sub value=确定 class=login></td></tr>"
Response.Write "</table></center></form>"
case 9
Response.Write "<form name=jlf2 method=post action=bbs_adminsave.asp?cz=2&user="&rs("PostUser")&">"
Response.Write "<center><table border=0 width=400 cellspacing=0 cellpadding=0 align=center class=table1><tr height=35><td class=tbhead align=center>惩罚类型</td><td class=tbhead align=center>分值操作</td><td class=tbhead align=center>操作理由</td></tr>"
Response.Write "<tr height=35><td class=light> <SELECT name=jl><option value=1>积分</option><option value=2>经验</option><option value=3>声望</option><option value=4>金钱</option></select></td>"
Response.Write "<td class=light align=center><SELECT name=fc><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option></select></td>"
Response.Write "<td class=light><input type=text size=45 name=qu></td></tr>"
Response.Write "<tr height=35><td colspan=3 align=center class=light><input type=Submit name=sub value=确定 class=login></td></tr>"
Response.Write "</table></center></form>"
case 10
rs("by2")="Y"
rs.Update
Response.Write "已经设为公告"
Application(BBSname&"gg")=""
Application(BBSname&"indexgginfo")=""
case 11
rs("by2")=" "
rs.Update
Response.Write "已经解除公告"
Application(BBSname&"gg")=""
Application(BBSname&"indexgginfo")=""
case 12
Response.Write "<form name=zt method=post action=bbs_admin.asp?cz=13&filename="&rs("FileName")&">"
Response.Write "<center><table border=0 width=400 cellspacing=0 cellpadding=0 align=center class=table1><tr height=35><td class=light align=center>选择所属专题</td><td class=light align=center>"
Response.Write "<SELECT name=SpecialID><option value=0>不属于任何专题</option>"
Set rsx = Server.CreateObject("ADODB.Recordset")
sqlx="SELECT ID,Special FROM Special "
rsx.open sqlx,conn,1,1
if rsx.BOF and rsx.EOF then
Response.Write "没有任何记录"
else
rsx.MoveLast
while not rsx.BOF
Response.Write "<option value="&rsx("ID")&">"&rsx("Special")&"</option>"
rsx.MovePrevious
wend
end if
rsx.Close
set rsx=nothing
Response.Write "</select></td><td colspan=3 align=center class=light><input type=Submit name=sub value=确定 class=login></td></tr>"
Response.Write "</table></center></form>"
case 13
SpecialID=Request.Form("SpecialID")
if specialID<>"" then
rs("SpecialID")=SpecialID
rs.update
Response.Write "设置成功,所属专题号:"&specialid
else
Response.Write "参数有误"
end if
case 14
Response.Write "<form name=move method=post action=bbs_admin.asp?cz=15&filename="&filename&">"
Response.Write "<center><table border=0 width=400 cellspacing=0 cellpadding=0 align=center class=table1><tr height=35><td class=tbhead align=center>移动到</td></tr>"
Response.Write "<tr height=35><td class=light> <SELECT name=moveto>"
aRS=Application(BBSname&"BT_Board")
If Not(aRS(1,0)=-1 Or VarType(aRS)=0) Then
For j=0 to UBound(aRS,2)
Response.Write "<option value="&cstr(aRS(0,j))&">"&aRS(3,j)&"</option>"
Next
End if
Response.Write "</select></td></tr>"
Response.Write "<tr height=35><td colspan=3 align=center class=light><input type=Submit name=sub value=确定 class=login></td></tr>"
Response.Write "</table></center></form>"
case 15 moveto=Request.Form("moveto") '移动文件
pathfilename="bbs"+cstr(rs("BoardID"))+"/"+filename myFile = Server.MapPath(pathfilename)
movetofile=server.MapPath("bbs"&moveto)+"\" SET fileStreamObj = CreateObject("Scripting.FileSystemObject")
fileStreamObj.MoveFile myFile,movetofile
aRS=Application(BBSname&"BT_Board") '修改数据库内容
If Not(aRS(1,0)=-1 Or VarType(aRS)=0) Then
For j=0 to UBound(aRS,2)
If aRS(0,j)=cint(Request.Form("moveto")) Then
BoardID=rs("BoardID")
rs("BoardName")=aRS(3,j)
rs("BoardID")=aRS(0,j)
rs.update
BoardName2=aRS(3,j)
Response.Write "移动成功"
End If
Next
Else
Response.Write "找不到任何版面"
End if
Const ForReading = 1 Const Forwriting = 2
Const ForAppending = 8
myFile=movetofile+filename
SET fileStreamObj = CreateObject("Scripting.FileSystemObject") '修改文件中的内容 SET textStream = fileStreamObj.OpenTextFile(myFile,ForReading,False) fString = textStream.ReadAll() fstring1="<a href=../dislist.asp?boardid="&cstr(BoardID)&"><font class=NavColor>"&BoardName&"</font></a>" fstring2="<a href=../dislist.asp?boardid="&moveto&"><font class=NavColor>"&BoardName2&"</font></a>"
fString = replace(fString, fstring1,fstring2)
SET fileStreamObj = CreateObject("Scripting.FileSystemObject") '保存修改文件中的内容 SET textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False) textStream.Write(fString)
set textStream=nothing
set fileStreamObj=nothing
Application.Lock '重置缓存
Application(BBSname&boardname+"bs")=Application(BBSname&boardname+"bs")+1
Application(BBSname&boardname2+"bs")=Application(BBSname&boardname2+"bs")+1
Application(BBSname&"index")=""
Application(BBSname&boardname)=""
Application(BBSname&boardname2)=""
Application(BBSname&"gg")=""
Application(BBSname&"gg_FT")=""
Application.UnLock
end select
end if
rs.Close
set rs=nothing
conn.close
set conn=nothing
end if
%>
<head>
<link rel="stylesheet" type="text/css" href="../css/style1.css">
</head>
<body>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -