<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="forbbs.asp"-->
<%
call head()
call saycardd("群发内线")%>

<%
Server.ScriptTimeOut = 1800

dim txt,fid,urls
urls=request("url")
urls=replace(urls,"@@","&amp;")
urls=replace(urls,"sidoo=","sid=")
txt=forbbs(request("txt"))
face=request("face")
keynum=clng(request("keynum"))

TP=request("TP")
if TP<>"" then
if txt="" then
  Call Error("内容不能为空！")
  end if
if len(txt)>1000 then
  Call Error("消息内容最多1000字！")
  end if
dim objgbrs,ids
 set objgbrs=Server.CreateObject("ADODB.Recordset")
 if keynum=1 then
  objgbrs.open"select * from users where skey>0 order by id desc",conn,1,1
  elseif keynum=0 then
  objgbrs.open"select * from users where keys=1 order by id desc",conn,1,1
  else
    objgbrs.open"select * from users order by id desc",conn,1,1
  end if
 Do While Not objgbrs.EOF
      ids=objgbrs("id")
      qfmsg
     objgbrs.MoveNext
  Loop
objgbrs.close
set objgbrs=nothing
Function qfmsg()
  sql="insert into guest(fid,sid,fnr,tou) values ("
  sql=sql & sqlstr(0) & ","
  sql=sql & sqlstr(ids) & ","
  sql=sql & sqlstr(txt) & ","
  sql=sql & sqlstr(face) & ")"
  Application.Lock
  conn.execute(sql)
  Application.Unlock
End function
function sqlstr(data)
sqlstr="'" & Replace(data,"'","'") & "'"
End function
if keynum=1 then
response.write"恭喜,群发消息给所有版主成功！"
elseif keynum=0 then
response.write"恭喜,群发消息给所有管理员成功！"
else
response.write"恭喜,群发消息给所有会员成功！"
end if
else
response.write "选择表情"
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""adminmsgall.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "<select title='表情' name='face' value='0'>"&chr(13)
response.write "<option title='表情' value='0'>表情</option>"&chr(13)
response.write "<option title='微笑' value='1'>微笑</option>"&chr(13)
response.write "<option title='哭泣' value='2'>哭泣</option>"&chr(13)
response.write "<option title='调皮' value='3'>调皮</option>"&chr(13)
response.write "<option title='脸红' value='4'>脸红</option>"&chr(13)
response.write "<option title='害羞' value='5'>害羞</option>"&chr(13)
response.write "<option title='生气' value='6'>生气</option>"&chr(13)
response.write "<option title='偷笑' value='7'>偷笑</option>"&chr(13)
response.write "<option title='流汗' value='8'>流汗</option>"&chr(13)
response.write "<option title='我倒' value='9'>我倒</option>"&chr(13)
response.write "<option title='得意' value='10'>得意</option>"&chr(13)
response.write "<option title='眦牙' value='11'>眦牙</option>"&chr(13)
response.write "<option title='疑问' value='12'>疑问</option>"&chr(13)
response.write "<option title='睡觉' value='13'>睡觉</option>"&chr(13)
response.write "<option title='好色' value='14'>好色</option>"&chr(13)
response.write "<option title='口水' value='15'>口水</option>"&chr(13)
response.write "<option title='敲头' value='16'>敲头</option>"&chr(13)
response.write "<option title='可爱' value='17'>可爱</option>"&chr(13)
response.write "<option title='猪头' value='18'>猪头</option>"&chr(13)
response.write "<option title='YEAH' value='19'>YEAH</option>"&chr(13)
response.write "<option title='玫瑰' value='20'>玫瑰</option>"&chr(13)
response.write "</select><br/>"&chr(13)
response.write "发送对象"
response.write "<select title='发送对象' name='keynum' value='0'>"&chr(13)
response.write "<option title='管理' value='0'>所有管理员</option>"&chr(13)
response.write "<option title='版主' value='1'>所有版主</option>"&chr(13)
response.write "<option title='会员' value='2'>所有会员</option>"&chr(13)
response.write "</select><br/>"&chr(13)
response.write "发送内容"
response.write "<input name=""txt"" title=""内容"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""1000"" value=""""/><br/>"
response.write "<input type=""hidden"" name=""tp"" value=""1""/>"
response.write "<input type=""submit"" name=""Submit"" value=""群发消息""></form><br/>"
else
response.write "<select title='表情' name='face' value='0'>"&chr(13)
response.write "<option title='表情' value='0'>表情</option>"&chr(13)
response.write "<option title='微笑' value='1'>微笑</option>"&chr(13)
response.write "<option title='哭泣' value='2'>哭泣</option>"&chr(13)
response.write "<option title='调皮' value='3'>调皮</option>"&chr(13)
response.write "<option title='脸红' value='4'>脸红</option>"&chr(13)
response.write "<option title='害羞' value='5'>害羞</option>"&chr(13)
response.write "<option title='生气' value='6'>生气</option>"&chr(13)
response.write "<option title='偷笑' value='7'>偷笑</option>"&chr(13)
response.write "<option title='流汗' value='8'>流汗</option>"&chr(13)
response.write "<option title='我倒' value='9'>我倒</option>"&chr(13)
response.write "<option title='得意' value='10'>得意</option>"&chr(13)
response.write "<option title='眦牙' value='11'>眦牙</option>"&chr(13)
response.write "<option title='疑问' value='12'>疑问</option>"&chr(13)
response.write "<option title='睡觉' value='13'>睡觉</option>"&chr(13)
response.write "<option title='好色' value='14'>好色</option>"&chr(13)
response.write "<option title='口水' value='15'>口水</option>"&chr(13)
response.write "<option title='敲头' value='16'>敲头</option>"&chr(13)
response.write "<option title='可爱' value='17'>可爱</option>"&chr(13)
response.write "<option title='猪头' value='18'>猪头</option>"&chr(13)
response.write "<option title='YEAH' value='19'>YEAH</option>"&chr(13)
response.write "<option title='玫瑰' value='20'>玫瑰</option>"&chr(13)
response.write "</select><br/>"&chr(13)
response.write "发送对象"
response.write "<select title='发送对象' name='keynum' value='0'>"&chr(13)
response.write "<option title='管理' value='0'>所有管理员</option>"&chr(13)
response.write "<option title='版主' value='1'>所有版主</option>"&chr(13)
response.write "<option title='会员' value='2'>所有会员</option>"&chr(13)
response.write "</select><br/>"&chr(13)
response.write "发送内容"
response.write "<input name=""txt"&tt&""" title=""内容"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""1000"" value=""""/><br/>"
Response.write "<anchor>群发消息"
Response.write "<go href='adminmsgall.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name=""txt"" value=""$(txt"&tt&")""/>"
Response.write "<postfield name=""face"" value=""$(face)""/>"
Response.write "<postfield name=""keynum"" value=""$(keynum)""/>"
Response.write "<postfield name=""TP"" value=""1""/>"
Response.write "</go></anchor>"end if
end if
conn.close
set conn=nothing
Response.write "<br/>群发内线会很占服务器资源,请不要多次使用,发出的系统内线,最好定期<a href='adminguestdel.asp?sid="&sid&"&amp;saytk="&saytk&"'>清空内线</a>"&chr(13)%>
<!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
