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)
 Small mod: Blocking forum email spam
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 6

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2006 :  07:09:30  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Version 1.01 - 2006/08/25
Snitz forum version: 3.4.05


This mod will stop members emailing other forum members until they reach a given number of forum posts. It's useful to stop spammers who register just to send emails to forum members.

It's not a very elaborate mod, and the post limit must be changed in the code, but I'm providing it because with the current surge of spammers registering all over the place, it can be useful to avoid them annoying your valuable forum members.

It's even more interesting because it will allow the spammer to write the email and when the email is sent, it will show a message stating that it won't be sent, since the member does not have the required number of posts to send it. So, they'll have the trouble to compose the message only to be told it can't be sent, once that is tried.
It will also send a message to the forum admin, notifying him of the spam attempt, so that the member can be blocked.

Code changes to an unchanged pop_mail.asp:
Starting with a pop_mail.asp, at line# 46, add the following code:

'######## Email Spam Mod ############

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""

   strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
   strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID

   set rs = my_Conn.Execute (strSql)

   If Not rs.EOF then
      intMPosts = rs("M_POSTS")

      if intMPosts < 10 then
         Err_Msg = "<li>You don't have enough posts to email other members.</li>"
         	strSpammerName = RS("M_NAME")

         'Send email to forum admin
         strRecipients = strSender
         strFrom = strSender
         strFromName = "Automatic Server Email"
         strSubject = "Possible Spam Poster"
         strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
         strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & Request.Form("Name") & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine 
         strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
         strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."

%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
  
     
      end If

   End if

   rs.Close
end if
'############# End of email spam mod #############


Then at line# 102, where you have

if Request.QueryString("mode") = "DoIt" then
  Err_Msg = ""

comment the 2nd line, so that it will look like this:

if Request.QueryString("mode") = "DoIt" then
  'Err_Msg = ""

The commented line can also be removed, of course.

This has been tested with 3.4.05 and has been working well. If you need to change the number of messages a member must have before emailing other members, just change the number in red to the desired value.

If you need help with this, please post in the mod implementation forum.
<


Snitz 3.4 Readme | Like the support? Support Snitz too

Nertz
Junior Member

Canada
341 Posts

Posted - 25 August 2006 :  08:01:20  Show Profile  Reply with Quote
Excellent Rui, thanks! Great timing too... I was trying to find time to do something like this.

cheers,
Nat<

Sadly, most Family Court Judges wrongfully reward opportunistic gold diggers
that use our children unjustly as "instruments" of power.


www.fathers-4-justice-canada.ca
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2006 :  09:35:51  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
You're welcome .<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

borge
Junior Member

Norway
185 Posts

Posted - 25 August 2006 :  14:11:34  Show Profile  Reply with Quote
It's not working on my 3.4.03<

borge
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 25 August 2006 :  14:16:59  Show Profile  Visit AnonJr's Homepage  Reply with Quote
What specifically is the problem/error?<
Go to Top of Page

borge
Junior Member

Norway
185 Posts

Posted - 25 August 2006 :  14:23:35  Show Profile  Reply with Quote
I do not get any error message, it just ignores the mod and lets me post with a 0 post count

The 100 characters mod worked fine though<

borge
Go to Top of Page

borge
Junior Member

Norway
185 Posts

Posted - 25 August 2006 :  14:28:38  Show Profile  Reply with Quote
It is actually not sending the possible spam e-mail, and gives a notice "E-mail has been sent". It fails to display the "You don't have enough posts to email other members" message, but does the job and sends the spam. It sends a waring to forum admin about possible spam.<

borge

Edited by - borge on 25 August 2006 14:40:58
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 25 August 2006 :  14:41:09  Show Profile  Visit AnonJr's Homepage  Reply with Quote
hmm.. I wonder if there is a problem with the two working together; I wouldn't think so though. I almost think thats even better - let the spammer's think the e-mail was sent when it wasn't. The only problem is that it hurts the real members who want to send an email with fewer than the required posts since it does tell them it went through when it actually didn't. =/

Edit: you had to go and edit it while I was typing a reply! So it is sending the e-mail?<

Edited by - AnonJr on 25 August 2006 14:42:29
Go to Top of Page

borge
Junior Member

Norway
185 Posts

Posted - 25 August 2006 :  14:50:42  Show Profile  Reply with Quote
Yes, sorry, I notised the e-mails came in with a little delay. It is actually sending the e-mails, however I should probably say the messages were sent to a forum moderator account, hmmm...would it make a difference when sent to an ordinary member? I'll have to do more testing.<

borge
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2006 :  14:58:26  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
You can change the destination email by changing this line:

strRecipients = strSender

to

strRecipients = "whateverAddressYou@whish.com"

If it says the email was sent, then it was. Want to post a link to a text version of your pop_mail.asp file?<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 25 August 2006 :  15:00:21  Show Profile  Visit AnonJr's Homepage  Reply with Quote
The code rui posted looks like it doesn't care who is sending it or to whom it is going... I suspect it won't make a difference. Then again, I haven't really played with pop_mail.asp too much either...

Maybe a txt version of pop_mail.asp and inc_mail.asp would help...

Edit: rui, you beat me again. <

Edited by - AnonJr on 25 August 2006 15:01:54
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2006 :  15:02:53  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
quote:
Originally posted by AnonJr

The code rui posted looks like it doesn't care who is sending it or to whom it is going...
Edit: rui, you beat me again.



Quite so... in both counts .<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2006 :  15:34:06  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
You have an error in pop_mail.asp. Where now you have this at line# 77

else
	intMemberID = 0
end if

You should cut these lines and move them to around line number# 47, so that the code, starting at line# 46 looks like this:

if Request.QueryString("ID") <> "" and IsNumeric(Request.QueryString("ID")) = True then
	intMemberID = cLng(Request.QueryString("ID"))
else
	intMemberID = 0
end if
'######## Email Spam Mod ############
<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

borge
Junior Member

Norway
185 Posts

Posted - 25 August 2006 :  15:52:34  Show Profile  Reply with Quote
Fixed the code as suggested but still it is not working. I updated the txt file too if you like to check.<

borge
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2006 :  16:13:35  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Instructions updated to add a new required code change, regarding line# 102.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

borge
Junior Member

Norway
185 Posts

Posted - 25 August 2006 :  17:59:46  Show Profile  Reply with Quote
It works now
Thanks!!!<

borge
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Next Page
 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.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07