Group Forum Subscription v1.4

If you use Group Forum Subscription for BuddyPress, you should upgrade to the most recent version, 1.4, released today. This version fixes a bunch of bugs, including one important bug that causes automatic subscription to fail for some members of large groups.

As always, if you have any issues with the plugin, please let me know. I plan to include some big new features for the next release, so stay tuned.

EDIT: I almost forgot to mention that this release also marks the inclusion of several new translations. Many, many thanks to those who have translated this plugin:

  • German: Markus Schubert
  • French: Daniel H
  • Italian: Luca Camellini
  • Russian: slaFFik
  • Spanish: Admin at dominicana.net.do
  • Traditional Chinese: Levin

Upgrading from BuddyPress 1.0 to 1.1

The upgrade from BuddyPress 1.0.x to BuddyPress 1.1 on the CUNY Academic Commons posed a number of challenges. Between the big changes to theme structure, the one-click installation of bbPress forums, and ongoing plugin compatibility issues, a lot of planning and testing was required. This week, I and the rest of the CAC development team finally made the switch. Over the course of a few practice upgrades in development environments, followed by an upgrade on the production site, I developed a pretty detailed set of instructions for myself. I thought I’d write up an annotated version of those instructions, for the benefit of anyone who might be facing a similar upgrade.

The Academic Commons had previously been set up roughly along the same lines as Jim Groom describes here: with bbPress storing its data in a separate database, but through the cunning use of various clever plugins, sharing user data, cookies, and BP group info with the WPMU installation. BP 1.1 does things differently: the one click installation of BP forums expects to store its data in tables that exist in the BP/WP database. In order to save the old data, we had two choices: move the old data into the new structure, or make BP 1.1 recognize the old db setup. Fellow dev team member Chris Stein and I decided that the former choice would be the easiest and most future proof. Here’s how it was done.

    Dealing with bbPress forums

  1. Move orphan forums into groups. Strictly speaking, this doesn’t have to be done first, but if you’ve got bbPress forums that aren’t attached to groups, you’ve got to get them in a group in order for them to display in BP. To the best of my knowledge, there’s no really way to do this from the bbPress or BP admin panels, but it’s easy to do manually. Set up a new group for each forum (a “Help” forum might get a “Help” group, for example), make sure the group has discussion forums enabled, and then find the line in table wp_bp_groups_groupmeta corresponding to the group_id of the new group and meta key `forum_id`, and change the meta_value to match the forum number of the orphan group. Rinse and repeat.
  2. Export your bbPress database to a local file.
  3. Replace HTML markup. bbPress (my installation at least) stored formatting in HTML. The most common markup has to do with line breaks: bbPress interprets a single line break in a forum post as <br />, and double line breaks as </p> and <p>. Opening the local version of the bbPress db in a plain text editor, I did a couple big search-and-replaces:
    • </p>\\n<p> became \n\r\n\r (redundant UNIX newlines)
    • Some <p> and </p> tags still remain (single paragraph posts), which I replaced with an empty string
    • <br /> became \n\r

    You’ll also need to make sure that all references to tables in the SQL dump are replaced with the proper names. For me, that meant replacing things like bb_posts with wp_bb_posts, but it might be different depending on the prefixes you use for bbPress and WP. If you’re not sure about how BP will name the tables, do the one-button forum setup in BP 1.1 (as a new installation) and post a test forum item, to make sure the forums get created. Then check out the database to see how BP formats table names on your install.

  4. Upgrading

    The instructions at buddypress.org are quite helpful. Here’s a short version:

  5. Deactivate BP-dependent plugins. I once neglected to do this. If you do, and then deactivate BP, there is a very good chance that your entire site will go white-screen-of-death, as the plugins will be making reference to BP functions that do not exist. Check your plugin list three or four times to make sure you’ve deactivated each one that has to do with BuddyPress. I like to make a list, so that I remember which ones to activate after the upgrade (though some, like the bbPress integration plugins, won’t be necessary).
  6. Back up all your data. Always! I like to take a snapshot of the whole database, and then an individual export of the wp_sitemeta table. That way, if I screw anything up (say, by deactivating plugins in the wrong order!) I can bring the site back to life by reverting to a previous state that is known to work.
  7. Upgrade BuddyPress. Deactivate, upload, reactivate.
  8. Reactivate BP dependent plugins. I didn’t have too many issues with plugin compatibility, but you might, depending on what you use. Some plugins will not be necessary anymore, while others (like Forum Attachments for BuddyPress) become useful.
  9. Themes

    The CUNY Academic Commons was in the midst of a redesign, so it made sense to have the new design implemented in BuddyPress’s new, parent-child theme environment. Buddypress.org has some instructions that you might find helpful. Our theme consists of a highly customized home page, header, and footer, with interior BuddyPress pages that are more or less similar in terms of markup to the BuddyPress parent theme. Thus it made sense for us to create a child theme in wp-content/themes (by copying and renaming the bp-default folder that comes with BuddyPress), make our CSS changes, and fill our child theme with only those templates where our markup had to differ from bp-sn-parent. For us that means home.php, header.php, footer.php, functions.php (which does not override but adds to bp-sn-parent/functions.php), and a few other miscellaneous files. How to implement:

  10. Rename bp-themes. If BuddyPress sees the bp-themes folder, it will assume that you’re going to use the older, deprecated theme structure. I renamed it to bp-themes-old, and will remove it altogether once we’re 100% done with the migration.
  11. Move bp-sn-parent, bp-default, and your child theme to the main WP themes folder. In most cases this is wp-content/themes.
  12. Activate the themes in Dashboard > Site Admin > Themes. No need to activate bp-sn-parent, since it’s not used directly.
  13. Apply the child theme of your choice (either bp-default or your custom theme) to the main blog.
  14. Setting up the forums

    You’ve exported and modified the forum data from the bbPress standalone version, but you’ll still need to get them into BP.

  15. Rename /forums. In our case, our previous installation of bbPress just happened to live at [BP install dir]/forums – exactly where the BP 1.1 forum directory goes. I don’t think it’d hurt anything to leave that folder named the way it is (because of the order in which BP handles URL arguments), but just to be safe I changed it to forums-old.
  16. Set up BP forums. In Dashboard > BuddyPress > Forum Setup, set up forums as a new installation.
  17. Drop the empty forum tables from the BP database. I can’t remember whether BP creates the forum tables upon installation or upon the first forum post, but in any case you won’t be able to import your old data properly without first dropping any table prefixed with wp_bb_.
  18. Import the modified local version of your forum data. I did it in PHPMyAdmin, which was easy because the file had been exported in the form of a huge INSERT command. If all goes well – and it should! – you should now be able to navigate to your groups and see the proper forum posts for that group.

There are kinks we’re still trying to work out of the system. Some strange things happened to some users’ avatars after the upgrade. And tweaking the theme is turning out to be a hassle in a lot of ways. But overall, the migration of data – which I had lost a bit of sleep over – went extremely smoothly. Good luck!

Group Forum Subscription v1.3

I’ve just put version 1.3 of Group Forum Subscription into the WordPress plugin repository. Lots of cool stuff has been fixed, added, or improved:

  • Localization complete. Shipped with four translations: French, German, Russian, Spanish
  • Dashboard menu moved under BuddyPress section
  • Forum Subscription notification block added to BP’s forum index.php pages
  • Forum subscription notification block removed for non-logged-in users
  • Fixed bug that subscribed non-confirmed users to forums created in standalone bbPress
  • Admins can choose whether posters receive notifications of their own posts (off by default; not togglable in standalone bbPress)

I got a TON of help from some readers of this blog, who were diligent about bug reports and extremely generous with their translations. Thanks so much for your help!

Translate Group Forum Subscription for BuddyPress

With a lot of help from users, Group Forum Subscription is becoming pretty stable (and widely used!). I’ll be releasing the next version 1.3 within the next few days, and one of the new features is localization. If you’re using the plugin for a site in a language other than English, I encourage you to have a go at creating a translation and, if you’d like, providing it to me for release with future versions.

Never translated a WordPress plugin before? Neither had I, until the other day when I put my rusty French to work on this plugin. The process is quite easy. There are two ways to do it:

  1. If you think you’ll find yourself translating often, I encourage you to follow the instructions at http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/. The program PoEdit that the author recommends is (once you get it installed) very, very easy to use, and it remembers your translations of commons words and phrases for future use. If you take this route, please send both the .po and the .mo files to me or to cunycommons@gmail.com, and don’t forget to include your name in the email, blog comment, or .po metadata, so that you receive credit for your work. Make sure you use the trunk version of the plugin, available at http://svn.wp-plugins.org/group-forum-subscription-for-buddypress/trunk/, as the stable version does not contain the localization code.
  2. If you’d rather not install a program, you can download my French translation group-forum-subscription-fr_FR and edit it in a plain-text editor (like Notepad or TextEdit – not Word!). The lines beginning “msgid” are the original English. The lines beginning “msgstr” are the translations. Replace the French translations with translations in your language and post/send the file to me.

Thanks for your help!

Group Forum Subscription v1.1

If you’re using Group Forum Subscription for BuddyPress, you might like to know that I’ve just pushed out v1.1. There’s nothing new in terms of functionality, but a lot of small bugs have been fixed, as well as a fairly large bug that was affecting automatic subscription on the joining/leaving of BP groups. Download the latest version through your WP Plugins panel, or download it from wordpress.org.

Thanks to r-a-y, MarkS, WestPointer, and other users for helping me to spot and squash those bugs!

New BuddyPress / bbPress plugin: Group Forum Subscription

BuddyPress and bbPress connect nicely, giving BuddyPress groups a handsome forum interface, but the software has no native ability to allow users to receive email when their favorite discussions are updated. Without this functionality, it can be hard for users to keep up-to-date with forums, and subsequently the forums are less active than they otherwise could be.

Subscription panel on group home page
A panel on each group home page lets users know whether they'll automatically receive email notifications of new discussion activity in the group

Group Forum Subscription is a set of plugins I’ve written (mostly on the BuddyPress side, with a small bbPress trigger plugin) that adds the missing forum notification functionality. GFS allows members of BuddyPress communities to subscribe to email notifications of new discussion activity. Subscriptions can be managed on a topic-by-topic or group-by-group basis.

Users can subscribe or unsubscribe from entire groups on the Notification Settings page
Users can subscribe or unsubscribe from entire groups on the Notification Settings page

The plugin also has some administrative settings. Notable among these is the ability to set up email notifications for the first time after the plugin is installed, so that users are automatically subscribed to topics in their groups without having to set it up manually. This is a setup process that we’ll be running in the upcoming days here on the CUNY Academic Commons.

Group Forum Subscription will currently work only on 1.0.x versions of BuddyPress – the brand-new BP 1.1 is not yet supported. I’ll be working on the upgrade very soon. Read more about the guts of the plugin or download it for yourself.

New WordPress plugin: Sitewide Tag Suggestion

WordPress’s Post Tags box, which appears on each Edit Post and Add New Post screen, has a great feature called “Choose from the most used tags in Post Tags”. This link allows you to see which tags you’ve used frequently in the past and apply them to your current blog post. The feature gives rise to two nice effects. One is that you avoid ending up with a lot of close-but-not-quite-identical tags on your blog (like “WordPress”, “WP”, “Word Press”, and so on) that, because they aren’t grouped together, tend to defeat the organizing purpose of tags. Another benefit is that it reminds you of the things you found important in past posts, and encourages you to mark your current post with the same tags, if relevant.

Sitewide Tag Suggestion
Sitewide Tag Suggestion

This plugin (and set of hacks) that I’m calling Sitewide Tag Suggestion allows you to glean the same benefits from the tag collection not just of a single blog, but of all the blogs on a WPMU installation. In short: STS adds another link to the Post Tags box, this one allowing authors choose from the entire community’s most popular tags when composing a post.

If you’ve got a blog on the CUNY Academic Commons, you can take advantage of Sitewide Tag Suggestion today. Just check out the Post Tags box when you’re writing a blog entry.

You can download the plugin here: sitewide-tag-suggestion.php.zip.

Detailed instructions for installation – which, partially as a result of my own ineptitude, involves a few hacks to WPMU’s core code – are contained inside of the file. Please note that WPMU 2.8+ is required, as is Donncha’s Sitewide Tags plugin.

New BuddyPress plugin: Remove Previous Comment Edits From BuddyPress Activity

UPDATE: BP Dev Andy writes in a comment to this post that this bug will be fixed in BP core soon. If you’re running a recent version of BP, it’s likely that you won’t need this plugin. Please make sure you can reproduce the issue before installing.

This plugin fixes a small but potentially annoying quirk in BuddyPress. If you, as a blog owner, edit a comment that appears on your blog, BuddyPress adds an entry to the sitewide and individual activity streams – but it doesn’t delete the old entries. As a result, if you end up (for example) editing your own comment a few times in a row, you’ll see multiple items on the activity feed.

This plugin fixes the problem by checking whether a submitted comment is an edit, and if it is, by deleting previous versions of the comment in the activity stream.

Until the plugin is in the WordPress repository, I’ve made it available in a zip file here. Just load bp-activity-skip-comment-edits.php into your /wp-content/plugins folder, activate in Dashboard > Plugins (sitewide, if you’d like), and you should be good to go.

Making Sitewide Tags work

Sitewide Tags is a cool plugin by Donncha O Caoimh that pulls blog posts from all over a WordPress Multi-User installation – like the one here on the CUNY Academic Commons – into a supplementary catch-all blog. The power of this plugin is that, with all sitewide blog posts aggregated into one place, you can begin to see the kinds of topics and trends that emerge from the community of bloggers. More specifically, Sitewide Tags allows you to create a tag cloud that reflects blogging activity across the entire community. (See the tag cloud at WordPress.com for a sense of what this looks like.)

I’ve got Sitewide Tags up and running here on the Commons – see our tag cloud (scroll down the page) and our aggregated blog. Getting things running seamlessly took a bit of tinkering though, and I thought it might be useful to share some of the tinkering here.

Read on for more of this (unexpectedly!) long process.

Continue reading “Making Sitewide Tags work”

Updated version (0.2) of Custom Profile Filters for BuddyPress

I’m releasing a new version of my Custom Profile Filters for BuddyPress plugin. The initial version, described here, gave BuddyPress users more control over which terms in their profiles become linked to a community-wide profile search. The new version gives BP administrators the ability to tweak these links even more. Here’s what’s new:

  1. Some profile information – phone numbers, IM handles, and so on – is unique to the individual user. Thus there’s no real need to have this information linked to a community-wide search. Using this plugin, administrators can specify certain profile fields that will remain non-linked. By default, profile fields called Skype ID, Phone, and IM will not be processed as links, but you can tweak this to be whichever fields you want. See readme.txt and custom-profile-filters-for-buddypress.php for more information.
  2. Other fields, especially those social networking sites where each user’s handle is attached to a profile page, can be more usefully linked to those user profiles than to a search of the community. For example, it makes more sense for the contents of the Twitter field to link to an individual’s Twitter page rather than to other users in the community who have the same Twitter handle (hopefully no one!). With this plugin, administrators can specify that certain fields will turn the user’s social networking ID into a profile link. By default, the plugin recognizes fields called Twitter, Delicious ID, YouTube ID, Flickr ID, and FriendFeed ID. See custom-profile-filters-for-buddypress.php for more information and to change these settings.

I also added a little bit of code to make sure that BuddyPress can recognize email addresses with periods before the @-sign.

You can see some of these things at work in my profile here on the CUNY Academic Commons: https://commons.gc.cuny.edu/members/boonebgorges. You’ll notice that the Twitter field shows a link to my Twitter profile, even though I just entered my handle in the Edit Profile screen.

Grab the latest version from the trunk http://svn.wp-plugins.org/custom-profile-filters-for-buddypress/ or download it here: custom-profile-filters-for-buddypress-v02.zip