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

<%call head()
dim bbsid,ID
bbsid=trim(request.QueryString("bbsid"))
id=trim(request.QueryString("id"))
if id="" or Isnumeric(id)=false then
ID=1
end if
if bbsid="" or Isnumeric(bbsid)=false then
  Call Error("<card title='出错了'><p>ID无效！")
end if
'检查有几条新留言
dim newguest
newguest = 0
IF myid > 0 THEN
  newguest = ForNewGuest(myid)
END IF
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select name,shuo,id,did,hyin,vicexs,oopp from ydbbs where id="&bbsid,conn,1,1
if rs.eof then
  Call Error("<card title='出错了'><p>无此论坛！")
end if
rs.close
set rs=nothing
Call saycardd("滚动公告")


if myid<>0 then
if newguest > 0 then
Response.write "<br/><img src='/bbs/xi.gif' alt='.' /><a href='/bbs/msgview.asp?url=" & Replace(Replace(R_url(), "sid=", "o="), "sid=", "o=") & "&amp;saytk="&saytk&"&amp;sid="&sid&"'>您有(" & newguest & ")条新消息</a><br/>" & Chr(13)
end if
end if

   Response.write "本版滚动列表<br/>"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "select * from sell where yc=0 and bbsid="&bbsid&" and topsell=1 order by retime desc",conn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=listnum					
	Dim Count,page,pagecount,gopage			
	gopage="bbstoday.asp?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))
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
response.write ""&i+(page-1)*PageSize&"."
response.write "<a href='topic.asp?tid="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
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 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
response.write "<br/><a href=""board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回本版</a>"%>
<!--#include file="fanhui.asp"-->
<%call headsay()%>