<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Include/Connect.asp"-->
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../CSS/Hompy/hompy.css" type=text/css rel=stylesheet>
<title></title>
<script language="JavaScript">
<!--
function showPersonacon(persona_view_id) {
	var span_name = "persona"+persona_view_id;
	var open = document.getElementById(span_name).style.display;

	if(open == "none") {
		document.getElementById(span_name).style.display = '';
	}
	else {
		document.getElementById(span_name).style.display = 'none';
	}
}

function setPersona(frmName, cid, rid, pid, pimg) {
	var srcName = "personasrc" + cid;
	var span_name = "persona" + cid;
	document.getElementById(srcName).src = pimg;
	document.forms[frmName].personaconid.value = pid;
	if(document.getElementById(span_name).style.display == "") {
		document.getElementById(span_name).style.display = 'none';
	}
}

function formcheck(frmName) {
    if(frmName.comment.value.length ==0)
	{
	alert("评论不能为空！");
	frmName.comment.focus();
	return false;
	}
}

function ask(msg) {
	
	if( msg=='' ) {
		msg='真的要这样做吗？';
	}

	if (confirm(msg)) {
		return true;
	} else {
		return false;
	}
}
//-->
</script>
<script language="JavaScript">
<!--
//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height+"点击察看原始尺寸";
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height+"点击察看原始尺寸";
        }
    }
} 
//-->
</script>
</head>
<body  oncontextmenu="window.event.returnValue=false" onselectstart="return false">
<TABLE cellSpacing=0 cellPadding=0 width=473 border=0>
  <TBODY>
    <TR> 
      <TD height=27 align="center"><table width="97%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>&nbsp;</td>
            <td align="right"><a href="photolist.asp?username=<%=request.querystring("username")%>&viewmode=1&groupid=<%=request.querystring("groupid")%>"><img src="../Images/Hompy/btn_list.gif" width="87" height="19" border="0" align="absmiddle"></a>&nbsp;</td>
          </tr>
        </table> </TD>
    </TR>
    <TR> 
      <TD height=24><div align="center">
<%
Username=Checkstr(request.querystring("Username"))
PhotoID=Checkstr(request.querystring("PhotoID"))
GroupID=Checkstr(request.querystring("GroupID"))
if PhotoID="" or Username="" or GroupID="" then
%>
<table width="97%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td style="HEIGHT: 3px;BORDER-TOP: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px dotted; BACKGROUND-COLOR: #f7f7f7"><img src="" width="3" height="3" alt=""></td>
  </tr>
  <tr> 
    <td></td>
  </tr>
  <tr> 
              <td height="108" align="center">缺少参数！</td>
  </tr>
  <tr> 
    <td height="1" style="BORDER-BOTTOM: #cecfce 1px solid;"><img name="" src="" width="1" height="1" alt=""> </td>
  </tr>
</table>
<%
response.end()
else
set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLPhoto where PhotoID="&PhotoID&""
rs.open sql,cn,1,3
rs("Hit")=rs("Hit")+1
rs.update
rs.close
set rs=nothing

set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLPhoto where PhotoID="&PhotoID&""
rs.open sql,cn,1,1
%>
          <table width="97%" border="0" cellpadding="0" cellspacing="0">
            <tr> 
              <td colspan="3" align="center" style="HEIGHT: 24px;BORDER-TOP: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px dotted; BACKGROUND-COLOR: #f7f7f7"><b><%=rs("Topic")%></b></td>
            </tr>
            <tr> 
              <td width="37%">作者：<a class=popmenu href="hompy.asp?username=<%=rs("Username")%>" target="_blank"><%=rs("Username")%></a></td>
              <td width="49%">发表日期：<SPAN style="FONT-SIZE: 11px; COLOR: #9c9a9c"><SPAN><%=rs("Posttime")%></span></span></td>
              <td width="14%">点击：<SPAN style="FONT-SIZE: 11px; COLOR: #ff6600"><SPAN><%=rs("Hit")%></span></span></td>
            </tr>
            <tr> 
              <td colspan="3" align=middle style="PADDING-TOP: 10px;PADDING-BOTTOM: 10px"><A href="../UploadPhoto/<%=username%>/<%=rs("Filename")%>" target="blank"><img src="../UploadPhoto/<%=username%>/<%=rs("Filename")%>" border="0" align="absmiddle" onload="javascript:DrawImage(this,300,500)"></a></td>
            </tr>
            <tr> 
              <td height="24" colspan="3" valign="top">转贴：<SPAN style="FONT-SIZE: 11px; WIDTH: 420px; COLOR: #9c9a9c"><SPAN>http://www.show5.net/photoview.asp?id=<%=rs("PhotoID")%> <a href=javascript: onclick=alert('复制成功！');clipboardData.setData('Text','http://www.show5.net/photoview.asp?id=<%=rs("PhotoID")%>') ><img src="../Images/Hompy/copy_s.gif" width="32" height="13" border="0" align="absmiddle"></a> 
                &nbsp; 
                <%
