<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="../forbbs.asp"-->
<%call head()

Call FortxtChat
Call saycarda("发言")
  dim pa,TM
  pa=request("pa")
  TM=request("TM")
dim ID,Chat,Face,user
ID   = request("ID")
Chat = request("Chat")
Face = request("Face")
user = request("user")

  if Instr(Chat,".info")>0 or Instr(Chat,".info")>0 or Instr(Chat,".info")>0 then
Call Error("你的发言不能含有“.info”字眼，有广告成份！")
  end If

  if Instr(Chat,".INFO")>0 or Instr(Chat,".INFO")>0 or Instr(Chat,".INFO")>0 then
Call Error("你的发言不能含有“.INFO”字眼，有广告成份！")
  end If

  if Instr(Chat,".tk")>0 or Instr(Chat,".tk")>0 or Instr(Chat,".tk")>0 then
Call Error("你的发言不能含有“.tk”字眼，有广告成份！")
  end If

  if Instr(Chat,".com")>0 or Instr(Chat,".com")>0 or Instr(Chat,".com")>0 then
Call Error("你的发言不能含有“.com”字眼，有广告成份！")
  end If
  if Instr(Chat,".cn")>0 or Instr(Chat,".cn")>0 or Instr(Chat,".cn")>0 then
Call Error("你的发言不能含有“.cn”字眼，有广告成份！")
  end If
  if Instr(Chat,".cc")>0 or Instr(Chat,".cc")>0 or Instr(Chat,".cc")>0 then
Call Error("你的发言不能含有“.cc”字眼，有广告成份！")
  end If
  if Instr(Chat,".net")>0 or Instr(Chat,".net")>0 or Instr(Chat,".net")>0 then
Call Error("你的发言不能含有“.net”字眼，有广告成份！")
  end If
  if Instr(Chat,"wap.")>0 or Instr(Chat,"wap.")>0 or Instr(Chat,"wap.")>0 then
Call Error("你的发言不能含有“wap.”字眼，有广告成份！")
  end If
if ID="" or IsNumeric(ID)=false Then

   Call Error("不存在的聊天室！")
end if

if Chat = "" then
   Call Error("请输入发言内容！")
end if

Chat=Replace(Chat,",","，")
Chat=left(Chat,500)
Chat=forbbs(Chat)

'写入数据库
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select Chattxt,chathall from Chat where ID="&ID,conn,1,2
if rs.eof then
   rs.close
   set rs=Nothing
   Call Error("不存在的聊天室！")
end if

if Instr(","&rs("chathall")&",",","&Myid&",") > 0 then
   rs.close
   set rs=Nothing
   Call Error("您被禁止进入此聊天室！")
end if
dim speakuser
if user<>"all" and user<>"" then

speakuser="对"&user
else
speakuser=""
end if
if rs("Chattxt")<>"" then
if face<> 0 then
   if InStr(rs("Chattxt"),myni&"("&myid&")[/url]：[img]/bbs/face/"&face&".gif[/img]"&Chat) > 0 then
   rs.close
   set rs=Nothing
   Call Error("重复发言！")
   end if
else
   if InStr(rs("Chattxt"),myni&"("&myid&")[/url]："&Chat) > 0 then
   rs.close
   set rs=Nothing
   Call Error("重复发言！")
   end if
end If

if face<>0 then
   rs("Chattxt")="[url=chatsend.asp?ID="&ID&"&amp;IDS="&myid&"&amp;sid=@@sid@@]"&myni&"("&myid&")[/url]"&speakuser&"：[img]/bbs/face/"&face&".gif[/img]"&Chat&"["&time()&"],"&left(rs("Chattxt"),5000)
else
   rs("Chattxt")="[url=chatsend.asp?ID="&ID&"&amp;IDS="&myid&"&amp;sid=@@sid@@]"&myni&"("&myid&")[/url]"&speakuser&"："&Chat&"["&time()&"],"&left(rs("Chattxt"),5000)
end if
else
   rs("Chattxt")="[url=chatsend.asp?ID="&ID&"&amp;IDS="&myid&"&amp;sid=@@sid@@]"&myni&"("&myid&")[/url]："&Chat&"["&time()&"]"
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=Nothing

response.write "<onevent type=""ontimer"">"&chr(13)
response.write "<go href=""chatroom.asp?ID="&ID&"&amp;TM="&TM&"&amp;Pa=15&amp;sid="&sid&"&amp;saytk="&saytk&"""/>"&chr(13)
response.write "</onevent>"&chr(13)
response.write "<timer value=""10""/>"&chr(13)
Response.write "发言成功！"&chr(13)
Response.write "<br/><a href=""chatroom.asp?ID="&ID&"&amp;TM="&TM&"&amp;Pa="&Pa&"&amp;sid="&sid&"&amp;saytk="&saytk&""">返回聊天</a>"&chr(13)
call head1()
%>