<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/function.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/Conn_User.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=SiteName%> >>> 相册</title>
<link href="img0415/css.CSS" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	color: #FF6600;
	font-weight: bold;
}
.STYLE2 {
	color: #993300;
	font-weight: bold;
}
-->
</style>

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp"-->
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="5" bgcolor="f2f2f2"></td>
    <td width="1" bgcolor="cccccc"></td>
    <td width="888" align="center" bgcolor="#FFFFFF"><table width="870" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td valign="top">
<table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table>
            <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="1" height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                      <td colspan="2" bgcolor="#CCCCCC"></td>
                      <td width="1"></td>
                    </tr>
                    <tr> 
                      <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                      <td width="150" height="30" bgcolor="f2f2f2">&nbsp;&nbsp;&nbsp;<span class="STYLE2"><font color="#FF6600" style='FONT-SIZE: 12px'>&raquo;&nbsp;相册列表</font></span>&nbsp;<font color="#999999" style='FONT-SIZE: 10px'>Photo 
                        List</font> </td>
                      <td align="right" bgcolor="f2f2f2"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <form action="photo_search.asp" method="post" name="myform">
                            <td width="28" align="center"><img src="img0415/search.gif" width="15" height="16"></td>
                            <td width="210"><input name="keywords" type="text" class="input2" size="35"></td>
                            <td width="70"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                                </tr>
                              </table>
                                <input name="imageField2" type="image" src="img0415/search2.gif" width="56" height="19" border="0">
                            </td>
                            <td><strong><font color="#FF6600">热门:</font></strong></td>
                          </form>
                        </tr>
                      </table></td>
                      <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                    <tr> 
                      <td align="right" bgcolor="#FFFFFF" > <table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="9"><img src="img0415/space.gif"></td>
                          </tr>
                        </table>
                        <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="9">
                              <table width="626" height="8"  border="0" align="right" cellpadding="0" cellspacing="0">
                                <tr> 
                                  <td> 
                                    <%
myPagesize=20
set rs=server.createobject("adodb.recordset")
rs.open "select * from photo order by photoid desc",conn,1,1
call myPages(rs,myPagesize)
%>
                                    <table border="0" cellpadding="0" cellspacing="0">
                                      <tr> 
                                        <%line=myPagesize
dim i
i=1
do while not rs.eof and line>0
%>
                                        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="f2f2f2">
                                            <tr> 
                                              <td width="1" height="1"></td>
                                              <td height="1" bgcolor="#BCBCBC"></td>
                                              <td width="1" height="1"></td>
                                            </tr>
                                            <tr> 
                                              <td bgcolor="bcbcbc"></td>
                                              <td height="22" align="center"><strong><font color="#ff6600"><font color="#ff6600"><%=left (rs("PhotoName"),6)%></font></font></strong></td>
                                              <td bgcolor="#BCBCBC"></td>
                                            </tr>
                                          </table>
                                          <table width="115" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr> 
                                              <td width="1" height="1" bgcolor="#BCBCBC"></td>
                                              <td height="1" background="user/li_x_02.gif"></td>
                                              <td width="1" height="1" bgcolor="#BCBCBC"></td>
                                            </tr>
                                            <tr> 
                                              <td bgcolor="#BCBCBC"></td>
                                              <td height="28" align="left" bgcolor="#FFFFFF"><table width="100%" height="10"  border="0" cellpadding="4" cellspacing="0" bgcolor="#bcbcbc">
                                                  <tr> 
                                                    <td bgcolor="#FFFFFF"> 
                                                      <%if rs("photourl")<>"" then%>
                                                      <table  border="0" align="center" cellpadding="0" cellspacing="5" >
                                                        <tr> 
                                                          <td width="70" height="70" align="center" style="{background-image: URL(<%=rs("PhotoUrl_Thumbsm")%>);
