More $wpdb->prepare() fixes
Remove duplicate constant definitions in bb-config
Ports BP r7343

Fixes a PHP notice. See http://buddypress.trac.wordpress.org/ticket/5132