Skip to:
Content
Pages
Categories
Search
Top
Bottom

"Add Friend" button for users that are already registered

  • Avatar of romanovskis
    romanovskis
    Participant

    @romanovskis

    (This is copy of the post on WP support forum, maybe here it will get noticed)

    When I invite someone who is already registered, plugin warns that
    $email is already registered on this site.

    If there are many users and you know only user email but not his/her username, it is almost impossible to find them. Is it possible to add button or at least link to that user’s profile?

    I found that “by-email.php” on line 1118 generates error message

    $returned_data['error_message'] .= sprintf( __( "%s is already a registered user of the site.", 'bp-invite-anyone'), $email );
    

    Would it be possible to insert before this line something like

    $ia_invitee = get_user_by( 'email' , $email );
    $ia_invitee_data = get_userdata ($ia_invitee->ID);
    $ia_invitee_url = $ia_invitee_data->user_url;
    

    and then add this url to the generated error message, so that inviter can immediately go to invitee profile and add him as a friend?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of romanovskis
    romanovskis
    Participant

    @romanovskis

    up. please help me with this.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    You wouldn’t likely have got a response on WP forum this question relates to BP and a specific unnamed plugin, either this forum or plugin author would have been the place to start of at.

    The plugin ‘Invite-anyone’ is designed for inviting people to the site who are not registered, so not sure why you are using it to try and find people so you can ‘friend’ them.

    Why do not go the more normal route of friending from members listing or from a user avatar when it appears in a piece of metadata which would take you to their profile.

    If you really want to modify the plugin it may be possible but you ought to do it by checking what apply_filters have been added to functions to allow you to add or modify the function return.

    Avatar of romanovskis
    romanovskis
    Participant

    @romanovskis

    Hi @hnla, thank you for replying. I am trying to make a community for private diaries. User share their diary with up to 7 friends. They need to invite those. Some of invitees can be already members of the site, in this case, plugin throws error “email is already registered”. As I see it, in this situation, there is no easy way to find friend’s profile if you know only his/her email, because search goes only through usernames. Am I right, or is there some way to do it?

    I was thinking of modifying the error message to contain link to the existing member’s profile. If that worked, I could do without “add friend” button.

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

You must be logged in to reply to this topic.