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


<%
call head()
Call saycarda("转移帖子")
dim bbsid,tid,newid
bbsid=request("bbsid")
tid=request("tid")
newid=request("newid")
if bbsid="" or IsNumeric(bbsid)=False then
  Call Error("ID无效！")
 end if
if tid="" or IsNumeric(tid)=False then
  Call Error("ID无效！")
  end if
if keys=1 or skey=abs(bbsid) or adminzone=abs(bbsid) or keys=2 then
else
  Call Error("权限不足！")
end if

if request("Action")="ok" then

if newid="" or IsNumeric(newid)=False then
  Call Error("论坛ID无效！")
end if

dim sellname
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select bbsid,name from sell where yc=0 and  id="&tid,conn,1,2
if rs.eof then
  Call Error("帖子不存在！")
  end if
rs("bbsid")=newid
rs.update
sellname=rs("name")
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&")将帖子["&sellname&"]从论坛ID"&bbsid&"转移到论坛ID"&newid&""
rs.update
rs.close
set rs=nothing
response.write "帖子转移成功！<br/>"
response.write "<a href=""board.asp?bbsid="&newid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">进入所在论坛</a>"
else
dim bbsname
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select name from ydbbs where id="&bbsid,conn,1,1
if rs.eof then
rs.close
set rs=nothing

  end if
bbsname=rs("name")
rs.close
set rs=nothing
response.write "帖子现在所在的论坛为["&bbsname&"]<br/>"
response.write "请选择要转移到的版块<br/>"
call xlanlj("bbsmove.asp?saytk="&saytk&"&amp;sid="&sid&"")
response.write "<select name='newid'><option value='转移帖子'>=选择版块=</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name,pid from ydbbs where lx=1 order by pid asc",conn,1,1
dim j
j=1
do while not rs.eof
 dim names
names=rs("name")
if len(names)>8 then names=left(names,8)
Response.write "<option value="""&rs("id")&""">"&ubb(names)&"</option>"
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
Response.write "</select><br/>"
if saytk>1 then
call xltjlj("tid",""&tid&"")
call xltjlj("bbsid",""&bbsid&"")
call xltjlj("action","ok")
call xlanlj1("确定转移")
else
response.write "<br/><anchor>确定转移<go href=""bbsmove.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"">"
response.write "<postfield name=""newid"" value=""$(newid)""/>"
response.write "<postfield name=""tid"" value="""&tid&"""/>"
response.write "<postfield name=""bbsid"" value="""&bbsid&"""/>"
response.write "<postfield name=""Action"" value=""ok""/>"
response.write "</go></anchor>"
end if
end if
response.write "<br/><a href=""board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回本版</a>"%>
<!--#include file="fanhui.asp"-->
<%call headsay()%>