SAS1024
Active 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):
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::setDebugMode( false );
$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 );