DOLPHIN: Befriend Notification
Here is another fix... To generate an email notification when a user attempts to befriend another user:
- Open /list_pop.php file
- Around line 23 find:
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
- AFTER add the following:
require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); // 405Mod - Friend Request Notify
- Around line 119 find:
$ret = _t_action('_User was invited to friend list');
- 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
- 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.
Error: Database 'profiles' doesn't exist
Please change to 'Profiles'
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
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') );