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
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 28 May 2007 :  17:27:36  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
The code change seems ok. A reference on dbs files is here: http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=5120


You should create the column with the desired default value (0) and then use a small dbs script to set the value to 1 for the existing records.<


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

matko
New Member

54 Posts

Posted - 29 May 2007 :  01:33:56  Show Profile  Reply with Quote
Thanks rurib, that was exactly what I was looking for. So next step should be

[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]


Let's move to thrid step, probably the most difficult.

Where can I find what user levels are stored in mLev variable? I am only guessing from the code that mLev = 0 means not logged in, mLev =1 means common user, mLev = 4 admin?<

Edited by - matko on 29 May 2007 04:16:36
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 29 May 2007 :  03:33:06  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
You need to start using the search feature, most your questions could be answered through it...

Anyway, here it goes: 1 = Member, 2 = Post Author, 3 = Moderator, 4 = Admin<


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

matko
New Member

54 Posts

Posted - 29 May 2007 :  04:17:30  Show Profile  Reply with Quote
Sorry about that, somehow I didn't put the correct key words to get my answers. I'll try harder next time, before I ask.<

Edited by - matko on 29 May 2007 04:18:01
Go to Top of Page

matko
New Member

54 Posts

Posted - 29 May 2007 :  11:20:04  Show Profile  Reply with Quote
Ok, I think I have finished this, there are only three relatively simple changes needed.
1. In unmodified pop_profile.asp look for this code (around 969)

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


and right BELOW these lines add this code

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


So it looks like this

strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_BIO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ALLOWEMAIL"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"


2. In the same pop_profile.asp look for this (around 1586):
if strBio = "1" then
   strSql = strSql & ", M_BIO = '" & chkString(Request.Form("Bio"),"message") & "'" 
end if


and right BELOW these lines add this:

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


so it looks like this

if strBio = "1" then
   strSql = strSql & ", M_BIO = '" & chkString(Request.Form("Bio"),"message") & "'" 
end if
strSQL = strSql & ", M_ALLOWEMAIL = " & cLng(Request.Form("allowemail"))
strSql = strSql & " WHERE MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))

my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords


3. in inc_profile.asp look for this code (around 532)


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


and right BELOW this add this 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	


so it looks like this


        if rs("M_LEVEL") = 3 then Response.Write(" selected")
        Response.Write	">Administrator</option>" & vbNewLine & _
        "                      </select>" & vbNewLine
    end if
    Response.Write	"                      </td>" & vbNewLine & _
    "                    </tr>" & vbNewLine
    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	
		
end if
if not(strUseExtendedProfile) then


My only question now is, what will happen if a new user will register? Will the M_ALLOWEMAIL value be set automatically do default value, or is there any other code change needed?<

Edited by - matko on 29 May 2007 11:20:53
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 29 May 2007 :  13:50:40  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
The default value for M_ALLOWEMAIL is 0, so new users will have the value set to 0.<


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

matko
New Member

54 Posts

Posted - 30 May 2007 :  04:31:49  Show Profile  Reply with Quote
In that case work is finished, I modified the code on my forum and I can prove that on Access it's working properly and it is also compatible with all mods that are part of Image's modification.

Is it worth to put this as a separate topic or is it enough if we leave it here?<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 30 May 2007 :  05:05:53  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
You can start a new topic, in the Mod W/Code forum and present the whole code for the changes there.<


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

gpspassion
Junior Member

260 Posts

Posted - 13 November 2007 :  03:28:20  Show Profile  Visit gpspassion's Homepage  Reply with Quote
Excellent MOD, I added the IP line too !<

Edited by - gpspassion on 13 November 2007 05:01:14
Go to Top of Page

kmac
New Member

USA
58 Posts

Posted - 13 November 2007 :  07:45:59  Show Profile  Reply with Quote
Kudos on the mail spam mod, and also the PM variant!

I don't know if I missed something, but I have a small glitch in the "Possible Spam Poster" email sent to the forum admin. It doesn't include the spam target's name. The output is this -
.......
There is a possible spam poster at Blue Moon Fabrications - forum

Member bluemoonie1, with MemberID 468, has been trying to send emails to , without having enough posts to be allowed to do it.

Here are the message contents:
spam test
.........

Line 69, in pop_mail.asp reads -
...........
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."
..............

Can I include the target's name in the email?



I also noticed, in the PM mod, that I wasn't getting the spammer's message in in the admin email. It worked when I changed Msg to Message

before - "Here are the message contents: " & VbNewLine & Request.Form("Msg")

after - "Here are the message contents: " & VbNewLine & Request.Form("Message")


Thanks, Ken<

Edited by - kmac on 13 November 2007 07:59:35
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 November 2007 :  08:00:31  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
Can you post a link to a text version of your pop_mail.asp?<


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

kmac
New Member

USA
58 Posts

Posted - 13 November 2007 :  08:04:34  Show Profile  Reply with Quote
Thanks for looking!

http://www.bluemoonfabrications.com/pop_mail.txt<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 November 2007 :  08:42:21  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
The mod was written for Snitz 3.4.05. Snitz 3.4.06 changed pop_mail.asp and it does not include some form fields that were available with Snitz 3.4.05. Getting the destination member name will require another DB query. Here is the code for the initial mod part, required to have it working with 3.4.06:

'######## 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 < 5 then
         Err_Msg = "<li>You don't have enough posts to email other members.<br>If you feel that you have received this message in error, please contact the forum administrator.</li>"
            strSpammerName = RS("M_NAME")
		
        rs.Close


		strSql = "SELECT M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
        strSql = strSql & " WHERE M.MEMBER_ID = " & intMemberID

         set rs = my_Conn.Execute (strSql)

		 if rs.bof or rs.eof Then
			strDestName = ""
		 Else
		    strDestname = rs("M_NAME")
		 End If

        rs.close
        Set rs = nothing
 
         '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 " & strDestName & ", 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 #############


Don't forget that there is another change required for the mod, as per the original post.

I haven't tested this, but it should work.<


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

kmac
New Member

USA
58 Posts

Posted - 13 November 2007 :  09:03:09  Show Profile  Reply with Quote
Hi ruirib,

When I try to send the email, I get this error message -
...........
Microsoft VBScript runtime error '800a01a8'

Object required: 'rs'

/forum/pop_mail.asp, line 99
........

My new post_mail file is here - http://www.bluemoonfabrications.com/pop_mail2.txt

Thanks, Ken<
Go to Top of Page

kmac
New Member

USA
58 Posts

Posted - 13 November 2007 :  09:45:16  Show Profile  Reply with Quote
Update - it is sending the spam warning email to the admin, and the content looks good. It's just not returning the "you don't have enough posts" page on the spammer's "send" click<
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | 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