Mail - Allows mail to be sent to non friends

Has anyone had this issue - When a member goes to send a mail to someone, it automatically lists the whole database of members on the to box. I dont want my members to get spammed. Can I change this so that they can only mail friends?

Thanks

MeMe

Quote · 21 Mar 2012

Hello

Yes, it's a default Dolphin's feature, which allows to easily select a recipient from a list. Unfortunately there is no possibility to replace the list of all members with a list of friends only via admin panel. You need to do a custom modification. 

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 22 Mar 2012

Hi Anton,

Thank you for your reply.

Instead of just friends cant i just disable it, so that they type the name or just msg via the msg button?Does it mess with some of the privacy settings then? What if someone doesnt want non friends to msg them? (im not sure if the privacys even goes that far to be honest). Dolphin is huge and sometimes i forget how to do stuff!!!

Im getting all sorts of spammers registering and I am removing them daily but i dont want to give them an opportunity to figure this out and spam the hell out of my members.

Thanks

M

Quote · 12 Apr 2012

 Hi Anton,

Hello

Yes, it's a default Dolphin's feature, which allows to easily select a recipient from a list. Unfortunately there is no possibility to replace the list of all members with a list of friends only via admin panel. You need to do a custom modification. 

Can you do this custom mod? Please message me if you can.

 

Thank you

Quote · 1 May 2012

For anyone in future, you can accomplish this by modifying this function getAutoCompleteList at line 1641 in file templates/base/script/BxBaseMailBox.php

so much to do....
Quote · 1 May 2012

Thank you for this helpful info.

Do I just remove that line?

 

Thanks

M

Quote · 1 May 2012

no....lol

I just pointed the function. You need to edit that and make changes in the function. If you can't do obviously hire someone.

so much to do....
Quote · 1 May 2012

Thank you for that. It really helped.

 

M

Quote · 1 May 2012

I did post a job and I got no bids. So that's why I asked Anton from here as he is the one who suggested it to me.

Quote · 1 May 2012

to answer your question, or give you the code you need (for dolphin 7.09 confirmed) ....

 

in the file templates/base/script/BxBaseMailBox.php  around line 1644

 

find....

           // init some needed variables ;
            $iLimit = (int) $iLimit;
            $sQuery = process_db_input($sQuery, BX_TAGS_STRIP);

            $sOutputHtml = null;

            $sQuery  = "SELECT `NickName` FROM `Profiles` WHERE `NickName` LIKE '%{$sQuery}%' LIMIT {$iLimit}";
            $rResult = db_res($sQuery);

Replace with this

           // init some needed variables ;
            $iLimit = (int) $iLimit;
            $sQuery = process_db_input($sQuery, BX_TAGS_STRIP);

            $sOutputHtml = null;

###
#SteveSoft
#05-01-2012
#           
                $iId   = getLoggedId() ;                  
                $sJoinClause = ' LEFT JOIN  `sys_friend_list` Friend ON
                (`Profiles`.`ID` =  Friend.`Profile` AND Friend.`ID` = "' .
                $iId. '" AND Friend.`Check` = "1") LEFT JOIN  `sys_friend_list` Profile
                ON (`Profiles`.`ID` = Profile.`ID`  AND Profile.`Profile` = "' .
                $iId . '"  AND Profile.`Check` = "1") ';

                $sWhereClause = ' AND ((Friend.`Profile` AND Friend.`ID` = "' .
                $iId . '") OR (Profile.`ID` AND Profile.`Profile` = "' . $iId. '"))';

            $sOutputHtml = null;

            $sQuery  = "SELECT `NickName`, `Profiles`.`ID`  FROM `Profiles` " . $sJoinClause . " WHERE `NickName` LIKE '%{$sQuery}%' " . $sWhereClause . " LIMIT {$iLimit}";

            $rResult = db_res($sQuery);

 

I have tested it with 3 test users and it only shows the friends in the drop down.  it does NOT prevent a user from sending email to a non friend,  It just populates the drop down of existing friends.

Make sure you clear your cache and reload the page before trying, or it MAY give you a database error.  also, as always, BACKUP the file in case it doesn't work for your site!

 

http://www.mytikibar.com
Quote · 1 May 2012

Thank you Steve... impressed yet again with your offer to share code on the forum!  May I suggest one refinement?  Please add code so the "Friends Only listing" does not happen for members with *admin* privileges... I'd like them to see the entire list.  

TIA :-)

Paul

http://pkforum.dolphinhelp.com
Quote · 1 May 2012

Thank you Steve,

I really appreciate your free code sharing.

Regards

MeMe

Quote · 2 May 2012

I just did it and it works perfectly.

Thank you so much. I have been waiting for someone to bid on my job post and then you come and give it away for free. Your so kind.

Thank you again.

MeMe

Quote · 2 May 2012

 

Thank you Steve... impressed yet again with your offer to share code on the forum!  May I suggest one refinement?  Please add code so the "Friends Only listing" does not happen for members with *admin* privileges... I'd like them to see the entire list.  

TIA :-)

