Skip to:
Content
Pages
Categories
Search
Top
Bottom

Code help: restrict no. of friends

  • I would like to add a check in AddFriends function to limit freinds to 10 ( a game related requirement in the site). Can someone please show me where to hook this. Just for testing I modified bp-friends.php , but it has no effect.

    Buddypress:1.1.3

    Added following in bp-friends.php / function friends_action_add_friend() :

    if ( friends_get_total_friend_count($bp->loggedin_user->id ) < 10 )

    {

    /* Existing code …

    from : if ( ‘not_friends’ == $friendship_status ) {

    to: bp_core_add_message( __( ‘You already have a pending friendship request with this user’, ‘buddypress’ ), ‘error’ );

    }

    */

    }

    else

    bp_core_add_message( __( ‘only 10 Friends are allowed.’, ‘buddypress’ ), ‘error’ );

You must be logged in to reply to this topic.