• Resolved ri-kun

    (@ri-kun)


    I cant really explain it well but before the upgrade people registering to my site are placed in the site popsicles.ph like this:

    Username/Name/E-mail/Registered/Sites
    poppers/pop/[email protected]/2010/08/03/www.popsicles.ph/

    but now after the upgrade when people register they will be registered but the “Sites is completely blank”:

    Username/Name/E-mail/Registered/Sites
    poppers/pop/[email protected]/2010/08/03/

    so when I try to change their user from member to author I cant

Viewing 5 replies - 31 through 35 (of 35 total)
  • I checked out the plugin and it didn’t work. I have been experimenting with code snippets in my theme’s function.php file and am getting close to a solution but haven’t fixed the problem yet.

    The first snippet:

    function add_new_user_to_mainsite($blog_id, $user_id) {
    ????add_user_to_blog( $blog_id, $user_id, ‘contributor’ );
    }
    add_action(‘user_register’, ‘add_new_user_to_mainsite’);

    This snippet does add the registered user to the main site (according to my admin panels). But after the user clicks on confirmation email, the page that is supposed to display the user’s password states that this snippet triggered a fatal error. Nonetheless, when I visit my user list in the admin panels I do see that this user successfully registered with my main blog.

    The second snippet:

    function add_user_to_mainsite(){
    global $current_user,$blog_id;
    add_user_to_blog($blog_id, $current_user->ID, “contributor”);
    }
    add_action(‘wp’, ‘add_user_to_mainsite’, 10);

    This snippet runs to make sure that the logged in user is registered with my main site and does not trigger any errors. Unfortunately, it only works when a logged in user visits the admin panels for his/her second time. The first time a newly registered user logs in he/she still sees the global dashboard. If, while logged in, the user visits the main site, and then clicks “site admin” he/she is redirected to the main blog. This is getting closer but I need to completely prevent the user from ever seeing the global dashboard so I guess I’m looking for some happy harmony between the first two snippets.

    I am still teaching myself php so any help perfecting these snippets would be much appreciated. I have already spent many hours experimenting with different action hooks, revising the syntax, and trying to blend the two snippets but so far I have been unsuccessful. I based the two snippets off the following sites: Snippet 1, Snippet 2.

    I have been experimenting with code snippets in my theme’s function.php file

    if you want code to run network-wide don’t stick it in the theme’s functions file.

    (I really dislike this trend…)

    take that code you want to run all the time, stuff it in its own php file.
    make a folder called /wp-content/mu-plugins/
    put your code in there.

    it will run all the time. it will NOT need to be activated.

    Im having an issue almost similar, on my multisite ever since the 3.1 update when a new blog is created its supposed to be placed in https://www.mydomain.com/blogs/newblog but now its going to https://www.mydomain.com/newblog and I can not figure out why

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Not even close to the same issue.

    Blogathought please make a NEW topic (don’t post in this thread) and include details on how you got your subblog to exist in a subfolder.

    Hi All,
    I solved my issue last week based on Andrea_r’s suggestion but I realized I forgot to post the correct code, since I’m sure other people may have the same/similar issue.

    <?php
    add_action( ‘wpmu_new_user’, ‘fudem_add_new_user_to_mainsite’, 10, 2);
    function fudem_add_new_user_to_mainsite($user_id) {
    add_user_to_blog(‘1’, $user_id, ‘contributor’);
    }
    ?>

    When the above code is added to a document in MU-Plugins it works perfectly. Thanks to everyone who helped me!
    Best,
    Jonathan

Viewing 5 replies - 31 through 35 (of 35 total)
  • The topic ‘Problem with registration after Upgrade to 3.1’ is closed to new replies.