Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Can you multi-site BuddyPress?


John James Jacoby
Keymaster

@johnjamesjacoby

@anointed, I think the best way to do something like this would be to extend the existing multi-site plugin(s) and introduce a method to either serialize the sites that users belong to and add it to a _usermeta field, or insert/update/delete blog_id/site_id to the _usermeta every time a user is added or removed and check against those meta’s on every page load if the user is logged in.

The problem comes from situations where site-admins technically are users on all sites, and how to deal with collisions where users can be added to blogs without being added to sites, if that makes sense?

What you would need to do is hook into all of the places where users can be added/removed from blogs, and add your own actions to those functions to perform your special tasks, which-ever you choose to do.

Then… Once that’s all done… You’ll need to modify the members directory to sniff out only the users that are in those _usermeta values that you assign them to. In my opinion, this is a modification of the kind of magnitude best left for professionals or tinkerers with lots of extra time to test and make sure you don’t corrupt the relationships between users, sites, and blogs.

There are functions already to see which users are already part of which blog_id’s, but that doesn’t really work for all users across any particular group of blogs based on a site_id. I haven’t needed to do something like this myself so I can’t say for sure, but I haven’t seen a core function to find users belonging to particular sites… It would require first checking the wp_blogs table for all blog_id’s matching your site_id, and then checking the roles and caps for users that match.

Skip to toolbar