Hello,
I am trying to integrate the acounts (and threads) of the forum on a php website made completely independent of it. After searching a bit on the internet it seems that is not hard to get the information considering that Xenforo is initialized.
Ok, so, for initializing (and example) I found this:
But when I do this, the page is completely screwed up. If I just have the code untill the setupAutoloader, I get this as expected:
However, if I simply add the initialize, this is what happens:
There are no php errors, and if I add all the code above, the call to $userinfo is working correctly.
Does anyone why do the page gets like this?
I am trying to integrate the acounts (and threads) of the forum on a php website made completely independent of it. After searching a bit on the internet it seems that is not hard to get the information considering that Xenforo is initialized.
Ok, so, for initializing (and example) I found this:
Code:
define('XF_ROOT', 'C:/wamp/www/xenforo');
$userinfo = null;
require_once(XF_ROOT . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader(XF_ROOT. '/library');
XenForo_Application::initialize(XF_ROOT . '/library', XF_ROOT);
XenForo_Session::startPublicSession();
$visitor = XenForo_Visitor::getInstance();
if ($visitor->getUserId()){
$userModel = XenForo_Model::create('XenForo_Model_User');
$userinfo = $userModel->getFullUserById($visitor->getUserId());
}
But when I do this, the page is completely screwed up. If I just have the code untill the setupAutoloader, I get this as expected:
However, if I simply add the initialize, this is what happens:
There are no php errors, and if I add all the code above, the call to $userinfo is working correctly.
Does anyone why do the page gets like this?