Why would you use wp_sitemeta to store data about a group? Doesn’t really make sense to me. This table is for storing data about your site, not about a group. Also, this table doesn’t exist in a single WP install, so it’d be kinda counter-productive. If you need to store data about a group, then store it in the proper table, which is wp_bp_groups_groupmeta.
As for metadata tables vs creating your own plugin tables, it just depends on what your needs are. Metadata tables are fine for kinda static, small pieces of data, while you would use a custom table for data that grows with time.
A plugin that modifies or adds to group functionality will most likely utilize the groups API. This is suitable for adding more complex functionality. More basic functionality can be added by using the various action calls you can find in the template files. Again, it really depends on what you’re trying to achieve.
@techguy The philosophy for wide-spread adoption is to not create any additional tables, and use meta whenever possible. This way you can rely on the internal functions of WordPress and BuddyPress to get and set that data, and you don’t have an upset site admin that needs to figure out where to put that table, how to cache it, how to serve it across multiple servers, etc…
I also think it depends on the scope that you need to achieve. The Groups API works really well for just about anything that you would want to plug into the groups component, but at the same time there can also be a need for totally 100% custom jobs where even the built in functionality doesn’t work for your application, in which case a totally custom theme might be in order.
All in all, I usually start with a custom plugin, that relies on the Groups API and group meta, and only use wp_sitemeta/wp_options if it’s a blanket default setting for all groups that can be changed by the site administrator.
Thanks for the information and explanation. Little by little I’m figuring out all the various options for customizing and extending BP. The great part is that there are lots of options.
Do you know of any existing plugins that use the Groups API really well that I could look at for an example?