1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I load *2* xenforo forums ?

Discussion in 'XenForo Development Discussions' started by Matt777, Dec 21, 2013.

  1. Matt777

    Matt777 Member

    I need help from someone smarter than I am...

    I'm loading Xenforo into a PHP page, and writing a new user to it. That part works fine. (y) My code is:

    XenForo_Autoloader::getInstance()->setupAutoloader($fileDir '/library');

    $startTime microtime(true);
    XenForo_Application::initialize($fileDir '/library'$fileDir);

    // create new user
    $writer XenForo_DataWriter::create('XenForo_DataWriter_User');
    // set all the values
    // save user

    Here's the problem: :D

    Immediately after this above code executes, I want to insert a user into another xenforo forum, into a different xenforo install from the first.

    I tried repeating this same code again, pointing to the second xenforo install by specifying the second forum's file directory to variable $fileDir... but unfortunately, it gives me errors the second time around.

    It doesn't like to see this line a second time, right there that crashes the page:
    And when I remove that line of code and try different things, it still fails. :confused:

    My question is, how do I insert a user into one xenforo install, and then immediately into another xenforo install? Is this possible?
    Last edited: Dec 21, 2013
  2. Itworx4me

    Itworx4me Well-Known Member

  3. Matt777

    Matt777 Member

    Oooh :eek: that's a pretty cool looking plugin... but probably feature overkill for what I'm doing. My one forum is retired, read-only, so users don't need to remain synchronized or anything that complicated. I'd like a simpler solution that can be done with a few line changes to the PHP code.

Share This Page