<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/config.asp"-->
<!--#include file="../conn/nosql.asp"-->
<%if Not ChkPosturl then response.redirect ("../login.asp")
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("../../index.asp")
end if
if session("adminname")="" then
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
end if
if nosql(request("action"))="save" then
''''''''''替换模块START''''''''''''
Function ReplaceText(fString,patrn, replStr)
Set regEx = New RegExp  ' 建立正则表达式。
regEx.Pattern = patrn   ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
regEx.Global = True     ' 设置全局可用性。 
ReplaceText = regEx.Replace(fString, replStr) ' 作替换。
End Function
''''''''''替换模块END''''''''''''
function ContentEncode(fString)
fString=Replace(fString ,vbCrLf,"<br>")
fString=Replace(fString,chr(32)&chr(32), "<BR>")
fString=replace(fString,vbCrlf, "")
fString=replace(fString,"\","&#92;")
fString=replace(fString,"'","&#39;")
fString=replace(fString,"我爱你gege","<Img src=../gege.jpg>")
fString=ReplaceText(fString,"<(.[^>]*)(&#|cookie|window.|Document.|javascript:|js:|vbs:|about:|file:|on(blur|click|change|Exit|error|focus|finish|key|load|mouse))", "&lt;$1$2$3")
fString=ReplaceText(fString,"<(\/|)(iframe|object|SCRIPT|form|style|meta|TEXTAREA)", "&lt;$1$2")
ContentEncode=fString
end function

faceimg=nosql(trim(request.form("faceimg")))
body=ContentEncode(request.form("body"))
show=ContentEncode(request.form("show"))
zshow=nosql(request.form("zshow"))
id=nosql(request("id"))
bid=nosql(request("bid"))
body=body&show
if show<>"" and zshow<>"" then
Response.Write "<script Language=Javascript>alert('使用魔法表情请先关闭文字秀功能！');javascript:history.go(-1)</script>"
Response.end
end if

if len(body)<1  then
response.write"<script language='javascript'>alert('对不起，内容不能小于一个字符')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if

'ls=session("lasttime")
if ls+1/8640>now() then
response.write"<script language='javascript'>alert('请不要重复提交帖子')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("../../index.asp")
end if

if session("adminname")="" then
sql="select * from snsn_user where  id="&session("id")&""
Set rsjf= Server.CreateObject("ADODB.Recordset") 
rsjf.open sql,conn,1,3
if rsjf.eof or rsjf.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此用户，请确认后或联系管理员再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
rsjf.close
set rsjf=nothing
end if


set rs=server.CreateObject("adodb.recordset")
sql="select * from snsn_bbs where id="&id
rs.open sql,conn,1,3
if rs("userid")=session("id") then
body=body&"<br>此帖子被作者编辑于："&now()&""
rs("body")=body
else
body=body&"<br>此帖子被管理员编辑于："&now()&""
rs("body")=body
end if
rs("faceimg")=faceimg
rs("wdate")=now()
rs("ldate")=now()
rs("userid")=web_id
if zshow<>"" then
rs("zshow")=1
else
rs("zshow")=0
end if
rs.update
rs.close
set rs=nothing
response.redirect "view.asp?id="&bid
else
if isChkInteger(request("bid")) then
bid=request("bid")
else
Response.Redirect ("../../index.asp")
end if
sql="select * from snsn_bbs where id="&id&""
Set Rs=Conn.Execute(sql)
title=rs("title")
bbsclass=rs("bbsclass")
if session("user")<>rs("username") and session("bbsbz")<>"yes" then
response.write"<script language='javascript'>alert('没有权限,请确认后再访问')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员论坛-<%=webname%></title>
<link href="../css.css" REL="stylesheet" TYPE="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {color: #FFFFFF}
.style10 {color: #FF3300;
	font-weight: bold;
}
-->
</style>
<SCRIPT language=javascript>
//--检测登陆-->

	   function DoLogin() {

	      var UsernameGet = trim(document.loginForm.UsernameGet.value);
		  var PasswordGet = trim(document.loginForm.PasswordGet.value);
		  var Verifycode = trim(document.loginForm.Verifycode.value);

          if(UsernameGet == "") {
		    alert("请输入会员登录名！");
			document.loginForm.UsernameGet.focus();
		    return false;
		  } 
		  if(PasswordGet == "") {
		    alert("请输入您的会员密码！");
			document.loginForm.PasswordGet.focus();
		    return false;
		  } 
		  if(Verifycode == "") {
		    alert("请输入您的登录验证码！");
			document.loginForm.Verifycode.focus();
		    return false;
		  }  
		  
		  
		 }

           function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

//-->
</SCRIPT>
<SCRIPT language=JavaScript>

function CheckInput(){

if(snsn.title.value==''){
		alert("您没有填写主题！");
		snsn.title.focus();
		return false;
	}
	return true;
}
</SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body><!--#include file="top.asp"-->
<table width="100" height="5" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" valign="top"><!--#include file="../left.asp"--></td>
    <td width="5" valign="top"><span class="style10"> </span></td>
    <td valign="top"><table width="575" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="23" background="../images/bj_575_0.gif"><table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="23"><img src="../images/bj_575_4.gif" width="9" height="23"></td>
            <td><img src="../images/bj_575_bjtz.gif" width="69" height="23" border="0"></td>
            <td><a href="view.asp?id=<%=id%>"><img src="../images/bj_575_fhzt.gif" width="69" height="23" border="0"></a></td>
            <td><a href="list.asp?id=<%=bbsclass%>"><img src="../images/bj_575_fhlb.gif" width="69" height="23" border="0"></a></td>
            <td><a href="index.asp"><img src="../images/bj_575_ltsy.gif" width="69" height="23" border="0"></a></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td background="../images/bj_575_1.gif"><form method="post" action="bbs_save.asp?action=save&id=<%=id%>&bid=<%=bid%>"  name="snsn" onSubmit="return CheckForm(this);">
          <input name="body" type="hidden" value='<%=server.htmlencode(rs("body"))%>'>
          <div align="center">
            <center>
              <table width="570" border="0" cellpadding="2" cellspacing="0">
                <tr bgcolor="#FFFFFF">
                  <TD height=30 align="left" bgcolor="#FFFFFF">&nbsp;<B>帖子主题：</B>&nbsp; <%=title%> <FONT                                                                                                                              
      color=#2953c0>*</FONT> <a href=javascript:; onClick="window.open('/bbs/up.asp','bbsup','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" title="可以上传图片，视屏，flash等">上传接口</a></TD>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <TD height=25 align="left" bgcolor="#FFFFFF">&nbsp;<B>魔法表情：</B>&nbsp;
                      <input name="show" type="text" class=wenbenkuang id="show" size="28" maxlength="28">
                      <a href="javascript:;" onClick="window.open('/web/qq/selqq.asp','web_show','scrollbars=no,resizable=no,width=370,height=365,menubar=no,top=188,left=188')" class=over>魔法表情浏览</a></TD>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <TD height="283" align="left" vAlign=top bgcolor="#FFFFFF"><SCRIPT src="img/post.js"></SCRIPT>
                  </TD>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <td height="30" bgcolor="#FFFFFF"> &nbsp;
                      <input name="submit1" type="submit" class="go-wenbenkuang" value="发 表"  onClick="return CheckInput();">
                      <input name="return" type="button" class="go-wenbenkuang" onClick="javascript:history.go(-1)" value="返 回" >
&nbsp;
            <input name="zshow" type="checkbox" id="zshow" value="1" <%if rs("zshow")=1 then%>checked<%end if%>>
            是否使用文字秀· <a href="javascript:CheckLength();">查看内容长度</a> </td>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <td height="6" bgcolor="#FFFFFF">&nbsp; &nbsp; &nbsp; 魔法表情和文字秀不能同时使用。</td>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <td height="7" bgcolor="#FFFFFF">&nbsp; &nbsp; &nbsp; 使用文字秀将失去HTML功能。</td>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <TD height=53 align="left" bgcolor="#FFFFFF"><table width="98%"  border="0" align="center" cellpadding="5" cellspacing="0">
                      <tr>
                        <td><%For I=1 to 56%>
                            <input type="radio" name="faceimg" value="<%=i%>" checked>
                            <%session("lasttime")=now()%>
                            <img src="img/Mood/<%=i%>.gif" width="20" height="20">
                            <%                               
Next                               
%></td>
                      </tr>
                  </table></TD>
                </tr>
              </table>
            </center>
          </div>
        </form></td>
      </tr>
      <tr>
        <td><img src="../images/bj_575_2.gif" width="575" height="7"></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="100" height="5" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<!--#include file="../end.asp"-->
</body>
</html>
<map name="Map">
  <area shape="rect" coords="14,33,91,57" href="../minishow/jieshou.asp?action=jieshou" target="_top" alt="快点查看你的好友送给你的礼品吧">
  <area shape="rect" coords="14,4,90,26" href="../minishow/minishow.asp" target="_top" alt="家园也要经常管理哟！">
  <area shape="rect" coords="106,3,185,26" href="../minishow/minishc.asp" target="_top" alt="今天你收藏了吗？">
  <area shape="rect" coords="107,33,182,56" href="../minishow/index.asp" target="_top" alt="好多的礼等你拿">
  <area shape="rect" coords="17,62,181,88" href="../minishow/mymini.asp" target="_top" alt="将你的SHOW个性化吧！">
</map><%end if%>
