Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: Redesign of xprofile fields in members directory #19842

    Please link me to your page, Should be a minor css as you have amlmost done it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] limit friendship #19838

    Hi there,
    Happy New Year.

    1. In your case, since you only need to limit the number of requests a person can send, Please only enable “Restrict who can add friend?” and disable all other settings.

    We only want to restrict request sending.

    Now, You can put this in bp-custom.php

    
    
    /**
     * Restrict sending request.
     *
     * @param bool $is_valid is valid request.
     * @param int $user_id sender user.
     *
     * @return bool
     */
    function buddydev_custom_restrict_sending_friendship_request( $is_valid, $user_id ) {
    
    	// If a user has these many friends, they won't be able to send new request.
    	$limit_on_friends_count = 1;
    
    	// If a user has specified number of friends, can not send new request.
    	if ( friends_get_friend_count_for_user( $user_id ) >= $limit_on_friends_count ) {
    		return false;
    	}
    
    	// for sent request count.
    	global $wpdb;
    	$bp = buddypress();
    
    	$sent_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT('*') FROM {$bp->friends->table_name} WHERE initiator_user_id = %d", $user_id ) );
    
    	// this is the maximum number of request a user can send
    	// it includes accepted friendship(sent by the user too).
    	$allowed_request_count = 1;// change it if you need.
    	if ( $sent_count >= $allowed_request_count ) {
    		return false;
    	}
    
    	return $is_valid;
    }
    
    add_filter( 'bpf_restrictions_user_is_valid_sender', 'buddydev_custom_restrict_sending_friendship_request', 10, 2 );
    
    

    This will solve your issue of the restriction and you will not need to make auto friends. Please update the values as you need.

    By default, BuddyPress does not list sent friendship request. We implemented in our theme(Community Builder) but most other theme won’t have this.

    We are going to release CB2 in next 1-2 week(it has been going on a overhaul for months) and we are putting a free version for our members too. You can give it a try and see if it suits you then.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    You are welcome.

    The important rule was needed as the original css was inline.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] How to re-arrange the BP Menu Items #19835

    Hi Daniel,
    That’s good to know. It seems you are using Bp Nouveau template pack as it has this functionality in the customizer.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Hi Daniel,
    I haven’t been able to look into it any further. Will do on 2nd/3rd and post back by 3rd latest.

    For future to avoid this we are opening our custom service options in January. That will help us deliver faster for any non BuddyDev related customizations.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Please use this

    
    input#limit_membership_count {
    
      width: 50px !important;
    }
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] limit friendship #19827

    Hi @evillizard

    1. Please do not use comma. Also, why do you need to set it to 30000000. Do you know the value is for 57 years duration?

    If you want to test it set a smaller time? It works. Let me assist you with other configuration to show how it works.

    Now for your questions:

    This No. of Friends & Friendship Request Sent & Received
    https://i.postimg.cc/kggWrLsK/msg-3-not-work.png

    i dunno but doesnt it mean ..if a user sends.. then the friendship count would automaticcally increase by 1 friend?

    No. Unless a user confirms the friendship, the count is not increased. That’s why you have the option to include requests in the count.

    basically want to speed adding of the new recruits up .. i.e one the recruiter(the one who invited) sends friend request ..the friends count would automatically increase … wether or not the reciever of the request chooses to accept the request or not .. – since the friendship is already limited..then no need to wait for acceptance of requests.

    Sorry, you are mistaken about this plugin then. It does not automatically confirm friends. The involved user need to confirm their friendship as normal. The plugin restricts.

    It is your choice to use the friends count or the friends count+request count as restriction.

    Please allow me to look a bit more about your situation and post back in the evening.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Hi Philippe,
    Thank you for posting.

    It seems to me that you are using a plugin for creating custom roles.

    Here is what I am guessing the issue is, the custom roles created by the plugins are not available on BuddyPress Activation action.

    WordPress will set the role if it exists and it seems to me that due to the priority of activation action, the custom roles are most probably not available.

    To check this, Can you please map student to “Contributor” and try. This is a built in role and should give us a better idea.

    Please let me know how it goes and also which plugin you are using for creating custom role, I can look into it and see if there is any way to make the roles available early from it.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: Questions about avatars #19820

    Hi Carsten,
    Yes, the thumb size is used and it is constrained by passing height/width in the avatar function. You can inspect and see the constrained and original size. You can use css to override it if you need to use original size.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] How to re-arrange the BP Menu Items #19819

    Hi Daniel,
    Since the reordering is allowed by theme, I am unable to assist much here. My advise will be to wait till the first week when they are back and can assist you.

    Regards
    Brajesh