This is a simple addon to the PM mod, which allows the admin to easily send a PM to all moderators.
In privatesend.asp, locate the following (about line 149):
if (mLev = 4) and strRqMethod <> "Forward" then Response.Write ("<br><input type=""checkbox"" name=""allmem"" value=""true"">Send PM to all users<br>") '# All Member PM Modification
Directly after it, add the following:
if (mLev = 4) and strRqMethod <> "Forward" then Response.Write ("<input type=""checkbox"" name=""allmods"" value=""true"">Send PM to all moderators<br>") '# All Moderators PM Modification
In privatesend_info.asp, look for the following on about line 79:
if Request.form("allmem") = false then '# PM All Members MOD
if Request.Form("sendto") = "" then
Go_Result "You Must Supply a member name to send this message!", 0
Response.End
end if
end if '# PM All Members MOD
Replace that passage of lines with the following:
if (Request.form("allmem") <> "true" and Request.form("allmods") <> "true") then '# PM All Members/Moderators MOD
if Request.Form("sendto") = "" then
Go_Result "You Must Supply a member name to send this message!", 0
Response.End
end if
end if '# PM All Members/Moderators MOD
The second (and last) change in privatesend_info.asp, look for the following (starts on about 104):
'############### Start PM all members #################
if Request.form("allmem") = "true" then
strSql = "SELECT M_NAME"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_PMRECEIVE = 1"
strSql = strSql & " ORDER BY M_NAME Asc"
set rsName = my_Conn.Execute (strSql)
do while not rsName.eof
arrAllNames = arrAllNames & rsName("M_NAME")
rsName.moveNext
if not rsName.eof then
arrAllNames = arrAllNames & ","
end if
loop
rsName.close
set rsName = nothing
arrNames = split(arrAllNames, ",")
else
'############## End PM all members ###################
arrNames = split(Request.Form("sendto"), ",")
'############### PM all members one line ###################
end if
Replace that with the following:
'############### Start PM all members #################
if Request.form("allmem") = "true" then
strSql = "SELECT M_NAME"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_PMRECEIVE = 1"
strSql = strSql & " ORDER BY M_NAME Asc"
set rsName = my_Conn.Execute (strSql)
do while not rsName.eof
arrAllNames = arrAllNames & rsName("M_NAME")
rsName.moveNext
if not rsName.eof then
arrAllNames = arrAllNames & ","
end if
loop
rsName.close
set rsName = nothing
arrNames = split(arrAllNames, ",")
elseif request.form("allmods") = "true" then '### Start PM all moderators ###
strSql = "SELECT M_NAME"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_PMRECEIVE = 1 AND M_LEVEL = 2"
strSql = strSql & " ORDER BY M_NAME Asc"
set rsName = my_Conn.Execute (strSql)
do while not rsName.eof
arrAllNames = arrAllNames & rsName("M_NAME")
rsName.moveNext
if not rsName.eof then
arrAllNames = arrAllNames & ","
end if
loop
rsName.close
set rsName = nothing
arrNames = split(arrAllNames, ",") '### End PM all moderators ###
else
'############## End PM all members ###################
arrNames = split(Request.Form("sendto"), ",")
'############### PM all members one line ###################
end if
I thought about making a drop down list instead of checkboxes, and then adding the possibility to send PM:s to whole groups of user also. (Using Nikkols Usergroups mod).
I just installed and sent a test PM, the response (privatesend_info) was that it had only been sent to three of the mods but the forum has about six, is that normal?
I'm waiting for responses fom the mods so I don't know yet if they all received the test PM or if it was just the three listed on privatesend_info..
They must have pm's as we've exchanged many pm's even up to today, but then again... There is an error when trying to set Inbox prefernces, just tried setting one of my accounts to "Enable private messages" and it won't because of the error.... I'll try to chase it up again!
Alright there, I use access on Huws windows server..some info in my sig too if it helps! I'll try to find the post about the error, it's a real pain as it goes
Alright Masterao, I just went back to the topic and found an answer, one thats good enough for me anyway! I guess it doesn't solve the whole issue but it does work... here's what was posted!
quote:The strange thing I found out is; Their are three options you can change the first 2 don't have anything picked, but the 3rd one has something picked. If I just pick one option and leave one without click on it (the little green dot in the O) Then I'll get a error code.
If you pick more then one option at once you don't get any errors!
Sorry if this has messed up your topic by the way, if you'd like me to delete it let me know okay!