if session("username")=username then
%>
                <a class="orange" href="photoedit.asp?photoid=<%=rs("PhotoID")%>">编辑</a> 
                | <a class="orange" href="javascript:if(ask('真的要删除吗？')) location.href='photodel.asp?photoid=<%=rs("PhotoID")%>';">删除</a> 
                <%
end if
%>
                </SPAN></SPAN></td>
            </tr>
            <tr> 
              <td height="37" colspan="3" valign="top" style="BACKGROUND-COLOR: #f7f7f7"> 
                <A name=comment></A> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                  <TBODY>
                    <TR> 
                      <TD style="BACKGROUND-IMAGE: url(../Images/Hompy/li_x_02.gif)" height=1></TD>
                    </TR>
                    <%
set rs_comment=server.CreateObject("adodb.recordset")
sql="select * from Show5_Photocomment where PhotoID="&rs("PhotoID")&""
rs_comment.open sql,cn,1,1
   if not rs_comment.eof or rs_comment.bof then
   i=0
   do while not rs_comment.eof
%>
                    <TR> 
                      <TD 
                            style="PADDING-RIGHT: 0px; PADDING-LEFT: 11px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" 
                            bgColor=#f0f0f0 height=27> <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                              border=0>
                          <TBODY>
                            <TR vAlign=top> 
                              <TD width=25><IMG style="MARGIN: 3px" height=17 src="../Images/Personacon/p_<%=rs_comment("PersonaconID")%>.gif" width=17 align=absMiddle></TD>
                              <TD class=ln16 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 3px; PADDING-TOP: 4px; word-break:break-all" width=380><A href="hompy.asp?username=<%=rs_comment("Commentuser")%>" target="_blank" class=popmenu><%=rs_comment("Commentuser")%></A> <SPAN style="FONT-SIZE: 11px; COLOR: #9c9a9c"><SPAN>(<%=rs("Posttime")%>)</span></span>: <%=rs_comment("Comment")%> </TD>
                            </TR>
                          </TBODY>
                        </TABLE></TD>
                    </TR>
                    <TR> 
                      <TD style="BACKGROUND-IMAGE: url(../Images/Hompy/li_x_02.gif)" height=1></TD>
                    </TR>
                    <%
   rs_comment.movenext
   loop
   rs_comment.close
   set rs_comment=nothing
   end if
