DOLPHIN: Befriend Notification

405ideas posted 8th of October 2008 in Community Voice. 10 comments.

Here is another fix... To generate an email notification when a user attempts to befriend another user:

  1. Open /list_pop.php file
  2. Around line 23 find:
    require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
  3. AFTER add the following:
    require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); // 405Mod - Friend Request Notify
  4. Around line 119 find:
    $ret = _t_action('_User was invited to friend list');
  5. AFTER add the following:
    // 405Mod - Friend Request Notify
       $query = "SELECT * FROM `profiles` WHERE `ID` = '$targetID'";
       $temp = db_assoc_arr($query);
       if( $targetID == $temp['ID'] ) {
        $message = "Dear " . $temp['NickName'] . ",\r\n\r\n".getNickName( $sourceID ) . " has requested to become your friend.\r\n\r\n"."To view this request please visit:\r\n".$site['url']."contacts.php?show=friends_inv&list=me\r\n\r\nSincerely,\r\n".$site['title']." Team";
        sendMail( $temp['Email'], "Friendship Request", $message );
       }
    // end mod
  6. You are done!

Please comment if you find this post useful. 

P.S. I have also written an SMTP mod for sendMail function that allows to do authenticated emailing among other things.  This is especially usefull for people who's mail() function is not working. Please comment if you are interested.

 

 
Comments
·Oldest
·Top
Please login to post a comment.
melia
Thanks for this mod!
zak2008
fyi...received db error when tested. I have 6.1.3
Synergy
I received a database error also.
Stuart038
Nice one - Which Dolphin version is this for?
Punkis
no you are not done. database error
Whitt
If you're getting a Database Error in Dolphin 6.1.4

Error: Database 'profiles' doesn't exist

Please change to 'Profiles'
joafruit
Please please please fix this! We need befriend notifications!!!
netmuzz
Here is another fix with some corrections on the first... To generate an email notification when a user attempts to befriend another user:

1. Open /list_pop.php file
2. Around line 23 find:
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
3. AFTER add the following:
require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); // 405Mod - Friend Request Notify
4. in this function (around line 98)
function PageListFriend($sourceID, $targetID)
{
$ret = '';....
add see more this line below $ret = ''; :
global $site;
5. Around line 119 find:
$ret = _t_action('_User was invited to friend list');
6. AFTER add the following:
// 405Mod - Friend Request Notify
$query = "SELECT * FROM `Profiles` WHERE `ID` = '$targetID'";
$temp = db_assoc_arr($query);
if( $targetID == $temp['ID'] ) {
$message = "Dear " . $temp['NickName'] . ",\r\n\r\n".getNickName( $sourceID ) . " has requested to become your friend.\r\n\r\n"."To view this request please visit:\r\n".$site['url']."contacts.php?show=friends_inv&list=me\r\n\r\nSincerely,\r\n".$site['title']." Team";
sendMail( $temp['Email'], "Friendship Request", $message );
}
// end mod
7. You are done!

now the database error's will be gone in version 6.1.1 and above. Further more now the $site['url'] and $site['title'] will actually print something in the mail sent to the invitee.

Hope this is usefull.
For more questions don't hesitate to contact me at http://www.netmuzz.com/jurgen
Do you have a fix for Dolphin 7?

I can't follow your step #4 because the function code was written differently in my version 7:

function PageListFriend($iProfileId, $iMemberId = 0)
{
$sOutputCode = '';
$iProfileId = (int) $iProfileId;
$iMemberId = (int) $iMemberId;

if( !$iMemberId || !getProfileInfo($iMemberId) ) {
return MsgBox( _t('_Failed to apply changes') );
 
 
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.
PET:0.1092369556427