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

    <%@language="VBScript"%>
<!--#include file="title.asp"-->
<!--#include file="sub.asp"-->
<%
contents=contents &"<title>发送密信-"& caption &"</title>"&_
"</head>"&_
"<body title=""可以使用Alt+S或者Ctrl+Enter直接提交密信"">"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"&_
"<tr>"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"
if gbmaduser="" then
contents=contents &"<script language=""JavaScript"">alert(""出错:你还没登陆或者已经掉线,请重新登陆。"");window.close();</script>"
else
if gb<30 then
contents=contents &"<script language=""JavaScript"">alert(""出错:你的"& gbname &"不足30,不能使用密信功能。"");window.close();</script>"
else
if validate<>creatvalidate(gb+imprison,ip) then
contents=contents &"<script language=""JavaScript"">alert(""出错:验证Cookies信息出错,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
else
if imprison="3" or imprison="5" or imprison="6" or imprison="7" then
contents=contents &"<script language=""JavaScript"">alert(""出错:你因为违反社区条例,被禁止发送密信。具体可以查看异动报告。"");window.close();</script>"
else
Dim id,oldid,content,erryes,oldcontent,recontent,sender,posttime,delmessage,username,url
id=Request.Form("id")
if IsNumeric(id) then
id=Clng(id)
else
id="0"
end if
oldid=Request.Form("oldid")
if IsNumeric(oldid) then
oldid=Clng(oldid)
else
oldid="0"
end if
if gb<99 then
content=Trim(contentcode(Request.Form("content"),0))
else
content=Trim(contentcode(Request.Form("content"),1))
end if
delmessage=Request.Form("delmessage")
username=Trim(Replace(Request.QueryString("username"),"'",""))
if username="" then username=Trim(Replace(Request.Form("username"),"'",""))
url=Request.ServerVariables("HTTP_REFERER")
if id>0 and content<>"" then
rs.Open "Select userpwd From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,1
if Not rs.Eof then
if rs("userpwd")<>userpwd then
contents=contents &"<script language=""JavaScript"">alert(""出错:密码验证错误,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
erryes="yes"
end if
else
contents=contents &"<script language=""JavaScript"">alert(""出错:不存在的用户,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
end if
rs.Close
if erryes<>"yes" then
rs.Open "message Where id="& id,conn,1,3
if Not rs.Eof then
if LCase(rs("gbmaduser"))=LCase(gbmaduser) then
oldcontent=rs("content")
recontent=rs("recontent")
sender=rs("sender")
posttime=rs("posttime")
rs.Delete
else
contents=contents &"<script language=""JavaScript"">alert(""出错:你要回复的密信不属于你。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
end if
else
contents=contents &"<script language=""JavaScript"">alert(""出错:你要回复的密信不存在。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
end if
rs.Close
end if
if erryes<>"yes" then
if delmessage<>"yes" then
rs.Open "oldmessage Where id=0",conn,1,3
rs.AddNew
rs("content")=oldcontent
rs("recontent")=recontent
rs("gbmaduser")=gbmaduser
rs("sender")=sender
rs("posttime")=posttime
rs("remessage")=content
rs.Update
rs.Close
end if
rs.Open "gbmaduser Where gbmaduser='"& sender &"'",conn,1,1
if rs.Eof then
contents=contents &"<script language=""JavaScript"">alert(""出错:你要回复的密信接收者不存在。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
end if
rs.Close
if erryes<>"yes" then
rs.Open "message Where id=0",conn,1,3
rs.AddNew
rs("content")=content
rs("recontent")=oldcontent
rs("gbmaduser")=sender
rs("sender")=gbmaduser
rs("posttime")=Now()
rs.Update
rs.Close
contents=contents &"<script language=""JavaScript"">alert(""提示:向 "& sender &" 回复密信成功。"");window.open(""session.asp"","""& bbssn &"online"");document.location="""& url &""";</script>"
end if
end if
elseif oldid>0 and content<>"" then
rs.Open "Select userpwd From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,1
if Not rs.Eof then
if rs("userpwd")<>userpwd then
contents=contents &"<script language=""JavaScript"">alert(""出错:密码验证错误,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
erryes="yes"
end if
else
contents=contents &"<script language=""JavaScript"">alert(""出错:不存在的用户,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
end if
rs.Close
if erryes<>"yes" then
rs.Open "oldmessage Where id="& oldid,conn,1,3
if Not rs.Eof then
if LCase(rs("gbmaduser"))=LCase(gbmaduser) then
oldcontent=rs("content")
recontent=rs("recontent")
sender=rs("sender")
posttime=rs("posttime")
rs.Delete
else
contents=contents &"<script language=""JavaScript"">alert(""出错:你要回复的密信不属于你。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
end if
else
contents=contents &"<script language=""JavaScript"">alert(""出错:你要回复的密信不存在。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
end if
rs.Close
end if
if erryes<>"yes" then
if delmessage<>"yes" then
rs.Open "oldmessage Where id=0",conn,1,3
rs.AddNew
rs("content")=oldcontent
rs("recontent")=recontent
rs("gbmaduser")=gbmaduser
rs("sender")=sender
rs("posttime")=posttime
rs("remessage")=content
rs.Update
rs.Close
end if
rs.Open "gbmaduser Where gbmaduser='"& sender &"'",conn,1,1
if rs.Eof then
contents=contents &"<script language=""JavaScript"">alert(""出错:你要回复的密信接收者不存在。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
end if
rs.Close
if erryes<>"yes" then
rs.Open "message Where id=0",conn,1,3
rs.AddNew
rs("content")=content
rs("recontent")=oldcontent
rs("gbmaduser")=sender
rs("sender")=gbmaduser
rs("posttime")=Now()
rs.Update
rs.Close
contents=contents &"<script language=""JavaScript"">alert(""提示:向 "& sender &" 回复密信成功。"");window.open(""session.asp"","""& bbssn &"online"");document.location="""& url &""";</script>"
end if
end if
elseif username<>"" and content<>"" then
rs.Open "Select userpwd From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,1
if Not rs.Eof then
if rs("userpwd")<>userpwd then
contents=contents &"<script language=""JavaScript"">alert(""出错:密码验证错误,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
erryes="yes"
end if
else
contents=contents &"<script language=""JavaScript"">alert(""出错:不存在的用户,请重新登陆。\n引起该错误的原因可能是因为你手动修改了Cookies。"");window.close();</script>"
end if
rs.Close
if erryes<>"yes" then
rs.Open "Select gbmaduser,gb From gbmaduser Where gbmaduser='"& username &"'",conn,1,1
if rs.Eof then
if Instr(url,"/message.asp")>0 then
url="parent."& bbssn &"right.sendmessage.button.disabled="""";document.location=""about:blank"";"
else
url="window.close();"
end if
contents=contents &"<script language=""JavaScript"">alert(""出错:你要发送的密信接收者不存在。\n请重新选择接收者,如果依旧出错,请联系管理员报告错误。"");"& url &"</script>"
erryes="yes"
elseif rs("gb")<30 then
if Instr(url,"/message.asp")>0 then
url="parent."& bbssn &"right.sendmessage.button.disabled="""";document.location=""about:blank"";"
else
url="window.close();"
end if
contents=contents &"<script language=""JavaScript"">alert(""出错:你要发送的密信接收者的"& gbname &"小于30。\n他(她、它)不能收发密信,请等他(她、它)的"& gbname &"大于30后再发。"");"& url &"</script>"
erryes="yes"
end if
rs.Close
end if
if erryes<>"yes" then
rs.Open "message Where id=0",conn,1,3
rs.AddNew
rs("content")=content
rs("gbmaduser")=username
rs("sender")=gbmaduser
rs("posttime")=Now()
rs.Update
rs.Close
if Instr(url,"/message.asp")>0 then
url="parent."& bbssn &"right.sendmessage.username.value="""";parent."& bbssn &"right.sendmessage.content.value="""";parent."& bbssn &"right.sendmessage.button.disabled="""";document.location=""about:blank"";"
else
url="window.close();"
end if
contents=contents &"<script language=""JavaScript"">alert(""提示:向 "& username &" 发送密信成功。"");window.open(""session.asp"","""& bbssn &"online"");"& url &"</script>"
end if
elseif username<>"" then
rs.Open "Select gbmaduser,gb From gbmaduser Where gbmaduser='"& username &"'",conn,1,1
if rs.Eof then
contents=contents &"<script language=""JavaScript"">alert(""出错:你要发送的密信接收者不存在。\n请重新选择接收者,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
erryes="yes"
elseif rs("gb")<30 then
contents=contents &"<script language=""JavaScript"">alert(""出错:你要发送的密信接收者的"& gbname &"小于30。\n他(她、它)不能收发密信,请等他(她、它)的"& gbname &"大于30后再发。"");window.close();</script>"
erryes="yes"
end if
rs.Close
if erryes<>"yes" then
contents=contents &"<form name=""sendmessage"" method=""post"" onsubmit=""return validinput();"" action=""sendmessage.asp"" onkeydown=""resend()"">"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">向 "& username &" 发送密信</td></tr>"&_
"<tr class=""tds""><td>"&_
"<script language=""JavaScript"">"&_
"function validinput()"&_
"{"&_
"if (document.sendmessage.content.value.length==0)"&_
"{"&_
"alert(""请填写好密信内容。"");"&_
"document.sendmessage.content.focus();"&_
"return false;"&_
"}"&_
"document.sendmessage.button.disabled=""true"";"&_
"return true;"&_
"}"&_
"function resend()"&_
"{"&_
"if ((event.altKey==true && event.keyCode==83) || (event.ctrlKey==true && event.keyCode==13))"&_
"{"&_
"this.document.sendmessage.button.click();"&_
"}"&_
"}"&_
"</script>"&_
"密信对象:"& username &"<input name=""username"" type=""hidden"" value="""& username &"""> <input name=""button"" type=""submit"" value=""提交"" onmouseover=""this.className='over';"" onmouseout=""this.className='out';"" class=""out"">"&_
"<br><textarea name=""content"" rows=""8"" cols=""53"">"& content &"</textarea>"&_
"</td></tr>"&_
"</form>"
end if
else
contents=contents &"<script language=""JavaScript"">alert(""出错:非法调用或者程序出错。\n请确定你是通过正常方式进行操作,如果依旧出错,请联系管理员报告错误。"");window.close();</script>"
end if
end if
end if
end if
end if
contents=contents &"</table>"&_
""&_
""
%>
<!--#include file="bottom.asp"-->