Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP on Multisite multi-language


  • tergra
    Participant

    @tergra

    Hi,

    I’ve seen old posts about this but I don’t think these questions have been asked lately 🙂 If they have I’m very sorry !

    I have a WP Multi-site 4.6.2 with a BP 2.6.2.
    Every multi-site is in a different language and on a different subdirectory :

    • mydomain.com in english
    • mydomain.com/fr in French
    • mydomain.com/es in Spanish
    • etc.

    I saw on other posts on this forum that Buddypress is common to all multi-sites. I guess that means that when a user registers on one of the multi-sites he can use his account on all the other websites of the Multi-site installation, right ? Meaning :
    One user that registers on mydomain.com/fr as an author can also post content on mydomain.com/ and on mydomain.com/es, is that right ? (I hope it’s not because it would get messy quickly ^^⁾

    Also, more important : when a user is browsing mydomain.com/fr (so the French version of the website) when he clicks on “My Profile” it seems to automatically redirect him to the domain in English (mydomain.com/members/username/profile/), meaning it takes him out of the French Website to put him onto the English one. Of course this is not something I want as then the user gets totally lost because of that. I tried adding /fr to the url (like mydomain.com/fr/members/username/profile/) but it gives a 404 error.

    Is there a way to correct this ?

    Thank you very much !

Viewing 8 replies - 1 through 8 (of 8 total)
  • I guess that means that when a user registers on one of the multi-sites he can use his account on all the other websites of the Multi-site installation, right ?

    Yes, but understand that you have to give that user access to those other sites (in wp-admin) to write blog posts, for example. If a user does not have explicit permissions to a specific multisite site, they won’t have any special access; they’ll only be able to read the content as if they were another normal visitor. You can test this right now, without BuddyPress, and see how it works.

    meaning it takes him out of the French Website to put him onto the English on

    You seem to be using multisite to have your content localised into different languages. This is a common approach for WordPress multisite, but BuddyPress does not work the way you want it to in this situation.

    You can activate BuddyPress in a few different ways. Simply, on multisite, you can activate the plugin on a specific site, or network-wide. There is lots more detail at https://codex.buddypress.org/getting-started/installation-in-wordpress-multisite/ but if BuddyPress is activated network-wide, all the BuddyPress content will only appear on one site (we call this the “root blog”). We use redirects to support this, exactly as you’ve found.

    You can’t have BuddyPress active on a multisite that uses the sub-sites as different languages, and have the BuddyPress social network appear on all of them and work in the same way, except with different translations. It doesn’t work that way out the box…

    …however here is an advanced setting you can use to make BuddyPress behave like this: BP_ENABLE_MULTIBLOG

    See https://codex.buddypress.org/getting-started/customizing/bp_enable_multiblog/
    I would encourage you fully test this setting out if you enable it, before you start building the rest of your site, just to understand and confirm its behaviour.

    🙂


    tergra
    Participant

    @tergra

    Hey Paul, thanks for your fast and precise answer 🙂

    BP_ENABLE_MULTIBLOG seems to be exactly what I’d like to do !
    Yet I understand it will create several pages in different languages for the same profile ; is there a way though for the site admin to know which language the profile was originally created in ? In other words, is there a way to segment the user database depending on which website created the user profile ?
    Because if I want to communicate with my users and send emails to them I want to send the emails in the right language, in their language.

    Thanks again !

    I think with multisite, WordPress user registrations only occur on the main/root site. I don’t know how BP_ENABLE_MULTIBLOG works with this (i.e. I can’t remember if the registration redirect happens). It’s been a while since I’ve used it.

    If you’re a little technical, you could test it, and then look in the database afterwards — probably the wp_x_users, wp_x_usermeta, wp_x_signups tables, and see if there’s any field such as a blog ID or blog URL set somewhere for the new users that you could use.

    Otherwise, I think you’d have to code something up.

    You could also see if the user gets associated with the site they sign up on (this would be easiest to find out by looking at the Users screen in wp-admin for each multisite site, and seeing if/where users are listed).


    tergra
    Participant

    @tergra

    Thanks for the answer. The user is redirected to the same site he registered in, which is nice. Yet new users are visible in the Network users listing, (wp-admin/network/users.php) but not in each site’s users listing (wp-admin/users.php), so I would assume there is no differenciation… Gonna look up in the database as you suggested


    tergra
    Participant

    @tergra

    I went through the DB, turns out neither of these tables show anything related to the site which received the registration. Except if the ‘meta value’ show this info somewhere, but I must understand I can’t really understand how it’s formated :
    examples :
    a:2:{s:11:”add_to_blog”;s:1:”2″;s:8:”new_role”;s:12:”ap_moderator”;}
    a:1:{s:11:”contributor”;b:1;}
    a:3:{s:7:”field_1″;s:5:”roger”;s:17:”profile_field_ids”;s:1:”1″;s:8:”password”;s:34:”$P$BPW7grRY2kH62WleeehSB/Wd0AI2KnT.Cr/”;}


    tergra
    Participant

    @tergra

    I found this : https://wordpress.org/support/topic/multisite-user-registration-access/

    So I think the variable is_user_member_of_blog should return true only when used on the blog the user created his profile on, what do you think ? 😉

    If you can’t see the users on the appropriate sites’ wp-admin screens, then that function is going to return exactly the same data.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar