<!--#include file="../conn.asp" -->
<!--#include file="inc.asp" -->
<%
if Trim(request.QueryString("id"))<>"" then
id=Trim(request.QueryString("id"))
else
response.Write("<script language='javascript'>alert('该条日记被锁，你只能看到标题，请登陆后查看！');</script>") 
response.write "<script>window.close();</script>"
response.end() 
response.Redirect("/index.asp")
end if

set rs=server.CreateObject("adodb.Recordset")
sql="Select * From diary where diaryid="&id&""
Rs.Open sql,conn,1,1
userid=rs("userid")
display=rs("display")
rs.close
'set rs=server.CreateObject("adodb.Recordset")
sql2="select * from diaryuser where userid="&userid&""
Rs.Open Sql2,conn,1,1
user=rs("username")
bookname=rs("bookname")
rs.close

if session("username")=user then
else
if display=0 then
response.Write("<script language='javascript'>alert('该条日记被锁，你只能看到标题，请登陆后查看！');</script>") 
response.write "<script>window.close();</script>"
response.end() 
else
end if
end if
'set rs=server.CreateObject("adodb.Recordset")
if session("username")=user then
sql2="select * from diary where diaryid="&id&""
else
sql2="select * from diary where diaryid="&id&" and display=1"
end if
Rs.Open Sql2,conn,1,1
bg=rs("bg")
tq=rs("tq")
xq=rs("xq")

Set rx = Server.CreateObject("ADODB.Recordset")
  sql="select * from xqlist where xqorder="&CInt(xq)
   rx.open sql,conn,3,2
   xq=rx("xqcontent")
   rx.update
   rx.close

time1=rs("diarytime")
content=rs("content")
ptitle=rs("title")
typeid=rs("typeid")
rs.close
'set rs=nothing
'set rs2=server.CreateObject("adodb.Recordset")
sql22="select * from diarytype where id="&cint(typeid)&""
Rs.Open Sql22,conn,1,1
rijitype=rs("type")
rs.close
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>《<%=ptitle%>》 日记本:<%=bookname%></title>
<meta name="keywords" content="日记,免费日记,心情日记,网络日记,免费日记,隐私日记,交换日记,粉可爱留言本、日记本申请">
<link href="<%=alltubg%>css.css" rel="stylesheet" type="text/css">
<script src="<%=alltubg%>alt.js"></script>

</head>

<body background="<%=bgrnd%>" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0">
<div align="center">
<table width="990" border="0" cellspacing="0" cellpadding="0" height="920">
    <tr>
      <td background="<%=alltubg%>play/riji.gif">
        <table border="0" width="989" id="table2" cellspacing="0" cellpadding="0" height="740">
          <tr> 
            <td width="81">&nbsp; </td>
            <td width="81">&nbsp; </td>
            <td width="39">&nbsp; </td>
            <td width="581" valign="bottom"> 
              <table border="0" width="581" id="table6" height="720" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="165" bgcolor="#FFF2EC" width="581" colspan="3"> 
                    <p align="center"> <img border="0" src="<%=alltubg%><%=bg%>"> 
                  </td>
                </tr>
                <tr> 
                  <td height="10" valign="middle" bgcolor="#FFF2EC" width="60">&nbsp;&nbsp;<%=xq%></td>
                  <td height="10" valign="middle" bgcolor="#FFF2EC" width="50"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
                        <td align="right">天气:</td>
                        <td align="left"><img src="<%=alltubg%><%=tq%>" border="0" align="middle"></td>
  </tr>
</table>
</td>
                  <td height="10" valign="middle" bgcolor="#FFF2EC" width="471">&nbsp;分类:<%=rijitype%>　日记本:<a target="_blank" href="/?i=<%=userid%>"><%=bookname%></a>　作者:<a target="_blank" href="/?i=<%=userid%>"><%=user%></a>　<%=time1%></td>
                </tr>
                <tr valign="top"> 
                  <td width="581" colspan="3">
<DIV id=demo style="overflow-y:auto;height :520px;width :98%;margin:5px 0 0 10px;background-color:white;
border-width :1px;border-style :none ;border-color :black ;background:'#FFF2EC';background-image:url('<%=alltubg%>img/bg_line.gif');">
<%=content%>
</DIV>
</td>
                </tr>
              </table>
            </td>
            <td width="51">&nbsp; </td>
            <td width="83">&nbsp; </td>
            <td width="73">&nbsp; </td>
          </tr>
        </table>
        <table border="0" width="989" cellspacing="0" cellpadding="0" id="table3" height="98">
          <tr> 
            <td width="81">&nbsp; </td>
            <td width="81">&nbsp; </td>
            <td width="39">&nbsp; </td>
            <td width="581">
              <table border="0" width="581" id="table7" cellspacing="0" cellpadding="0" height="98">
                <tr> 
                  <td width="135">　</td>
                  <td width="229" colspan="2">　</td>
                  <td width="217" colspan="2">　</td>
                </tr>
                <%
set rs=server.CreateObject("adodb.Recordset")
sql8="Select * From replay where playid="&id&" order by id desc"
Rs.Open sql8,conn,1,1
dim replayno
IF Rs.Eof and rs.bof Then
replayno=0
else
end if
do while not rs.eof
%>
                <%
replayno=replayno+1
%>
                <%
rs.movenext 
loop
%>
                <%
rs.close
%>
                <tr> 
                  <td width="135">　</td>
                  <td width="53">　</td>
                  <td width="176">　此篇日记共有<%=replayno%>个评论</td>
                  <td width="95"> <a target="_blank" href="<%=diarydir%>u/replay.asp?id=<%=id%>&userid=<%=userid%>&user=<%=user%>"> 
                    <img border="0" src="<%=alltubg%>img/re.gif" width="87" height="21"></a></td>
                  <td width="122"> <a target="_blank" href="<%=diarydir%>u/replay.asp?id=<%=id%>&userid=<%=userid%>&user=<%=user%>"> 
                    <img border="0" src="<%=alltubg%>img/see.gif" width="87" height="21"></a></td>
                </tr>
                <tr> 
                  <td width="135" height="51">　</td>
                  <td width="53" height="51">　</td>
                  <td width="176" height="51">　</td>
                  <td width="95" height="51">　</td>
                  <td width="122" height="51">　</td>
                </tr>
              </table>
            </td>
            <td width="51">&nbsp; </td>
            <td width="83">&nbsp; </td>
            <td width="73">&nbsp; </td>
          </tr>
        </table>
        <table border="0" width="990" cellspacing="0" cellpadding="0" id="table4" height="82">
          <tr> 
            <td width="82">&nbsp; </td>
            <td width="81">&nbsp; </td>
            <td width="39">&nbsp; </td>
            <td width="581" align="center"> 
              <table border="0" width="550" id="table5" cellspacing="0" cellpadding="0" height="55">
                <tr> 
                  <td height="55" background="<%=alltubg%>bg3.gif" width="550">　 
                    <% call linkdow %>
                  </td>
                </tr>
              </table>
            </td>
            <td width="51">&nbsp; </td>
            <td width="83">&nbsp; </td>
            <td width="73">&nbsp; </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>

</body>

</html>


