<!--#include file="conn.asp"-->
<!--#include file="inc/publicfun.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="bbsuser.asp"-->
<!--#include file="inc/ubbcode.asp" -->
<!-- #include file="inc/htmlencode2.asp"-->
<%
userid=request.cookies("clubuser_id")
%>
<!--#include file="memberinfo.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=Checkstr(htmlencode2(request.form("blogtitle")))
   blogqs=request.form("blogqs")
   blogtypeid=request.form("blogtypeid")
   xinqin=request.form("DiaryHeart")
   writedate=request.form("writedate")
   remenu=Checkstr(request.form("remenu"))
   
   blogtag=Checkstr(request.form("blogtag"))
   bbstag=Checkstr(request.form("bbstag"))
   userip=request.servervariables("remote_addr")
   userid=request.cookies("clubuser_id")
   plqs=request.form("plqs")
   bloghtmfile=request.form("bloghtmfile")
   '阻止IP
   Sql_arrest="select * from BBS_arrest where kind='IP' order by id asc"
   set rs_arrest=server.createobject("adodb.recordset")
   rs_arrest.open sql_arrest,conn,1,1
   do while not rs_arrest.eof
	  if rs_arrest("content")=ip then
		response.write "<SCRIPT language=JavaScript>alert('对不起，你无权发布！');history.go(-1);</script>"        
        response.end
	  end if
      rs_arrest.movenext
   loop
   rs_arrest.close
   '阻止关键字
   Sql_arrest="select * from BBS_arrest where kind='Keyword' order by id asc"
   rs_arrest.open sql_arrest,conn,1,1
   do while not rs_arrest.eof
	  if (instr(menu,rs_arrest("content"))<>0 or instr(title,rs_arrest("content"))<>0) then
		title=replace(title,rs_arrest("content"),"*****")
		menu=replace(menu,rs_arrest("content"),"*****")		
	  end if
      rs_arrest.movenext
   loop
   rs_arrest.close
   set rs_arrest=nothing
  
   if request.cookies("payuser")=3 then
      response.write "<SCRIPT language=JavaScript>alert('你的用户名被管理员封锁,请联系管理员！');history.go(-1);</script>"        
      response.end
   end if

   If getcodeoff=1 Then
      codestr = Trim(request.form("codestr"))
      codename = Trim(request.form("codename"))
      If CStr(Session("GetCode"&codename)) <> CStr(codestr) Then
      response.write "<script language='javascript'>alert('验证码错误，请刷新后重新输入！');window.location.href='adddiary.asp';</script>"
      response.end 
      end if
   End If
   
   remenu=htmlencode2(remenu)
   remenu=ftHTMLCode(remenu)
   remenu=ubbcode(remenu)
   remenu = RegExReplace(remenu,"\b(script)\b"," $1 ")
   remenu = RegExReplace(remenu,"\b(iframe)\b"," $1 ")
   str="update ftblog set blogtitle='"&blogtitle&"',blogcontent='"&remenu&"',blogtypeid="&blogtypeid&",blogqs="&blogqs&",writedate='"&writedate&"',xinqin='"&xinqin&"',userip='"&userip&"',blogtag='"&blogtag&"',userid="&userid&",plqs="&plqs&",bloghtmfile='"&bloghtmfile&"' where id="&id
   conn.execute(str)
   response.redirect "blogcenter.asp"
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">
</head>
<body>
<center>
<title><%=username%>的短信管理中心</title>
<link rel="stylesheet" type="text/css" href="<%=cssfile%>">
<!--#include file="usernav.asp" -->
<div id="main" align="left">
<script language=javascript src="js/windowsize.js"></script>
	<div id="header">
	<div class="lc"><div class="rc"></div></div>
	<div class="tit"><a href="home.asp?userid=<%=userid%>" class="titlink" title="<%=username%>的空间"><%=username%></a></div>
	<div class="desc"><%=homepagetitle%></div>
	<div id="tabline">&nbsp;</div>
	<div id="tab"><a href="home.asp?userid=<%=userid%>" class="on">主页</a><a href="boker.asp?userid=<%=userid%>">博客</a><span>|</span><a href="myphoto.asp?userid=<%=userid%>">相册</a><span>|</span><a href="myinfo.asp?userid=<%=userid%>">个人档案</a>
	</div>
</div>
<div class="stage">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<!--#include file="usercalog.asp" -->
</div>
</td>
<td valign="top" class="c2t1">
<div id="mod_bloglist" class="mod" rel="drag"> 
              <table width="95%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="50">
<div align="center"><strong>编辑日志</strong></div></td>
                </tr>
              </table>
              <table width="95%" border="0" cellspacing="0" cellpadding="0">
                <form name="form1" method="post" action="" onsubmit="return CheckForm(this)">
                  <tr> 
                    <td width="16%" height="27"> 
                      <div align="center">标题：</div></td>
                    <td width="86%"> 
                      <input name="blogtitle" type="text" id="blogtitle" value="<%=rsblog("blogtitle")%>" size="40">
                      是否公开发表？ 
                      <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> 
                    <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> 
                    <td height="28"> 
                      <div align="center">时间：</div></td>
                    <td> 
                      <input name="writedate" type="text" id="writedate" value="<%=rsblog("writedate")%>" size="26"></td>
                  </tr>
                  <tr> 
                    <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> 
                    <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> 
                    <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>
                  <%If getcodeoff=1 Then%>
                  <TR class="maintbtr1"> 
                    <TD width="16%" height="28"> 
                      <div align="center"> &nbsp;验证码：</div></TD>
                    <TD width="84%"> 
                      <input name=codestr id=codestr type=text size=10 maxlength=4> 
                      <%response.write getcode%>
                    </TD>
                  </TR>
                  <%end if%>
                  <tr> 
                    <td height="35"> 
                      <div align="right"></div></td>
                    <td> 
                      <input type="submit" name="submit1" value="提交(Ctrl+Enter)" class="button"> 
                      <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")%>"> 
                    </td>
                  </tr>
                </form>
              </table>
              <br>
            </div>
</td>
</tr></table>
</div>
</div>
<br><center>
    <!--#include file="tail.asp" -->
  </center>
</center>
</body>
</html>
<%closedb%>