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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 PM mod always sends emails
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

imperialdata
Starting Member

United Kingdom
15 Posts

Posted - 11 January 2006 :  16:16:43  Show Profile
I have just enabled the email sending from my server via CDOSYS. A moderator reports that despite turning off the option to send emails when he gets a pm (from pm preferences), it still sends emails to his Yahoo Webmail account upon a new pm arriving.

Using Snitz 3.4.03

imperialdata
Starting Member

United Kingdom
15 Posts

Posted - 19 January 2006 :  05:18:16  Show Profile
Any comments on this, it is very annoying as I may have to turn the complete email feature off.

M_PMEMAIL is off for this member in the Access database
Go to Top of Page

imperialdata
Starting Member

United Kingdom
15 Posts

Posted - 21 January 2006 :  06:53:14  Show Profile
Asking other users, it seems that when email notification is turned off in preferences, you will still get notified if someone else sends you a mail who has it turned on. What asp code should I be looking at for this?
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 28 January 2006 :  01:02:01  Show Profile  Visit NiteOwl's Homepage
Hi I don't know the code or what to change but this is a problem with this mod, if you search you should find the comments here http://forum.snitz.com/forum/topic.asp?TOPIC_ID=54086&whichpage=6 his name is/was GarethMoore


-=NiteOwl=-
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 28 January 2006 :  02:17:36  Show Profile
Yes, I have the same problem - just never bothered to find the faulty code because there's VERY few users that don't want to get emailed when they get PM'd.
Go to Top of Page

imperialdata
Starting Member

United Kingdom
15 Posts

Posted - 01 February 2006 :  18:53:32  Show Profile
Thanks for that. It seems it is a bug where you can deselect to receive emails notifying of PM's but if the sending member has notification on, it emails you anyway! Need a code guru to sort this one out as I think support for this mod is not here any more.
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 01 February 2006 :  19:37:26  Show Profile  Visit MarkJH's Homepage
This bug has been around since the PM MOD came about. I've only had one or two members bring it up over the last five years so it hasn't been a priority. Of course, if somebody could find a fix, that would be great.

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 02 February 2006 :  16:34:52  Show Profile  Visit masterao's Homepage
The following change should fix this bug

In privatesend_info.asp, locate the sub DoReplyEmail() (at the end). Add the line marked green below, and that should be it.

I have only tested it on mysql, but I think it should work both access and mssql as well.


    '## Emails all users who wish to receive notification of private message
    '## Forum_SQL
    strSql = " SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
    strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_NAME "
    strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
    strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PMEMAIL "
    strSql = strSql & ", " & strTablePrefix & "PM.M_SUBJECT "
    strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS "
    strSql = strSql & "INNER JOIN " & strTablePrefix & "PM "
    strSql = strSql & "ON " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
    strSql = strSql & "WHERE " & strMemberTablePrefix & "MEMBERS.M_PMEMAIL = '1' "
    strSql = strSql & "ORDER BY " & strTablePrefix & "PM.M_SENT DESC"

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 08 February 2006 :  01:39:10  Show Profile  Visit NiteOwl's Homepage
Thank You!! I have added this to my site and am now trying it out. I very much appreciate your investigating this issue for us.


-=NiteOwl=-
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 08 February 2006 :  16:58:04  Show Profile  Visit Webbo's Homepage
I made the above changes but now find that when replying to a PM I also receive an email to inform me that one has been received

ie:

Hello Dave

Dave has sent you a private message at The Maggotdrowner's Forum.
Regarding.....


Strange??
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 08 February 2006 :  21:17:30  Show Profile  Visit masterao's Homepage
Webbo, I can recreate that as well. Ok, here is a new go at it .

In privatesend_info.asp, locate the following lines:

        if strEmail = "1" then
          If Request.Form("Method_Type") = "Forward" then
            if strPMNEmail = "1" then
              DoReplyEmail
            end if
          else
            'if strPMREmail = "1" then
              DoReplyEmail
            'end if
          end if
        end if


Add a ' on the lines with a red ', or you can just remove these lines altogether, changing the above lines of code to this:

        if strEmail = "1" then
          If Request.Form("Method_Type") = "Forward" then
            if strPMNEmail = "1" then
              DoReplyEmail
            end if
          else
              DoReplyEmail
          end if
        end if


Locate the sub DoReplyEmail() (at the end). Add the lines marked green below (earlier change remains):


