BuddyBoss Home – Web Support Forums Themes Boss. theme "Add Friend" instead of "Private Message"

Viewing 5 posts - 1 through 5 (of 5 total)
  • Question

    #44593
    @secondfirsts

    I would like the default button to be “Add Friend” instead of “Private Message” for members that aren’t currently friends when a user views someone’s wall. How can I change it?

    Boss v1.1.8 with BBWall & BBMedia plugins.

    Answers

    #44605
    @vapvarun

    Hi @secondfirsts,
    you need to copy boss/buddypress/members/single/member-header.php
    to child theme at same path boss-child/buddypress/members/single/member-header.php
    after line 132
    replace

    
    <?php 
                                if($showing == "follows") {
                                    bp_follow_add_follow_button();
                                }elseif($showing == "friends") {
                                    if(!bp_is_friend(bp_displayed_user_id())) {
                                        bp_add_friend_button();
                                    } elseif(bp_is_active( 'messages' )) {
                                        bp_send_private_message_button();
                                    } else {
                                        bp_send_public_message_button();
                                    } 
                                }else {
                                    bp_send_public_message_button();
                                } 
                            ?>
    

    with

    
    <?php 
    bp_add_friend_button();
    ?>
    

    Let us know , if it works exactly same as you need.
    Regards
    Varun Dubey

    #44607
    @secondfirsts

    That code just removed the “Private Message” option but then there is no button at all, just the “…”. I don’t think the code you gave me is the correct code you meant.

    Actually, it seems to me the default code that is in member-header.php at lines 136 & 137 should already do what I want, but it isn’t working. The friend button is not being made the main button. If I replace the code in lines 136-142 with just “bp_add_friend_button();” then the friend button does become the main friend button. I’m not sure why the “if(!bp_is_friend(bp_displayed_user_id()))” in line 136 would be evaluating to false in this case when I’m viewing a user that is not my friend. Seems like a bug?!

    #44609
    @secondfirsts

    I figured it out… you have a bug. The function bp_is_friend() does not return a boolean. It returns a string ‘is_friend’, ‘not_friends’, or ‘pending’. To fix the bug I changed lines 112 & 136 to:

    if('not_friends'==bp_is_friend(bp_displayed_user_id())) {
    #44610
    @vapvarun

    Hey @secondfirsts, Thanks for your input we will check for it. I have copied wrong codes earlier, you can replace it modified codes as above just cut them all down.
    Regards
    Varun Dubey

Viewing 5 posts - 1 through 5 (of 5 total)
  • The question ‘"Add Friend" instead of "Private Message"’ is closed to new replies.