BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25218
    Brajesh Singh on in reply to: Change Who's Online to Friend only #3529

    Hi Dandy,
    Please put this code in your bp-custom.php.

    
    function buddydev_show_online_friends_only( $args ) {
    	
    	if ( ! is_user_logged_in() || empty( $args['type'] ) || $args['type'] !='online' ) {
    		return $args;
    	}
    	
    	$friend_ids = friends_get_friend_user_ids( bp_loggedin_user_id() );
    	
    	if ( empty( $friend_ids ) ) {
    		$friend_ids = array( 0, 0 );//invalid
    	}
    	
    	$args['include'] = $friend_ids;
    	
    	return $args;
    }
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_show_online_friends_only' );
    

    It will list only friends and if a user has no friends, they won’t see any online user.

    Hope that helps.
    regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    Hi Andrew,
    I believe it is not the above code but the validation that is failing. The member type plugin uses lower case values for the names.

    Try changing this

    
     $_POST['field_1140'] = $_POST['field_960'];
    

    to

    
     $_POST['field_1140'] = strtolower( $_POST['field_960'] );
    

    Most probably that should do it. Otherwise, I will advise to check for the values and see if they are same as the key of the member type.

  • Keymaster
    (BuddyDev Team)
    Posts: 25218
    Brajesh Singh on in reply to: CDN support in mediapress #3522

    Hi Simon,
    Any plugin that supports CDN upload for WordPress should work out of the box with MediaPress. Please try any of these that works for normal media and let me know if that works for you or not?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    Hi Jemma,
    Are you sure that you are using the code above for generating the uploader?

    I tried it and for me, It is not listing the galleries. It works if the $gallery_id is a valid gallery.

  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    You may upload it somewhere and link here or you may send me it via mail at brajesh@buddydev.com

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25218
  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    Hi Ada,
    Thank you. Finally, I understood it.

    I will be posting code a little late today.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    Please use this code where you want the uploader to appear

    
    
    $user_id = get_current_user_id(); //or bp_displayed_user_id();
    
    $gallery_id = mpp_get_wall_gallery_id( array( 
    				'component'		=> 'members',//can be 'groups', 'sitewide' 
    				'component_id'	=> $user_id, //user_id, group id etc based on the component
    				'media_type'	=> 'photo'//can be 'video', 'audio', 'photo' etc 
    			) );
    
    //run the shortcode
    echo do_shortcode( "[mpp-uploader gallery_id={$gallery_id} ]" );
    
    

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    Hi Ada,
    I am sorry, i was away.

    I am sorry but I am still not very clear about the goal.

    1. Are you using category and taxonomy both? Are you assigning category automatically and want me to help in listing terms to the user for the ‘level’ taxonomy.

    Or if possible, can you please explain what needs to be done here. I am very sorry for not understanding it.

  • Keymaster
    (BuddyDev Team)
    Posts: 25218

    Hi Jemma,
    Since you are calling the shortcode in php code( If I remember correctly from the previous posts), It will be easy to find the gallery id for each user.

    you can use

    
    $gallery_id = mpp_get_wall_gallery_id( array( 
    				'component'		=> 'members',//can be 'groups', 'sitewide' 
    				'component_id'	=> get_current_user_id(), //user_id, group id etc based on the component
    				'media_type'	=> 'photo'//can be 'video', 'audio', 'photo' etc 
    			) );
    
    

    That will give you the gallery id. Hope you can use it. Please do let me know if you need any further help.

    Thank you
    Brajesh