The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
<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">
<font color="blue">2. in unmodified <b>pop_mail.asp</b> find this code (at around line 45):</font id="blue">
<font color="blue">and comment Err_Msg= "" so it looks like this:</font id="blue">
<font color="blue">4. In unmodified <b>pop_profile.asp</b> look for this code (around 969)</font id="blue">
<font color="blue">and right <b>BELOW</b> these lines add this code</font id="blue">
<font color="blue">So it looks like this</font id="blue">
<font color="blue">5. In the same <b>pop_profile.asp</b> look for this (around 1586):</font id="blue">
<font color="blue">and right BELOW these lines add this:</font id="blue">
<font color="blue">so it looks like this</font id="blue">
<font color="blue">6. in <b>inc_profile.asp</b> look for this code (around 532)</font id="blue">
<font color="blue">and right BELOW this add this code</font id="blue">
<font color="blue">so it looks like this</font id="blue">
And that's it. I hope you'll find it usefull, if you have any suggestions how to improve this, please let me know.
<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">
Code:
[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">
Code:
if Request.QueryString("ID") <> "" and IsNumeric(Request.QueryString("ID")) = True then
intMemberID = cLng(Request.QueryString("ID"))
else
intMemberID = 0
end if[/code]
<font color="blue">and right <b>BELOW</b> it add this:</font id="blue">
Code:
'##################### 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">
[code]
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
<font color="blue">and comment Err_Msg= "" so it looks like this:</font id="blue">
Code:
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">
Code:
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">
Code:
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ALLOWEMAIL"<font color="blue">So it looks like this</font id="blue">
Code:
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">
Code:
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">
Code:
strSQL = strSql & ", M_ALLOWEMAIL = " & cLng(Request.Form("allowemail"))<font color="blue">so it looks like this</font id="blue">
Code:
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">
Code:
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">
Code:
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">
Code:
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) thenAnd that's it. I hope you'll find it usefull, if you have any suggestions how to improve this, please let me know.