<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: diaryview.asp
' Version:3.0
' Date: 2005-9-17
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
dim Did
Did=Checkstr(Trim(Request("Did")))
if Did="" or not isnumeric(Did) then
  	errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
else
Did=Clng(Did)
end if
stats="阅读日记"
if Cint(GroupSetting(5))=0 then
  	errmsg=errmsg+"<br>"+"<li>您没有浏览会员日记的权限。"
	founderr=true
end if
call nav()
if founderr then
	call head_var("","")
	call Mslove_error()
else
	call head_var("日记首页","diaryindex.asp")
call main()
end if
call activeonline()
call footer()

sub main()
dim Title,DiaryTemp,Postname,Ispublic,weekname
set rs=server.createobject("adodb.recordset")
sql="select * from Ms_diary where Checked=1 and Ispublic<>0 and Did="&Did&""
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
Title=rs("Title")
Postname=rs("Username")
DiaryTemp=rs("DiaryTemp")
Ispublic=rs("Ispublic")
%>
<style type="text/css">
<!--
.dotline {
	BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; PADDING-BOTTOM: 1px; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid
}
.xuxian {
	BORDER-BOTTOM: #cccccc 1px dotted
}
-->
</style>
<table width="100%" align=center cellpadding=0 cellspacing=0 background="Skins/Default/diary/list_bg1.gif" class=tableborder1>
  <tr align="left"> 
    <td height="14" colspan="2" align="right" valign="bottom" background="Skins/Default/diary/list_bg1.gif"  class=tablebody1><img src=Skins/Default/diary/detail_top<%=DiaryTemp%>.jpg></td>
  </tr>
  <tr align="left"> 
    <td width="97%" height="28" align="right" valign="bottom" background="Skins/Default/diary/list_bg1.gif"  class=tablebody1><a href="diarylist.asp?action=name&username=<%=postname%>" target="_blank"><%=Postname%>作品集</a> <a href=dispuser.asp?username=<%=Postname%> target="_blank">认识作者</a> 
      <a href=javascript:openScript('messanger.asp?action=new&touser=<%=Postname%>',500,400)>发送短信</a> 
      <a href="favlist.asp?action=addU&favurl=diaryview.asp?Did=<%=Did%>">加入收藏</a> 
      <a href="friendlist.asp?action=addF&myFriend=<%=Postname%>" target="_blank">加为好友</a> 
      <a href="sendpage.asp?actsend=diary&id=<%=Did%>">推荐给朋友</a> 
    </td>
    <td width="3%" align="right" valign="bottom" background="Skins/Default/diary/list_bg1.gif"  class=tablebody1>&nbsp;</td>
  </tr>
  <tr align="center" valign="top" background="Skins/Default/diary/list_bg1.gif"> 
    <td height="397" colspan="2"> 
      <table width="93%" height="397" border="0" cellpadding="0" cellspacing="0" class=dotline>
        <tr> 
          <td height="395" align="center" valign="top" bgcolor="#f5f5fa" style="word-wrap:break-word;line-height : 17pt"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="47" align="center"><b><%=Title%></b></td>
              </tr>
              <tr> 
                <td height="27" align="center">作者：<a href=dispuser.asp?username=<%=Postname%>><%=Postname%></a>　　最近更新：<%=replace(rs("Lasttime"),right(rs("Lasttime"),3),"")%>　　人气：<%=rs("hits")%></td>
              </tr>
              <tr> 
                <td height="28" align="center" class=xuxian>日期：<%=rs("Datetime")%>　 <%=weekdayname(WeekDay(rs("Datetime")))%> 
                  　天气：<img src=Skins/Default/weather/<%=rs("Weather")%>.gif border=0 width=13>　 
                  　　心情：<img src=<%=rs("Topic")%> width=20 border=0 align="absmiddle"> 
                  　　<a href="postcomp.asp?Typeid=2&page=diaryview.asp?did=<%=did%>">检举日记</a> 
                </td>
              </tr>
              <TR>
              <tr> 
                <td height="29" align="center">&nbsp;</td>
              </tr>
            </table> 
            <table width="93%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td><%=rs("Content")%></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr align="center"> 
    <td height="27" align="right" background="Skins/Default/diary/list_bg1.gif"  class=tablebody1><a href="diarylist.asp?action=name&username=<%=postname%>" target="_blank"><%=Postname%>作品集</a> <a href=dispuser.asp?username=<%=Postname%> target="_blank">认识作者</a> 
      <a href=javascript:openScript('messanger.asp?action=new&touser=<%=Postname%>',500,400)>发送短信</a> 
      <a href="favlist.asp?action=addU&favurl=<%=Request.ServerVariables("HTTP_REFERER")%>">加入收藏</a> 
      <a href="friendlist.asp?action=addF&myFriend=<%=Postname%>" target="_blank">加为好友</a> 
      <a href="sendpage.asp?actsend=diary&id=<%=Did%>">推荐给朋友</a></td>
    <td height="27" align="right" background="Skins/Default/diary/list_bg1.gif"  class=tablebody1>&nbsp;</td>
  </tr>
