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: 25472
    Brajesh Singh on in reply to: filter the buddypress members in the list of members #13126

    HI Herve,
    Glad that it worked.

    If the value is stored in usermeta, It is certainly possible to order the list but using xprofile field data will need some sql manipulations and I am not much in favour of it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472

    Good to know. In this case, It was not WordPress but the BuddyPress storing the complete user url.

    Best Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472
    Brajesh Singh on in reply to: Move media between albums #13122

    Hi Richard,
    Sorry for missing this. If you ever did it, please do let me know 🙂

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472

    Hi Herve,
    I am sorry for the delayed reply.

    Your best bet is to do a Search and replace on table for the old to new urls( Only the link upto dire ctory part)

    You can use this

    https://github.com/interconnectit/Search-Replace-DB

    It is very easy to use and you can see what changes will happen before actually running.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472

    Hi Sam,
    Thank you.

    Before assisting further,can you please check if a slider like this will solve the purpose
    http://sachinchoolur.github.io/lightGallery/

    If yes, Then I can suggest some way.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472

    Ok. Marking it as resolved. Let us continue the discussion there.

  • Keymaster
    (BuddyDev Team)
    Posts: 25472

    Hi Herve,
    My mistake. I forgot that bp_has_members() won’t use xprofile_query instead it should be specified on BP_User_Query

    Here is the updated code

    
    
    /**
     * Custom filter for members list for Herve.
     *
     * @param BP_User_Query $query query object.
     *
     * @return array
     */
    function buddydev_filter_members_list_herve( $query ) {
    
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	$user_id = get_current_user_id();
    	// get the value for the field.
    	// Use field id for better performance.
    	$searching_for = xprofile_get_field_data( 'I search', $user_id, 'comma' );
    
    	if ( empty( $searching_for ) ) {
    		return;
    	}
    
    	$xprofile_query = isset( $query->query_vars['xprofile_query'] ) ? $query->query_vars['xprofile_query'] : array();
    
    	$xprofile_query[] = array(
    		'field'   => 'I am', // I sugget using field id for more efficiency.
    		'value'   => $searching_for,
    		'compare' => '=',
    	);
    
    	if ( ! empty( $xprofile_query ) ) {
    		$query->query_vars['xprofile_query'] = $xprofile_query;
    	}
    
    	return $query;
    }
    
    add_action( 'bp_pre_user_query_construct', 'buddydev_filter_members_list_herve', 0 );
    

    Replace the field with actual field is/name and it will work. Please make sure to remove the old code.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472
    Brajesh Singh on in reply to: [Resolved] MediaPress activity feed not working #13116

    Hi Richard,
    Are you looking for it for the uploads from Gallery->Upload screen or from the activity upload screen.

    If it is for activity upload screen, My question will be what happens when you post the activity with attached media?

    If it is for Gallery upload screen, Please visit Dashboard->settings->BuddyPress and you can enable automatic posting to activity there.

    Best Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25472
    Brajesh Singh on in reply to: My Gallery/Galleries/Album/s title/label #13115

    Hi Richard,
    Agree about the plural. About being configurable, isn’t translating it the same?

    In next update, I will update the string to use plurals instead. For now, Please feel free to translate it.

  • Keymaster
    (BuddyDev Team)
    Posts: 25472

    Can you please use user switching plugin and check it? I am not sure whay will that happen.