<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="../Include/char.asp" -->
<!--#include file="../diary/ubbcode.asp" -->
<%
m_grade=Session("Curgrade")
m_ID = Session("CurUserID")
m_username=CheckStr(request("username"))
m_username_a=Session("CurUserName")

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>襄樊生活网心情日记:</title>
<link href="../css/member.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css"></style>
</head>

<body onLoad="MM_preloadImages('images/hy_b_1b.gif','images/hy_b_3b.gif')">
<!--#include file="../include/top.asp" -->
<!--#include file="../Include/member_Top.asp" -->
<!--#include file="club_top.asp" -->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="10" valign="top"></td>
  </tr>
</table>
<TABLE cellSpacing=0 cellPadding=0 width=780 align=center border=0>
  <TBODY>
    <TR> 
      <TD bgColor=#ffffff colSpan=8><IMG height=83 
      src="images/club_diary1.gif" width=780></TD>
    </TR>
    <TR> 
      <TD width=30 bgColor=#f6f6f6></TD>
      <TD width=6 bgColor=#ffffff></TD>
      <TD width=12 bgColor=#f7f7f7></TD>
	  <TD align=center width=690 bgColor=#ffffff height=150> <table width="100%" border="0" cellpadding="0">
          <tr> 
            <td width="50%"><table width="100%" border="0" cellpadding="0">
                <tr> 
                  <td height="25" align="center"><strong>推荐日记本</strong></td>
                </tr>
                <%
			m_Sql="select top 10 * from RJ_Diary order by f_index desc"
			Set rs = conn.Execute(m_Sql)
			do while not rs.eof 
			Set rs_user = conn.Execute("select f_username FROM T_Member where f_id="&rs("f_userid"))
			if not rs_user.eof then
			%>
                <tr> 
                  <td>&nbsp;&nbsp; <a href="club_member_diary.asp?username=<%=rs_user("f_username")%>" target="_blank"><%=rs("f_diaryname")%></a></td>
                </tr>
                <%
				end if
				rs_user.close
				set rs_user=nothing
			rs.movenext
			loop
			rs.close
			set rs=nothing
			%>
              </table></td>
            <td width="50%"><table width="100%" border="0" cellpadding="0">
                <tr> 
                  <td height="25" align="center"><strong>最新日记本</strong></td>
                </tr>
                <%
			m_Sql="select top 10 * from RJ_Diary order by f_addtime desc"
			Set rs = conn.Execute(m_Sql)
			do while not rs.eof 
			Set rs_user = conn.Execute("select f_username FROM T_Member where f_id="&rs("f_userid"))
			if not rs_user.eof then
			%>
                <tr> 
                  <td>&nbsp;&nbsp; <a href="club_member_diary.asp?username=<%=rs_user("f_username")%>" target="_blank"><%=rs("f_diaryname")%></a></td>
                </tr>
                <%
				end if
				rs_user.close
				set rs_user=nothing
			rs.movenext
			loop
			rs.close
			set rs=nothing
			%>
              </table></td>
          </tr>
        </table>

        <%  
	  
	 
		

					dim PerPage
					set rs_c=server.createobject("adodb.recordset")
					sql_c="select f_userid,f_title,f_content,f_weather,f_addtime,F_HeartPic from rj_diarylist where f_islock=1 order by F_Addtime desc"
					rs_c.open sql_c,conn,1,1
					'flag="尚未处理"
                    PerPage=15
				
                   '假如没有数据时
                  If rs_c.eof and rs_c.bof then
                 response.write "<p align='center'><font color=#666666 size=2><strong>该会员还未公开的心情日记！</strong></font></p>"
                   else
                
					'取得页数,并判断用户输入的是否数字类型的数据，如不是将以第一页显示
                    text="0123456789"
                    Rs_c.PageSize=PerPage
					
                    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 checkpage<>0 then
                  If NOT IsEmpty(request("page")) Then
                  CurrentPage=Cint(request("page"))
                  If CurrentPage < 1 Then CurrentPage = 1
                  If CurrentPage > Rs_c.PageCount Then CurrentPage = Rs_c.PageCount
                  Else
                  CurrentPage= 1
                  End If
                 If not Rs_c.eof Then Rs_c.AbsolutePage = CurrentPage end if
                 Else
                 CurrentPage=1
                 End if					
				%> 
        <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
          <TBODY>
            <TR> 
              <TD vAlign=top align=middle width=660 
            height=25>该会员总共有&nbsp;<B><%=Cstr(rs_c.RecordCount)%></B>&nbsp;篇公开的心情日记，每页&nbsp;<B><%=PerPage%></B>&nbsp;篇，共&nbsp;<B><%=Cstr(rs_c.pagecount)%></B>&nbsp;页，当前是第&nbsp;<B><%=CurrentPage%></B>&nbsp;页</TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE style="TABLE-LAYOUT: fixed" cellSpacing=1 cellPadding=0 width=100% 
      bgColor=#CCCCCC border=0>
          <TBODY>
            <%
