<!--#Include File="Connection.Asp"-->

<%
Dim JaZ,C,flyN,B,cur
Set JaZ = new q_zone
B = JaZ.JaKillStr(Request.QueryString("JaUid"))
If B="" Then
B= "2"
End If
C=Split(JaZ.GetHeadElement("*",B,"JaFaceSet",""),"<><><>")
flyN = split(Trim(C(2)),"|")
If Cint(Trim(C(1)))<>0 Then
cur = "CURSOR:url('cur/"&C(1)&".ani');"
Else
cur = ""
End If

dim act,photoID
act = JaZ.JaKillStr(Request.QueryString("act"))

if act="face" and JaZ.JaIsUser(B)="yes" then
photoID = JaZ.JaKillStr(Request.QueryString("photoID"))
Dim photo
Set photo = Conn.Execute("Select JaPhotoUrl From [JaPhoto] Where ID="&photoID&" and JaUid='"&B&"' and JaPhotoUrl<>'defeat.gif' ")
Conn.Execute("Update JaUser Set JaFace='upload/"&photo(0)&"' where JaUid='"&B&"'")
response.write "<script>alert(""形象更新成功！"")</script>"
end if


Dim rs,sqlstr,MaxPerPage,text,checkpage,CurrentPage,i,p
Dim albumID,phstr
Dim JaCheckIsLog
Dim flag
Dim rrs
albumID = JaZ.JaKillStr(Request.QueryString("albumID"))
JaCheckIsLog = JaZ.JaIsUser(B) 
phstr = JaZ.GetBlogRe("*","JaAlbum","ID="&albumID&" And JaUid='"&B&"' ")

If phstr(4,0)=0 Then flag="close"
If phstr(4,0)=1 Then flag="open"
If phstr(4,0)=2 Then flag="passopen"

If phstr(4,0)=0 and JaCheckIsLog<>"yes" Then
flag = true
End if

sqlstr = "SELECT * FROM [JaPhoto] Where JaUid='"&B&"' and JaAlbumID="&albumID&" Order By ID DESC"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sqlstr,conn,1,1
MaxPerPage=3
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If request("page")="" Then 
p = 1
Else
p = request("page")
End if
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
i=0 
%>
<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>myzone-互动-个性交友-在线聊天-装扮小屋</title>
<link type="text/css" rel="stylesheet" href="Style/<%=Trim(C(5))%>/css.css">
</head>
<script src="JsInc/PhotoPage.js"></script>
<body leftMargin=2 topMargin=0 marginheight="0" marginwidth="0" style="background-color:transparent;<%=cur%>" text="#cccccc" link="#cccccc" vlink="#cccccc" alink="#cccccc">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td height="23" colspan="3" background="Style/<%=Trim(C(5))%>/titleback.gif"><span class="classs"><img src="Style/<%=Trim(C(5))%>/b.gif" width="1" height="1" align="absmiddle" class="ltitle">&nbsp; 
      <b><%=phstr(2,0)%></b></span> <div align="center"></div></td>
<%If JaCheckIsLog = "yes" Then%>
    <td width="30" background="Style/<%=Trim(C(5))%>/titleback.gif">
<div align="center"><img src="Qz/p_icon11.gif" width="13" height="10"></div></td>
    <td width="140" valign="middle" background="Style/<%=Trim(C(5))%>/titleback.gif"><a href="PhotoUp.asp?JaUid=<%=B%>&albumID=<%=albumID%>">上传照片</a> 
    </td>
<%End if%>
  </tr>
  <tr> 
    <td width="691" height="2"></td>
    <td width="30"></td>
    <td colspan="3"></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><div align="center">
        <table width="99%" border="0" cellspacing="2" cellpadding="0">
          <tr> 
            <td height="23" colspan="2" background="Style/<%=Trim(C(5))%>/titleback.gif"><%=phstr(5,0)%> 
<%If JaCheckIsLog="yes" Then%>
              <a href="AlbumEdit.asp?JaUid=<%=B%>&albumID=<%=albumID%>">
			  <img src="Qz/p_icon12.gif" alt="修改相册" width="15" height="15" border="0"></a>
<%End if%>
			  </td>
          </tr>
          <tr> 
            <td colspan="2"> 
              <div align="center"> 

