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

Rebuilding last post info from external script

Discussion in 'XenForo Development Discussions' started by SAS1024, Sep 13, 2016.

  1. SAS1024

    SAS1024 Member

    Hi all!

    Anyone, help me please.

    How I can rebuild last post info in selected node from external script?

    My XenForo installation was integrated with my site with this method (and I can use any XenForo methods on my site):
    PHP:
                define'TIMENOW'time() );
                
    define'SESSION_BYPASS'false ); // if true: logged in user info and sessions are not needed

                
    require_once( __DIR__ '/../forum/library/XenForo/Autoloader.php' );

                
    XenForo_Autoloader::getInstance()->setupAutoloader__DIR__ '/../forum/library' );

                
    XenForo_Application::initialize__DIR__ '/../forum/library'__DIR__ '/../forum' );
                
    XenForo_Application::set'page_start_time'TIMENOW );
                
    XenForo_Application::disablePhpErrorHandler();
                
    XenForo_Application::setDebugModefalse );
                
    $dependencies = new XenForo_Dependencies_Public();
                
    $dependencies->preLoadData();

                if ( !
    SESSION_BYPASS ) {
                    
    XenForo_Session::startPublicSession();

                    
    $visitor         XenForo_Visitor::getInstance();
                    
    self::$visitor   XenForo_Visitor::getInstance()->toArray();
                    
    self::$userModel XenForo_Model::create'XenForo_Model_User' );
                    if ( 
    $visitor->getUserId() ) {
                        
    self::$currentUserInfo self::$userModel->getFullUserById$visitor->getUserId() );
                    }
                }

                
    restore_error_handler();
                
    restore_exception_handler();
                
    $xfPaths                 XenForo_Application::get'requestPaths' );
                
    $xfPaths['fullBasePath'] = 'http://' $_SERVER['SERVER_NAME'] . '/forum/';
                
    XenForo_Application::set'requestPaths'$xfPaths );
     

Share This Page