Skip to:

hide public groups user is not a member of.

  • Hello everyone,

    I am running wordpress 3.3.1 and buddypress

    I have some users who hate getting all these public groups updates and I wanted to know if there is a built in way to block public groups from people who are not a member of them on the main activity wall. If not i can think of a couple ways to do so inside of the bp_has_activities loop to block certain posts if user not in group. But i wouldn’t want to do this for everyone unless they wanted too. So do you think the best way would be to create an option in the user settings so they can toggle this on or off? Doesn’t seem to complicated, but some ideas or best case approaches if any one has nay would be appreciated.


Viewing 4 replies - 1 through 4 (of 4 total)
  • You could do that. It is certain viable. If you have a activity stream within a user profile, maybe you could emphasise that more, so people use it?

    Yeah That’s a good idea. Most of the users as of now use just the Main wall for viewing everything. Thanks for the tip and the response I was gonna start something tonight!


    @mrjarbenne has two nice plugins that might do the brunt of the work for you. will force your users to their own profile upon login, and will feed them content from the groups they are members of and people they are friends with.

    @mrjarbenne Thanks for the links, But those are paid plugins and I am all about the open source! especially if it is for wordpress

    @djpaul Hey was wondering if you might help me out with some idea concepts. I got the whole settings to work and added my own page to the nav bar, that part was easy. However I hit a topping point.

    I thought it would be easier to check if an update was part of a group AND if the user is part of that group. However I am finding it difficult to check this.

    I noticed that in the activity there is a item_id which if it is a group update it is the group Id … but is there any other way to check to see if the activity_update is a group other than this? What about changing the content type to activity_group_update or something… Right now I have this and it seems totally hackish and not good at all. Seems to work to check though but also is invalid for any other update other than a group one….
    ` global $current_user;
    $hide_public_groups = get_user_meta( $current_user->ID, ‘hide_public_groups’ );
    $hide_update = false;
    if ( $hide_public_groups[0] == “yes” ) {
    global $activities_template;
    $group_id = $activities_template->activity->item_id;

    $is_member_of_group = check_is_member_of_group( $current_user->ID, $group_id );
    //echo $is_member_of_group;
    if ( $is_member_of_group ) {
    //this is working but is filtering out any other post
    //need to check for if this is not a group post to just let it slide.
    //maybe it is better to grab the groups_loop real quick and then just query for this specific group and then make sure it is public and is member….
    //echo “no hide”;
    } else {
    //echo “hide it”;
    //$hide_update = true;

    } `

    Also just a note the check_is_member_of_group i stole from the class Bp_Groups_Member…
    Any ideas anyone? I know this should be easier and I am way over thinking it.. It was late last night…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hide public groups user is not a member of.’ is closed to new replies.
Skip to toolbar