I too found it very strange that the "Friend request box" is only shown to the profile of the befriender when they view the profile of the befriendee - rather than as a prompt shown to the befriendee when they view their own profile. I also wanted to show this on the Account page so it would be visible to the befriendee when they log in.
So I figured out how to change it and make it work the way I wanted it to.
Let's just be clear. Person A makes a friend request for Person B. Person B gets an email telling them about the request. They log in to the site, view their own profile (or account page) and see a Friend Request alert. They click on it, jump to the "Communicator" and then they can accept or reject the friend request.
Find the file /templates/base/scripts/BxBaseProfileView.php
Find the function: function showBlockFriendRequest on line 472 (in 7.0.9)
Replace the entire function with the below:
function showBlockFriendRequest($sCaption, $bNoDB = false){
if(!isMember())
return "";
//we show the friend request to the befriendee so they can be prompted to confirm it, so show this whenever the Profile column matches this profile AND the viewer
$aViewer = getProfileInfo();
//if the viewer is looking at their owner profile, then check for friend requests
if ($aViewer['ID']==$this -> _iProfileID) {
//find the first unconfirmed friend request matching this user
$mixedCheck = $GLOBALS['MySQL']->getOne("SELECT `Profile` FROM `sys_friend_list` WHERE `Profile`=" . $this -> _iProfileID . " AND `Check` != 1 LIMIT 1");
//if there is one, show it
if($mixedCheck==$this -> _iProfileID) {
return MsgBox(_t('_pending_friend_request_answer', BX_DOL_URL_ROOT . "communicator.php?person_switcher=to&communicator_mode=friends_requests"));
} else {
return "";
}
} else {
return "";
}
}
Now make sure the "Friend request" box is showing on the Profile page. And refresh your cache. And voila!
If you ALSO want the same Friend Request alert to appear on the Account page (which I did), then run this SQL and put it there:
INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`, `Cache`) VALUES
( 'member', '998px', 'Friend request notification', '_FriendRequest', 1, 0, 'FriendRequest', '', 1, 34, 'memb', 0, 0);
and then also modify /member.php by adding this function (which is similar, but slightly different to the one above - customised for the Account page:
function getBlockCode_FriendRequest(){
if(!isMember())
return "";
//we show the friend request to the befriendee so they can be prompted to confirm it, so show this whenever the Profile column matches this profile AND the viewer
$aViewer = $this->aMemberInfo;
//find the first unconfirmed friend request matching this user
$mixedCheck = $GLOBALS['MySQL']->getOne("SELECT `Profile` FROM `sys_friend_list` WHERE `Profile`=" . $aViewer['ID'] . " AND `Check` != 1 LIMIT 1");
//if there is one, show it
if($mixedCheck==$aViewer['ID']) {
return MsgBox(_t('_pending_friend_request_answer', BX_DOL_URL_ROOT . "communicator.php?person_switcher=to&communicator_mode=friends_requests"));
} else {
return "";
}
}
Clear your cache and test it works.