Mtor
New Member
Hi,
It's not perfect but at least handles the most important for my customer, replaced the group.php file from vBulletin with that file content (it uses 301config.php from vB redirection script for xF.
It's not perfect but at least handles the most important for my customer, replaced the group.php file from vBulletin with that file content (it uses 301config.php from vB redirection script for xF.
PHP:
<?php
$startTime = microtime(true);
$fileDir = dirname(__FILE__);
if (file_exists($fileDir . '/301config.php'))
{
include($fileDir . '/301config.php');
}
require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
$dependencies = new XenForo_Dependencies_Public();
$dependencies->preLoadData();
$inputHandler = new XenForo_Input(new Zend_Controller_Request_Http());
$input = $inputHandler->filter(array(
'cat' => XenForo_Input::UINT,
'discussionid' => XenForo_Input::UINT,
'gmid' => XenForo_Input::UINT,
'groupid' => XenForo_Input::UINT
));
$target = false;
if ($input['gmid'])
{
$importModel = XenForo_Model::create('XenForo_Model_Import');
$logTable = (defined('IMPORT_LOG_TABLE') ? IMPORT_LOG_TABLE : 'xf_import_log');
if ($newId = $importModel->getImportContentMap('nsg_vb38x_post', $input['gmid'], $logTable))
{
$target = XenForo_Link::buildPublicLink('canonical:posts', array('post_id' => reset($newId)));
}
}
else if ($input['discussionid'])
{
$importModel = XenForo_Model::create('XenForo_Model_Import');
$logTable = (defined('IMPORT_LOG_TABLE') ? IMPORT_LOG_TABLE : 'xf_import_log');
if ($newId = $importModel->getImportContentMap('nsg_vb38x_thread', $input['discussionid'], $logTable))
{
$target = XenForo_Link::buildPublicLink('canonical:threads', array('thread_id' => reset($newId)));
}
}
else if ($input['cat'])
{
$importModel = XenForo_Model::create('XenForo_Model_Import');
$logTable = (defined('IMPORT_LOG_TABLE') ? IMPORT_LOG_TABLE : 'xf_import_log');
if ($newId = $importModel->getImportContentMap('nsg_vb38x_category', $input['cat'], $logTable))
{
$target = XenForo_Link::buildPublicLink('canonical:groups/categories', array('team_category_id' => reset($newId)));
}
}
else if ($input['groupid'])
{
$importModel = XenForo_Model::create('XenForo_Model_Import');
$logTable = (defined('IMPORT_LOG_TABLE') ? IMPORT_LOG_TABLE : 'xf_import_log');
if ($newId = $importModel->getImportContentMap('nsg_vb38x_group', $input['groupid'], $logTable))
{
$target = XenForo_Link::buildPublicLink('canonical:groups', array('team_id' => reset($newId)));
}
}
if (!$target)
{
$target = XenForo_Link::buildPublicLink('canonical:groups');
}
$response = new Zend_Controller_Response_Http();
$response->setRedirect(XenForo_Link::convertUriToAbsoluteUri($target), 301);
$response->sendResponse();