<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/ubbcode.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/Conn_User.asp"-->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>日志</title>

<SCRIPT FOR = aa EVENT = onload>
var MaxWidth=400;
if(aa.readyState!="complete"){
 return false;//确保图片完全加载
}
if(aa.width>MaxWidth){ 
aa.width=MaxWidth; 
}

</script>


<style type="text/css">
BODY {
	scrollbar-face-color:#DDDDDD;
	scrollbar-highlight-color: #cccccc;
	scrollbar-shadow-color: #CCCCCC;
	scrollbar-3dlight-color: #F5F5F5;
	scrollbar-darkshadow-color: #F5F5F5;
	scrollbar-track-color: #F0F0F0;
	scrollbar-arrow-color: #FFFFFF;
	margin-left: 10px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
}
</style>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll()
  {
   if (document.form1.Content.value=="")
  {
    alert("请输入评论内容！");
	document.form1.Content.focus();
	return false;
  }
  return true; 
  }
function ConfirmDel()
{
   if(confirm("确定要删除吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;
	 
}

</SCRIPT>
<link href="new/css.CSS" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #999999}
-->
</style>
</head>

<body>
<%userid=request("userid")
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where userid="&userid&" order by userid desc"
rs.open sql,Conn_User,1,1
username=rs("username")

rs.close
set rs=nothing
%>
<%if request("classid")="" then%>
<%
myPagesize=5
set rs=server.createobject("adodb.recordset")
rs.open "select * from photo where editor='"&username&"' and Deleted=false order by photoid desc",conn,1,1
call myPages(rs,myPagesize)
%>
<%else%>
<%
myPagesize=5
classidd=request("classid")
set rs=server.createobject("adodb.recordset")
rs.open "select * from photo where editor='"&username&"' and classid="&classidd&" and Deleted=false order by photoid desc",conn,1,1
call myPages(rs,myPagesize)
%>
<%end if%>
<%if rs.recordcount=0 then %>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <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="27" align="center"><table width="97%" cellpadding="0" cellspacing="0">
          <tr>
            <Td width="15%" align="center">&nbsp;</td>
            <td align="center"><table width="100%" height="1"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td></td>
                </tr>
              </table>
                <strong>---&nbsp;我的相册&nbsp;</strong>---</td>
            <td width="15%" align="right"><table width="100%" height="2"  border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td></td>
              </tr>
            </table>
            </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" width="1"></td>
      <td height="27" align="center" bgcolor="ffffff">        <br>
        <table  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><img src="user/1.jpg" width="16" height="16"></td>
            <td><img src="user/2.jpg" width="85" height="16"></td>
            <td>&nbsp;</td>
            <td align="right"><img src="user/3.jpg" width="85" height="16"></td>
            <td height="16"><img src="user/4.jpg" width="16" height="16"></td>
          </tr>
          <tr>
            <td width="16" valign="top"><img src="user/12.jpg" width="16" height="72"></td>
            <td colspan="3" rowspan="3" align="center"><img src=user/nophoto.gif alt="暂时没有相片" name="aa" width="350" height="200" border=0 id=aa /></td>
            <td width="16" valign="top"><img src="user/5.jpg" width="16" height="72"></td>
          </tr>
          <tr>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td valign="bottom"><img src="user/11.jpg" width="16" height="77"></td>
            <td valign="bottom"><img src="user/6.jpg" width="16" height="77"></td>
          </tr>
          <tr>
            <td><img src="user/10.jpg" width="16" height="16"></td>
            <td><img src="user/9.jpg" width="85" height="16"></td>
            <td>&nbsp;</td>
            <td align="right"><img src="user/8.jpg" width="85" height="16"></td>
            <td height="16"><img src="user/7.jpg" width="16" height="16"></td>
          </tr>
        </table>
        <br></td>
      <td bgcolor="#BCBCBC" width="1"></td>
    </tr>

  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="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="25" align="left" bgcolor="#f2f2f2">&nbsp;</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>
  <%else%>

<table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><div align="right">查看方式:</div></td>
      <td width="22" align="center"><img src="user/photoon.gif" width="17" height="17" border="0" alt="列表"></td>
      <td width="17"><a href="photo2.asp?userid=<%userid=request("userid")%><%=userid%>&classid=<%=request("classid")%>"><img src="user/photo2on.gif" alt="缩略图" width="17" height="17" border="0"></a></td>
    </tr>
</table>
  <table width="100%" height="5"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td></td>
    </tr>
  </table>
<%line=myPagesize
do while not rs.eof and line>0
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <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="28" align="center"><strong><font color="#FF6600">---&nbsp;<%=rs("PhotoName")%>&nbsp;---</font></strong>
      <%if rs("photourl")<>"" then%></td>
      <td bgcolor="#BCBCBC"></td>
    </tr>

</table>

  <table width="100%" border="0" cellspacing="0" cellpadding="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="25" align="center" bgcolor="F0F0F0"><table width="95%" height="24" cellpadding="0" cellspacing="0" >
        <tr>
          <Td width="175"><font style='FONT-SIZE: 11px' color='#666666'>作者&nbsp;:&nbsp;<font style='FONT-SIZE: 11px' color='#1F3174' class="no"><%=rs("editor")%></font></font></td>
          <td valign="top"><table width="100%" height="2"  border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td></td>
              </tr>
            </table>
              <font style='FONT-SIZE: 10px' color='#999999'><%=year(rs("UpdateTime"))%>.<%=month(rs("UpdateTime"))%>.<%=day(rs("UpdateTime"))%></font>&nbsp;<span class="STYLE1">&nbsp;|&nbsp;</span>&nbsp;<font style='FONT-SIZE: 10px' color='#999999'><%=rs("hits")%>HITS</font> </td>
          <td align="right"><%
	  userid=request("userid")
	
	  if CheckUserLogined()=true then
	  UserNamed=Request.Cookies("asp163")("UserName")
	 
	 set userq=server.createobject("adodb.recordset")
sql="select * from [user] where UserName='"&UserNamed&"' order by userid desc"
userq.open sql,Conn_User,1,1

	  
	  userw=userq("userid")
	 
	  If cint(userw)=cint(userid) then
	  
	  %>
              <a href="User_PhotoMod.asp?PhotoID=<%=rs("PhotoID")%>"><img src=user/mody.gif border="0"></a> <a href="User_PhotoDel.asp?PhotoID=<%=rs("PhotoID")%>&userid=<%=userid%>&classid=<%classid=request("classid")%><%=classid%>" onClick="return ConfirmDel();"><img src=user/del.gif border="0"></a>
              <%else
	  end if%>
              <%
	  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" width="1"></td>
      <td height="27" align="center" bgcolor="ffffff"><br>
      <table  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><img src="user/1.jpg" width="16" height="16"></td>
              <td><img src="user/2.jpg" width="85" height="16"></td>
              <td>&nbsp;</td>
              <td align="right"><img src="user/3.jpg" width="85" height="16"></td>
              <td height="16"><img src="user/4.jpg" width="16" height="16"></td>
        </tr>
        <tr>
          <td width="16" valign="top"><img src="user/12.jpg" width="16" height="72"></td>
              <td colspan="3" rowspan="3" align="center"><a href=photo_show.asp?photoid=<%=rs("photoID")%> target="_blank"><img src=<%=rs("PhotoUrl_Thumb")%> name="aa" border=0 id=aa style="<%= rs("styletype")%>"/></a></td>
              <td width="16" valign="top"><img src="user/5.jpg" width="16" height="72"></td>
        </tr>
        <tr>
          <td></td>
              <td></td>
        </tr>
        <tr>
          <td valign="bottom"><img src="user/11.jpg" width="16" height="77"></td>
              <td valign="bottom"><img src="user/6.jpg" width="16" height="77"></td>
        </tr>
        <tr>
          <td><img src="user/10.jpg" width="16" height="16"></td>
              <td><img src="user/9.jpg" width="85" height="16"></td>
              <td>&nbsp;</td>
              <td align="right"><img src="user/8.jpg" width="85" height="16"></td>
              <td height="16"><img src="user/7.jpg" width="16" height="16"></td>
        </tr>
        </table>
          <%else
  end if%>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="10">
          <tr>
            <td><p><font style='FONT-SIZE: 11px' color='#666666'><%=ubbcode(dvHTMLEncode(rs("PhotoIntro")))%></font></p></td>
          </tr>
        </table></td><td bgcolor="#BCBCBC" width="1"></td>
    </tr>

  </table>
  
  <%
photoid=rs("photoid")
set rsc=server.createobject("adodb.recordset")
sql="select * from [photocomment] where photoid="&photoid
rsc.open sql,Conn,1,1

%><%do while not rsc.eof %>

  <%
usernames=rsc("UserName")
set rsuser=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&usernames&"'"
rsuser.open sql,Conn_user,1,1

%>  
<table width="100%" border="0" cellspacing="0" cellpadding="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="25" align="left" bgcolor="F0F0F0">
	  
	  
	    <table width="100%" height="25"  border="0" align="left" cellpadding="0" cellspacing="0">
        <tr>
         <td width="10"></td> 
          <td width="13" align="left"><img src="user/bbs_s02_04.gif" width="11" height="11"></td>
          <td><table width="100%"  border="0" cellspacing="0" cellpadding="3">
            <tr>
              <td><p><a href="user.asp?userid=<%=rsuser("userid")%>&mdid=indexd&htm=indexs.asp?userid=<%=rsuser("userid")%>" target="_blank"><font style='FONT-SIZE: 11px' color='#1F3174' class="no"><%=rsc("username")%></font></a>&nbsp;&nbsp;<font style='FONT-SIZE: 11px' color='#666666'>(<%=rsc("writetime")%>)</font>&nbsp;&nbsp;<%=rsc("content")%></p></td>
            </tr>
          </table> </td>
        </tr>
      </table></td>
      <td bgcolor="#BCBCBC"></td>
    </tr>
    
</table>
  <%rsc.movenext
  loop
  %>

  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="form1" method="post" action="photoCommentsave.asp" onSubmit="return CheckAll();">
    <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="30" align="left" bgcolor="#FFFFFF"><table height="28"  border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="15">&nbsp;</td>
            <td width="35" align="left">评论:</td>
            <td><%if Request.Cookies("asp163")("username") <>"" then%>
			<input name="Content" class="inputnoa" type="text" size="53">
			<%else%>
			<input name="Content" class="inputno" type="text" size="53" value=登录后发表评论 readonly>
			<%end if%>
			<input name="userid" type="hidden" size="50" value="<%=request("userid")%>">
			<input name="classid" type="hidden" size="50" value="<%=request("classid")%>">
			<input name="photoid" type="hidden" size="50" value="<%=rs("photoid")%>"></td><td width="58" align="center">
              <%if Request.Cookies("asp163")("username") <>"" then%>
                            
              <input name="imageField" type="image" src="user/enter.gif" width="46" height="16" border="0"></td><td width="15"></td>
          <%else%><table width="100%" height="3"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td></td>
                </tr>
              </table><img src="user/enter.gif"><%end if%>
		  </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>  </form>
  </table>


  <table width="100%" height="10"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
</table>
  <%rs.movenext
   line=line-1
loop
  %>
  <%rsc.close
set rsc=nothing
rsuser.close
set rsuser=nothing%>
  <center><%call listpages(mycondition)%></center>
  <%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&"&classid="&request("classid")&"&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 '--------定义变量，这些变量在主页面中，进行地址传递%>
  <%end if%>
</body>
</html>
