<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%
call head()
%>

<%Call saycarda("贴子管理")
dim ids,gettxt,bbsid
bbsid=request("bbsid")
ids=request("ids")
if ids<>"" then
if ids="" or Isnumeric(ids)=False then
  Call Error("ID无效！")
  end if
'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT name FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("会员ID不存在！")
end if
  rs.close
  set rs=Nothing

gettxt="where Fid="&ids
end if


if bbsid<>""  then
if bbsid="" or Isnumeric(bbsid)=False then
  Call Error("论坛ID无效！")
  end if

if gettxt<>"" then

gettxt=gettxt&"and bbsid="&bbsid
else
gettxt="where bbsid="&bbsid
end if

end if


response.write"<a href='admingsell.asp?TP=1&amp;bbsid="&bbsid&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>精华</a>|"
response.write"<a href='admingsell.asp?TP=2&amp;bbsid="&bbsid&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>置顶</a>|"
response.write"<a href='admingsell.asp?TP=3&amp;bbsid="&bbsid&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>固底</a>|"
response.write"<a href='admingsell.asp?TP=4&amp;bbsid="&bbsid&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>锁定</a><br/>"
response.write"----------<br/>"
dim TP
TP=trim(request.querystring("TP"))
if TP <>"" then
TP=abs(TP)
if TP=1 then

if gettxt<>"" then

gettxt=gettxt&"and jj=1"
else
gettxt="where jj=1"
end if
end if

if TP=2 then

if gettxt<>"" then

gettxt=gettxt&"and num=1"
else
gettxt="where num=1"
end if
end if

if TP=3 then

if gettxt<>"" then

gettxt=gettxt&"and num=20"
else
gettxt="where num=20"
end if
end if

if TP=4 then

if gettxt<>"" then

gettxt=gettxt&"and st=1"
else
gettxt="where st=1"
end if
end if

end if

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from sell "&gettxt&" order by id desc",conn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="admingsell.asp?bbsid="&bbsid&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
	For i=1 To PageSize     						
	If rs.eof Then Exit For
response.write "[<a href='topicdel.asp?action=tid&amp;ids="&rs("id")&"&amp;id="&rs("Fid")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>删</a>]"
response.write ""&i+(page-1)*PageSize&"."
response.write "<a href='adminsellmo.asp?bbsid="&rs("bbsid")&"&amp;tid="&rs("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"
response.write ubb(rs("name"))&"</a><br/>"
	rs.moveNext
 	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页"
if saytk=1 then
response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a><br/>"
end if
Else
   Response.write "暂时没有贴子<br/>"
end if
rs.close
set rs=nothing
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""admingsell.asp?sid="&sid&"&amp;saytk="&saytk&""">"
Response.write "用户ID:(可空)<input name='ids' value='' size='5'/>"
response.write "<br/>选择版块"
response.write "<select name='bbsid' value='0'>"
response.write "<option value=''>全部版块</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name 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>"
response.write "<input type=""submit"" name=""Submit"" value=""搜索贴子""></form><br/>"
else
Response.write "用户ID:(可空)<input name='ids"&tt&"' value='' size='5'/>"
response.write "<br/>选择版块"
response.write "<select name='bbsid"&tt&"' value='0'>"
response.write "<option value=''>全部版块</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name from ydbbs where lx=1 order by pid asc",conn,1,1
j=1
do while not rs.eof
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>"
Response.write "<br/><anchor>搜索贴子"
Response.write "<go href=""admingsell.asp?sid="&sid&"&amp;saytk="&saytk&""" method=""post"" accept-charset=""utf-8"">"
Response.write "<postfield name=""ids"" value=""$(ids"&tt&")""/>"
Response.write "<postfield name=""bbsid"" value=""$(bbsid"&tt&")""/>"
Response.write "</go></anchor>"&chr(13)end if
conn.close
set conn=Nothing
response.write"<br/><a href=""admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&""">帖子处理</a>"&chr(13)
response.write"<br/><a href=""adminsell.asp?sid="&sid&"&amp;saytk="&saytk&""">帖子回收</a>"&chr(13)%>
<!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
