<!--#include file="conn.asp"-->
<!--#include file="admin/check_master.asp" -->
<!-- #include file="inc/htmlencode2.asp"-->
<!--#include file="inc/ubbcode.asp"-->
<%
call FTBBS_HTML_MB
url=Application("FTBBSMB")(10,0)
upfiletype=Application("FTBBSMB")(12,0)
upfilesize=Application("FTBBSMB")(13,0)
getcodeoff=Application("FTBBSMB")(30,0)
htm_ext=Application("FTBBSMB")(32,0)
if htm_ext="" then htm_ext=".htm"

if request.form("act")="y" then
   id=request.form("id")
   blogtitle=htmlencode2(request.form("blogtitle"))
   blogqs=request.form("blogqs")
   blogtypeid=request.form("blogtypeid")
   xinqin=request.form("DiaryHeart")
   writedate=request.form("writedate")
   remenu=request.form("remenu")
   blogtag=request.form("blogtag")
   bbstag=request.form("bbstag")
   userip=request.servervariables("remote_addr")
   userid=request.cookies("clubuser_id")
   plqs=request.form("plqs")
   bloghtmfile=request.form("bloghtmfile")

   if len(remenu)<=0 then
	  response.write "<SCRIPT language=JavaScript>alert('内容不能为空！');history.go(-1);</script>"        
      response.end
   end if   
   
   remenu=htmlencode2(remenu)
   remenu=ftHTMLCode(remenu)
   remenu=ubbcode(remenu)
   str="update ftblog set blogtitle='"&blogtitle&"',blogcontent='"&remenu&"',blogtypeid="&blogtypeid&",blogqs="&blogqs&",writedate='"&writedate&"',xinqin='"&xinqin&"',userip='"&userip&"',blogtag='"&blogtag&"',plqs="&plqs&",bloghtmfile='"&bloghtmfile&"' where id="&id
   conn.execute(str)
   response.redirect request("reurl")
end if
sql="select * from ftblog where id="&request("id")
set rsblog=server.createobject("adodb.recordset")
rsblog.open sql,conn,3,1
%>
<html><head><meta http-equiv=content-type content="text/html; charset=gb2312">
<link href="css/xmwuye.css" rel="stylesheet" type="text/css">
</head>
<body>
 
              
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
                  <td height="50" bgcolor="#FFFFFF">
<div align="center"><strong>编辑日志</strong></div></td>
                </tr>
              </table>
              
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post" action="" onsubmit="return CheckForm(this)">
    <tr bgcolor="#FFFFFF"> 
      <td width="16%" height="27"> <div align="center">标题：</div></td>
      <td width="86%"> <input name="blogtitle" type="text" id="blogtitle" value="<%=rsblog("blogtitle")%>" size="50">
        是否公开发表？ 
        <select name="blogqs" id="blogqs">
          <option value="0" <%if rsblog("blogqs")=0 then%>selected<%end if%>>是</option>
          <option value="1" <%if rsblog("blogqs")=1 then%>selected<%end if%>>否</option>
        </select></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="28"> <div align="center">分类：</div></td>
      <td> <select name="blogtypeid" id="blogtypeid">
<%
   sql="select * from ftblog_type where blogphoto=0 order by id desc"
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,3
   do while not rs.eof
%>
          <option value="<%=rs("id")%>" <%if rs("id")=rsblog("blogtypeid") then%>selected<%end if%>><%=rs("blogtype")%></option>
          <%
rs.movenext
loop
rs.close
%>
        </select>
        心情： 
        <select name="select" id="postheart" Onchange="setHeart();">
          <option value="" <%if rsblog("xinqin")="" then%>selected<%end if%>>无</option>
          <option value="一般" <%if rsblog("xinqin")="一般" then%>selected<%end if%>>一般</option>
          <option value="开心" <%if rsblog("xinqin")="开心" then%>selected<%end if%>>开心</option>
          <option value="伤心" <%if rsblog("xinqin")="伤心" then%>selected<%end if%>>伤心</option>
          <option value="郁闷" <%if rsblog("xinqin")="郁闷" then%>selected<%end if%>>郁闷</option>
          <option value="茫然" <%if rsblog("xinqin")="茫然" then%>selected<%end if%>>茫然</option>
          <option value="说不清" <%if rsblog("xinqin")="说不清" then%>selected<%end if%>>说不清</option>
          <option value="selfHeart">自填心情</option>
        </select> &nbsp; <input name="DiaryHeart" id="myheart" style="display:none;" size="14" maxlength="10"> 
        <script language="JavaScript">
function setHeart()
{
if(document.getElementById("postheart").value == "selfHeart")
{
document.getElementById("myheart").style.display = "";
document.getElementById("myheart").style.color = "#c0c0c0";
document.getElementById("myheart").value = "请输入自填心情";
}
else
{
document.getElementById("myheart").style.display = "none";
document.getElementById("myheart").value = document.getElementById("postheart").value;
}
}
function isNum(theNum)
{
if (theNum =="")
return false;
for(var i=0;i<theNum.length;i++){
oneNum=theNum.substring(i,i+1);
if (oneNum<"0" || oneNum>"9")
return false;
}
return true;
}
</script> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="28"> <div align="center">时间：</div></td>
      <td> <input name="writedate" type="text" id="writedate" value="<%=rsblog("writedate")%>" size="26"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height=300></td>
      <td> <TEXTAREA type="hidden" rows=1 cols=1 name="remenu" style="position:absolute;left:0;visibility:hidden;"><%=rsblog("blogcontent")%></textarea> 
        <SCRIPT src="htmledit/bloghtml.js"></SCRIPT> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="28"> <div align="center">标签：</div></td>
      <td> <input name="blogtag" type="text" id="blogtag" value="<%=rsblog("blogtag")%>" size="28">
        多个标签用&quot;|&quot;线分开.</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="28"> <div align="center">评论：</div></td>
      <td> <input name="plqs" type="radio" value="0" <%if rsblog("plqs")=0 then%>checked<%end if%>>
        允许 
        <input type="radio" name="plqs" value="1" <%if rsblog("plqs")=1 then%>checked<%end if%>>
        禁止</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="35"> <div align="right"></div></td>
      <td> <input type="submit" name="Submit1" value="提交(Ctrl+Enter)" class="button" <%if instr(session("admin_qs"),2)<=0 then%>disabled<%end if%>> 
        <input name="act" type="hidden" id="act" value="y"> <INPUT type="hidden" name="id" value="<%=rsblog("id")%>"> 
        <input name="bloghtmfile" type="hidden" id="bloghtmfile" value="<%=rsblog("bloghtmfile")%>">
        <input name="reurl" type="hidden" id="reurl" value="<%=request.serverVariables("Http_REFERER")%>"> 
      </td>
    </tr>
  </form>
</table>
</body>
</html>
<%closedb%>