<%
If Rs.Eof Then			  
Response.Write "对不起，该相册还未上传照片<br><br>"
Else
If flag="open" Or JaCheckIsLog="yes" Or Session("AlbumOpen")<>"" Then
Do While Not Rs.Eof
%>
                <form name="form1" method="post" action="PhotoRe.asp?JaUid=<%=B%>&albumID=<%=albumID%>">
                  <table width="98%" border="0" cellspacing="2" cellpadding="2">
                    <tr> 
                      <td height="23" background="Style/<%=Trim(C(5))%>/titleback.gif"> 
                        <div align="center"><%=Rs(3)%></div></td>
                    </tr>
                    <tr> 
                      <td>时间：<%=Rs(7)%></td>
                    </tr>
                    <tr> 
                      <td><div align="center"> <a href="UpLoad/<%=Trim(Rs(5))%>" target="_blank"> 
                          <img src="UpLoad/<%=Trim(Rs(5))%>" border="0" onload="javascript:if(this.width>360)this.width=360;" onMouseOver="javascript:if(this.width>360)this.width=360;"></a>
<%If JaCheckIsLog="yes" Then%>
						 <br>
                          >> <a href="PhotoEdit.asp?JaUid=<%=B%>&albumID=<%=albumID%>&photoID=<%=Rs(0)%>">修改</a> 
                          <a href="PhotoMove.asp?JaUid=<%=B%>&albumID=<%=albumID%>&photoID=<%=Rs(0)%>" onClick="{if(confirm('确定要移动吗?')){return true;}return false;}">移动</a> 
                          <a href="PhotoDel.asp?JaUid=<%=B%>&albumID=<%=albumID%>&photoID=<%=Rs(0)%>" onClick="{if(confirm('确定删除吗?')){return true;}return false;}">删除</a> 
                          << <br>
<a href="?JaUid=<%=B%>&act=face&albumID=<%=albumID%>&photoID=<%=Rs(0)%>">设为形象</a>
                          <%End if%>
                        </div></td>
                    </tr>
                    <tr> 
                      <td><%=Rs(6)%> <br>
<%
Set rrs = Conn.Execute("Select * From [JaPhotoRe] Where JaPhotoID="&Rs(0)&" ")
Do While Not rrs.Eof
Response.Write "<font color='#0964B8'>"&rrs(3)&"</font>:" & rrs(4) &" ("&rrs(5)&")"
If JaCheckIsLog="yes" Then
Response.Write "&nbsp;<a href='PhotoReDel.asp?JaUid="&B&"&albumID="&albumID&"&photoID="&rrs(0)&"' onClick='{if(confirm(""确定删除吗?"")){return true;}return false;}'><img src='Qz/p_icon07.gif' border='0' alt='删除'></a>"
End if
Response.Write "<br>"
rrs.MoveNext
Loop
rrs.Close
%>
                 </td>
                    </tr>
                    <tr>
                      <td>发表评论： 
                        <input name="photoRe" type="text" size="40" maxlength="40">
                        <input name="photoID" type="hidden" id="photoID" value="<%=Rs(0)%>">
                        <input name="imageField" type="image" src="Qz/p_icon16.gif" border="0">
                      </td>
                    </tr>
                  </table>
                 </form>
                <%
i=i+1 
If i >= MaxPerpage Then Exit do
Rs.MoveNext
Loop
Else

If flag="close" And Session("AlbumOpen")="" Then
Response.Write "该相册没有公开!"
Else
   If flag="passopen" And Session("AlbumOpen")="" Then
%>
 <form name="form2" method="post" action="AlbumOpen.asp?JaUid=<%=B%>&albumID=<%=albumID%>">
                  <table width="60%" border="0" cellspacing="2" cellpadding="2">
                    <tr> 
                      <td><div align="center">该相册要凭密码才能观看！</div></td>
                    </tr>
                    <tr>
                      <td><div align="center">
                          <input name="passopen" type="text" id="passopen" maxlength="20">
                          <input type="submit" name="Submit" value="提交">
                        </div></td>
                    </tr>
                  </table>
                </form>
<%
End if
End if
End if


End if
%>        
            </div></td>
          </tr>
          <tr> 
            <td height="16" colspan="2"> 
              <hr color="#CCCCCC" width="100%" size="1" noshade></td>
          </tr>
          <tr> 
            <td width="50%"><div align="center">
<%If Rs.PageCount <> 0 Then%>
共<%=Rs.PageCount%>页
<Script Language="JavaScript">Pages(<%=CurrentPage%>,<%=Rs.PageCount%>,<%=Rs.RecordCount%>,'page',<%=B%>,<%=albumID%>);</Script>
<%End if%>
 </div>
</td>
          </tr>
        </table>
      </div></td>
  </tr>
</table>
</body>
</html>
<%
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn=Nothing
%>
