www.gusucode.com > 仿MOP对开式论坛程序 1.0源码程序 > sendmta.asp

    <%@language="VBScript"%>
<!--#include file="title.asp"-->
<!--#include file="sub.asp"-->
<%
contents=contents &"<title>密信群发-"& caption &"</title>"&_
"</head>"&_
"<body>"&_
""&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"
if bbsadmin>3 then
Dim sendto,content,i,rsa,sendtu
sendto=Request.Form("sendto")
content=Trim(contentcode(Request.Form("content"),1))
if sendto<>"" and content<>"" then
Set rsa=Server.CreateObject("ADODB.Recordset")
if sendto="online" then
content="<font class=""del"">由社区管理员 "& gbmaduser &" 发送给全体在线用户的密息:</font><br><br>"& content
rs.Open "Delete From online Where lasttime<#"& Date() &" "& TimeValue(TimeSerial(Hour(Time()),Minute(Time())-10,Second(Time()))) &"# or lasttime<=#"& Date() &"#",conn,1,3
rsa.Open "message Where id=0",conn,1,3
rs.Open "Select gbmaduser From online Where unshow=1 or unshow is Null Order by gbmaduser",conn,1,1
For i=1 to rs.RecordCount
rsa.AddNew
rsa("content")=content
rsa("gbmaduser")=rs("gbmaduser")
rsa("sender")=gbmaduser
rsa("posttime")=Now()
rsa.Update
sendtu=sendtu & rs("gbmaduser") &"、"
rs.MoveNext
Next
rs.Close
rsa.Close
elseif sendto="all" then
content="<font class=""del"">由社区管理员 "& gbmaduser &" 发送给全体用户的密息:</font><br><br>"& content
rsa.Open "message Where id=0",conn,1,3
rs.Open "Select gbmaduser From gbmaduser Where gb>29 Order by gbmaduser",conn,1,1
For i=1 to rs.RecordCount
rsa.AddNew
rsa("content")=content
rsa("gbmaduser")=rs("gbmaduser")
rsa("sender")=gbmaduser
rsa("posttime")=Now()
rsa.Update
sendtu=sendtu & rs("gbmaduser") &"、"
rs.MoveNext
Next
rs.Close
rsa.Close
end if
if sendtu<>"" then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">密信群发</td></tr>"&_
"<tr class=""tds""><td>"
if sendto="online" then contents=contents &"已经将密信发给所有在线且"& gbname &"大于30的用户了。<br>"
if sendto="all" then contents=contents &"已经将密信发给所有"& gbname &"大于30的用户了。<br>"
contents=contents &"接收到密信的用户列表如下:<br>"& Left(sendtu,Len(sendtu)-1) &"</td></tr>"
end if
Set rsa=Nothing
end if
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">密信群发</td></tr>"&_
"<tr class=""tds""><td>"&_
"<script language=""JavaScript"">"&_
"function validinput()"&_
"{"&_
"if (document.sendmta.content.value.length==0)"&_
"{"&_
"alert(""请填写好密信内容。"");"&_
"document.sendmta.content.focus();"&_
"return false;"&_
"}"&_
"document.sendmta.button.disabled=""true"";"&_
"return true;"&_
"}"&_
"</script>"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"&_
"<form name=""sendmta"" method=""post"" onsubmit=""return validinput();"" action=""sendmta.asp"">"&_
"<tr><td width=""64"">密信对象:</td><td><input type=""radio"" value=""online"" checked name=""sendto""> 在线用户 <input type=""radio"" value=""all"" name=""sendto""> 所有用户 <input name=""button"" type=""submit"" value=""提交"" onmouseover=""this.className='over';"" onmouseout=""this.className='out';"" class=""out""></td></tr>"&_
"<tr><td valign=""top"">密信内容:</td><td><textarea name=""content"" rows=""8"" cols=""53""></textarea></td></tr>"&_
"<tr><td>注意事项:</td><td><br>密信群发时比较消耗系统资源,特别是发给社区所有用户时。另外不会对"& gbname &"小于30的用户发送。<font class=""anonymity"">发送时请耐心等待</font>。</td></tr>"&_
"</form>"&_
"</table>"&_
"</td></tr>"
else
call connclose
Response.Redirect "login.asp"
end if
contents=contents &"</table>"&_
""
%>
<!--#include file="bottom.asp"-->