BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25174
    Brajesh Singh on in reply to: List of groups plugin idea #2377

    Hi,
    Perhaps there is an existing widget here
    https://github.com/sorich87/buddypress-my-groups-widget

    If that does not suits you, can you please let me know what improvements can we provide if we have to create new widget?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25174

    Hi Rodolfo,
    I am sorry but I am not able to produce any of these.

    I am on WordPress 4.4.1/BuddyPress 2.4.3 and using BuddyBlog 1.1,4 and BP Simple front end post 1.2.7

    Can you please post a screenshot of your settings page for BuddyBlog?

  • Keymaster
    (BuddyDev Team)
    Posts: 25174

    Hi Leo,
    Thank you for the details.

    I can understand it now. Since in MediaPress, The MPP_Media_Query and MPP_Gallery_Query extends WP_Query, any action/filter applied on the WP_Query also affects it.

    There is an easy solution though.

    
    
    function SearchFilter($query) {
    	
    	if ( $query->is_main_query() && $query->is_search) {
    		$query->set( 'post_type', 'post' );
    	}
    	
    	return $query;
    }
    add_action( 'pre_get_posts', 'SearchFilter' );
    
    

    Make sure to check for is_main_query() on the query object and it will not affect any other loop.

    More details on MPP_Media_Query and MPP_Gallery_Quey below.

    https://buddydev.com/mediapress/topics/api-reference/core/mpp_media_query/
    https://buddydev.com/mediapress/topics/api-reference/core/mpp_gallery_query/

    Hope that helps

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25174
    Brajesh Singh on in reply to: Buddypress branded login formatting #2368

    Hi Brandon,
    I am sorry, I was not able to assist yesterday.

    Here is what I consider the best strategy.

    Empty blogin/login.php (in your theme’s copy).
    Now, copy the content of your defuault page.php from your theme and put it in this file.

    Now, you can visit the backend and add the shortcode etc. If that does not work(BuddyPress resets page id, so content may not be visible), We may need to use the php code in the template like

    
    
    <?php echo do_shortcode( ' [some_shortcode]' );?>
    
    

    Also, If you want to go with the look of wpmetalist, It will be very easy to do so.

  • Keymaster
    (BuddyDev Team)
    Posts: 25174
    Brajesh Singh on in reply to: BP-Album Importer #2367

    Hi,
    I am sorry but I haven’t reworked on it. Spent last few days preparing MediaPress for WordPress.org submission and the documentation. Have finally submitted it.

    I won’t be able to work on it today but will start working on it tomorrow and keep you updated. 2-3 days should be more than enough to have this plugin now.

  • Keymaster
    (BuddyDev Team)
    Posts: 25174

    Hi Leo,
    Are you using some custom code for MediaPress media status or preventing access. Everything seems fine to me but whenever I try to access the lightbox, the server is sending empty list( most probably permission issue with media visibility).

    Also, I am not able to visit my own media in my personal galleris.

    There can be only 2 reasons.

    1. Either there is some custom code preventing the media from being listable/accessible or
    2. the _mpp_is_mpp_media meta is not being stored.

    I doubt it is the first issue.

    Have you made any changes/upgrades or custom code?

  • Keymaster
    (BuddyDev Team)
    Posts: 25174

    Hi Leo,
    Most prbably the response from server is not valid json. Is it happening on the same server where we were testing or somewhere else?

  • Keymaster
    (BuddyDev Team)
    Posts: 25174
    Brajesh Singh on in reply to: BuddyBlog additional support #2357

    Hi Bill,
    Welcome to BuddyDev forums.

    If you have installed the BuddyBlog and BP Simple Front end post plugin, you sould get an out of the box form that allows users to post.

    Can you please visit your BuddyPress profile and see if it appearing or not?

    Now, “Registering a Form Instance”, You don’t need to do that with BuddyBlog. BuddyBlog does it for you. If you want to modify the form, please do let me know.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25174
    Brajesh Singh on in reply to: [Resolved] User Galleries #2355

    Hi Paul,
    Thank you for asking.

    Yes, all of the above except the last one( I will get indo details of that is easily doable).
    Here is the code you can put in your bp-custom.php

    
    
    //allow to create only one gallery
    function mpp_custom_check_gallery_create_permission( $can_do, $component,  $user_id ) {
    	
    	if ( is_super_admin() ) {
    		return true;
    	}
    		
    	$total_gallery_count = mpp_get_total_gallery_for_user( $user_id );
    	
    	if ( bp_is_my_profile() && $total_gallery_count < 1) {
    		return true;
    	}
    	
    	return false;
    }
    add_filter( 'mpp_user_can_create_gallery', 'mpp_custom_check_gallery_create_permission', 10, 3 );
    
    //should we automatically create gallery?
    //allow deleting gallery? no
    
    //Restrict gallery deletion
    function mpp_custom_check_gallery_delete_permission( $can, $user_id ){
    	
    	if ( is_super_admin() ) {
    		return true;
    	}
    	
    	return false;//do not allow i
    }
    add_filter( 'mpp_user_can_delete_gallery', 'mpp_custom_check_gallery_delete_permission', 10, 2 );
    
    function mpp_custom_create_gallery() {
    	
    	if ( ! function_exists( 'mpp_is_user_gallery_component' ) ) { 
    		return;
    	}
    	
    	
    	if ( ! bp_is_my_profile() ) {
    		return ;
    	}
    
    	$user_id = get_current_user_id();
    		
    	$total_gallery_count = mpp_get_total_gallery_for_user( $user_id );
    	
    	if ( $total_gallery_count ) {
    			return ;
    	}
    	
    	$gallery_id = mpp_create_gallery( array(
    		'creator_id'	 => $user_id,
    		'title'			 => sprintf( _x( "%s's Photos", 'wall gallery name', 'mediapress' ), bp_core_get_user_displayname( $user_id ) ),
    		'description'	 => '',
    		'status'		 => mpp_get_option( 'default_status' ),
    		'component'		 => 'members',
    		'component_id'	 => $user_id,
    		'type'			 => 'photo'
    	) );
    	
    	if ( $gallery_id ) {					
    		mpp_update_wall_gallery_id( array(
    			'component'		=> 'members',
    			'component_id'	=> $user_id,
    			'media_type'	=> 'photo',
    			'gallery_id'	=> $gallery_id
    		) );
    	}
    }
    
    add_action( 'mpp_init', 'mpp_custom_create_gallery', 100 );
    
    

    The above code restricts gallery creation to 1 gallery per user. It will automatically create a photo gallery for a user when the user visits his/her profile. It will not allow users to delete their gallery.

    Now, coming to the last one, It is doable as we are storing the media count for each gallery in a meta. I haven’t added a filter to the query, so unable to put the code here. Please give me till tomorrow and I will update MediaPress, then we can restrict the empty gallery from showing.

  • Keymaster
    (BuddyDev Team)
    Posts: 25174
    Brajesh Singh on in reply to: Buddypress branded login formatting #2352

    Hi Brandon,

    Thank you for the reply.
    1. Where have you applied the css? It is not loaded it seems. If there is a cache please clear and see if that makes it apply(Currently I don’t see the css being applied there)

    2. yes, you are right about that.