Reply to thread

If you really need XenForo integrated in your website, you could build an entire product like xfSite does, or just add these lines (which I use on a production website) "globally":

[PHP]require_once(XF_ROOT . '/library/XenForo/Autoloader.php');


XenForo_Autoloader::getInstance()->setupAutoloader(XF_ROOT . '/library');


XenForo_Application::initialize(XF_ROOT . '/library', XF_ROOT);

XenForo_Application::set('page_start_time', TIMENOW);

XenForo_Application::disablePhpErrorHandler();

XenForo_Application::setDebugMode(false);


if (!SESSION_BYPASS)

{//when user info and sessions are needed

    XenForo_Session::startPublicSession();


    $visitor = XenForo_Visitor::getInstance();


    if ($visitor->getUserId())

    {

        $userModel = XenForo_Model::create('XenForo_Model_User');

        $userinfo = $userModel->getFullUserById($visitor->getUserId());

    }

}[/PHP]


Back
Top Bottom