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

urlu=Replace(R_url(),"&","@@")
urlr=request.QueryString("url")
If urll="" Then 
url=urlu
Else
url=urlr

End if

dim rs1,username
Call saycarda("查看新消息")

Response.write "====消息盒子====<br/>"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest where book=0 and sdel=0 and sid="&myid&" order by ftm desc",conn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="msgview.asp?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	
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select name,id from Users where id="&rs("fid"),conn,1,1
if rs1.eof then
username="系统消息"
else
username=rs1("name")
end if
rs1.close
set rs1=nothing
Response.write ""&i+(page-1)*PageSize&"."
if rs("fzt")=0 then 
Response.write "<img src=""/bbs/xi.gif"" alt=""新""/>"
End If

Response.write ""&ubb(username)&":"&Left(ubb(rs("fnr")),10)&""
Response.write "<a href=""msginview.asp?id="&rs("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;url="&url&""">[查看]</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/>"&page&"/"&pagecount&"页,共"&Count&"条<br/>"
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
Response.write "==============<br/>"
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.write "<a href=""mymsg.asp?sid="&sid&"&amp;saytk="&saytk&""">我的信箱</a>"%>
<!--#include file="fanhui.asp"-->
<%call head1()%>