Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbpress profile integrates with bp


Burt Adsit
Participant

@burtadsit

I didn’t have time to dig through the xprofile component to do exactly what you want but I did have time to do this. I added a filter to the group and user data that goes across to bbpress. There are two fns that build the associative array of info that goes across and gets stuffed into bbpress forum and user meta tables.

I added the filter ‘oci_get_user’ to the oci_get_user() fn and ‘oci_get_group’ to the oci_get_group() fn. I also did a little demo of how to create such a filter for any data you want to go across to bbpress. I pulled the user’s forum list and the list of forums where the user is ‘staff’ and implemented that as a filter. It doesn’t get created or include by the fn I created for that purpose anymore. It uses a filter. oci_get_user() builds and includes info from the bp user obj and then calls the filter for the added and needed forum info.

/**

* oci_get_user_filter()

*

* Live example of how to use the filter mechanism to add info to the data going across to bbpress

* This filter adds the user’s forums and forums where the user is staff into the $user array

* @return

* @param associative array $user from oci_get_user()

*/

function oci_get_user_filter($user){

$users_group_info = oci_get_users_group_info($user);

$user = $users_group_info;

$user = $users_group_info;

return $user;

}

add_filter(‘oci_get_user’,’oci_get_user_filter’,10,1);

The data being stuff into the $user array used to be included in the oci_get_user() fn and now it’s being included in that filter.

You just need to create your own filter fn and trap the ‘oci_get_user’ filter chain like I did above. The zip with the new capability is available on my site as:

http://ourcommoninterest.org/downloads/bp_group_forums_0.24.zip

I didn’t bump the ver number, change the readme.txt or update the plugin’s blog post yet. This reply is the docs for the moment. :)

You have to be careful what you send across. Only primitive types can go over through xmlrpc. No objects. int, string, bool, array…

Skip to toolbar