Private Message Sending Limit MOD - Postet den (1768 Views)
Junior Member
endomorph
Innlegg: 128
128
Here is a very quick MOD for those of you who use the Private Message MOD.
This is a quick fix to limit the amount of messages that can be sent in one session. I used it because I found that I had members SPAMMING other members.
In privatesend.asp, look for this around line 199 -

" <td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" value=""Send Message""> <input name=""Preview"" type=""button"" value=""Preview"" onclick=""OpenPreview()""> <input name=""Reset"" type=""reset"" value=""Reset Fields""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _


and replace with this -

" <td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewLine

Session("pmlimit") = Session("pmlimit") + 1

if Session("pmlimit") < 5 then

Response.Write " <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" value=""Send Message""> <input name=""Preview"" type=""button"" value=""Preview"" onclick=""OpenPreview()""> <input name=""Reset"" type=""reset"" value=""Reset Fields""></td>" & vbNewLine

else

Response.Write " <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" disabled=""disabled"" value=""You have sent too many messages in one session""></td>" & vbNewLine

end if

Response.Write " </tr>" & vbNewLine & _


To change you maximum limit, change the number in this line

if Session("pmlimit") < 5 then

Worked great for me, hope this does for you.
<
Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation
   
 Sidestørrelse 
Postet den
Forum Moderator
AnonJr
Innlegg: 5768
5768
I don't use the PM MOD, but just a random thought as I read... wouldn't you want to exempt your Admins and Moderators from the limit? I would think that while most members don't need to send more than n PMs a session, your staff may be a different matter. wink
Also, you probably don't want to increment the counter until after the message is sent. I'm not sure where you're initializing the number, but unless you're starting at 0 (a safe assumption) your code will stop me at 4 messages instead of 5.

Either way, I don't want to get dinged for sending a message unless I actually sent it - your code dings me for pulling up the form.
Just a few things I noticed. smile HTH<
Postet den
Medlem er låst
philsbbs
Innlegg: 397
397
I've installed this and think it's very good but agree with AnonJr points.<
Phil
Postet den
Junior Member
endomorph
Innlegg: 128
128
OK, re-worked code -
In privatesend.asp, look for this around line 199 -
" <td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" value=""Send Message""> <input name=""Preview"" type=""button"" value=""Preview"" onclick=""OpenPreview()""> <input name=""Reset"" type=""reset"" value=""Reset Fields""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _


and replace with this -
" <td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewLine

' Change 6 to whatever you want the PM limit to be
if Session("pmlimit") < 6 or mLev = 3 or mLev = 4 then

Response.Write " <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" value=""Send Message""> <input name=""Preview"" type=""button"" value=""Preview"" onclick=""OpenPreview()""> <input name=""Reset"" type=""reset"" value=""Reset Fields""></td>" & vbNewLine

else

Response.Write " <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" disabled=""disabled"" value=""You have sent too many messages in one session""></td>" & vbNewLine

end if

Response.Write " </tr>" & vbNewLine & _


in privatesend_info.asp, look for this around line 385 -

select case Request.Form("Method_Type")
case "Topic"
Response.Write("Your Message has been sent!")
case "Reply"
Response.Write("Your Reply has been sent!")
case "ReplyQuote"
Response.Write("Your Reply has been sent!")
case "Forward"
Response.Write("Your Message has been Forwarded!")
case "Edit"
Response.Write("Thank you for your contribution!")
case else
Response.Write("Have a nice day!")
end select

and replace with this -
select case Request.Form("Method_Type")
case "Topic"
Response.Write("Your Message has been sent!")
Session("pmlimit") = Session("pmlimit") + 1
case "Reply"
Response.Write("Your Reply has been sent!")
case "ReplyQuote"
Response.Write("Your Reply has been sent!")
case "Forward"
Response.Write("Your Message has been Forwarded!")
Session("pmlimit") = Session("pmlimit") + 1
case "Edit"
Response.Write("Thank you for your contribution!")
case else
Response.Write("Have a nice day!")
end select
<
Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation
Postet den
Junior Member
campinmom03
Innlegg: 190
190
Has anyone else tried this new mod since the security update with the PM's found here http://forum.snitz.com/forum/topic.asp?TOPIC_ID=66176 ? Just curious.
Any problems or errors with heavily modded forums? I'm asking these questions cause I would love to add this... But as I read and check my files for the lines and code - mine does look a little different. I would need some help I think.
Just a thought while I'm on the topic of PM's. It sure would be nice to see an option for making drafts and being able to save as a draft. I can't tell you how many times I typed up a PM and wished I had that as an option. <
Have a great day! Terry
Postet den
Average Member
Andy Humm
Innlegg: 908
908
endomorph - which PM Mod did you use, because the suggested text you have for privatesend.asp does not appear on my asp file, even though I have a PM Mod installed.

I used this PM Mod link
If this Mod is different, could you suggest the 'if else,then ' alterations for the privatesend.asp file. The privatesend_info.asp text suggested appears on this PM Mod version.
thank you andy<
Postet den
Junior Member
endomorph
Innlegg: 128
128
Andy,

Email me the two files and I will code it for you. Not sure exactly which PM I used. It was installed a good few years ago, and sure I took it from Snitzbitz<
Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation
Postet den
Average Member
Andy Humm
Innlegg: 908
908
endomorph I could not find an attachment facility on this forum. Two files fowarded via your external email sent to me. Thank you
andy<
Postet den
Junior Member
endomorph
Innlegg: 128
128
Another happy customer.
BTW, if anyone else would like to see whats used on the site, there is a testing / demo account already set up. Use demo / demo to log in.<
Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation
 
Du må legge inn en melding