Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Blocking members from sending e-mail

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
matko Posted - 31 May 2007 : 06:38:06
<font size="1"><b>Credits:</b>This MOD is based on idea of ruirib in Small mod: Blocking forum email spam</font id="size1">

<b>Version 1.0
Snitz forum version 3.4.06</b>

This mod will prevent members to send an e-mail to other members until they reach certain number of posts or until admin allows them to do so. Usefull to block e-mail spammers while allowing admin to overide this for users he knows or recommended users. Override can be set in User profile. It will also send a message to the forum admin, notifying him of the spam attempt, so that the member can be blocked.

<b>Difficulty:</b> easy to implement

<font color="blue">1. In admin section go to Alternative mod setup and run this code:</font id="blue">

[ALTER]
MEMBERS
ADD#M_ALLOWEMAIL#SMALLINT##0
[END]

[UPDATE]
MEMBERS
M_ALLOWEMAIL#1#
[END]

[ALTER]
MEMBERS_PENDING
ADD#M_ALLOWEMAIL#SMALLINT##0
[END]

[UPDATE]
MEMBERS_PENDING
M_ALLOWEMAIL#1#
[END]


<font color="blue">2. in unmodified <b>pop_mail.asp</b> find this code (at around line 45):</font id="blue">

if Request.QueryString("ID") <> "" and IsNumeric(Request.QueryString("ID")) = True then
intMemberID = cLng(Request.QueryString("ID"))
else
intMemberID = 0
end if
'##################### e-mail anti-spam MOD #######################
strSql = "SELECT M_NAME, M_POSTS, M_ALLOWEMAIL 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")
intAllowEmail = rs("M_ALLOWEMAIL")

if intMPosts < <font color="red">10</font id="red"> and intAllowEmail="0" then
Err_Msg = "<li>You can't send e-mail yet.</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 anti-spam mod #############


<font size="1">In red is number of posts member has to reach before allowed to send e-mail. Next version of this mod (if there is interest from people) can allow to set this value via admin menu, currently it has to be set in the code.</font id="size1">

<font color="blue">3. in <b>pop_mail.asp </b> look for this code (around line 102)</font id="blue">

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


<font color="blue">and comment Err_Msg= "" so it looks like this:</font id="blue">
if Request.QueryString("mode") = "DoIt" then
  <font color="green">'</font id="green">Err_Msg = ""


<font color="blue">4. In unmodified <b>pop_profile.asp</b> look for this code (around 969)</font id="blue">

strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_BIO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"


<font color="blue">and right <b>BELOW</b> these lines add this code</font id="blue">

strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ALLOWEMAIL"


<font color="blue">So it looks like this</font id="blue">

strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_BIO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
<font color="green">strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ALLOWEMAIL"</font id="green">
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"


<font color="blue">5. In the same <b>pop_profile.asp</b> look for this (around 1586):</font id="blue">
if strBio = "1" then
   strSql = strSql & ", M_BIO = '" & chkString(Request.Form("Bio"),"message") & "'" 
end if


<font color="blue">and right BELOW these lines add this:</font id="blue">

strSQL = strSql & ", M_ALLOWEMAIL = " & cLng(Request.Form("allowemail"))


<font color="blue">so it looks like this</font id="blue">

if strBio = "1" then
   strSql = strSql & ", M_BIO = '" & chkString(Request.Form("Bio"),"message") & "'" 
end if
<font color="green">strSQL = strSql & ", M_ALLOWEMAIL = " & cLng(Request.Form("allowemail"))</font id="green">
strSql = strSql & " WHERE MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))

my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords


<font color="blue">6. in <b>inc_profile.asp</b> look for this code (around 532)</font id="blue">


     if rs("M_LEVEL") = 3 then Response.Write(" selected")
     Response.Write ">Administrator</option>" & vbNewLine & _
     "                      </select>" & vbNewLine
end if
Response.Write "                      </td>" & vbNewLine & _
   "                    </tr>" & vbNewLine


<font color="blue">and right BELOW this add this code</font id="blue">


response.write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>User allowed to send<br />e-mail before limit of <br />posts is reached? </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ valign=""bottom"">" & vbNewLine
response.write " <select name=""allowemail"">" & vbNewLine & _
" <option value=""1"""
if rs("M_ALLOWEMAIL")="1" then Response.Write(" selected")
Response.Write ">Yes</option>" & vbNewLine & _
" <option value=""0"""
if rs("M_ALLOWEMAIL")="0" then Response.Write(" selected")
Response.Write ">No</option>" & vbNewLine & _
" </select>" & vbNewLine
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine


<font color="blue">so it looks like this</font id="blue">


if rs("M_LEVEL") = 3 then Response.Write(" selected")
Response.Write ">Administrator</option>" & vbNewLine & _
" </select>" & vbNewLine
end if
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine
<font color="green"> response.write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>User allowed to send<br />e-mail before limit of <br />posts is reached? </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ valign=""bottom"">" & vbNewLine
response.write " <select name=""allowemail"">" & vbNewLine & _
" <option value=""1"""
if rs("M_ALLOWEMAIL")="1" then Response.Write(" selected")
Response.Write ">Yes</option>" & vbNewLine & _
" <option value=""0"""
if rs("M_ALLOWEMAIL")="0" then Response.Write(" selected")
Response.Write ">No</option>" & vbNewLine & _
" </select>" & vbNewLine
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine</font id="green">

end if
if not(strUseExtendedProfile) then



And that's it. I hope you'll find it usefull, if you have any suggestions how to improve this, please let me know.

7   L A T E S T    R E P L I E S    (Newest First)
BroIgnatius Posted - 05 October 2007 : 21:33:37
I am getting this error message when someone tries to register:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] The field 'FORUM_MEMBERS_PENDING.M_ALLOWEMAIL' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.

/bbs/register.asp, line 730


line 730 is:
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords


Any help appreciated.


<
TastyNutz Posted - 29 July 2007 : 20:41:34
Oops. Missed a line of code.

Works great now!<
TastyNutz Posted - 29 July 2007 : 14:24:08
I've added this mod and it successfully blocks email from members without enough posts. But the Admin override isn't working. I select "Yes" from the menu and click 'Submit' but the database doesn't update. When I check the profile again, the menu option has reverted back to "No."

Any ideas what I missed?<
dcohn Posted - 02 July 2007 : 02:27:06
Matko

Does everyone default to yes they can send without reaching and can that be changed to NO as the default so it is more like RUI's code without your added options. Otherwise I must go into every user with a yes and under the amount and change to no.


Where you write

2. in unmodified pop_mail.asp find this code (at around line 45):

I assume you mean you find the first few lines and then add the balance of the contents, correct?

Sorry for being so anal.

THANK YOU for what I have been looking for. I have a serious problem on a Feline health forum where crazies attack new users with lies etc.

I was also wondering whether these users that cannot email CAN email the ADMIN or does that defeat the purpose when it is used to prevent spammers?

IE In my case I need to just control people from their own bad behavior as well as protect against the more common spammer issue.

Thanks again as this is a great addition as it is for us non coder types.

Doug<
AnonJr Posted - 31 May 2007 : 15:20:22
Its one of those little hidden gems that is set up just here. The code for adding it (or something like it) is floating around here if you want to add it to your forum.<
matko Posted - 31 May 2007 : 13:17:22
AntonJr: I didn't know such a tag exists

I put widest part of code in scrollcode now, so the page is not stretching anymore.<
AnonJr Posted - 31 May 2007 : 08:23:33
Cool. Its a neat addition. The only change I'd make is put your code in [scrollcode] tags so it doesn't stretch the page. <

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07