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: 25323
    Brajesh Singh on in reply to: Redesign of xprofile fields in members directory #19855
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25323
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    By Condition I mean restricting the header visibility to only certain profile tabs. If you want to limit it, you can do so by putting the above code (it is in the nouveau file) under some condition.

    Regards
    Brajesh

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

    You will need to target using media query. Simply removing position:absolute and the bottom margin for avatar will solve it for the mobile.

    As of the last design shared(3 cols or 2 cols), That will need template modification, mere css won’t be able to fix it.

    Regards
    Brajesh

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

    Also,
    If it looks bad, Please change margin rule in the above code from

    
    margin-left: 0;
    
    

    to

    
    margin-left: 0 !important;
    
    

    That should put the text under image.

    Regards
    Brajesh

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

    Hi Carsten,
    Please add the following css and it should do it partially.

    
    .bph_xprofile_fields {
    
        margin-left:0
        position: absolute;
        left: 0;
        bottom: 0;
    }
    
    #members-dir-list .bp-list li .item-avatar {
      margin-bottom: 100px;
    }
    
    

    That should most probably do it.

    Please let me know if it works or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi Carsten,
    Happy New Year.

    I agree with you on the visibility of header. It can be controlled via the themes though.

    You can change that by copying buddypress/bp-templates/bp-nouveau/buddypress/members/single/home.php to yourtheme/buddypress/members/single/home.php

    The code block that you may want to put under condition is

    
    	<div id="item-header" role="complementary" data-bp-item-id="<?php echo esc_attr( bp_displayed_user_id() ); ?>" data-bp-item-component="members" class="users-header single-headers">
    
    		<?php bp_nouveau_member_header_template_part(); ?>
    
    	</div><!-- #item-header -->
    
    

    To be honest, I believe BuddyPress has great functionalities but the UI is a let down. I am not sure about the BuddyPress default templates but We are certainly hoping that we will be able to change that experience with BuddyPress in near future with our themes.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323
    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: 25323
    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: 25323

    You are welcome.

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

    Regards
    Brajesh