<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="Diary_Conn.asp"-->
<!--#INCLUDE FILE="Class_Checkuser.asp" -->
<!--#INCLUDE FILE="Class_Top.asp" -->
<%
locat="风铃日记"

if membername="" Then
  	ErrMsg=ErrMsg+"<br>"+"<li>您还没有<a href=Class_Login.asp><font color=red>登录或注册校友录</font></a>。"
	Call top(1,1)
	Call Error("Information",ErrMsg)
	
	call footer() 
Else
 call top(1,1)

call plus_main()
 call footer() 
 end if
dim ismast,content
Sub plus_main()
%>
<script language="JavaScript" src="Diary_mainjs.js"></script>
<script language="VBScript" src="Diary_mainvbs.js"></script>

<table width=100% border=0 align="center" cellpadding=0 cellspacing=0 class="tableborder1">
  <tr> 
    <td width=100% height=*% valign=top align=left>
	  <p>
        
      </p>
      <% 
	  dim zmx,tmx
	  set rs=server.createobject("adodb.recordset")
sql="select count(*) as c,'zmx' as n from clasky_diary where state = 'v' union select count(*) as c, 'tmx' as n from clasky_diary where state = 'v' and addtime like '"&formatdatetime(now,2)&"'"			
    rs.open sql,clasky_cn,1,3
	do while not rs.eof 
	if rs("n")="zmx" then 
	zmx=rs("c")
	else
	tmx=rs("c")
	end if
	rs.movenext
	loop
	rs.close
	  
	   %>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
        <tr> 
          <th height="25" colspan="2">风铃日记 (共 <%= zmx %> 篇，今日：<font color="#FF0000"><%= tmx %> 
            </font>篇)</th>
        </tr>
        <tr> 
          <td width="75%" valign="top" class=tablebody1><br>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
              <tr> 
                <td width="49" class="TopLighNav1" style="cursor:hand" onClick="add_diary()" title="赶快来写今天的日记吧！"><div align="center"><font color="#FF0000">写日记</font></div></td>
                <td width="80" class="TopLighNav1" ><div align="center"><a href="Diary_index.asp">日记首页</a></div></td>
                <td width="100" class="TopLighNav1"><div align="center"><a href="Diary_list.asp">所有日记</a></div></td>
                <td width="100" class="TopLighNav1"><div align="center"><a href="Diary_list.asp?ziduan=whois&text=<%=membername%>">我的日记</a></div></td>
                <td width="100" class="TopLighNav1"><div align="center"><a href="Diary_list.asp?ziduan=addtime&text=<%=formatdatetime(now,2)%>">今天日记</a></div></td>
                <td class="TopLighNav1"><div align="center">&nbsp;</div></td>
              </tr>
            </table>
            <br>
            <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
        <th colspan="6" height="20"><div align="left">-=> 最新日记</div></th>
		  <tr> 
            <td width="40" class="TopLighNav1"><div align="center">排 名</div></td>
            <td class="TopLighNav1"><div align="center">标 题</div></td>
            <td width="85" class="TopLighNav1"><div align="center">作 者</div></td>
            <td width="75" class="TopLighNav1"><div align="center">时 间</div></td>
            <td width="45" class="TopLighNav1"><div align="center">天 气</div></td>
            <td width="45" class="TopLighNav1"><div align="center">人 气</div></td>
          </tr>
          <% 

dim id,whois,title,content,weather,xinqing,ispub,addtime,dotime,hitnum
i=0
sql="select top 10 * from clasky_diary where (state = 'v' and ispub='1') order by dotime desc "			
    rs.open sql,clasky_cn,1,3
	if rs.eof then