Paul

 

 Ha! I TOTALLY overlooked that! 

Here is the entire function.

        function getAutoCompleteList($sQuery, $iLimit = 10 )
        {
            // init some needed variables ;
            $iLimit      = (int) $iLimit;
            $sQuery      = process_db_input($sQuery, BX_TAGS_STRIP);
            $sOutputHtml = null;
###
#SteveSoft
#05-01-2012
#            
        if ((!isAdmin()) && (!isModerator())){
                $iId                = getLoggedId() ;                   
                $sJoinClause = ' LEFT JOIN  `sys_friend_list` Friend ON
                (`Profiles`.`ID` =  Friend.`Profile` AND Friend.`ID` = "' .
                $iId. '" AND Friend.`Check` = "1") LEFT JOIN  `sys_friend_list` Profile
                ON (`Profiles`.`ID` = Profile.`ID`  AND Profile.`Profile` = "' .
                $iId . '"  AND Profile.`Check` = "1") ';

                $sWhereClause = ' AND ((Friend.`Profile` AND Friend.`ID` = "' .
                $iId . '") OR (Profile.`ID` AND Profile.`Profile` = "' . $iId. '"))';

        }

            $sQuery  = "SELECT `NickName`, `Profiles`.`ID`  FROM `Profiles` " . $sJoinClause . " WHERE `NickName` LIKE '%{$sQuery}%' " . $sWhereClause . " LIMIT {$iLimit}";            
            $rResult = db_res($sQuery);

            while( true == ($aRow = mysql_fetch_assoc($rResult)) )
            {
                $sOutputHtml .= "{$aRow['NickName']} \n";
            }

            return $sOutputHtml;
        }

If you are an admin or a moderator it will not create the additional join clause and where clause.

Thanks for pointing out the oversight as admins MUST see all!  LOL!

http://www.mytikibar.com
Quote · 2 May 2012

 

I just did it and it works perfectly.

Thank you so much. I have been waiting for someone to bid on my job post and then you come and give it away for free. Your so kind.

Thank you again.

MeMe

 I do this because I enjoy programming, but, I REALLY need someone to step up and make me a template!  So I am hoping my kindness pays off.  ;)

http://www.mytikibar.com
Quote · 2 May 2012

I will help you, if you like and if im able. What do you need.

 

M

Quote · 2 May 2012

Steve, I added your updated code and tested it on my site (with many customizations)... works perfect... thank you very much :-)

http://pkforum.dolphinhelp.com
Quote · 2 May 2012

 

Steve, I added your updated code and tested it on my site (with many customizations)... works perfect... thank you very much :-)

 Glad I could help!  :D

http://www.mytikibar.com
Quote · 2 May 2012

for president! Smile
Shame, I even haven't noticed this feature before, never used compose without knowing who to write to in the first place, lol.

Quote · 30 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.