Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Hide Forum Topics and Replies, But Not @Mentions in activity feed


  • tomnikkola
    Participant

    @tomnikkola

    Hello

    We have two different membership groups using our website. The first group should only see certain forum topics and replies. The other group can see all. When the members use the actual forums, this works great, but if any of the members use their activity feed, they see content from forums they should not see.

    As a short-term solution, I want to hide ALL topics and replies from the activity feed, but not hide the “mentions.”

    I put this in my CSS editor:

    .bbpress.activity-item {
    display: none;
    }

    and while it it does remove the forum topics and replies from all activity feeds, it also removes the list of mentions.

    I’ve looked throughout the BuddyPress and bbPress forums and can’t find an answer. I’d much appreciate any assistance.

Viewing 4 replies - 1 through 4 (of 4 total)

  • danbp
    Moderator

    @danbp

    @tomnikkola,

    as you discovered already, the CSS trick is a poor solution.
    Two solution are on hand.
    A first one, which applies to all activity feeds.
    Basically the below snippet handles globally the activties output. You simply remove the activity(ies) you don’t want to see from the list. Note that almost all activity types are listed.
    Add it to child functions.php or to bp-custom.php

    function demo_parse( $retval ) {
    	// existing BP/bbP activities
    	// remove the one you wont to see from that list
    	$retval['action'] = '
    		activity_comment,
    		activity_update,
    		bbp_topic_create,
                    bbp_reply_create,
    		friendship_created,
    		joined_group,
    		last_activity,
    		new_avatar,
    		new_blog_post, 	
    		new_member,
    		updated_profile
    	';	
    
    	return $retval;
    	
    	}
    add_filter( 'bp_after_has_activities_parse_args', 'demo_parse' );

    Codex:

    Using bp_parse_args() to filter BuddyPress template loops

    The second solution, is to use a child-theme with a modified activity loop. This let you handle finer condition for each user.

    Read this tut how you can do that.

    Codex:

    Activity Loop


    tomnikkola
    Participant

    @tomnikkola

    Thank you @danbp.

    Just to make sure I understand correctly, if I were to leave out “bbp_topic_create” it would leave the new topics out of the activity feed, but if one member mentioned another in the toipc, that would still display?


    Henry Wright
    Moderator

    @henrywright

    @tomnikkola

    Just to make sure I understand correctly, if I were to leave out “bbp_topic_create” it would leave the new topics out of the activity feed, but if one member mentioned another in the toipc, that would still display?

    Using @danbp’s snippet, that’s exactly what will happen.


    froster2
    Participant

    @froster2

    Hi @danbp, I was able to filter the sitewide activity page to filter and show only “activity_update”. I am trying to achieve this in the personal member profile page. How can I display “activity_update” only for the personal member profile activity page e.g. buddypress.com/members/admin ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Hide Forum Topics and Replies, But Not @Mentions in activity feed’ is closed to new replies.
Skip to toolbar