@opencode
11 years, 7 months ago
If you are trying to have this within your child theme or somewhere like in authors.php below then you might want to have a small change.
` global $bp;
$loggedin_user_id = bp_loggedin_user_id(); $other_user_id = $curauth->ID; // <<< a change to get the id of author
if($loggedin_user_id == $other_user_id){ $check_string = 'its_me' ; } else{ $check_string = friends_check_friendship_status( $loggedin_user_id,$other_user_id); }
if ( $check_string == 'is_friend' ) { //Your Code Here echo "Is Friend"; } if ( $check_string == 'not_friends' ) { //Your Code Here echo "Not Friends"; } if ( $check_string == 'pending' ) { //Your Code Here echo "Pending"; } if ( $check_string == 'its_me' ) { //Your Code Here echo "Its You"; }`
Here an update
`global $bp;
$loggedin_user_id = bp_loggedin_user_id(); $other_user_id = bp_displayed_user_id();
if($loggedin_user_id == $other_user_id){ $check_string = ‘its_me’ ; } else{ $check_string = friends_check_friendship_status( $loggedin_user_id,$other_user_id); }
if ( $check_string == ‘is_friend’ ) { //Your Code Here echo “Is Friend”; } if ( $check_string == ‘not_friends’ ) { //Your Code Here echo “Not Friends”; } if ( $check_string == ‘pending’ ) { //Your Code Here echo “Pending”; } if ( $check_string == ‘its_me’ ) { //Your Code Here echo “Its You”; } `
11 years, 9 months ago
Hello,
I was searching way to find the same solution and I’ve implemented in the following way.
`add_action(‘wp_footer’,’bp_adminbar_notifications_menu’);`
it will place the notification on footer of site
🙂