It worked!
This is the new code:
PHP Code:
$name = $_SERVER['SERVER_NAME'];
$uri = $_SERVER['REQUEST_URI'];
if( stripos($name, "forum.herogamers") !== false )
{
if( stripos($uri, "langid=3") !== false )
{
$newurl = "http://foro.herogamers.net" . $uri;
if( !headers_sent() )
{
header("Location: " . $newurl . "");
die();
}
}
else
{
$_REQUEST['langid'] = 1;
}
}
else if( stripos($name, "foro.herogamers") !== false )
{
if( stripos($uri, "langid=1") !== false )
{
$newurl = "http://forum.herogamers.net" . $uri;
if( !headers_sent() )
{
header("Location: " . $newurl . "");
die();
}
}
else
{
$_REQUEST['langid'] = 3;
}
}
I had to remove the $vbulletin->userinfo['languageid'] thing because in init_startup that information is not initialized yet.