Tag Archives: groups

Group Announcements tab in BuddyPress

Cross-posted at the CUNY Academic Commons Development blog

I had a request or two to explain how I built the Group Announcements feature on the CUNY Academic Commons. Here goes.

Brief background: When the Commons was upgraded to BuddyPress 1.2, we got the benefit of interactive activity streams everywhere, including groups. This caused some confusion, however, as users were uncertain where conversation best fit into the Commons’s architecture: in the Forums (where it had been traditionally), or in the activity stream. In some communities this kind of fracturing might be okay or even welcome, but in ours it was confusing. At the same time, we wanted a way for group admins and mods to send important notices to the members of their groups. By taking the group activity updates and repurposing it as a Group Announcements section, I was able to kill two birds with one stone: providing an announcement space for mods, while focusing extended discussion in the forums.

You can download the CAC Group Announcements plugin here.

I’m not putting this in the repo at the moment because I don’t want to build a proper admin UI and support it 🙂 For that reason, here is a primer on how the plugin works – if you want to customize or maintain it, you’re on your own, buster.

  1. The CAC_Group_Announcements class is an instance of the BuddyPress Group Extension API. It is responsible for creating the Announcements tab markup and adding it to the nav. You’ll notice that the majority of the markup is created by including bp-default’s activity-loop.php and post-form.php templates. You could customize this more if you wanted.
  2. bp_is_group_announcements() is a little template tag that can be used to test whether you’re looking at a group announcements page. This is needed for the activity filter, in step 3.
  3. cac_set_announcement_filter() adds a filter to the bp_has_activities query string when you are looking at an announcements page, so that it only displays activity items of the type activity_update. In other words, when you are looking at the regular activity stream for the group, you see all of the associated group activity items (new members, forum posts, etc) but when you’re on the announcements page you only see activity updates (which, remember, have been repurposed as announcements).

As I look at the code, I see that there are things I would definitely change if I were going to make this into a distributed plugin. If you want to make those changes, be my guest. You’re welcome to help each other in the comment section, but I won’t be formally supporting this, as it is a very basic hack that should happen at the theme level anyway. Good luck!

New BuddyPress plugin: BP Group Reviews

I’m working on a project that needs to allow users to leave reviews of groups, kinda like buddypress.org does with plugins. So, with Andy’s permission, I cleaned up, packaged, and extended his code into a new plugin, BP Group Reviews. It allows users to leave a star rating and a text review of any group on your BuddyPress installation.

New BuddyPress plugin: BuddyPress Group Email Subscription

Email Options on settings page

Email Options on settings page

I’m quite happy to announce the release of a more-or-less stable (we hope!) version of BuddyPress Group Email Subscription, a BuddyPress plugin that allows for fine-grained, user-controllable email subscription to group content in BuddyPress.

This plugin is different from some of my others in that it was truly a group endeavor. The base of the plugin was written by David Cartwright, with a little bit of code from me. A nearly complete rewrite of the front-end and most of the guts of the plugin was undertaken by Deryk Wenaus. I wrote the daily and weekly digest functionality, along with some of the settings pages and various bugfixes throughout. The current codebase of the plugin is probably 60% Deryk, 30% me, and 10% David.

It was my first time working on a truly collaborative software development project like this, and it was a real pleasure working with both of these gentlemen. Thanks, guys.

Get BuddyPress Group Email Subscription here.

New BuddyPress plugin: BP Group Management

Another day, another plugin for BuddyPress. In BP < 1.2, it was impossible for site admins to manage group membership in groups where they weren't also the local admin. This is good in a lot of situations, but in some applications of BP it can be a pain – the system administrator needs more power in order to correct problem, wreak havoc, and so on. In BP 1.2+ the situation is better – admins can manage groups more – but it's still not all that easy to see everything in one place. This plugin rectifies the situation by allowing site admins to manage the members of groups across their BP installation from a single screen.

Read more about it.

New BuddyPress / bbPress plugin: Group Forum Subscription

BuddyPress and bbPress can be plugged into each other such that BuddyPress groups get their own discussion forums, which are powered by bbPress. Adding Burt Adsit’s bpGroups means that private and hidden groups can have their discussion forums private too. But a major hurdle is email notification: Certain kinds of BP communities simply won’t get rolling if there’s no easy way for users to get email notification of new discussions. There are solutions out there to assuage this problem within bbPress (notably Thomas Klaiber’s Post Notification, which served as the inspiration for the mechanics of my own plugin), but email notification remains hidden in bbPress favorites, instead of in an out-front toggle.

Group forum notification is coming in a future version of BuddyPress, but it’s important enough that I needed it now.

This set of plugins, called Group Forum Subscription, fixes that. Features:

  • Users can subscribe to individual discussion topics from within BuddyPress
  • Users can subscribe to topics on a group-by-group basis – that is, one can subscribe to all existing and future topics associated with a particular BuddyPress group
  • Users are automatically unsubscribed from a group’s discussions when they leave the group
  • Administrators can subscribe all users to the appropriate forums with a single click (potentially handy for first-time setup
  • Administrators can toggle whether email notification is turned on by default.
  • Administrators can determine whether the topic links in the notification emails will point to bbPress or to the BuddyPress forum interface

Installation instructions

  1. Download the package
  2. Upload the BuddyPress plugin bp-group-forum-subscription.php to the plugins directory of your main WPMU blog and activate it
  3. If you prefer for the members of your community to use the BuddyPress posting interface for discussions, add the following hook: [sourcecode language=”php”][/sourcecode] immediately after [sourcecode language=”php”]
    [/sourcecode] in /[your bp theme dir]/groups/forums/topic.php
  4. If you plan for your users to use bbPress for forum reading and posting, upload the bbPress trigger plugin bb-group-forum-subscription.php to [bbpress-install-dir]/my-plugins/ and activate it through the bbPress admin screen. Please note: the bbPress plugin changes the (IMO somewhat opaque) “Add to favorites” link on each topic page to a more straightforward Subscribe/Unsubscribe. If you like this change, open up [bbPress-theme-dir]/topic.php, and change
    [sourcecode language=”php”]user_favorites_link();[/sourcecode]
    to
    [sourcecode language=”php”]user_favorites_link( array(‘mid’ => __(‘Subscribe to this discussion’)),array(‘mid’ => __(‘Unsubscribe from this discussion’)));[/sourcecode]

You can configure the plugin on the admin page (Group Forum Subscription under Dashboard Settings. Members of your BP community can tinker with their subscriptions either on the individual topic pages (in bp or bbpress) or on their BP Settings > Notification page (where they can subscribe/unsubscribe to entire groups).

I’m in the process of setting up BuddyPress 1.1, which was just released today. Once I’ve got a dev instance of it up and running, I will do the necessary fixes to make the plugin run on the new version. (I don’t think it will be too hard, given the number of craptastic workarounds I had to do in this version because of the absence of all the nice 1.1 hooks.) Stay tuned.