<!--#include file="../Include/Conno.asp" -->
<!--#include file="../Include/char.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="../Include/md5.asp"-->


<%
sub ShowPrev(ID,AlbumID)
	dim rsPrev,sqlPrev
	sqlPrev="Select Top 1 * FROM Photo_AlbumList WHERE F_AlbumID = " & AlbumID &" and F_ID<" & ID& " order by F_ID DESC"
	Set rsPrev= Server.CreateObject("ADODB.Recordset")
	rsPrev.open sqlPrev,conn,1,1
	
	if rsPrev.Eof then
	  	response.write "最末页"
	else
		response.write "<a class=p2 href='?ID=" & rsPrev("F_ID")& "'><font color='ffffff'>[下一页]</font></a>"
	end if
	rsPrev.close
	set rsPrev=nothing
end sub

sub ShowNext(ID,AlbumID)
	dim rsNext,sqlNext
	sqlNext="Select Top 1 * FROM Photo_AlbumList WHERE F_AlbumID = " & AlbumID &" and F_ID>" & ID& " order by F_ID ASC"
	Set rsNext= Server.CreateObject("ADODB.Recordset")
	rsNext.open sqlNext,conn,1,1

	if rsNext.Eof then
	  	response.write "第一页"
	else
		response.write "<a class=p2 href='?ID=" & rsNext("F_ID")& "'><font color='ffffff'>[上一页]</font></a>"
	end if
	rsNext.close
	set rsNext=nothing
end sub

  If Request.ServerVariables("REQUEST_METHOD")="POST" then
      mAlbumID = Request.Form("hidAlbumID")
      mUserName = checkStr(Trim(Request.Form("txtUserName")))
      If Request.Form("chkAnonymity")="1" then
	    session("Anonymity")="1"
	    mUserName="匿名"
	  else
        mUserName = checkStr(Trim(Request.Form("txtUserName")))
      end if
	  
      mContent = checkStr(Trim(Request.Form("txtContent")))
      mIPInfo = Request.ServerVariables("REMOTE_ADDR")
      mSql = "Insert Into Photo_Review(F_AlbumID,F_UserName,F_Content,F_IPInfo,F_Addtime)"
      mSql = mSql + "Values('"&mAlbumID&"','"&mUserName&"','"&mContent&"','"&mIPInfo&"','"&now()&"')"
      conn.Execute(mSql)
      Call Msgbox("祝贺您，你已经对该主题，发了您的评论.","ShowPhoto.asp?ID="&mAlbumID)

  End if

  dim rs,mSql
  dim mTitle,mContent,mImage,UserName,mIPInfo
  dim ID
  ID = checkStr(Request.QueryString("ID"))
 
  if trim(ID) = "" OR (not isnumeric(ID)) then
   call msgbox("请不要误操作!",1)
   response.end
 end if
 
  mSql="Select * From Photo_AlbumList Where F_ID=" & ID
  Set rs = conn.Execute(mSql)
  If rs.Eof then
    Response.write "对不起，该页无法显示！请<a href='javascript:window.back(-1)'>[返 回]</a>"
	Response.end
  End if
    mAlbumID = rs("F_AlbumID")
    mID1 = rs("F_ID")
    mTitle = rs("F_Title")
    mContent = rs("F_Content")
    mImage = rs("F_Image")
    mUserName = rs("F_UserName")
	mUserID = rs("F_UserID")
    mIPInfo = rs("F_IPInfo")
    mAddtime = rs("F_Addtime")
	mImageSize = round(rs("F_ImageSize")/1024,2)
	if mImageSize < 1  then mImageSize = "0"+cstr(mImageSize)+"K" else mImageSize = cstr(mImageSize)+"K"
    mHits = rs("F_Hits")
    rs.Close
	
    'read next
	'm_Sql = "SELECT * FROM Photo_AlbumList WHERE F_AlbumID="&m_AlbumID
	'Set rs = conn.Execute(m_Sql)
	'do While Not rs.Eof
	'  if cstr(ID) = cstr(rs("F_ID")) then
	'  rs.MoveNext
	'loop
   

'Hits++
mSql = "Update Photo_AlbumList set F_Hits=F_Hits+1 Where F_ID=" & ID
conn.Execute(mSql)

if Request.Querystring("action") = "Delete" then
  m_Sql = "Delete From Photo_Review Where F_ID=" & Request("DeleteID")
  conn.Execute(m_Sql)
  Response.write "<script>location.replace('ShowPhoto.asp?ID="&Request("ID")&"')</script>"
