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: 25331
    Brajesh Singh on in reply to: [Resolved] BuddyPress xprofile fields #21443

    You are welcome.

  • Keymaster
    (BuddyDev Team)
    Posts: 25331

    Hi Chris,
    Welcome to BuddyDev and thank you for the question.

    It is doable. You need to create a template for listing all media for that user(You may use our shortcode) and override the template.

    Which template to override depends on 1. Do you want the media to be listed on http://example.com/members/user/ or http://example.com/members/user/gallery/ page? Please let me know and I will assist.

    PS:- We will be able to assist you as only limited support is available over weekend.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331
    Brajesh Singh on in reply to: Buddypress members list #21440

    Hi Matt,
    Our team will assist you on Monday/onwards. Over the weekend, our support is limited to pro members and requests with our own plugins.

    I will give you a hint though:- You need to record last activity time of a user to make them visible in the members directory.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331
    Brajesh Singh on in reply to: [Resolved] Location one file in buddypress #21439

    Hi Michaël,
    Thank you for asking.

    Please link me to a screenshot of the nav. There are 3 kinds of nav(in WordPress+BuddyPress). I am guessing you are either referring to adminbar menu items or to profile tabs. If you can link me to a screenshot, I will be able to assist quickly.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331

    Thank you Sam.
    I am glad it worked.

    I sincerely appreciate you upgrading to our Membership.

    I will push another update tomorrow with the option to have the tab visible to admin/super admins.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25331

    Hi Sam,
    Thank you for the patience. I have released 1.1.6 which fixes it. Your last post helped greatly to find and resolve the issue.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331

    Thank you for the kind words and the appreciation Kuni.
    It has always been a wonderful experience to work with it.

    Looking forward to assist you in future too.

    Best regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331

    Hi,

    Please put this code in your bp-custom.php (or theme’s functions.php)
    It will hide the I Research field on Registration/Edit profile and update its value from the “I am” field.

    I have used the field id from your site.

    
    
    /**
     * Update value of the dest field when source is updated.
     *
     * @param BP_XProfile_ProfileData $object data object.
     */
    function buddydev_sync_to_field_data_to_other_field_on_update( $object ) {
    	// Field id, whose value we use to determine the calculated value for the synchronized field.
    	$sync_source_field_id      = 3; // field when change, triggers change to the sync field.
    	// this is the field whose value will be updated based on the calculation.
    	$sync_dest_field_id = 6;// field we will update.
    
    	// If it is not the source field id, don't do anything.
    	if ( $object->field_id != $sync_source_field_id ) {
    		return;
    	}
    
    	$value       = $object->value;
    	$value       = maybe_unserialize( $value );
    	$other_value = '';
    
    	if ( empty( $value ) ) {
    		// delete.
    		xprofile_delete_field_data( $sync_dest_field_id, $object->user_id );
    
    		return;
    	}
    	// Determine, what value we should set.
    	// This is the block that we use to calculate
    	// you will need to update for your use case.
    	if ( 'Un Homme' == $value ) {
    		$other_value = 'Une Femme';
    	} else {
    		$other_value = 'Un Homme';
    	}
    	// If the sync_destination field is select/radio, make sure the calculated value is what you have
    	// added as option the the field add/edit screen. Should match exactly.
    	// set teh value.
    	xprofile_set_field_data( $sync_dest_field_id, $object->user_id, $other_value );
    }
    // On update.
    add_action( 'xprofile_data_after_save', 'buddydev_sync_to_field_data_to_other_field_on_update' );
    
    // On delete.
    function buddydev_sync_to_field_data_to_other_field_on_delete( $object ) {
    // Field id, whose value we use to determine the calculated value for the synchronized field.
    	$sync_source_field_id      = 3; // field when change, triggers change to the sync field.
    	// this is the field whose value will be updated based on the calculation.
    	$sync_dest_field_id = 6;// field we will update.
    
    	// If it is not the source field id, don't do anything.
    	if ( $object->field_id != $sync_source_field_id ) {
    		return;
    	}
    
    	xprofile_delete_field_data( $sync_dest_field_id, $object->user_id );
    }
    add_action( 'xprofile_data_after_delete', 'buddydev_sync_to_field_data_to_other_field_on_delete' );
    
    /**
     * Hide the synchronized field from Registration/Edit profile fields. Its value is set programatically.
     * @param $args
     *
     * @return mixed
     */
    function buddydev_exclude_sync_profile_field_in_edit_context( $args ) {
    
    	if ( ! bp_is_user_profile_edit() && ! bp_is_register_page() ) {
    		return $args;
    	}
    
    	$sync_to_field    = 6;
    	$exclude_fields   = isset( $args['exclude_fields'] ) ? explode( ',', $args['exclude_fields'] ) : array();
    	$exclude_fields[] = $sync_to_field;
    
    	$args['exclude_fields'] = join( ',', $exclude_fields );
    
    	return $args;
    }
    
    add_filter( 'bp_after_has_profile_parse_args', 'buddydev_exclude_sync_profile_field_in_edit_context' );
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25331
    Brajesh Singh on in reply to: New BuddyPress Blogs not generating slugs #21415

    Hi Chris,
    I just tested it. It is working for me on WordPress 5.1/BuddyPress 4.2/BuddyBlog 1.3.4 and BP Simple Front end post 1.3.6

    Are you allowing users to publish post(posts status set to publish or is it set to draft?). Also, can you please visit settings->permalink and make sure it is setup(I am assuming it is).

    Thank you
    Brajesh