<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%
call head()
%>
<%dim ids,tid,TP

tid=request("tid")
ids=request("ids")
TP=request("TP")
if TP="" or Isnumeric(TP)=False then TP=1
TP=clng(TP)
if TP=1 then

if ids<>"" and clng(ids)<>myid then
if ids="" or Isnumeric(ids)=False then
if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>ID无效！")
else
  Call Error("<card title=""出错""><p>会员ID无效！")
  end if
end if
'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>会员ID不存在！")
else
  Call Error("<card title=""出错""><p>会员ID不存在！")
end if
end if
  rs.close
  set rs=Nothing
call saycardd("TA的贴子")
else
ids=myid
call saycardd("我的贴子")

end if
else

if ids<>"" and clng(ids)<>myid then
if ids="" or Isnumeric(ids)=False then
  Call Error("会员ID无效！")
  end if
  call saycardd("TA的参与贴")
else
ids=myid

call saycardd("我的参与贴")
end if
end if

set rs=Server.CreateObject("ADODB.Recordset")

if TP=1 then
rs.open"select * from sell where fid="&ids&" and yc=0 order by  num,retime desc",conn,1,1
else
rs.open"select * from sell where yc=0 and id in (SELECT tid from relist where fid= "&ids&") order by num,retime desc",conn,1,1
end if

If Not rs.eof	Then
	Dim PageSize,i
	PageSize=10				
	Dim Count,page,pagecount,gopage			
	gopage="alist.asp?tid="&tid&"&amp;ids="&ids&"&amp;TP="&TP&"&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	
if TP=1 then
response.write "[<a href='topicdel.asp?action=tid&amp;ids="&rs("id")&"&amp;id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>删</a>]"
end if
response.write ""&i+(page-1)*PageSize&"."
response.write "<a href='/bbs/topic.asp?tid="&rs("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"
response.write ubb(rs("name"))&"</a><br/>"
rs.moveNext
 	Next
	'response.write "<br/>"&chr(13)
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下一页</a>"&chr(13)
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上一页</a>"&chr(13)

response.write "<br/>["&page&"/"&pagecount&"页 "&count&"贴]<br/>"

	if pagecount>1 and saytk=1 then response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""2""/><a href="""&gopage&"page=$(page)"">跳到该页</a><br/>"
Else
response.write "暂时没有贴子！<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing

if ids<>"" and clng(ids)<>myid then
if TP=1 then
response.write "<a href=""alist.asp?tid="&tid&"&amp;ids="&ids&"&amp;TP=2&amp;sid="&sid&"&amp;saytk="&saytk&""">[TA的参与贴]</a>"
else
response.write "<a href=""alist.asp?tid="&tid&"&amp;ids="&ids&"&amp;TP=1&amp;sid="&sid&"&amp;saytk="&saytk&""">[TA的贴子]</a>"
end if
else
if TP=1 then
response.write "<a href=""alist.asp?tid="&tid&"&amp;ids="&ids&"&amp;TP=2&amp;sid="&sid&"&amp;saytk="&saytk&""">[我的参与贴]</a>"
else
response.write "<a href=""alist.asp?tid="&tid&"&amp;ids="&ids&"&amp;TP=1&amp;sid="&sid&"&amp;saytk="&saytk&""">[我的贴子]</a>"
end if

end if
if tid<>"" then
response.write "<br/><a href=""topic.asp?tid="&tid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">[返回上级]</a>"
end if
response.write"<br/><a href='show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>用户信息</a>"%>
<!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