background-position: center; 
background-repeat: no-repeat; 
background-attachment: fixed;}" ><a href=photo_show.asp?photoid=<%=rs("photoID")%> target="_blank"><img src="img0415/sp.gif" width="77" height="77" border="0"></a><a href=photo_show.asp?photoid=<%=rs("photoID")%> target="_blank"></a></td>
                                                        </tr>
                                                      </table>
                                                      <%else
  end if%>
                                                    </td>
                                                  </tr>
                                                </table></td>
                                              <td bgcolor="#BCBCBC"></td>
                                            </tr>
                                            <tr> 
                                              <td width="1" height="1" bgcolor="#BCBCBC"></td>
                                              <td height="1" background="user/li_x_02.gif"></td>
                                              <td width="1" height="1" bgcolor="#BCBCBC"></td>
                                            </tr>
                                          </table>
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr> 
                                              <td bgcolor="#BCBCBC"></td>
                                              <td height="25" align="left" bgcolor="#fafafa"><table width="97%" align="right" cellpadding="2" cellspacing="0">
                                                  <tr> 
                                                    <td align="left"> 
                                                      <%
set rsf=server.createobject("adodb.recordset")
rsf.open "select * from [user] where username='"&rs("editor")&"' order by userid desc",conn_user,1,1 
%>
                                                      <font style='FONT-SIZE: 11px' color='#666666'><img src="img0415/b1.gif">&nbsp;<a href=user.asp?userid=<%=rsf("userid")%> target="_blank"><%=rs("editor")%></a></font></td>
                                                  </tr>
                                                </table></td>
                                              <td bgcolor="#BCBCBC"></td>
                                            </tr>
                                            <tr> 
                                              <td width="1" height="1"></td>
                                              <td height="1" bgcolor="#BCBCBC"><img src="" width="10" height="1" border="0"></td>
                                              <td width="1" height="1"></td>
                                            </tr>
                                          </table>
                                          <table width="100%" height="10"  border="0" cellpadding="0" cellspacing="0">
                                            <tr> 
                                              <td></td>
                                            </tr>
                                          </table></td>
                                        <td width="8"><img src="img0415/space.gif" width="10" height="10" alt=""></td>
                                        <%if i mod 5=0 then%>
                                      </tr>
                                      <%else%>
                                      <%end if%>
                                      <%rs.movenext
   line=line-1
   i=i+1
loop
  %>
                                    </table>
                                    <%rsc.close
set rsc=nothing
rsuser.close
set rsuser=nothing%>
                                  </td>
                                </tr>
                              </table>
                              <%sub listpages(mycondition)
	response.write "<table height=22  border=0 cellpadding=0 cellspacing=0><Tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	if pages<1 then
		exit sub
	end if
	
	
	if p>0 then
		response.write	"<a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=10&p="&p-1&mycondition&"><img src=user/prepre.gif alt=前十页 border=0></a>&nbsp;&nbsp;&nbsp;"
    else
	response.write	"<img src=user/prepre.gif alt=前十页 border=0>&nbsp;&nbsp;&nbsp;"
    end if
	'-------------------下面写出当前十个页码
	response.write "</td><td><img src=user/lined.gif border=0><img src=user/k.gif border=0 width=5>"
	for i=1 to 10
		if (p*10+i)>pages then exit for
		if currentpage=i then
		
			response.write "<b><a style='color:ff6600'"
		else
			response.write "<a"
		end if 
		response.write " href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage="&i&"&p="&p&mycondition&"><font class=no >"&(p*10+i)&"</font></a></b>&nbsp;&nbsp;<img src=user/lined.gif border=0><img src=user/k.gif width=5 border=0>"	
     next
	 response.write "</td><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	 '--------------------察看下十页的连接
    if (p*10+10)<pages then
		response.write "<img src=user/k.gif border=0><a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=1&p="&p+1&mycondition&"><img src=user/nextnext.gif alt=后十页 border=0></a>&nbsp;&nbsp;" 
		else
		response.write "<img src=user/k.gif border=0><img src=user/nextnext.gif alt=后十页 border=0>&nbsp;&nbsp;"
	end if
	'-----------------------------------------------上下页导航
	response.write "&nbsp;</td>"
	

	  response.write "</tr></table>"
