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
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Buddyblog Upload Image HTTP ERROR #3272

    Hi Vijay,

    Thank You for posting. I will acknowledge you on this issue at day end.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hi Dandy

    Thank You for reply. I am glad to help you.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hi Dandy

    Please try this code in your bp-custom.php

    
    function buddydev_remove_leave_group_button( $btn ) {
    
    	
    	if ( $btn['id'] == 'leave_group' ) {
    		unset( $btn['id'] );
    	}
    
    	return $btn;
    }
    add_filter( 'bp_get_group_join_button', 'buddydev_remove_leave_group_button' );
    

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hi Jaume,

    Please check the following code in your bp-custom.php file.

    
    function mpp_custom_create_gallery( $args ) {
    
    	$user_id = get_current_user_id();
    
    	$default = array(
    		'creator_id'	 => $user_id,
    		'title'			 => '',
    		'description'	 => '', //add description if any
    		'status'		 => mpp_get_default_status(),//can use any of the status e.g. 'public' , 'private', 'loggedin', 'friends' etc
    		'component'		 => 'members',//for user
    		'component_id'	 => $user_id,//no need to change
    		'type'			 => 'photo', //can change to "audio", "video", "doc"
    	);
    
    	$args = wp_parse_args( $args, $default );
    
    	$gallery_id = mpp_create_gallery( $args );
    
    	return $gallery_id;
    
    }
    //Automatic gallery creation for groups on group create
    function mpp_custom_create_default_group_galleries( $group_id, $group ) {
    	//make sure that you have enabled all these types in your Admin MediaPress setiings for the groups component
    	$types = array('photo' =>  'Images', 'video' => 'Video', 'audio'=> 'Music', 'doc'=> 'Docs' );
    
    	foreach ( $types as  $type => $label ) {
    
    		if ( ! mpp_component_supports_type( 'groups', $type ) ) {
    			continue;//component does not support this type
    		}
    		$gallery_id =  mpp_get_wall_gallery_id( array(
    			'component'     => 'groups',
    			'component_id'  => $group_id,
    			'media_type'    => $type
    		) );
    
    		if ( ! $gallery_id ) {
    			//let us create one
    			$gallery_id = mpp_custom_create_gallery( array(
    				'title'	=> $label,
    				'type'	=> $type,
    				'status'=> mpp_get_default_status(),
    				'component' => 'groups',//for user
    				'component_id'  => $group_id,
    			) );
    
    			mpp_update_wall_gallery_id(
    				array(
    					'component' => 'groups',
    					'component_id'  => $group_id,
    					'gallery_id'    => $gallery_id,
    					'media_type'    => $type
    				)
    			);
    
    		}
    
    	}
    
    	//and so on
    
    }
    add_action( 'groups_created_group', 'mpp_custom_create_default_group_galleries', 0, 2 );
    
    function mpp_custom_disable_user_to_create_group_gallery( $can_do, $component, $component_id ) {
    
    	if ( $component == 'groups' && ! is_super_admin() ){
    		$can_do = false;
    	}
    
    	return $can_do;
    }
    add_filter( 'mpp_user_can_create_gallery', 'mpp_custom_disable_user_to_create_group_gallery', 10, 3 );

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: "Gallery" position in user menu #3124

    Hi Minoo

    Thank you for posting. Please try this code with the action “wp_loaded”

    add_action( "wp_loaded", "change_menu_position" );
    function change_menu_position() {
    
    	if( ! function_exists( 'buddypress' ) ) {
    		return ;
    	}
    
    	$bp = buddypress();
    
    	$bp->bp_nav['mediapress']['position'] = 2;
    }

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: How to add categories to Mediapress? #2959

    Hi Piotr,

    You can use the following hooks list category on add, edit gallery form

    add_action( 'mpp_after_edit_gallery_form_fields', 'add_mpp_gallery_category_taxonomy' )
     add_action( 'mpp_before_create_gallery_form_submit_field', 'add_mpp_gallery_category_taxonomy' )

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Group Creation by BP Member Type #2870

    Hi Michael,

    Member type is not a capability. It’s more like category used for classifying users. So, we can not have a minimum member type requirement. But we can make it such that a user with certain member type can only create groups.

    If this is okay. Please let me know.

    Thank you
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Profile Visibility Manager: Visual tag for Usernames #2869

    Hi Michael,

    Thank you for posting. Please use the following code in bp-custom.php file

    
    function bp_visibility_add_member_visibility_css_class( $classes ) {
    
    	if ( ! function_exists( 'bp_profile_visibility_get_settings' ) ) {
    		return $classes;
    	}
    
    	$visibility = bp_profile_visibility_get_settings( bp_get_member_user_id(), 'bp_profile_visibility' );
    	$classes[]  = 'visibility-' . $visibility;
    	return $classes;
    
    }
    add_filter('bp_get_member_class','bp_visibility_add_member_visibility_css_class');
    
    

    It will add a new class based on their profile accessibility and you can then just style the list as you may please.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hi Ada

    Thank You for posting and confirming that it was not a issue. I am glad that issue is fixed.

    Thank You
    Ravi