BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 24
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 24
    xmginc on in reply to: [Resolved] synchronizing Member Types with WP Roles #10952

    Hi Brajesh,

    This would be a great addition to a multiblog enabled multisite – I’m wondering if this would be possible thanks!

  • Participant
    Level: Enlightened
    Posts: 24

    That’s great to know thanks Brajesh!

    Due to the nature of this particular directory which needs to be manually ordered, I’ve used the following method:

    – used [bpmtp-members-list include=”…”] shortcode and inserted a single ID in the quotes
    – repeated the shortcode for each member ID [bpmtp-members-list include=”10″][bpmtp-members-list include=”24″][bpmtp-members-list include=”17″] etc.
    – used CSS to hide #pag-bottom and float and style each member as needed
    – in this particular scenario, I am using a theme framework to create each member in their own columns

    So far, so good for the time being 😄

    • This reply was modified 7 years, 1 month ago by xmginc.
  • Participant
    Level: Enlightened
    Posts: 24

    Thanks for letting me know Brajesh. Good to know before I spend too much time on this 😄

    It’s too bad there is no way to manually order the members yet in Buddypress…

    Just an idea for future: I wish there was a way to use the user_id method but somehow pause and restart the loop between each id so that you can manually sort them by user_id number such as id 5, then id 3, then id 10 etc.

    Aside from that, thanks again for an invaluable plugin. Love it.

  • Participant
    Level: Enlightened
    Posts: 24

    Hi Brajesh,

    Could there be a way to add values into the shortcode to manually order the directory?

    For example, perhaps order alphanumerically based on an xprofile value?

    My hope is to manually order a directory for managers based on their seniority – not alphabetically.

    Thanks!
    Kuni

  • Participant
    Level: Enlightened
    Posts: 24
    xmginc on in reply to: Hide role type in directory of multiblog enabled multisite #10792

    Hi Brajesh, that would be great – I’m in thx!

  • Participant
    Level: Enlightened
    Posts: 24
    xmginc on in reply to: Hide role type in directory of multiblog enabled multisite #10790

    My apologies Brajesh – completely agree and while I’d like to share the final solution here, I’d like to communicate privately by message to be able to easily share login details etc.

    Once the final solution is sorted, I’d like to share it here for anyone else that can benefit from a similar but possibly rare situation 😄

    I will message you details shortly. Thank you!

  • Participant
    Level: Enlightened
    Posts: 24
    xmginc on in reply to: Hide role type in directory of multiblog enabled multisite #10788

    Hi Brajesh,

    Yes, multiblog is enabled and I have also sent you the WP login info via message as well.

    Thx!

  • Participant
    Level: Enlightened
    Posts: 24
    xmginc on in reply to: Hide role type in directory of multiblog enabled multisite #10786

    Thanks very much for your insight – I just started trying your BuddyPress Profile Visibility Manager and BuddyPress Member Types Pro – can’t believe I didn’t try these sooner!

    I’m currently trying to see what is the best combination but here is what I’m trying to do either with these plugins or continuing with the code above:

    Publicsite .com/members
    – show standard members directory + profile page
    – hide Admin, Contributors, Editors, Authors directory + profile page

    Publicsite .com/privatearea/members
    – show standard members directory + profile page
    – show Admin, Contributors, Editors, Authors directory + profile page

    So far, your Visibility Manager plugin is amazingly powerful.

    One thing I am still trying to see is if I can achieve site independent settings to show for private section but hide for public section for certain roles.

    I’m currently changing tactic based on logged in vs logged out since the public would not be logged in.

    Will post back soon if I can get all of this accomplished with your plugins.

    PS: hard to believe so many questions I see in other forums could all be solved with these plugins 😄

  • Participant
    Level: Enlightened
    Posts: 24
    xmginc on in reply to: Hide multiple user types from member/profile page #10662

    For example, could this be combined somehow with this below so that not only will the member role type not be displayed in the directory, the URL of the profile page will also not be visible:

    add_filter( ‘bp_after_has_members_parse_args’, ‘buddydev_exclude_users_by_role’ );

    function buddydev_exclude_users_by_role( $args ) {
    //do not exclude in admin
    if( is_admin() && ! defined( ‘DOING_AJAX’ ) ) {
    return $args;
    }

    $excluded = isset( $args[‘exclude’] )? $args[‘exclude’] : array();

    if( !is_array( $excluded ) ) {
    $excluded = explode(‘,’, $excluded );
    }

    //$role = ‘administrator’;//change to the role to be excluded
    $user_ids = get_users( array( ‘role__in’ => [‘administrator’ , ‘contributor’ , ‘author’, ‘editor’] ,’fields’=>’ID’) );

    $excluded = array_merge( $excluded, $user_ids );

    $args[‘exclude’] = $excluded;

    return $args;
    }

    Combined with the redirect of the profile page but including the various role types above:

    function buddydev_redirect_from_admin_profile() {
    //not a profile page or viewing own profile page, no redirect
    if ( ! bp_is_user() || bp_is_my_profile() ) {
    return;
    }

    //check if the user is admin?
    //there are multiple ways to do it, I will show for Super admin
    //You can use user_can(bp_displayed_user_id(), ‘cap_name’ ) too, Make sure to change cap name to appropriate cap

    $redirect_url = site_url(‘/why-did-i-get-redirected’);//or any url

    if ( is_super_admin( bp_displayed_user_id() ) ) {
    bp_core_redirect( $redirect_url );
    }

    }

    add_action( ‘bp_template_redirect’, ‘buddydev_redirect_from_admin_profile’ );