if not rs_c.eof then
i=0
do while not rs_c.eof
%>
            <TR> 
              <TD width=660 bgColor=#f2f2f2 
            height=25>&nbsp;&nbsp;<%=rs_c("F_title")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;<%= formatdatetime(rs_c("F_Addtime"),1) %>&nbsp;|&nbsp;&nbsp;<%= rs_c("F_Weather") %>&nbsp;&nbsp;| 
                <%
			Set rs_user = conn.Execute("select f_username FROM T_Member where f_id="&rs_c("f_userid"))
			if not rs_user.eof then
			%>
			<a href="club_member_diary.asp?username=<%=rs_user("f_username")%>" target="_blank"><%=rs_user("f_username")%></a> 写道： 
                <% 
			end if 
			rs_user.close
			set rs_user=nothing
			%>
			</TD>
            </TR>
            <TR> 
              <TD 
          style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; WORD-BREAK: break-all; LINE-HEIGHT: 150%; PADDING-TOP: 8px" 
          bgColor=#FFFFFF><img src="<%=rs_c("F_HeartPic")%>" width="40" height="40">&nbsp;&nbsp;<font color="#666666"><%=ubbCode(rs_c("F_Content"))%></font></TD>
            </TR>
            <%
i=i+1
if i >= Perpage then exit do
rs_c.movenext
loop
end if
%>
          </TBODY>
        </TABLE>
        <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
          <TBODY>
            <TR> 
              <TD vAlign=bottom align=middle width=660 height=25> <% If currentpage > 1 Then  %> &nbsp;<a href='club_diary.asp?username=<%=m_username%>&page=<%=cstr(1)%>'><SPAN style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">9</SPAN></a> 
                &nbsp;<a href='club_diary.asp?username=<%=m_username%>&page=<%=Cstr(currentpage-1)%>'><SPAN style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">7</SPAN></a> 
                &nbsp;
                <% Else  %> &nbsp;<SPAN style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">9</SPAN> 
                &nbsp;<SPAN style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">7</SPAN> 
                <% end if %> <%
			  if rs_c.pagecount>8 then
			  n_star=currentpage
			  n_end=currentpage+7
			  else
			  n_star=1
			  n_end=rs_c.pagecount			  
			  end if
			  %> <% FOR n=n_star to n_end %> <% if n>rs_c.pagecount then  exit for  end if%> &nbsp;<a href='club_diary.asp?username=<%=m_username%>&page=<%=n%>'><FONT color=#ff0000><B><%=n%></B></FONT></a> <%
					  next
					  %> <% If currentpage < Rs_c.PageCount Then %> &nbsp;<a href='club_diary.asp?username=<%=m_username%>&page=<%=Cstr(currentPage+1)%>'><SPAN  style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">8</SPAN></a> 
                &nbsp;<a href='club_diary.asp?username=<%=m_username%>&page=<%=Cstr(Rs_c.PageCount)%>'><SPAN  style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">:</SPAN></a> 
                <% else %> &nbsp;<SPAN  style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">8</SPAN> 
                &nbsp;<SPAN  style="FONT-SIZE: 15px; COLOR: #000000; FONT-FAMILY: webdings">:</SPAN> 
                <% end if %> </TD>
            </TR>
          </TBODY>
        </TABLE>
        <%    end if
				  
		%> </TD>
      
      <TD width=8 bgColor=#f7f7f7></TD>
      <TD width=7 bgColor=#ffffff></TD>
      <TD width=27 bgColor=#f6f6f6></TD>
    </TR>
    <TR> 
      <TD bgColor=#ffffff colSpan=8><IMG height=55 
      src="images/club_memberbottem.gif" width=780></TD>
    </TR>
    <TR bgColor=#ffffff> 
      <TD colSpan=8 height=5></TD>
    </TR>
  </TBODY>
</TABLE>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="10" valign="top"></td>
  </tr>
</table>
<!--#include file="../Include/Bottom.asp" -->
</body>
</html>