'    Response.Write "<li>还没有事件</li>"
	else
	do while not rs.eof and i<10
	id=rs("id")
	weather=doweather(rs("weather"))
	xinqing=rs("xinqing")
	title=rs("title")
	addtime=FormatDateTime(rs("addtime"),2)
	whois=rs("whois")
	
	hitnum=rs("hitnum")

	i=i+1
	
	
 %>
          <tr bgcolor="#FFFFFF"> 
            <td><div align="center"><font color="#666666"><%=i%> </font></div></td>
                <td><a href="#" onClick="show_diary(<%= id %>)"><%= title %></a></td>
            <td><div align="center"><font color="#666666"><a href="Diary_list.asp?ziduan=whois&text=<%=whois%>" title="查看他/她的所有日记"><%= whois %></a></font></div></td>
            <td><div align="center"><font color="#666666"><%= addtime %></font></div></td>
            <td><div align="center"><img src="images/clasky_diary/<%= weather %>" width="17" height="17"></div></td>
            <td><div align="center"><strong><font color="#FF0000"><%= hitnum %></font></strong></div></td>
          </tr>
          <%

rs.movenext
loop
end if
rs.close%>
        </table>  
			
            <br><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
              <th colspan="6" height="20"><div align="left">-=> 日记排行</div></th>
              <tr> 
                <td width="40" class="TopLighNav1"><div align="center">排 名</div></td>
                <td class="TopLighNav1"><div align="center">标 题</div></td>
                <td width="85" class="TopLighNav1"><div align="center">作 者</div></td>
                <td width="75" class="TopLighNav1"><div align="center">时 间</div></td>
                <td width="45" class="TopLighNav1"><div align="center">天 气</div></td>
                <td width="45" class="TopLighNav1"><div align="center">人 气</div></td>
              </tr>
			  
 <% 
i=0
sql="select top 10 * from clasky_diary where (state = 'v' and ispub='1') order by hitnum desc "			
    rs.open sql,clasky_cn,1,3
	if rs.eof then
'    Response.Write "<li>还没有事件</li>"
	else
	do while not rs.eof and i<10
	id=rs("id")
	weather=doweather(rs("weather"))
	xinqing=rs("xinqing")
	title=rs("title")
	addtime=FormatDateTime(rs("addtime"),2)
	whois=rs("whois")
	
	hitnum=rs("hitnum")

	i=i+1
	
	
 %>
              <tr bgcolor="#FFFFFF"> 
                <td><div align="center"><font color="#666666"><%=i%> </font></div></td>
                <td><a href="#" onClick="show_diary(<%= id %>)"><%= title %></a></td>
                <td><div align="center"><font color="#666666"><a href="Diary_list.asp?ziduan=whois&text=<%=whois%>" title="查看他/她的所有日记"><%= whois %></a></font></div></td>
                <td><div align="center"><font color="#666666"><%= addtime %></font></div></td>
                <td><div align="center"><img src="images/clasky_diary/<%= weather %>" width="17" height="17"></div></td>
                <td><div align="center"><strong><font color="#FF0000"><%= hitnum %></font></strong></div></td>
              </tr>
              <%

rs.movenext
loop
end if
rs.close%>
            </table>
            <p>&nbsp;</p></td>
          <td width="25%" valign="top" class=tablebody2>
		  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
              <tr>
                <th height="20">日记检索</th>
              </tr>
              <tr>
                <td class=tablebody1><form name="form1" method="post" action="Diary_list.asp">
                    <table border="0" cellspacing="0" cellpadding="3">
                      <tr> 
                        <td><div align="center">请选择： </div></td>
                        <td><select name="ziduan" id="ziduan">
                            <option value="title" selected>－－ 标 题 －－</option>
                            <option value="whois">－－ 作 者 －－</option>
                          </select></td>
                      </tr>
                      <tr> 
                        <td><div align="center">关键字： </div></td>
                        <td><input name="text" type="text" id="text" size="17"></td>
                      </tr>
                      <tr> 
                        <td width="30%"><div align="center"> </div></td>
                        <td width="70%"><input name="Submit" type="submit" class="clsPart" value="开始检索"> 
                          <input name="Submit2" type="reset" class="clsPart" value="重置"></td>
                      </tr>
                    </table>
                  </form></td>
              </tr>
              <tr>
                <td class=tablebody1>&nbsp;</td>
              </tr>
            </table>
            <br>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
              <tr> 
                <th height="20">我的日记</th>
              </tr>
              <tr> 
                <td class=tablebody1> <div align="center"></div>
                  <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1">
  <tr> 
    <td colspan="2" style="cursor:hand" onClick="writemonth(clasky_c-1)" title="上月"><div align="center"><font face="Webdings">3</font></div></td>
    <td colspan="3"><div align="center"><b id=nowmonth></b></div></td>
    <td colspan="2" style="cursor:hand" onClick="writemonth(clasky_c+1)" title="下月"><div align="center"><font face="Webdings">4</font></div></td>
  </tr>
  <tr> 
    <td class="TopLighNav1"><div align="center">日</div></td>
    <td class="TopLighNav1"><div align="center">一</div></td>
    <td class="TopLighNav1"><div align="center">二</div></td>
    <td class="TopLighNav1"><div align="center">三</div></td>
    <td class="TopLighNav1"><div align="center">四</div></td>
    <td class="TopLighNav1"><div align="center">五</div></td>
    <td class="TopLighNav1"><div align="center">六</div></td>
  </tr>