end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
	if myRS.eof and myRS.bof then str="没有纪录"
	if str="" then
		if mysize="" or NOT IsNumeric(mysize) then
			mysize=15
		end if
		myRS.PageSize=mysize
		pages=myRS.pagecount
		records=myRS.recordcount
		On Error Resume Next '取得数字
		currentPage=request("currentPage")
		if currentPage="" then
			currentPage=1
		end if
		currentPage=CInt(currentPage)
		if Err.Number <> 0 Then
			currentPage=1
			Err.Clear
		end if
		if currentPage<1 then
			currentPage=1
		elseIf currentPage>10 then
			currentPage=10
		end if
		'----------------处理p
		p=request("p")
		if p="" then
			p=0
		end if
		p=CLng(p)
		if Err.Number <> 0 Then
			p=0
			Err.Clear
		end if
		if p<0 then
			p=0
		end if
		'--判断是否出了页数范围
		nowPage=p*10+currentPage
		if nowPage>pages then
			p=(pages-1)\10
			currentPage=((pages-1) mod 10)+1
		end if
		myRS.absolutepage=p*10+currentPage
	else
	   currentPage=1
	   records=0
	   pages=1
	end if
end sub

dim pages,records,currentPage,p '--------定义变量，这些变量在主页面中，进行地址传递%>
                            </td>
                          </tr>
                        </table>
                        
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                <td height="26" align="center" bgcolor="f2f2f2">
                  <%call listpages(mycondition)%>
                </td>
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
              </tr>
              <tr> 
                <td width="1" height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                <td bgcolor="#CCCCCC"></td>
                <td width="1"></td>
              </tr>
            </table>
            <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table>
            </td>
          <td width="10"></td>
          <td width="220" valign="top" bgcolor="fafafa" class="line1"> <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table>
            <table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td><img src="img0415/logintop.gif" width="200" height="7" /></td>
              </tr>
              <tr> 
                <td background="img0415/loginbg.gif" bgcolor="#FFFFFF"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="25"><span class="STYLE1">&raquo;&nbsp;热门相册</span>&nbsp;&nbsp;<font color="#999999" style='FONT-SIZE: 9px'>Hot 
                        Photo </font> </td>
                    </tr>
                    <tr> 
                      <td height="1" background="img0415/linef.gif"></td>
                    </tr>
                  </table>
                  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="5">
                    <%
set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from [photo]  order by hits desc",conn,1,1 
%>
                    <tr> 
                      <%

						i=1
do while not rs.eof
%>
                      <td height="22" bgcolor="fafafa"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="20" align="center"><img src="img0415/d<%=i%>.gif"></td>
                            <td><a href="photo_show.asp?photoid=<%=rs("photoid")%>" target="_blank"><%=left(replace(rs("photoname"),"&nbsp;",""),8)%><%
				  if len(rs("photoname"))>8 then
				   response.Write"..."
				   else 
				   end if%></a> <font color="#FF6600" style="font-size:10" ><%=rs("hits")%></font></td>
                            <td align="right"> 

                              <font style='FONT-SIZE: 10px' color='#999999'><%=month(rs("updatetime"))%>.<%=day(rs("updatetime"))%>&nbsp;</font></td>
                          </tr>
                        </table></td>
                    </tr>
                    <%
						i=i+1
						if i>10 then exit do
						rs.movenext
						loop
						rs.close
						set rs=nothing%>
                  </table></td>
              </tr>
              <tr> 
                <td><img src="img0415/loginend.gif" width="200" height="8" /></td>
              </tr>
            </table>
            <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table></td>
        </tr>
      </table> </td>
    <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"><img src="img0415/space.gif"></td>
    <td width="5" bgcolor="f2f2f2"></td>
  </tr>
</table>
<!--#include file="end.asp"-->
</body>
</html>
