<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
'Save
if request("save")=1 then
Call Cw_login()
Call Cw_yzm()
Call Cw_yz(60)
content=request.Form("content")
pic=Frist_Pic(content)'获取内容中第一张图片
content=cw_keyword(content)'过滤关键词
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from cw_bbs"
rs.open sql,conn,1,3
rs.addnew
rs("title")=trim(request.Form("title"))
rs("content")=content
rs("ip")=Request.ServerVariables("REMOTE_ADDR")
rs("classid")=request.Form("classid")
rs("pic")=pic
if pic<>"" then rs("ispic")=1
rs("ispass")=bbs_pass
rs("userid")=session("userid")
rs.update
id=rs("id")
rs.close
set rs=nothing
call cw_jf("+",2)
response.Write("<script>alert('发布成功，系统将自动跳转到新贴子！');location.href='show.asp?id="&id&"';</script>")
response.End()
end if
'Editor
if request("save")=2 then
Call Cw_login()
Call Cw_yzm()
content=request.Form("content")
pic=Frist_Pic(content)'获取内容中第一张图片
content=cw_keyword(content)
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from cw_bbs where userid="&session("userid")&" and id="&request.Form("id")
rs.open sql,conn,1,3
if not rs.eof then
rs("title")=trim(request.Form("title"))
rs("content")=content
rs("pic")=pic
if pic<>"" then
  rs("ispic")=1
else
  rs("ispic")=0
end if
rs("ispass")=bbs_pass
rs.update
rs.close
set rs=nothing
else
   response.Write("<script>alert('非法操作！你己被记录！');history.back();</script>")
   response.End()
end if
response.Write("<script>alert('编辑成功，系统将自动跳转到新贴子！');location.href='show.asp?id="&request.Form("id")&"';</script>")
response.End()
end if
'Post-Writr
if request("classid")<>"" then
data=cw_redtemp(cf_root&"skins/"&cf_skin,tp_bbs_post)
data=cw_include(data)     
data=cw_system(data)
data=replace(data,"{cw:class_name}","发布帖子 - 论坛社区")
data=replace(data,"{cw:class_position}","<a href='"&cf_root&"'>"&cf_name&"</a> &gt; <a href='"&cf_root&"bbs/'>论坛社区</a> &gt; 发布帖子")
data=replace(data,"{cw:class_id}",request("classid"))
data=replace(data,"{save}",1)
data=replace(data,"{content}","")
data=replace(data,"{title}","")
data=replace(data,"{id}","")
data=cw_loop(data)
data=cw_function(data)
data=cw_if(data)
response.Write(data)
end if
'Editor-Write
if request("act")="editor" then
data=cw_redtemp(cf_root&"skins/"&cf_skin,tp_bbs_post)
data=cw_include(data)     
data=cw_system(data)
data=replace(data,"{cw:class_name}","编辑帖子 - 论坛社区")
data=replace(data,"{cw:class_position}","<a href='"&cf_root&"'>"&cf_name&"</a> &gt; <a href='"&cf_root&"bbs/'>论坛社区</a> &gt; 编辑帖子")
data=replace(data,"{cw:class_id}","")
set re=server.CreateObject("adodb.recordset")
req="select * from cw_bbs where userid="&session("userid")&" and id="&trim(request("id"))
re.open req,conn,1,1
if not re.eof then
data=replace(data,"{save}",2)
data=replace(data,"{content}",re("content"))
data=replace(data,"{title}",re("title"))
data=replace(data,"{id}",trim(request("id")))
else
   response.Write("<script>alert('非法操作！你己被记录！');history.back();</script>")
   response.End()
end if
re.close
set re=nothing
data=cw_loop(data)
data=cw_function(data)
data=cw_if(data)
response.Write(data)
end if
%>
