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

<%call head()
dim bbsid
bbsid=trim(request.QueryString("bbsid"))
if bbsid="" or Isnumeric(bbsid)=false then
  Call Error("<card title='出错了'><p>ID无效！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select name,shuo,id,prentID,hyin,vicexs,oopp,myjbin,myjyin from ydbbs where id="&bbsid,conn,1,1
if rs.eof then
  Call Error("<card title='出错了'><p>无此论坛！")
end if
dim namebbs,vicexs,hyin,shuo,prentID,oopp,myjbin,myjyin
namebbs=rs("name")
shuo=rs("shuo")
prentID=rs("prentID")
hyin=rs("hyin")
vicexs=rs("vicexs")
oopp=rs("oopp")
myjbin=rs("myjbin")
myjyin=rs("myjyin")
rs.close
set rs=nothing

if oopp=1 and keys<>1 then
browsers=Lcase(Left(Request.ServerVariables("HTTP_USER_AGENT"),4))
if browsers="oper"  or  browsers="winw"  or  browsers="wapi" or browsers="mc21" or browsers="up.b" or browsers="upg1" or browsers="upsi" or browsers="qwap" or browsers="jigs" or browsers="java" or browsers="alca" or browsers="wapj" or browsers="cdr/" or browsers="nec-" or browsers="fetc" or browsers="r380" or browsers="winw" or browsers="mozi" or browsers="mozi" or browsers="m3ga" then   Call Error("<card title='出错了'><p>请用手机访问！")
end if
if myjbin<>0 then
if clng(myjb)<myjbin then 
  Call Error("<card title='出错了'><p>"&getcent&"不足"&myjbin&"不能浏览本版！")
end if
end if
if myjyin<>0 then
if clng(myjy)<myjyin then 
  Call Error("<card title='出错了'><p>经验不足"&myjyin&"不能浏览本版！")
end if
end if
if hyin=2 and keys<>1 and skey=0 then 
  Call Error("<card title='出错了'><p>只限版主进入！")
end if
if hyin=1 and myid=0 then 
  Call Error("<card title='出错了'><p>只限会员进入！")
end if

Call saycarda("本版精华")
if myid<>0 then%><!--#INCLUDE file="newguest.asp"-->
<%'else
'response.write"您尚未<a href='login.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"'>登陆/注册</a><br/>"
end if
response.write "<a href=""writetext.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">发帖</a>"&chr(13)
response.write "<a href=""bbs_vip.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">版务</a>"&chr(13)
response.write "<a href=""board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">全部</a>"&chr(13)
response.write "<a href=""logview.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">日志</a><br/>"&chr(13)
'response.write "<br/>----------<br/>"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from sell where yc=0 and bbsid="&bbsid&" and jj=1 order by retime desc",conn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=listnum					
	Dim Count,page,pagecount,gopage			
	gopage="elist.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"&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))
	if page-pagecount<0 then 
response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"&chr(13)
        end if
	if page>1 then 
response.write "<a href="""&gopage&"page=1"">首页</a>"&chr(13)
        end if
	if page-pagecount<0 or page>1 then response.write "<br/>"
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
response.write ""&i+(page-1)*PageSize&"."
response.write("[精]")
        dim nowtx
        if rs("fs")=1 then
        nowtx="综合"
        elseif rs("fs")=2 then 
        nowtx="经验"
        elseif rs("fs")=3 then 
        nowtx="分享"
        elseif rs("fs")=4 then
        nowtx="提问"
        else 
        nowtx="综合"
        end if
response.write "<a href='topic.asp?tid="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
dim reCount
reCount=conn.execute("Select count(ID) from [relist] where tid="&rs("id"))(0)
response.write ubb(rs("name"))&"</a><br/>["
response.write ubb(rs("fname"))&"/"&nowtx&"/"&ubb(rs("rc"))&"/"
if reCount<=0 then
response.write reCount
else
response.write "<a href=""relist.asp?tid="&rs("id")&"&amp;bbsid="&rs("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount&"</a>"
end if
response.write"]<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&"贴"
	if pagecount>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>"

response.write "<br/>"
Else
response.write "暂时没有精华！<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<br/><a href="board.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;bbsid=<%=bbsid%>">返回本版</a>
<!--#include file="fanhui.asp"-->
<%Call headsay()%>