%
Dim objRS, sig, bodyquote, PMID, threadID
Dim rights,allforum, emnotify, PGDCode, forumID
Dim r_do, appid, subject, arrReply, emailview, allowupload, isPostAllowed
Dim oriMsgIcon, alwaysSig, toMem, toMemID, body, maxShortMsg, sendto, stored
Dim withsig, msgIcons, objCon, objCom, upfile,PMAlwaysSave
Dim reportToModerators, reportToAdmins, modIds, adminIds
isPostAllowed = true
maxShortMsg = Application(dbName&"maxShortMsg")
if maxShortMsg = 0 then isPostAllowed = false
if isGuest then isPostAllowed = false
if request.form<>"" then
if not fromThisDomain("pmsend.asp?") then
response.redirect (forumdir&"first.asp?error=referer")
response.end
end if
if request.form("jsenabled")="false" then
response.redirect (forumdir&"first.asp")
response.end
end if
subject = trim(request.form("subject"))
body = trim(request.form("body"))
if request.form("postingaction") = "report" then
reportToModerators = request.form("reportToModerators")
reportToAdmins = request.form("reportToAdmins")
modIds = request.form("modIds")
adminIds = request.form("adminIds")
if reportToModerators = "on" then sendto = modIds
if reportToAdmins = "on" then sendto = sendto & adminIds
sendto = CheckDelimitedFormat(sendto,",")
if sendto = "" then sendto = "0"
set objRS = server.createobject("adodb.recordset")
With objRS
.open "SELECT Login FROM pgd_members WHERE Mem in ("&sendto&")", datastore, , , adCmdText
if not (.eof and .bof) then toMem = .getString(adClipString,,"",",","")
.close
End With
set objRS = nothing
sendto = CheckDelimitedFormat(toMem,",")
else
sendto = CheckDelimitedFormat(request.form("toMem"),",")
end if
' response.write sendto
' response.end
if len(subject) = 0 or len(body) = 0 or len(sendto)=0 then
response.write (emptyTextBoxWarning & "
")
response.write (""&javascriptBackDesc&"")
response.end
end if
if isPostAllowed then
subject = SQLin(subject)
body = SQLin(body)
stored = request.form("savecopy")
withsig = request.form("withsig")
msgIcons = request.form("msgIcons")
upfile = request.form("upfile")
if request.form("embed") = "on" then body=body&vbcrlf&vbcrlf&"[image]local://upfiles/"&memID&"/"&upfile&"[/image]"
if stored = "on" then stored = 1 else stored = 0
if withSig = "on" then withSig = 1 else withSig = 0
if stored = 1 then
response.cookies(dbName&"PMAlwaysSave") = 1
response.cookies(dbName&"PMAlwaysSave").Expires = date + 1000
else
response.cookies(dbName&"PMAlwaysSave").Expires = date - 30
end if
set objCon = server.createobject("adodb.connection")
objCon.open datastore
set objCom = server.createobject("adodb.command")
With objCom
.activeConnection = objCon
.commandText = dbOwnerPrefix&"spPMSend"
.commandType = adCmdStoredProc
.Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Parameters.Append .Createparameter("@PMID", adInteger, adParamOutput, 0)
.Parameters.Append .Createparameter("@SenderID", adInteger, adParamInput, 0, memID)
.Parameters.Append .Createparameter("@subject", adVarChar, adParamInput, 150, subject)
.Parameters.Append .Createparameter("@body", adVarChar, adParamInput, 5000, body)
.Parameters.Append .Createparameter("@stored", adUnsignedTinyInt, adParamInput, 0, stored)
.Parameters.Append .Createparameter("@sentTo", adVarChar, adParamInput, 1000, sendto)
.Parameters.Append .Createparameter("@datesent", adDBTimeStamp, adParamInput, 0, SQLNowDate())
.Parameters.Append .Createparameter("@msgIcon", adUnsignedTinyInt, adParamInput, 0, msgIcons)
.Parameters.Append .Createparameter("@withsig", adUnsignedTinyInt, adParamInput, 0, withSig)
.Parameters.Append .Createparameter("@upfile", adVarChar, adParamInput, 50, upfile)
.execute , , adExecuteNoRecords
Dim returned
returned = .parameters("@RETURN_VALUE")
PMID = .parameters("@PMID")
End With
set objCom = nothing
if returned <> -1 then 'Sent Successfully, now receive..
Dim arrSentTos, iSentTo, ubArrSentTos, delEmails, PMreturnedValue, PMFinalMessage, PMSuccessEmail
arrSentTos = Split(sendto,",")
ubArrSentTos = ubound(arrSentTos)
delEmails = ""
for iSentTo = 0 to ubArrSentTos
Set objCom = server.createobject("adodb.command")
With objCom
.activeConnection = objCon
.commandText = dbOwnerPrefix&"spPMReceive"
.commandType = adCmdStoredProc
.Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Parameters.Append .Createparameter("@PMID", adInteger, adParamInput, 0, PMID)
.Parameters.Append .Createparameter("@recipient", adVarChar, adParamInput, 50, trim(arrSentTos(iSentTo)))
.Parameters.Append .Createparameter("@senderID", adInteger, adParamInput, 0, MemID)
.Parameters.Append .Createparameter("@maxiAllowed", adSmallInt, adParamInput, 0, maxShortMsg)
.Parameters.Append .Createparameter("@email", adVarChar, adParamoutput, 50)
.execute , , adExecuteNoRecords
PMreturnedValue = .parameters("@RETURN_VALUE")
PMSuccessEmail = .parameters("@email")
End With
set objCom = nothing
Dim successPMPic:successPMPic = "
"
Dim failPMPic:failPMPic = "
"
SELECT Case PMreturnedValue' = 1 then delEmails = delEmails & .parameters("@email") & ";"
Case 1
delEmails = delEmails & PMSuccessEmail & ";"
PMFinalMessage = PMFinalMessage &"
|
|