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: 25486

    Hi Dianne,
    Thank you for your patience.

    Please remove the old code and use the following.

    
    
    /**
     * Returns a list of user links sorted alphabetically.
     *
     * @param array $group_users user ids.
     *
     * @return string
     */
    function bp_custom_get_alpha_sorted_user_links( $group_users ) {
    
    	if ( empty( $group_users ) ) {
    		return '';
    	}
    
    	$group_user_ids = wp_list_pluck( $group_users, 'user_id' );
    
    	$users = get_users(
    		array(
    			'include' => $group_user_ids,
    			'orderby' => 'display_name',
    			'order'   => 'ASC',
    		)
    	);
    
    	$markup = '';
    
    	foreach ( $users as $user ) {
    		$markup .= sprintf( '<a href="%1$s" class="custom-user-group-user-link">%2$s</a>', esc_url( bp_core_get_user_domain( $user->ID ) ), bp_core_get_user_displayname( $user->ID ) );
    	}
    
    	return $markup;
    }
    
    function user_world_memberships( $atts, $content = '' ) {
    
    	$atts = shortcode_atts(
    		array(
    			'user_id'            => bp_displayed_user_id(),
    			'type'               => 'alphabetical',
    			'order'              => 'ASC',
    			'page'               => 1,
    			'per_page'           => - 1,
    			'group_type'         => '',
    			'group_type__in'     => '',
    			'group_type__not_in' => '',
    			'group_role'         => '', // 'admin' , 'mod', 'member'.
    			'list_admins'        => 0,
    		),
    		$atts,
    		'member_worlds'
    	);
    
    	$list_admins = (bool) $atts['list_admins'];
    	$user_groups = array();
    
    	if ( 'admin' === $atts['group_role'] ) {
    		$user_groups = bp_get_user_groups(
    			$atts['user_id'],
    			array(
    				'is_admin' => true,
    				'per_page' => $atts['per_page'],
    				'page'     => $atts['page'],
    			)
    		);
    	} elseif ( 'mod' === $atts['group_role'] ) {
    		$user_groups = bp_get_user_groups(
    			$atts['user_id'],
    			array(
    				'is_mod'   => true,
    				'per_page' => $atts['per_page'],
    				'page'     => $atts['page'],
    			)
    		);
    	}
    
    	if ( in_array( $atts['group_role'], array( 'admin', 'mod' ), true ) ) {
    		if ( empty( $user_groups ) ) {
    			return '';
    		}
    
    		$group_ids       = array_keys( $user_groups );
    		$atts['include'] = $group_ids;
    		unset( $atts['user_id'] );
    	}
    
    	$groups = groups_get_groups( $atts );
    
    	$groups = $groups['groups'];
    	if ( empty( $groups ) ) {
    		return '';
    	}
    
    	$list = '';
    	foreach ( $groups as $group ) {
    		$admin_markup = '';
    		if ( $list_admins ) {
    			$admin_markup = bp_custom_get_alpha_sorted_user_links( groups_get_group_admins( $group->id ) );
    		}
    		$list .= sprintf( '<li><a title="View %1$s" href="%2$s" class="custom-user-group-group-link">%3$s</a>%4$s</li>', esc_attr( $group->name ), esc_url( bp_get_group_permalink( $group ) ), esc_html( $group->name ), $admin_markup );
    	}
    
    	if ( ! empty( $list ) ) {
    		$list = "<ul class='custom-user-group-list'>{$list}</ul>";
    	}
    
    	return $list;
    }
    
    add_shortcode('member_worlds', 'user_world_memberships');
    

    You can pass group_role and list_admins options to list specific groups as in your initial requirement. It should handle most of the earlier use case.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486

    Hi,
    Thank you for using MediaPress.

    Please visit Dashboard->MediaPress->Settings->Theming tab and look for “Lightbox Settings”.
    You can disable lightbox from various section there.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486
    Brajesh Singh on in reply to: Link to Group Plugin #48794

    Hi Russel,
    Thank you.
    The filter is correct though we made a typo in the plugin while adding this filter.

    I will suggest going bp-custom.php route to avoid any surprise change in future.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25486
    Brajesh Singh on in reply to: BuddyBlog – Taxonomies #48792

    Hi Nik,
    Thank you for the detailed reporting of the issue.

    Please allow me to check this today and get back to you in next 24 hours.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486
    Brajesh Singh on in reply to: Link to Group Plugin #48789

    Hi Russel,
    Thank you for the question.
    yes, the bp-custom.php is in wp-content/plugins directory.

    Please link me to the post/topic in context to allow check the issue with filter.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486

    Hi Dianne,
    Thank you for your patience.
    I don’t see any issue with “Activity Log”. They should work fine for tracking login. Have you had a look their log to see if the login is being recorded or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486
    Brajesh Singh on in reply to: [Resolved] Reasons Not to Migrate to NING #48786
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25486

    Hi Tosin,
    Thank you for the question.
    it is doable but there is no scalable way to achieve it.

    you can filter on ‘bp_activity_get_where_conditions’ to exclude users you want to avoid. The problem is your user list will keep growing with all the registrations.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25486
    Brajesh Singh on in reply to: BuddyPress FOLLOW option #48772

    Hi Earl,
    I am sorry, I had to give up on the relationship plugin in the middle due to health issues last year.

    Please use Ray’s plugin for now. I will work on the relationship/follow sometimes soon.

    Regards
    Brajesh