<!--#include file="Inc.asp"-->
<!--#include file="ydzq1.asp"-->
<%'============================================================
' Copyright 2007-09 燃点真情. All Rights Reserved.
' Last Update: 2008-3-22  13:28
' ADD:wap.nowtx.cn
' E-Mail: xivn@163.com  QQ:531233814
'============================================================
%>
<%

call head()

Dim p,gettxt,yd
TP=trim(request.querystring("TP"))
if TP="" or Isnumeric(TP)= false then TP=0
TP=clng(TP)
if TP=1 then 
gettxt="order by id desc"
yd="最新上传"
elseif TP=2 then 
gettxt="order by id desc"
yd="所有相片"
elseif TP=3 then 
gettxt="order by fileCount desc"
yd="人气相片"
elseif TP=4 then 
gettxt="order by photoCount desc"
yd="评论最多"
else
gettxt="order by id asc"
yd="所有相片"
end if
%><card id="main" title="<%=yd%>">
<p><%
set rs=Server.CreateObject("ADODB.Recordset")
if TP=1 then 
rs.open"select top 100 * from upfile where smallstr=1 and photoview=0 "&gettxt&"",conn,1,1
else
rs.open"select * from upfile where smallstr=1 and photoview=0 "&gettxt&"",conn,1,1
end  if
If Not rs.eof Then
	Dim PageSize,i
	PageSize=5					
	Dim Count,page,pagecount,gopage			
	gopage="photohot.asp?TP="&TP&"&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("smallfiles") & "' 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>"
Else
response.write"暂时没有记录！"
end if
rs.close
set rs=nothing
conn.close
set conn=Nothing
   Response.write "<br/>---------<br/>"
   Response.write "<a href=""photolist.asp?saytk="&saytk&"&amp;sid="&sid&""">社区相册</a>"
   Response.write "<br/><a href=""show.asp?saytk="&saytk&"&amp;sid="&sid&""">我的空间</a>"
   Response.write "<br/><a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">社区首页</a>"
   Response.write "</p></card></wml>"
%>