end if
%>
<html>
<head>
<title><%=mTitle%>-襄樊信息港,真我风采,宿舍之家,学生时代,活动掠影,明星写真,影视娱乐,驴友公社,城市风光</title>
<meta name="keywords" content="<%=mTitle%>,真我风采,宿舍之家,学生时代,活动掠影,明星写真,影视娱乐,驴友公社,城市风光">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="../Include/Jimage.js"></script>
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=Delete';
}
</SCRIPT>
<script language="JavaScript">
function CheckData()
{
 if (document.form1.txtUserName.value=="")
 {
   alert('对不起，用户名不能为空!');
   document.form1.txtUserName.focus();
   return false;
 }
 if (document.form1.txtPassword.value=="")
 {
   alert('对不起，密码不能为空!');
   document.form1.txtPassword.focus();
   return false;
 }
 if (document.form1.txtContent.value=="")
 {
   alert('对不起，评论内容不能为空!');
   document.form1.txtContent.focus();
   return false;
 }
 
}
</script>
<link href="../css/member.css" rel="stylesheet" type="text/css"><style type="text/css">
<!--
#photo_box {
	BORDER-RIGHT: #f0f0f0 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #f0f0f0 1px solid; PADDING-LEFT: 0px; MARGIN-BOTTOM: 10px; PADDING-BOTTOM: 0px; BORDER-LEFT: #f0f0f0 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #f0f0f0 1px solid
}
#photo_box02 {
	BORDER-RIGHT: #d8d8d8 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #d8d8d8 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; BORDER-LEFT: #d8d8d8 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #d8d8d8 1px solid
}
#photo_box03 {
	BORDER-RIGHT: #b2b2b2 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #b2b2b2 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; BORDER-LEFT: #b2b2b2 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #b2b2b2 1px solid
}
.box4_pic {
	BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; MARGIN: 5px; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid
}
-->
</style>
</head>
<body topmargin="15" leftmargin="0">
<TABLE cellSpacing=1 cellPadding=0 width=778 align=center bgColor=#cccccc 
      border=0>
  <TBODY>
    <TR> 
      <TD bgColor=#ffffff height=225> <TABLE cellSpacing=0 cellPadding=0 width=98% align=center 
              border=0>
          <TBODY>
            <TR> 
              <TD width="100%" background=../Images/index2_r4_c2.jpg><IMG height=6 
                  src="e.files/index2_r4_c2.jpg" width=4></TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE cellSpacing=0 cellPadding=0 width=98% align=center 
            bgColor=#999999 border=0>
          <TBODY>
            <TR> 
              <TD width=100% bgColor=#ffffff>&nbsp; </TD>
            </TR>
            <TR> 
              <TD bgColor=#ffffff><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td height="2"></td>
                  </tr>
                </table>
                <TABLE style="MARGIN-TOP: 15px; MARGIN-BOTTOM: 20px" cellPadding=0 
  align=center>
                  <TBODY>
                    <TR> 
                      <TD> <DIV id=photo_box> 
                          <DIV id=photo_box02> 
                            <DIV id=photo_box03> 
                              <TABLE cellSpacing=2 cellPadding=2 align=center bgColor=#ffffff 
        border=0>
                                <TBODY>
                                  <TR> 
                                    <TD align=middle> 
                                      <%
					if Trim(mImage)<>"" then 
					   Response.write "<a href='../photo/SmallImages/"&mUserID&"/"&mImage&"' target='_blank'>"
					   Response.Write "<Img onmouseout=nereidFade(this,90,7,5) onmouseover=nereidFade(this,100,5,7) style='border:1 solid #666666;FILTER: alpha(opacity=95)' src='../photo/SmallImages/"&mUserID&"/"&mImage&"' border=1>"
                       Response.write "</a>"
					end if					  
					%>
                                    </TD>
                                  </TR>
                                </TBODY>
                              </TABLE>
                            </DIV>
                          </DIV>
                        </DIV></TD>
                    </TR>
                  </TBODY>
                </TABLE>
                <TABLE 
