BuddyPress hack: disable activity stream comments/favorites for certain types
Want to keep the noise ratio down on activity stream commenting? Besides the built-in
Disable activity stream commenting on blog and forum posts?:
I don’t see a way to implement additional filters on bp_activity_can_comment() nor is there one setup for favorites. (unless i’m not looking hard enough)
So, a quick and dirty function to block out certain activity_types.
add to whatever myhacks/functions php and define the excluded activity types
function my_denied_activity_meta_check($type) {
return in_array($type, array( 'bp_link_vote', 'friendship_created', 'friendship_accepted', 'new_forum_post', 'new_member') );
}
*we are removing the ability for voted up links, friendships, new forum posts for a group and new member registrations.
Then in your favorite theme (i’m using default) under the activity/entry.php file – add the function to the is_user_logged_in() if statement on the comment link and/or favorite link sections:
!my_denied_activity_meta_check( bp_get_activity_type() )
In this case, no comments or favorites when members add a friendship or votes up a link (from the awesome BuddyPress Links plugin)
I submitted trac tickets for BP 1.3 to include filtering on the two items (hopefully not a dup
)

February 26th, 2010 at 1:38 am
Cool hack! Do you know how I can exclude member registrations from showing up in the activity feed completely?
February 26th, 2010 at 8:59 am
look over this post on buddypress.org
http://buddypress.org/forums/topic/removing-blog-posts-form-the-swa-widget#post-36775
you can filter the has_activities but change the conditional check to type (from component) type name is called `new_member`
then on your theme – under activity/index.php remove the select option for `Show New Members`
at least in theory
February 26th, 2010 at 10:53 pm
Thanks Ill give this a shot!
April 7th, 2010 at 6:55 am
[...] You must allow activity types: new_blog_post and new_blog_comment (this is only important if you hacked BP to disallow certain commenting – something i have covered previously) [...]