Author |
Topic |
masterao
Senior Member
Sweden
1678 Posts |
Posted - 11 November 2003 : 19:51:22
|
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
All changes done. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
Edited by - masterao on 11 November 2003 19:54:28 |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 11 November 2003 : 20:16:58
|
Nice touch!
Thank you!
|
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 11 November 2003 : 20:34:40
|
You are welcome, Jan. |
|
|
weeweeslap
Senior Member
USA
1077 Posts |
Posted - 12 November 2003 : 02:33:19
|
worked beautifully, thanks! |
coaster crazy |
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 12 November 2003 : 07:12:22
|
I changed this to send PM to M_LEVEL >= 2 to send to admins too. |
/Tribaliztic - www.gotlandrace.se -
|
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 12 November 2003 : 10:24:38
|
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). |
/Tribaliztic - www.gotlandrace.se -
|
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 15 November 2003 : 09:16:50
|
Alright there, Nice addition this...
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..
Thanks, Robin. |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 15 November 2003 : 09:22:03
|
I just checked and it definately never went to all the mods?
Thanks, Robin. |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 16 November 2003 : 12:33:55
|
Has all of your moderators enabled PMs, Doughnut? The send to all Mods function will only send PMs if the reciever has enabled PMs. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 16 November 2003 : 15:57:52
|
Alright mastrao, Thanks for your reply...
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!
Thanks, Robin. |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 16 November 2003 : 18:22:47
|
Ok, I'll do some tests and see if I can reproduce that behaviour, Doughnut.
Which database and server are you using? |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 17 November 2003 : 04:43:41
|
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
Thanks, Robin. |
http://www.carp-uk.net |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 17 November 2003 : 04:58:37
|
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!
Thanks again, Robin. |
Edited by - Doughnut on 17 November 2003 04:59:46 |
|
|
Topic |
|