width=96% border=1 align="center" cellPadding=0 cellSpacing=0 borderColor=#cccccc borderColorDark=#ffffff>
                  <TBODY>
                    <TR> 
                      <TD width="100%" height=80><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="11"></td>
                          </tr>
                        </table> 
                        <TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
                          <TBODY>
                            <TR> 
                              <TD width="33%" height=20><font color="#990000">相册名称：</font><strong><%= mTitle %></strong></TD>
                              <TD width="67%"><font color="#990000">创建时间：</font><%= mAddtime %></TD>
                            </TR>
                            <TR> 
                              <TD height=20><font color="#990000">相册作者：</font><%= mUserName %></TD>
                              <TD><font color="#990000">相片描述：</font><%=Htmlencode(mContent) %></TD>
                            </TR>
                            <TR> 
                              <TD height=20><font color="#990000">人&nbsp;气 值：</font><font color="#FF0000"><%= mHits %></font>次</TD>
                              <TD>&nbsp;</TD>
                            </TR>
                          </TBODY>
                        </TABLE>
                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="11"></td>
                          </tr>
                        </table>
                        <TABLE cellSpacing=0 cellPadding=0 width=98% align=center 
              border=0>
                          <TBODY>
                            <TR> 
                              <TD width="100%" height="1" bgcolor="#666666"></TD>
                            </TR>
                          </TBODY>
                        </TABLE>
                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="11"></td>
                          </tr>
                        </table>
                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="12"><img src="../Images/member/hy_a_1.gif" width="19" height="25" hspace="4" align="absmiddle"><strong>相关评论：</strong></td>
                          </tr>
                        </table>
                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="2">
                          <tr> 
                            <td height="12"> 
    <%
	  Response.write "<table width='98%' border=0 align='center' cellpadding=1 cellspacing=0>"
	  mSql = "Select Top 20 * From Photo_Review Where F_AlbumID=" & mID1&" order by F_Addtime desc"
	  Set rs = conn.Execute(mSql)
	  if rs.eof then response.write "对不起，该照暂无评论！"
	  Do While Not rs.Eof
	    Response.write "<tr>"
		Response.write "<td>·"&rs("F_Content")
		Response.write "[<font color=D669A5>"&rs("F_UserName")&"</font>]"
		response.write "<font color=aaaaaa>("&formatdatetime(rs("F_Addtime"),2)&")</font>"
        if Cstr(rs("F_UserName"))= session("CurUserName") then
		  Response.write "<a href=javascript:jDelete('ShowPhoto.asp?ID="&mID1&"&DeleteID="&rs("F_ID")&"')>"
		  Response.write "<img src='../images/del.gif' alt='删除' border=0></a>"
		end if
		
		Response.write "</td>"
		Response.write "</tr>"
		rs.MoveNext
	  Loop
	  rs.Close
	  Response.write "</table>"
	  %>
                            </td>
                          </tr>
                        </table>
                        <table  width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td width="100%"  bgcolor="fcfcfc"><br> <form name="form1" method="post" action="ShowPhoto.asp?ID=<%=ID%>" onSubmit="return CheckData()">
                                <table cellpadding="0" cellspacing="0" border="0" width="98%" bgcolor="#9999CC" align="center">
                                  <tr> 
                                    <td width="100%"> <table width="100%" height="138" border="0" cellpadding="3" cellspacing="1">
                                        <tr bgcolor="f2f2f2"> 
                                          <td colspan="2"><font face="宋体" color="#333333"> 
                                            <input name="chkAnonymity" type="checkbox" value="1" <%if session("Anonymity") = 1 then Response.Write "checked" %>>
                                            </font><font face="宋体"> <strong>匿名发表</strong><b>　</b>发表相册评论,非注册用户也可以发表。<a name="buttom"></a> 
                                            <input name="hidAlbumID" type="hidden" value="<%=mID1%>">
                                            </font></td>
                                        </tr>
                                        <tr> 
                                          <td width="13%" height="23" valign="middle" bgcolor="#FFFFFF"><font face="宋体" color="#333333">网上大名: 
                                            </font></td>
                                          <td valign="middle" bgcolor="#FFFFFF"> 
                                            <input name=txtUserName class="text" value="<%=Session("CurUserName")%>" size=20> 
                                          </td>
                                        </tr>
                                        <tr> 
                                          <td height="71" valign="top" bgcolor="#FFFFFF"><font face="宋体">评论内容</font><font face="宋体" color="#333333"> 
                                            <br>
                                            UBB标签:<b><br>
                                            </b></font></td>
                                          <td bgcolor="#FFFFFF" valign="top" ><textarea cols="63" name="txtContent" rows="4" class="text" wrap="soft"></textarea> 
                                          </td>
                                        <tr bgcolor="f2f2f2"> 
                                          <td height="1" colspan="2" align="center" valign="middle"><input type="Submit" value="发  表" class="button" name="Submit&quot;"> 
                                            &nbsp; <input type="reset" name="Clear" class="button" value="清  除"></td>
                                        </tr>
                                      </table></tr>
                                </table>
                              </form></td>
                          </tr>
                        </table></TD>
                    </TR>
                  </TBODY>
                </TABLE>
                <br> </TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>
<!--#include file="../include/bottom.asp" -->
</body>
</html>
<% CloseDatabase %>