Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

  • OpenCode
    Participant

    @opencode

    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";
    }`


    OpenCode
    Participant

    @opencode

    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”;
    }
    `


    OpenCode
    Participant

    @opencode

    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

    🙂

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar