Archive for December, 2009

Buddypress Group Document Store

December 24th, 2009

I just uploaded my largest wordpress plugin yet: Buddypress Group Documents!

Group Documents creates a page within each BuddyPress group to upload and store documents.  Documents can be edited and deleted either by the owner or by the group administrator.  Document activity is logged in the main activity stream, and is also tied to the user and group activity streams.  The site administrator can set filters on file extensions, and soon (in the next update) users can set email notification preferences.  There is also a “Recent Uploads” widget than can be used to show any number of uploaded documents.

Get it while it’s hot!
WordPress.org Plugin Download Page

Installation
Make sure WPMU and BuddyPress are installed and active.
Copy the plugin folder buddypress-group-documents/ into /wp-content/plugins/

Browse to the plugin administration screen and activate the plugin.

There will now be a “Group Documents” menu item under the “BuddyPress” menu.  Here you will find a list of all file extensions allowed for uploaded files.  Please check and make sure the list suits you.

Please don’t hesitate to contact me, especially if you run into trouble.  I will respond promptly.  email hidden; JavaScript is required

Buddypress jQuery is not defined error

December 16th, 2009

While developing a Buddypress plugin, I was running into a problem where none of my Javascript was working. Instead, Firebug was telling me: “jQuery is not defined”.  This was quite frustrating, as I could verify that the jQuery file was indeed, being loaded.  While a few other people received the same error for different reasons (corrupt files, etc.) I did not quickly find the solution for my problem.  Here it is:

Problem: Buddypress calls your plugin’s JS files BEFORE jQuery files.
This applies when you use the function wp_enqueue_script() – as you should.

Solution: Tell wp_enqueue_script your file depends on jQuery.
It turns out, wp_enqueue_script() takes a few optional parameters – the third being an array of other js files yours is dependent on.

Here’s how the call looks after the change:
wp_enqueue_script(‘my-js-file’,’my-file-path.js’,array(‘jquery’));

Viola!  Your js file is now loaded after jQuery and you’re good to go.