setupAutoloader($fileDir . '/library'); XenForo_Application::initialize($fileDir . '/library', $fileDir); XenForo_Application::set('page_start_time', $startTime); $inputHandler = new XenForo_Input(new Zend_Controller_Request_Http()); $input = $inputHandler->filter(array( 't' => XenForo_Input::UINT, 'p' => XenForo_Input::UINT, 'page' => XenForo_Input::UINT, )); $importModel = XenForo_Model::create('XenForo_Model_Import'); $target = false; if ($input['t']) { if ($newId = $importModel->mapThreadId($input['t'])) { $data = array('thread_id' => $newId); $extraParams = array(); if (defined('INCLUDE_PAGE_LINKS') && INCLUDE_PAGE_LINKS && $input['page']) { $extraParams['page'] = $input['page']; } $target = XenForo_Link::buildPublicLink('canonical:threads', $data, $extraParams); } } else if ($input['p']) { $newId = $importModel->mapPostId($input['p']); if ($newId) { $target = XenForo_Link::buildPublicLink('canonical:posts', array('post_id' => $newId)); } } if (!$target) { $target = XenForo_Link::buildPublicLink('canonical:index'); } $response = new Zend_Controller_Response_Http(); $response->setRedirect(XenForo_Link::convertUriToAbsoluteUri($target), 301); $response->sendResponse();