New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

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

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

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

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

    Thank you
    Brajesh

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

    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: 25509
    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.

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

    Thank you.
    Can you please tell me from which page you are trying to upload? Is it the activity stream?

    Also, If it is not too much, please post me a screenshot(link to it).

    Thank you
    Brajesh

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

    Hi Thomas,
    Greetings.

    I am sorry but I am not able to understand the issue?

    Have you had an earlier version of MediaPress earlier? Are you trying to upload from activity stream or using shortcoide for uploading?

    Thank you
    Brajesh