<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->

<%
call head()


dim tid,bbsid,info
bbsid=request.QueryString("bbsid")
tid=request.QueryString("tid")

if tid="" or Isnumeric(tid)=false then
  Call Error("<card title='出错了'><p>ID无效！")
end if
if bbsid="" or Isnumeric(bbsid)=false then
  Call Error("<card title='出错了'><p>ID无效！")
end if

if keys=1 or skey=abs(bbsid) or adminzone=abs(bbsid) or keys=2 then
else
  Call Error("<card title='出错了'><p>权限不足！")
end if

info=request.querystring("info")

if info<>"j" and info<>"d" and info<>"g" and info<>"s" and info<>"l" and info<>"z" then
  Call Error("<card title='出错了'><p>非法操作！")
end if

Select Case info
	Case "j"   '加精解精
		Call j()
	Case "d"  '置顶解顶
		Call d()
	Case "g"    '固底解固
		Call g()
	Case "s"   '锁定解锁
		Call s()
	Case "l"   '滚动解滚
		Call l()
	Case "z"   '取消专题
		Call z()
end select 

Sub j()
dim rs1
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from sell where id="&tid,conn,1,2
if rs1.eof then
  Call Error("<card title='出错了'><p>帖子不存在！")
end if
if rs1("jj")=0 then
rs1("jj")=1
'加币
conn.Execute("update Users set myjb=myjb+"&clng(upjjb)&" Where id="&rs1("fid"))
'发信
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest",conn,1,2
rs.addnew
rs("fnr")="您的帖子["&rs1("name")&"]被版主["&myni&"(ID:"&myid&")]加为精华，系统奖励您"&clng(upjjb)&getcent&""
rs("sid")=rs1("fid")
rs("fid")=0
rs.update
rs.close
set rs=nothing
'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]加为精华"
rs.update
rs.close
set rs=nothing
Call saycardd("成功设置")




response.write "成功将帖子加为精华！"
ELSE
rs1("jj")=0
'减币
conn.Execute("update Users set myjb=myjb-"&clng(downjjb)&" Where id="&rs1("fid"))

'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]解除精华"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")


response.write "成功将帖子解除精华！"
END IF
rs1.update
rs1.close
set rs1=nothing
end sub
'-------------------------------
Sub d()
dim rs1
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from sell where id="&tid,conn,1,2
if rs1.eof then
  Call Error("<card title='出错了'><p>帖子不存在！")
end if
if rs1("num")=10 or rs1("num")= 20 then
rs1("num")=1
'加币
conn.Execute("update Users set myjb=myjb+"&clng(updjb)&" Where id="&rs1("fid"))
'发信
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest",conn,1,2
rs.addnew
rs("fnr")="您的帖子["&rs1("name")&"]被版主["&myni&"(ID:"&myid&")]置顶，系统奖励您"&clng(updjb)&getcent&""
rs("sid")=rs1("fid")
rs("fid")=0
rs.update
rs.close
set rs=nothing
'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]置顶"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")


response.write "成功将帖子置顶！"
ELSE
rs1("num")=10

'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]去顶"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子去顶！"
END IF
rs1.update
rs1.close
set rs1=nothing
end sub
'--------------------------------
Sub g()
dim rs1
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from sell where id="&tid,conn,1,2
if rs1.eof then
  Call Error("<card title='出错了'><p>帖子不存在！")
end if
if rs1("num")= 10 or rs1("num")= 1 then
rs1("num")=20
'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]设为固底"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子设为固底！"
ELSE
rs1("num")=10

'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]去掉固底"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子去掉固底！"
END IF
rs1.update
rs1.close
set rs1=nothing
end sub
'----------------------
Sub s()
dim rs1,act,stxt
act=request("act")
stxt=request("stxt")

set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from sell where id="&tid,conn,1,2
if rs1.eof then
  Call Error("<card title='出错了'><p>帖子不存在！")
end if

if rs1("st")= 0 then
if act="" Then
Call saycardd("成功设置")

 
if saytk=>2 then
Response.write "<form name=""form"" method=""post"" action=""bbscase.asp?info=s&amp;bbsid="&bbsid&"&amp;tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"
end If

 Response.Write "锁定理由：<br/>"
 Response.Write "<input name=""stxt"" value=""""/><br/>"

if saytk=>2 then
%>

<input type="hidden" name="act" value="ok">
<input type="submit" name="Submit" value="确定提交"></form><br/><%

else




 Response.Write "<anchor>确定提交"
 Response.Write "<go href=""bbscase.asp?info=s&amp;bbsid="&bbsid&"&amp;tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&""" method=""post"" accept-charset='utf-8'>"
 Response.Write "<postfield name=""stxt"" value=""$(stxt)""/>"
 Response.Write "<postfield name=""act"" value=""ok""/>"
 Response.Write "</go></anchor><br/>"
 end if
  Response.Write "<a href='topic.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;tid="&tid&"'>返回主贴</a>"
   Response.Write "<br/><a href='board.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;bbsid="&bbsid&"'>返回本版</a>"
Call headsay()
 Response.end
 end if
 if stxt="" then
   Call Error("<card title='出错了'><p>锁定理由不充分！")
end if
 if len(stxt)>30 then
   Call Error("<card title='出错了'><p>锁定理由不能多于30字！")
end if
rs1("sttxt")=stxt
rs1("sttime")=now()
rs1("stusid")=myid
rs1("st")=1
'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]锁定"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子锁定！"

ELSE
rs1("ST")=0

'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]解锁"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子解锁！"
END IF
rs1.update
rs1.close
set rs1=nothing
end sub
Sub l()
dim rs1
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from sell where id="&tid,conn,1,2
if rs1.eof then
  Call Error("<card title='出错了'><p>帖子不存在！")
end if
if rs1("topsell")=0 then
rs1("topsell")=1
'加币
conn.Execute("update Users set myjb=myjb+"&clng(upljb)&" Where id="&rs1("fid"))
'发信
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest",conn,1,2
rs.addnew
rs("fnr")="您的帖子["&rs1("name")&"]被版主["&myni&"(ID:"&myid&")]设为滚动显示,系统奖励您"&clng(upljb)&getcent&""
rs("sid")=rs1("fid")
rs("fid")=0
rs.update
rs.close
set rs=nothing
'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]设为滚动显示"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子设为滚动显示！"
ELSE
rs1("topsell")=0


'记录操作
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from [board]",conn,1,2
rs.addnew
rs("bbsid")=bbsid
rs("nr")="版主："&myni&"(id："&myid&")将帖子["&rs1("name")&"]解除滚动显示"
rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "成功将帖子解除滚动显示！"
END IF
rs1.update
rs1.close
set rs1=nothing
end sub

sub z()
dim newid
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select id,ztid from sell where bbsid="&bbsid&" and id="&tid,conn,1,2
if rs.eof then
  Call Error("<card title='出错了'><p>帖子不存在！")
end if
  newid=rs("ztid")
  rs("ztid")=0
  rs.update
rs.close
set rs=Nothing
Call saycardd("成功设置")
response.write "去掉专题成功！"
Response.write "<br/><a href=""ztlist.asp?id="&newid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回专题</a>"
end sub

conn.close
set conn=nothing%>
<br/><a href='board.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;bbsid=<%=bbsid%>&amp;page=1'>返回本版</a><!--#include file="fanhui.asp"-->
<%call headsay()%>