New BuddyPress plugin: BP External Activity

Here on the CUNY Academic Commons, we have an installation of MediaWiki which runs alongside our WordPress/BuddyPress installation. Without some additional coding, edits on the wiki don’t show up in the Commons News feed, and as a result they tend to get a little lost in the shuffle. This new plugin, BP External Activity, addresses this issue by allowing the administrator of a BuddyPress installation to specify an arbitrary RSS feed whose items will be regularly imported into the activity stream.

The plugin imports RSS feeds every hour. You may find that you need to decrease your Simplepie cache time to make it work:
add_filter( 'wp_feed_cache_transient_lifetime', create_function('$a', 'return 600;') );
reduces the RSS cache to ten minutes, for example. Put that in your bp-custom.php file if you are having problems with the plugin.

At the moment, the plugin uses the Author field from the RSS feed to look for a matching author in your WP database. If it doesn’t find one, it uses the unlinked text ‘A user’, as in ‘A user edited the wiki page…’.

Thanks to Andy Peatling, whose External Group Blogs served as the inspiration for a good part of the code.

Visit the plugin homepage for more details.

6 thoughts on “New BuddyPress plugin: BP External Activity”

  1. my mediawiki has 1800 articles so when i activated the plugin it posted 1800 posts to activity stream…can i limit that number?

  2. Yes, you should be able to. Change the innermost foreach loop in the plugin into a while loop. You’ll have to do a bit of reconfiguration of the variable names to make it work, but it’s totally doable.

  3. Hi Vanessa – Oops, I was totally wrong – it imports every 30 minutes(ish). In the future I’ll make an admin option for increasing/decreasing this time, but for now you can change the value on line 107 (‘+30 minutes’) to something larger.

  4. I’m bringing up errors on file uploads after activating the extension as detailed on the mediawiki extension page:

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/collabbo/public_html/figshare.com/figures/extensions/buddypress-activity/buddypress-activity.php on line 61

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/collabbo/public_html/figshare.com/figures/extensions/buddypress-activity/buddypress-activity.php on line 68

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/collabbo/public_html/figshare.com/figures/extensions/buddypress-activity/buddypress-activity.php on line 75
    Table ‘collabbo_figures.wp_bp_activity’ doesn’t exist

    Lines 61, 68 and 75 are as follows:

    ‘$resultarray = mysql_fetch_array($result);’
    ‘$bpresultarray = mysql_fetch_array($bpquery);’
    ‘$checkRecentArray = mysql_fetch_array($checkrecent);’

    WP 3.0.1 bp1.2.6

    Any ideas and help would be much appreciated. Thanks

Leave a Reply

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

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image

Additional comments powered by BackType