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

<%
call head()

dim ids,uid,tid
ids=request.querystring("ids")
if ids="" or Isnumeric(ids)=False then
ids=myid
end if

tid=request.querystring("tid")
if ids<>"" and clng(ids)<>myid then
'检查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
  Call Error("<card title=""出错""><p>会员ID不存在！")
end if
  rs.close
  set rs=Nothing
uid=ids
Call saycardd("TA的相册")

else
uid=myid
Call saycardd("我的相册")
end if
if clng(ids)=myid or clng(uid)=myid then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from upfile where Fid="&uid&" and smallstr=1 order by id desc",conn,1,1
else
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from upfile where Fid="&uid&" and smallstr=1 and photoview=0 order by id desc",conn,1,1
end if
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=5						
	Dim Count,page,pagecount,gopage			
	gopage="myphoto.asp?ids="&uid&"&amp;tid="&tid&"&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))					
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
response.write("<img src='" & rs("files") & "'   width='65' height='60' alt='.'/><br/>")

response.write""&i+(page-1)*PageSize&"."

if rs("photoContent")<>"" then
response.write"<a href='photoview.asp?id=" & rs("id") & "&amp;ids="&ids&"&amp;TP=1&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(ubb(rs("photoContent")),15)&"</a>"
else
response.write"<a href='photoview.asp?id=" & rs("id") & "&amp;ids="&ids&"&amp;TP=1&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(ubb(rs("filesname")),15)&"</a>"
end if
response.write"<br/><a href='uinfo.asp?id="&ubb(rs("fid"))&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>" & rs("username") & "</a>"
dim photoCount
	photoCount=conn.execute("Select count(ID) from [photopl] where photoid="&rs("id")&"")(0)	
response.write"(评"&photoCount&"/阅"&rs("fileCount")&")"
response.write"<br/>"
rs.moveNext
 	Next
	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
if myid<>0 then
mz="[url=/bbs/uinfo.asp?id="&myid&"&amp;saytk="&saytk&"&sid=[sid]]"&myni&"[/url]"
else
mz="游客"
end if
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&"浏览了(url=/bbs/myphoto.asp?saytk="&saytk&"&sid=[sid])个人相册(/url)')")
rs.close
set rs=nothing
conn.close
set conn=nothing
   Response.write "---------<br/>"
if clng(ids)=myid or clng(uid)=myid then
response.write"<a href='photofile.asp?saytk="&saytk&"&amp;sid="&sid&"'>上传相片</a>"
end if
if tid<>"" then
response.write"<br/><a href='topic.asp?tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>返回上级</a>"
end if
response.write"<br/><a href='photo.asp?saytk="&saytk&"&amp;sid="&sid&"'>社区相册</a>"
%><!--#include file="fanhui.asp"-->
<%call headsay()%>