sub DoReplyEmail()
    Select Case Request.Form("Method_Type")
      Case "Topic"
        strFromID = strPMID
      Case Else
        strFromID = strPMRID
    End Select
    '## Emails all users who wish to receive notification of private message
    '## Forum_SQL
    strSql = " SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
    strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_NAME "
    strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
    strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PMEMAIL "
    strSql = strSql & ", " & strTablePrefix & "PM.M_SUBJECT "
    strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS "
    strSql = strSql & "INNER JOIN " & strTablePrefix & "PM "
    strSql = strSql & "ON " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
    strSql = strSql & "WHERE " & strMemberTablePrefix & "MEMBERS.M_PMEMAIL = '1' "
    strSql = strSql & "AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID <> " & strFromID
    strSql = strSql & " ORDER BY " & strTablePrefix & "PM.M_SENT DESC"

Important note. Add a blank space between " and ORDER on the last line of code!

With these changes, I haven't gotten any mails unless I have checked the option receive email notification about new PMs, nor have I gotten any notification emails about PMs that I sent to others. Let me know if it works or not for you.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 09 February 2006 :  18:32:18  Show Profile  Visit NiteOwl's Homepage
testing now and I can't break it. I have mySQL

This is great masterao, it would be nice if you or someone could re-bundle the PM module at SnitzBitz and add this modified privatesend_info.asp for future down-loaders.


-=NiteOwl=-
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 11 February 2006 :  12:45:13  Show Profile  Visit masterao's Homepage
My changes need some bug-testing, NiteOwl, as I have noticed something strange with my PM mod. Im getting email notifications for PMs that isn't sent to me. Im not sure why it happens, but Im currently looking it up. When this modification to the mod is confirmed to work as it should, it will hopefully be added to the mod at SnitzBitz.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 11 February 2006 :  18:26:12  Show Profile  Visit NiteOwl's Homepage
Hi masterao, I received the same comment from one of my users so its not specific to your board.

-=NiteOwl=-

Edited by - NiteOwl on 11 February 2006 18:26:41
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 13 February 2006 :  10:31:53  Show Profile  Visit masterao's Homepage
Ok. I haven't had time to go through the code yet, but it is the first item on my to do list.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 16 February 2006 :  14:09:49  Show Profile  Visit masterao's Homepage
I think I have got a working fix now.

First, remove the code-changes I posted earlier and restore the code back to original. Im leaving those earlier changes unchanged, to help doing that.

Then, locate the following in privatesend_info.asp:


            '## FORUM_SQL
            strSql = "SELECT M_FROM, M_SUBJECT "
            strSql = strSql & " FROM " & strTablePrefix & "PM "
            strSql = strSql & " WHERE M_ID = " & ChkString(Request.Form("id"), "SQLString")

        set rs = my_Conn.Execute (strSql)

        strPMSubject = rs("M_SUBJECT")

        rs.close
        set rs = nothing
    else
        '## FORUM_SQL
        strSql = "SELECT M_FROM, M_SUBJECT "
        strSql = strSql & " FROM " & strTablePrefix & "PM "
        strSql = strSql & " WHERE M_ID = " & Request.Form("id")
        
        set rs = my_Conn.Execute (strSql)

        strPMTOID = rs("M_FROM")
        strPMSubject = rs("M_SUBJECT")


Exchange the code marked red with the following:

        strSql = "SELECT P.M_FROM, P.M_SUBJECT, M.M_PMEMAIL "
        strSql = strSql & " FROM " & strTablePrefix & "PM P, " & strMemberTablePrefix & "MEMBERS M"
        strSql = strSql & " WHERE P.M_ID = " & Request.Form("id") & " AND M.MEMBER_ID = P.M_FROM"
        
        set rs = my_Conn.Execute (strSql)

        strPMTOID = rs("M_FROM")
        strPMSubject = rs("M_SUBJECT")
        strPMNEmail = rs("M_PMEMAIL")

With that done, locate the following lines of code:

        if strEmail = "1" then
          If Request.Form("Method_Type") = "Forward" then
            if strPMNEmail = "1" then
              DoReplyEmail
            end if
          else
            if strPMREmail = "1" then
              DoReplyEmail
            end if
          end if
        end if

Exchange those lines with the following lines:

        if strEmail = "1" then
          if strPMNEmail = "1" then
            DoReplyEmail
          end if
        end if

Done.

I have tested this briefly, and it seems to work ok. However, I would appreciate others testing it as well.
I hope that this will also fix the problem with getting email notifications for PMs sent to others.

Edit: Corrected a small error in the instructions, which most likely doesn't affect the fix.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod

Edited by - masterao on 18 February 2006 03:26:56
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.4 seconds. Powered By: Snitz Forums 2000 Version 3.4.07