<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: album.asp
' Version:3.0
' Date: 2005-9-24
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
dim userfold
response.buffer=true
stats="相册中心"
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有<a href=login.asp>登陆</a>，不能浏览相册。如果您还没有<a href=reg.asp>注册</a>！"
	Founderr=true
end if
call nav()
if founderr then
	call head_var("","")
	call Mslove_error()
else
	call head_var("交友相册","")
call tumppages()'翻页处理
strFileName="album.asp?action="&Request("action")&"&id="&Request("id")&"&username="&userfold&"&Readpass="&Trim(Request("Readpass"))&""
Select Case Trim(Request("action"))
		Case "al_list"''创建目录
			Call al_list()
		Case "showpass"''密码输入框
			Call showpass()	
		case else
			call main()
		End Select
if founderr then call Mslove_error()
end if
call activeonline()
call footer()

sub main()
userfold=checkStr(Request("username"))
if userfold="" or strLength(request("userfold"))>20 then
		errmsg=errmsg+"<br>"+"<li>参数错误。"
		founderr=true
end if%>
  <table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
    <tr align="left"> 
      <th width="60%" height="28"  class=tablebody1><%=userfold%> 的相册</th>
    </tr>
<tr align="center"> 
      <td height="147"  class=tablebody1> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <%dim iu
	  set rs=server.createobject("adodb.recordset")
		  sql="select Phototype,id,Isphoto,Allpic from Ms_Uphtype where Username='"&trim(userfold)&"' and IsShell<>1 order by Orders ,id"
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
iu=0
call rspages()%>
          <tr> 
            <%do while not rs.eof and page_count<Cint(MaxPerPage)
		  iu=iu+1
		  %>
            <td height="164" align="center"> <table border="0" cellpadding="0" cellspacing="0" class=tableborder2 style="width:140">
                <tr> 
                  <td height="127" align=center><%if rs(2)<>"" then
				  response.Write("<img src="&rs(2)&" border=0 height=120 width=130>")
				  else
				  response.Write("<img src=images/nophoto_up.gif>")
				  end if%></td>
                </tr>
                <tr> 
                  <td height="25" align="center"><a href=?action=al_list&id=<%=rs(1)%>&username=<%=userfold%>><%=rs(0)%></a>&nbsp;<font color="#666666">(<%=rs(3)%>)</font></td>
                </tr>
              </table></td>
            <%if iu>0 and iu mod 5=0 then
  response.Write("</tr><tr>")
  end if
  page_count=page_count+1
  rs.movenext
  loop
  else
  response.write("<td height=""30"" colspan=""5"" align=""center""  class=tablebody1>"&stats&"无相册目录！</td>")
  end if
  rs.close
  %>
          </tr>
        </table></td>
    </tr>
    <tr align="center"> 
      <td width="100%" height="12" align="left"  class=tablebody1><%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%></td>
    </tr>
  </table>
<%
end sub

sub al_list()''浏览相册
dim id,IsShell,Readpass,Userpass
id=Checkstr(Trim(Request("id")))
if id="" or not isnumeric(id) then
  	errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
	exit sub
else
id=clng(id)
end if
sql="select IsShell,Readpass,username from Ms_Uphtype where id="&id&""
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
IsShell=rs(0)
Readpass=rs(1)
Userpass=rs(2)
end if
rs.close
if IsShell=1 and Userpass<>trim(membername) then
  	errmsg=errmsg+"<br>"+"<li>对不起，该目录为私有目录。"
	founderr=true
	exit sub
end if
if IsShell=2 and Readpass<>Trim(Request("Readpass")) then
Response.Redirect "album.asp?action=showpass&id="&id&""
end if
%>
 <table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
    <tr align="left"> 
      
    <th width="60%" height="28" align="center"  class=tablebody1>用户相册</th>
    </tr>
<tr align="center"> 
      <td height="147"  class=tablebody1> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <%dim iu,Checked
	  set rs=server.createobject("adodb.recordset")
		  sql="select Viewname,Fid,Hits,Readme,Checked from Ms_Upphoto where FTypes="&id&" and Ispublic=1 order by Orders ,fid"
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
iu=0
call rspages()%>
          <tr> 
            <%do while not rs.eof and page_count<Cint(MaxPerPage)
		  iu=iu+1
		  Checked=rs(4)
		  %>
            <td height="164" align="center"> <table border="0" cellpadding="0" cellspacing="0" class=tableborder2 style="width:140">
                <tr> 
                  <td height="127" align=center><%if rs(0)<>"" and Checked=1 then
				  response.Write("<a href=showphoto.asp?Fid="&rs(1)&" target=_blank Title=点击查看图片><img src="&rs(0)&" border=0 height=120 width=130></a>")
				  else
				  response.Write("图片未上传或未审核")
				  end if%></td>
                </tr>
                <tr> 
                  <td height="25" align="center"><%=left(rs(3),8)%>&nbsp;<font color="#666666">(<%=rs(2)%>)</font></td>
                </tr>
              </table></td>
            <%if iu>0 and iu mod 5=0 then
  response.Write("</tr><tr>")
  end if
  page_count=page_count+1
  rs.movenext
  loop
  else
  response.write("<td height=""30"" colspan=""5"" align=""center""  class=tablebody1>无相册记录！</td>")
  end if
  rs.close
  %>
          </tr>
        </table></td>
    </tr>
    <tr align="center"> 
      <td width="100%" height="12" align="left"  class=tablebody1><%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%></td>
    </tr>
  </table>
<%end sub

sub showpass()''输入密码框
dim id
id=Checkstr(Trim(Request("id")))
if id="" or not isnumeric(id) then
  	errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
	exit sub
else
id=clng(id)
end if
%>
<table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
  <form action="?action=al_list" method=POST name="theForm">
    <tr> 
      <th height="28" colspan="2" align="center"  class=tablebody1>请输入正确密码</th>
    </tr>
    <tr> <input name="id" type="hidden" id="id" value=<%=id%>>
      <td width="24%" align="right"  class=tablebody2>密码： </td>
      <td width="76%"  class=tablebody2><input name="Readpass" type="text" id="Readpass" size="20" maxlength="20">
      </td>
    </tr>
    <tr align="center"> 
      <td colspan="2"  class=tablebody1> 
        <input type="submit" name="Submit" value="确定">
      </td>
    </tr>
  </form>
</table>
<%end sub
%>   
</body>
</html> 