</table>



				  
			    </td>
              </tr>
              <tr> 
                <td class=tablebody1><div id="monthdate"></div></td>
              </tr>
            </table> 
            <br>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
              <tr> 
                <th height="20">今日首篇</th>
              </tr>
			  <% 
	sql="select top 5 * from clasky_diary where (addtime like '"&formatdatetime(now,2)&"' and state = 'v' and ispub='1') order by dotime"			
    rs.open sql,clasky_cn,1,3
	if rs.eof then
'    Response.Write "<li>还没有事件</li>"
	else
	do while not rs.eof  
	id=rs("id")
			  title=rs("title")
whois=rs("whois")
			   %>
              <tr> 
                <td class=tablebody1><a href="#" onClick="show_diary(<%= id %>)"><font face="Webdings">4</font> <%= title %> </a><font color="#003399"><a href="Diary_list.asp?ziduan=whois&text=<%=whois%>" title="查看他/她的所有日记"><%= whois %></a></font></td>
              </tr>
			  <% 
rs.movenext
loop
end if
rs.close
			  
			   %>
			  

			   <tr> 
                <td class=tablebody1>&nbsp;</td>
              </tr>
            </table> 
            <br>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
              <tr> 
                <th height="20">日记富翁</th>
              </tr>
              <% 
			  i=0
			  dim mx
	sql="select top 5 count(*) as mx,whois from clasky_diary where (state = 'v' and ispub='1') group by whois order by count(*) desc"			
    rs.open sql,clasky_cn,1,3
	if rs.eof then
'    Response.Write "<li>还没有事件</li>"
	else
	do while not rs.eof and i<5
	mx=rs("mx")
	whois=rs("whois")
			   %>
              <tr> 
                <td class=tablebody1><a href="#" onClick="show_diary(<%= id %>)"><font face="Webdings">4</font> <a href="Diary_list.asp?ziduan=whois&text=<%=whois%>" title="查看他/她的所有日记"><%= whois %></a> (<%=mx%>)
                  </a></td>
              </tr>
              <% 
i=i+1
rs.movenext
loop
end if
rs.close
			  
			   %>
              <tr> 
                <td class=tablebody1>&nbsp;</td>
              </tr>
            </table> </td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>

    </td>
  </tr>
   
</table>

<% 
dim mydiary
mydiary=","

sql="select addtime from clasky_diary where (state = 'v' and whois='"&membername&"')"			
    rs.open sql,clasky_cn,1,3
	if rs.eof then
'    Response.Write "<li>还没有事件</li>"
	else
	do while not rs.eof 
	mydiary=mydiary&datediff("d","2003-1-1",rs("addtime"))&","

	rs.movenext
	loop
end if
rs.close
Response.Write("<script language=""VBScript"">")
Response.Write("dodiary("""&mydiary&""")")
Response.Write("</script>")

call Close_clasky_cn


end sub %>

<%
 
function doweather(w)
select case w
	case "晴天" doweather="image/shine.gif"
	case "阴天" doweather="image/cloud.gif"
	case "雨" doweather="image/rain.gif"
	case "雪" doweather="image/xue.gif"
	case "雾" doweather="image/wu.gif"
end select

end function


 %>