Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Private Message Sending Limit MOD
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

endomorph
Junior Member

United Kingdom
128 Posts

Posted - 20 February 2008 :  02:32:00  Show Profile  Reply with Quote
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

AnonJr
Moderator

United States
5768 Posts

Posted - 20 February 2008 :  10:29:48  Show Profile  Visit AnonJr's Homepage  Reply with Quote
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.

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. HTH<
Go to Top of Page

philsbbs
Junior Member

United Kingdom
397 Posts

Posted - 21 February 2008 :  18:01:02  Show Profile  Reply with Quote
I've installed this and think it's very good but agree with AnonJr points.<

Phil
Go to Top of Page

endomorph
Junior Member

United Kingdom
128 Posts

Posted - 24 February 2008 :  10:59:45  Show Profile  Reply with Quote
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

Edited by - endomorph on 24 February 2008 11:10:28
Go to Top of Page

campinmom03
Junior Member

USA
190 Posts

Posted - 02 March 2008 :  10:28:31  Show Profile  Reply with Quote
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
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 10 March 2008 :  15:37:14  Show Profile  Reply with Quote
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<
Go to Top of Page

endomorph
Junior Member

United Kingdom
128 Posts

Posted - 10 March 2008 :  15:39:34  Show Profile  Reply with Quote
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
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 10 March 2008 :  16:25:35  Show Profile  Reply with Quote
endomorph I could not find an attachment facility on this forum. Two files fowarded via your external email sent to me. Thank you
andy<

Edited by - Andy Humm on 10 March 2008 16:43:37
Go to Top of Page

endomorph
Junior Member

United Kingdom
128 Posts

Posted - 12 March 2008 :  01:25:53  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07