%>
                    <TR> 
                      <TD height=30 style="BORDER-BOTTOM: #cecfce 1px solid;"><TABLE width="100%" height="30" border=0 cellPadding=0 cellSpacing=0>
                          <form name="frmWrite<%=i%>" action="addcomment_p1.asp?username=<%=request.querystring("username")%>&photoid=<%=request.querystring("photoid")%>&groupid=<%=request.querystring("groupid")%>" method="post" onSubmit="return formcheck(frmWrite<%=i%>);">
                            <INPUT type=hidden value=-1 name=personaconid>
                            <INPUT type=hidden value=<%=session("username")%> name=commentuser>
                            <TBODY>
                              <TR> 
                                <TD width="11%" height=25><div align="center">评论 
                                  </div></TD>
                                <TD width="65%"> <TABLE cellSpacing=1 cellPadding=0 width=288 bgColor=#a9aaaa border=0>
                                    <TBODY>
                                      <TR bgColor=#ffffff> 
                                        <TD align=middle width=24 height=19><IMG onmousedown=javascript:showPersonacon(<%=i%>); src="../Images/Personacon/p_-1.gif" id=personasrc<%=i%> name=personasrc<%=i%> width=17 height=17 border="0"></TD>
                                        <TD width=264> <%
										if session("username")="" then
										response.write("<INPUT style='BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 260px; BORDER-BOTTOM: 0px' name='comment' value='请登录后评论！' disabled>")
										else
										response.write("<INPUT style='BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 260px; BORDER-BOTTOM: 0px' name='comment'>")
										end if
										%> 
                                        </TD>
                                      </TR>
                                    </TBODY>
                                  </TABLE></TD>
                                <TD width="24%"> <%
								if not session("username")="" then
								response.write("<Input type='image' src='../Images/Hompy/btn_confirm.gif' width='39' height='18' align='absmiddle'></a>")
								end if
								%> </TD>
                              </TR>
                            </TBODY>
                          </form>
                        </TABLE></TD>
                    </TR>
                </TABLE></td>
            </tr>
            <tr> 
              <td height="36"><DIV id=persona<%=i%> 
                              style="DISPLAY: none; POSITION: absolute"> 
                  <TABLE style="CURSOR: hand" height=19 
                              cellSpacing=1 cellPadding=0 bgColor=#c4cad1 
                              border=0>
                    <TBODY>
                      <TR> 
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-1 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-1', '-1','../Images/personacon/p_-1.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-1.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-2 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-2', '-2','../Images/personacon/p_-2.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-2.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-3 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-3', '-3','../Images/personacon/p_-3.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-3.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-4 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-4', '-4','../Images/personacon/p_-4.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-4.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-5 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-5', '-5','../Images/personacon/p_-5.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-5.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-6 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-6', '-6','../Images/personacon/p_-6.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-6.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-7 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-7', '-7','../Images/personacon/p_-7.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-7.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-8 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-8', '-8','../Images/personacon/p_-8.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-8.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-9 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-9', '-9','../Images/personacon/p_-9.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-9.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-10 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-10', '-10','../Images/personacon/p_-10.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-10.gif" 
                                width=17 vspace=1></TD>
                      </TR>
                      <TR> 
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-11 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-11', '-11','../Images/personacon/p_-11.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-11.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-12 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-12', '-12','../Images/personacon/p_-12.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-12.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-13 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-13', '-13','../Images/personacon/p_-13.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-13.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-14 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-14', '-14','../Images/personacon/p_-14.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-14.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-15 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-15', '-15','../Images/personacon/p_-15.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-15.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-16 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-16', '-16','../Images/personacon/p_-16.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-16.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-17 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-17', '-17','../Images/personacon/p_-17.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-17.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-18 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-18', '-18','../Images/personacon/p_-18.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-18.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 bgColor=#ffffff><IMG 
                                id=imgPersona-19 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-19', '-19','../Images/personacon/p_-19.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-19.gif" 
                                width=17 vspace=1></TD>
                        <TD align=middle width=20 
                                bgColor=#ffffff><IMG 
                                id=imgPersona-19 
                                onclick="javascript:setPersona('frmWrite<%=i%>', '<%=i%>', '-20', '-20','../Images/personacon/p_-20.gif')" 
                                height=17 hspace=3 src="../Images/Personacon/p_-20.gif" 
                                width=17 vspace=1></TD>
                      </TR>
                    </TBODY>
                  </TABLE>
                </DIV>
                <%
set PrePhoto=cn.execute("select TOP 1 PhotoID,Username,GroupID from Show5_ALLPhoto where PhotoID>"&PhotoID&" and Username='"&Username&"' and GroupID="&GroupID&" order by PhotoID DESC")
if PrePhoto.bof or PrePhoto.eof then
PrePhoto_str="<img src='../Images/Hompy/up_b.gif' width='17' height='17' alt='没有上一篇了' border='0'>"
else
PrePhoto_str="<a href='Photoview.asp?PhotoID="&PrePhoto("PhotoID")&"&Username="&PrePhoto("Username")&"&GroupID="&PrePhoto("GroupID")&"'><img src='../Images/Hompy/up_b.gif' width='17' height='17' alt='上一篇' border='0'></a>"
end if
set PrePhoto=nothing

set NextPhoto=cn.execute("select TOP 1 PhotoID,Username,GroupID from Show5_ALLPhoto where PhotoID<"&PhotoID&" and Username='"&Username&"' and GroupID="&GroupID&" order by PhotoID DESC")
if NextPhoto.bof or NextPhoto.eof then
NextPhoto_str="<img src='../Images/Hompy/down_b.gif' width='17' height='17' alt='没有下一篇了' border='0'>"
else
NextPhoto_str="<a href='photoview.asp?PhotoID="&NextPhoto("PhotoID")&"&Username="&NextPhoto("Username")&"&GroupID="&NextPhoto("GroupID")&"'><img src='../Images/Hompy/down_b.gif' width='17' height='17' alt='下一篇' border='0'></a>"
end if
set NextPhoto=nothing
%> <%=PrePhoto_str%>&nbsp;<%=NextPhoto_str%></td>
              <td colspan="2" align="right"> <a href="photolist.asp?username=<%=request.querystring("username")%>&viewmode=1&groupid=<%=request.querystring("groupid")%>"><img src="../Images/Hompy/btn_list.gif" width="87" height="19" border="0"></a>&nbsp; 
              </td>
            </tr>
          </table>
<%
end if
rs.close
set rs=nothing
%>
        </div></TD>
    </TR>
  </TBODY>
</TABLE>
</body>
</html>
