BuddyPress Block Activity Stream Types

Download

BuddyPress Block Activity Stream Types Info

  • Latest Version: 0.5.2
  • Downloads: 5,124
  • Last Updated: 573 days ago
  • Requires WordPress Version: PHP 5.2, WordPress 3.2.1, BuddyPress 1.5.1
  • Tested compatible up to: PHP 5.3.x, WordPress 3.2.1, BuddyPress 1.5.1
  • Requires PHP5: Learn more

** IMPORTANT ** This plugin has been updated for BuddyPress 1.5.1

This plugin will "block" an activity record from being saved to the stream/database. Such as new member registration, joining groups, friendships created.

Please note, this will not allow an activity record to be saved into the database at all. You will need to know the "type" of activity record. It is advised NOT to block activity_comment and activity_update activities (will cause errors in buddypress)

What are activity types? BP Core includes several and plugins may register their own when hooking into the activity_record functions. This plugin will scan the activity table for distinct types already logged but will be ever changing due to new plugins.

Related Links:

Changelog

0.5.2

  • BUG: php notice on secondary_item_id in filter

0.5.1

  • BUG: fix network admin settings page on multisite
  • FEATURE: support for locale mo files

0.5.0

  • BUG: updated for BuddyPress 1.5.1

0.3.0

  • Feature: New filter hook to allow granular blocking (ie block on a per blog_id)

0.2.0

  • Bug: Invalid reference on PHP 5.3.x

0.1.0

  • First [BETA] version

GitHub Activity

14 thoughts on “BuddyPress Block Activity Stream Types

  1. hi, im trying to block all group activity (updates and comments) from my main site-wide activity, can this plugin rectify this problem? thanks in advance !

    • Yes, but requires a little work. (Also, this blocks from saving to the database)

      You’ll need to use this filter

      apply_filters( 'etivite_bp_activity_block_denied_activity_type_check', in_array( $type, apply_filters( 'etivite_bp_activity_block_denied_activity_types', $types ) ), $type, $item_id, $secondary_item_id, $user_id, $component );

      and check the component for groups and/or item_id for the group_id – return true if you want to block that specific activity item.

    • Yes, it is possible with a little bit of work.

      A filter is passed during the check

      apply_filters( 'etivite_bp_activity_block_denied_activity_type_check', in_array( $type, apply_filters( 'etivite_bp_activity_block_denied_activity_types', $types ) ), $type, $item_id, $secondary_item_id, $user_id, $component )

      When a new blog post is recorded , these values are set

      'item_id'           => $blog_id,
      'secondary_item_id' => $post_id,
      

      So you would need get the post (via the post_id) and then find out category information. If on MS install – the switch to blog function would need to be used (via blog_id)

  2. I am having trouble getting this to work. I have installed/activated/configured the types that I want to block, but they are still posting to the activity stream. i am trying to block new members, buddypress likes, forum updates, etc. Basically, I only want for status updates and blog posts to post on the activity stream. I’m using WordPress 3.2.1 and Buddypress 1.5.1. Has anyone else had this issue?

    • I can block them on my production/local dev install. What version of PHP? If you’re comfortable – open up bp-activity-block.php and look at line 48. There is a check for a php version and and uses a different function for the filter. Maybe remove that and try it manually to see which one works. (report back if you find something)

      • Thanks for the quick reply. I will check on this tonight when I get home, and I’ll report back to you what I find.

      • I tried this suggestion but no luck. I did think of something though. I changed the prefixes on my php for security reasons. If my activity database is abc_bp_activity instead of bp_activity, would that break the plugin? If so, how can I fix this?

      • Ok.. I figured out my problem: I’m an idiot.

        “Seperate types with commas.”

        When selecting the types, I put them each on their own line, with no commas.

        So, if anyone else out there is having this problem, read the instructions and don’t be an idiot. It’s working good now!!! Thanks for your help!

      • Thanks for letting me know :P On my ‘one day’ todo list of adding an admin multiple selection list instead of manually adding each type.

  3. Is it possible to block replies on published comments in the activity tab? (why i want this: if replying is possible, it surpasses the groupforum, makes a sort of second forum)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>