Skip to:
Content
Pages
Categories
Search
Top
Bottom

User Sync for multisite


  • m2sahin
    Participant

    @m2sahin

    Hello to everyone,

    My site is multisite. How do I synchronize cross-site user and user information? Now, I’m going to explain exactly what I want to do.

    #############################################################

    My site (multisite)

    example.com/
    example.com/sub1
    example.com/sub2

    I want to register on all subsites at the same time when registering from any subsite.

    example.com/sub2/register – username: m2sahin (I registered from here)

    -—-—-—-—-—-—-—-—-—-

    example.com/members/m2sahin (active)
    example.com/sub1/members/m2sahin (active)
    example.com/sub2/members/m2sahin (active)

    When I change user information on any site, I want that information changed on all sites. (Profile photo, cover photo, country, forum, hobbies, etc.)

    example.com/members/m2sahin (profile photo 1 , Ukraine)
    example.com/sub1/members/m2sahin (profile photo 1 , Ukraine)
    example.com/sub2/members/m2sahin (profile photo 1 , Ukraine)

    -—-—-—-—-—-—-—-—-—-

    example.com/sub1/members/m2sahin/settings (profile photo 3 , Greece) (updated)

    -—-—-—-—-—-—-—-—-—-

    example.com/members/m2sahin (profile photo 3 , Greece)
    example.com/sub1/members/m2sahin (profile photo 3 , Greece)
    example.com/sub2/members/m2sahin (profile photo 3 , Greece)

    How can I do that, is it possible ???

Viewing 8 replies - 1 through 8 (of 8 total)

  • shanebp
    Moderator

    @shanebp

    On networked installs ( mulitsite ) WP and BP use the same users for ALL the sites.
    So profile data for a user will be available to ALL the sites that user belongs to.
    So there is no need for synchronization.


    m2sahin
    Participant

    @m2sahin

    define( ‘BP_ENABLE_MULTIBLOG’, true ); this code is active.

    in fact I want to make a multilingual site with multisite. Each site has a separate forum, I want someone who is enrolled in the Greek site to see profile information on the English site, and use the English forum and other things.

    Now I’m going to tell you about two different situations and their problems.

    **********************

    #1- Network Active (BP_ENABLE_MULTIBLOG disable)

    in this situations, the profile page will only appear on the main site. So a user who registered to the Greek site can only edit their profile on the English site.

    example.com/members/m2sahin (Active)
    example.com/sub1/members/m2sahin ( 404 )
    example.com/sub2/members/m2sahin ( 404 )

    *****************************

    #2- BP_ENABLE_MULTIBLOG enable

    A user who registered in the Greek site and updated his profile information cannot see the profile information he has changed on the English site.

    example.com/sub2/register – username: m2sahin (I registered from here)

    ———-

    example.com/members/m2sahin (active) (no profile photos , no other information)
    example.com/sub1/members/m2sahin (active) (no profile photos , no other information)
    example.com/sub2/members/m2sahin (active) (no profile photos , no other information)

    -—-—-—-—-—-—-—-—-—-

    example.com/sub1/members/m2sahin/settings (profile photo 1 , Occupation: Lawyer) (updated)

    -—-—-—-—-—-—-—-—-

    example.com/members/m2sahin (no profile photos , no other information)
    example.com/sub1/members/m2sahin (profile photo 1 , Occupation: Lawyer)
    example.com/sub2/members/m2sahin (no profile photos , no other information)


    m2sahin
    Participant

    @m2sahin

    Please tell me you understand. I really need help with this. I’m thinking of opening a ticket.


    Bigue Nique
    Participant

    @biguenique

    I haven’t figured out for profile header image yet, but you will find solutions for centralizing avatar storage on MULTIBLOG-enabled BP networks here: https://buddypress.org/support/topic/multiblogmultisite-avatar-missing/

    Basically, if you want to use avatars from the main site, you can just add this to your wp-config.php:

    
    define( 'BP_AVATAR_UPLOAD_PATH', dirname(__FILE__).'/wp-content/uploads' );                         define( 'BP_AVATAR_URL', '//'.$_SERVER['HTTP_HOST'].'/wp-content/uploads' );
    

    If you want to use avatars from another site, you will likely need to add the site’s upload path (eg. ‘/sites/2’) to both paths.


    Bigue Nique
    Participant

    @biguenique

    Here is the solution for forcing BP uploads form every MULTIBLOG-enable network sites to be stored on (and fetched from) the main site : https://buddypress.trac.wordpress.org/ticket/6931#comment:1

    To put it simple, simply create a file wp-content/plugins/bp-custom.php and paste in the code from this gist: https://gist.github.com/imath/91d56292673e6de61597

    The code speaks for itself.


    gels13
    Participant

    @gels13

    There is a much easier way to sync avatars, directly from cPanel on the site, using command commands to sync avatars folder with other similar folders in subdomains or sub sites. Automated tasks (cron jobs) are set. This type of task is created in cPanel-> Automated tasks (Cron jobs), and through them you can specify in a certain period to perform an action.
    For example, to sync the content of example.com/wp-content/uploads/avatars in sub1.example.com/wp-content/uploads/avatars, you can use the following cron task:
    rsync -av –progress / home / directory of the site in cPanel / example.com / wp-content / uploads / avatars / sub1.example.com / wp-content / uploads / avatars /

    It is recommended that cron tasks not be performed too often. You can configure the task to run every 10 minutes.


    Bharat
    Participant

    @chavodbharat

    After activating multisite I installed and network activated BuddyPress. I also added this line to wp-config.php: define ( ‘BP_ROOT_BLOG’, 2 ); where 2 is ID of your communitycommunity.mysite.com

    That way BP is accessible from an entire network, but profiles are handled only from the network site.


    Bharat
    Participant

    @chavodbharat

    Here solution

    After activating multisite I installed and network activated BuddyPress. I also added this line to wp-config.php: define ( 'BP_ROOT_BLOG', 2 ); where 2 is ID of your communitycommunity.mysite.com

    That way BP is accessible from an entire network, but profiles are handled only from the network site.

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