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: 25468

    Hi Tosin,
    about your last question.

    It is difficult to disable based on the member types as the member type is registered too late.

    Ravi & I looked at it and we found that we can disable the component conditionally but not using member type as context./ if using the user roles as context will work for you please let us know and we will post the code.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468

    Posted a solution there.

  • Keymaster
    (BuddyDev Team)
    Posts: 25468

    Hi,
    Please use the following code in bp-custom.php

    
    
    /**
     * Disable add friends button fro admin users
     *
     * it is an example and not recommended. It can cause n extra queries due to capability checking on the members loop.
     *
     * @param $button
     *
     * @return mixed
     */
    function buddydev_hide_admin_friends_button( $button ) {
    
    	if( ! isset( $button['id'] ) || $button['id'] != 'not_friends' ) {
    		return $button;
    	}
    
    	$user_id = absint( str_replace( 'friend-','', $button['link_id'] ) );
    	if ( ! $user_id ) {
    		return $button ;
    	}
    
    	//we can check using is_super_admin( $user_id ) || user_can( $user_id, 'cap' )
    
    	if ( user_can( $user_id, 'manage_options' ) ) {
    		$button['id'] = false;
    	}
    
    	return $button;
    }
    add_filter( 'bp_get_add_friend_button', 'buddydev_hide_admin_friends_button' );
    
    

    Please do note that it will cause n extra queries on the members loop.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468

    Hi dandy,
    Thank you for posting.

    Please put teh following code in your css file

    
    #activity-stream li .activity-content  a.activity-time-since {
    	color: red !important; /** change with your own color*/
    }
    
    

    change the color with your preferred color and it will work.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468

    Sorry, my bad.

    I will need a little time on this one as it needs some UI change. Please give me a day.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468

    Hi Sadiqur,
    Please open a new topic and we will post a solution.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468
    Brajesh Singh on in reply to: problem wiith Media uplad in stream #8582

    Thank you.
    It is very strange(havew seen it for the first time).

    I am looking at it and will get back to you later today.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468
    Brajesh Singh on in reply to: [Resolved] BuddyPress Limit Friendship Issue #8581

    Hi Richard,
    Sorry for the delayed example.

    here is an example code to limit based on role

    
    
    /**
     * Limit BuddyPress friendship based on WordPress roles
     *
     * @param int $count how many
     * @param int $user_id for the given user.
     *
     * @return int allowed no. of friends
     */
    function buddydev_limit_friendship_count_based_on_role( $count, $user_id ) {
    
    	if ( user_can( $user_id, 'manage_options' ) ) {
    		//site admin
    		$count = 100; // 100 friends allowed
    	} elseif (  user_can( $user_id, 'moderate_comments' ) ) {
    		//editor
    
    	} elseif ( user_can( $user_id, 'edit_published_posts' ) ) {
    		//authors
    
    	} elseif ( user_can( $user_id, 'read' ) ) {
    		//subscriber
    
    		$count = 3; // only 3 allowed for subscribers
    	}
    
    	return $count;
    }
    add_filter( 'bp_limit_friendship_count', 'buddydev_limit_friendship_count_based_on_role', 10, 2 );
    
    

    Hope it helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468

    Hi Jaroslaw,
    Thank you for posting.

    In case of MediaPress, by default each user have their own gallery for each type of media(wall gallery).

    Are you using the shortcode to create sitewide gallery? Uploads from activity stream goes to personal gallery and not to sitewide gallery.

    if it is happening for a user( say a user uploads 2 photos and there are 3 gallerires created, then it is an issue).

    Now, If I look at your question, It seems you want a single shared gallery for all users to upload? It is possible using our Global Shared gallery addon and filtering on wall gallery to avoid create one for each. Please let me know if this is what you want?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25468
    Brajesh Singh on in reply to: problem wiith Media uplad in stream #8574

    Hi Thomas,
    I am sorry that file is not opening for me.