</table>
<%end if
rs.close
if Postname<>trim(membername) then'判断是否是自己，否则点击加1
	if split(Reflash,"|")(0)=1 then'防刷新点击
		  if not Request.ServerVariables("REMOTE_ADDR")=request.cookies("IP"&Did&"") then
		  response.cookies("IP"&Did&"")=Request.ServerVariables("REMOTE_ADDR")
		  conn.execute("update Ms_diary set Hits=Hits+1 where Did="&Did&"")
		  end if
	else
		  conn.execute("update Ms_diary set Hits=Hits+1 where Did="&Did&"")
	end if
end if%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
  <tr> 
    <th height="27" align="left"> &nbsp;* 主题：<%=Title%> </th>
  </tr>
  <%Set rs = Server.CreateObject("ADODB.Recordset")
sql="select Topic,LastPost,Title,Content,LastTime from Ms_diaryb where TID="&DID&"  order by LastTime desc"
rs.open sql,conn,1,1
if not (rs.eof and rs.bof) then
do while not rs.eof%>
  <tr>
    <td height="26" class="tablebody2"><img src=<%=rs("Topic")%> width="18" align="absmiddle"> 
      <b><%=rs("Title")%></b>　评论：<a href=dispuser.asp?username=<%=rs("LastPost")%>><%=rs("LastPost")%></a>　时间：<%=rs("LastTime")%></td>
  </tr>
  <tr>
    <td height="27" class="tablebody1"><%=rs("Content")%></td>
  </tr>
  <%rs.movenext
  loop
  rs.close
  end if
%>
</table>
<%
if Ispublic=1 then
if Cint(GroupSetting(99))=0 then
ErrMsg=ErrMsg+"<Br>"+"<li>您没有回复权限，请与管理员联系。"
   	FoundErr=True
exit sub
end if%>
<script language = 'JavaScript'>
function selectPaginationType(){
  document.theForm.PaginationType.value=2;
}
function CheckForm(){
  var CurrentMode=editor.CurrentMode;
  if (CurrentMode==0){
    document.theForm.Content.value=editor.HtmlEdit.document.body.innerHTML; 
  }
  else if(CurrentMode==1){
   document.theForm.Content.value=editor.HtmlEdit.document.body.innerText;
  }
  else{
    alert('预览状态不能保存！请先回到编辑状态后再保存');
    editor.HtmlEdit.focus();
     return false;
  }
  if (document.theForm.Title.value==''){
     alert('日记评论标题不能为空！');
     document.theForm.Title.focus();
     return false;
  }

    if (document.theForm.Content.value==''){
      alert('日记评论内容不能为空！');
      editor.HtmlEdit.focus();
      return false;
    }
}
</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class=tableborder1>
  <form method='POST' name='theForm' onSubmit='return CheckForm();' action='diaryresave.asp' target='_self'>
  <tr> 
      <th height="25" colspan="2" align="left">&nbsp;* 快速评论：<%=Title%></th>
  </tr>
  <tr> <input name="action" type="hidden" id="action" value="re">
      <td width="26%" height="36" align="center" class=tablebody2><strong>评论表情</strong></td>
    <td width="74%" height="36"  class="tablebody2"><strong>评论标题</strong>： 
      <input name="Title" type="text" id="Title" size="35" maxlength="200">
       <%if Cint(Codeshow(3))=1 then%>
	    <strong>验证码：</strong> 
        <input type="text" name="codestr" maxlength="4" size="4"> &nbsp;<%=GetCode()%>
		<%end if%></td>
  </tr>
  <input name="Did" type="hidden" id="Did" value="<%=Did%>">
  <!--指定classid为讨论类-->
  <input name="TID" type="hidden" id="TID" value="<%=Did%>">
  <tr>
    <td width="26%" height="89" align="center" valign="top" class=tablebody2>
<table border="0" cellpadding=3 cellspacing=1 style="width:98%" class=tableborder2>
        <tr> 
          <td height="61" class="tablebody1"> <%dim e
		  for e=1 to 18%> <input type="radio" value="images/topicface/<%=e%>.gif" name="Topic" <%if e=1 then response.write "checked"%>> 
            <img src="images/topicface/<%=e%>.gif" >&nbsp; 
            <%if e>0 and (e mod 3=0) then response.write "<br>"%> <%next%> </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="24"><strong>评论内容：
            </strong> <br>
            <li>评论篇幅长度 <b><font color=red>
		<%if GroupSetting(100)=0 then
		response.Write("不限")
		else
		response.Write(GroupSetting(100))
		end if%></font></b> 字符</li>
		<li>评论操作金钱/篇 <b><%=GroupSetting(102)%> <%=GroupSetting(103)%></b> 元</li>
		<li>评论操作魅力/篇 <b><%=GroupSetting(104)%> <%=GroupSetting(105)%></b> 点</li>
		<li>评论操作经验/篇 <b><%=GroupSetting(106)%> <%=GroupSetting(107)%></b> 点</li></td>
        </tr>
      </table></td>
    <td height="89" valign="top"  class="tablebody1"> <textarea name='Content' style='display:none'></textarea> 
      <iframe id='editor' src='qeditor.asp' frameborder=0 scrolling=no width='540' height='300'></iframe></td>
  </tr>
  <tr align="center"> 
    <td height="31" colspan="2"  class="tablebody2"><input type="submit" name="Submit" value="提交评论">
      　
<input type="reset" name="Submit2" value="清空所有"></td>
  </tr>
  </form>
</table>
<%end if
end sub%>
</body>
</html> 
