session_start(); //sesje, do logowania
// wersja jezykowa angielska
//przekierowanie
if (strstr($_SERVER['HTTP_HOST'],'magchristmas.co.uk'))
{
// strona glowna
if ($_SERVER['REQUEST_URI'] == '/')
{
$homepage = file_get_contents('http://www.mag.info.pl/?lang=en');
$homepage = str_replace('','',$homepage);
if (strstr($_SERVER['REQUEST_URI'],'lang=en') OR ($_SERVER['REQUEST_URI'] == '/'))
{
$homepage = str_replace('','',$homepage);
}
$homepage = str_replace('http://www.e-mag.com.pl/','/',$homepage); echo $homepage;
}
// podstrony
elseif ($_SERVER['REQUEST_URI'] != '/')
{
$homepage = file_get_contents("http://www.mag.info.pl". $_SERVER['REQUEST_URI']."");
$homepage = str_replace('','',$homepage);
$homepage = preg_replace('#class="topic">Christmas tree #','class="topic">', $homepage);
$homepage = preg_replace('#class="topic">Christmas Tree #','class="topic">', $homepage);
$homepage = preg_replace('# christmas tree#','', $homepage);
$homepage = preg_replace('#
Christmas trees
#','Artificial christmas trees
', $homepage);
$homepage = preg_replace('#Spruce garlands
#','Christmas garlands
', $homepage);
$homepage = preg_replace('#\Darlands
#','
', $homepage);
if (strstr($_SERVER['REQUEST_URI'],'lang=en'))
{
if((strstr($_SERVER['REQUEST_URI'],'products&cid=small-24'))
|| (strstr($_SERVER['REQUEST_URI'],'products&cid=big-25'))
|| (strstr($_SERVER['REQUEST_URI'],'products&cid=viktoria-3-10-m-26'))
|| (strstr($_SERVER['REQUEST_URI'],'products&cid=giant-27'))
|| (strstr($_SERVER['REQUEST_URI'],'products&cid=decorated-28'))
|| (strstr($_SERVER['REQUEST_URI'],'products&cid=colorful-29'))
|| (strstr($_SERVER['REQUEST_URI'],'id=catalogue'))
|| (strstr($_SERVER['REQUEST_URI'],'id=form'))
){
$homepage = str_replace('','',$homepage);
}else{
$homepage = str_replace('','',$homepage);
}
}
elseif (!strstr($_SERVER['REQUEST_URI'],'lang=en'))
{
$homepage = str_replace('','',$homepage);
}
//poprawiam linki na pagerach
$homepage = str_replace('href="http://www.mag.info.pl/index.php?lang=en','href="/?lang=en',$homepage);
$homepage = str_replace('http://www.e-mag.com.pl/','/',$homepage); echo $homepage;
}
}
// wersja jezykowa niemiecka
elseif (strstr($_SERVER['HTTP_HOST'],'magchristmas.de'))
{
// strona glowna
if ($_SERVER['REQUEST_URI'] == '/')
{
$homepage = file_get_contents('http://www.mag.info.pl/?lang=de');
$homepage = str_replace('','',$homepage);
if (strstr($_SERVER['REQUEST_URI'],'lang=de') OR ($_SERVER['REQUEST_URI'] == '/'))
{
$homepage = str_replace('','',$homepage);
}
$homepage = str_replace('http://www.e-mag.com.pl/','/',$homepage); echo $homepage;
}
// podstrony
elseif ($_SERVER['REQUEST_URI'] != '/')
{
$homepage = file_get_contents("http://www.mag.info.pl". $_SERVER['REQUEST_URI']."");
$homepage = str_replace('','',$homepage);
$homepage = preg_replace('#Tannengirlande
Weihnachtsbaum #','class="topic">', $homepage);
$homepage = preg_replace('# Weihnachtsbaum
#','
', $homepage);
if (strstr($_SERVER['REQUEST_URI'],'lang=de'))
{
$homepage = str_replace('','',$homepage);
}
elseif (!strstr($_SERVER['REQUEST_URI'],'lang=de'))
{
$homepage = str_replace('','',$homepage);
}
if((strstr($_SERVER['REQUEST_URI'],'produkten&cid=kleine-24'))
|| (strstr($_SERVER['REQUEST_URI'],'produkten&cid=groe-25'))
|| (strstr($_SERVER['REQUEST_URI'],'produkten&cid=viktoria-3-10-m-26'))
|| (strstr($_SERVER['REQUEST_URI'],'produkten&cid=gigant-27'))
|| (strstr($_SERVER['REQUEST_URI'],'produkten&cid=dekorierte-28'))
|| (strstr($_SERVER['REQUEST_URI'],'produkten&cid=farbige-29'))
|| (strstr($_SERVER['REQUEST_URI'],'id=katalog'))
){
$homepage = str_replace('','',$homepage);
}
//sekcja head
$homepage= str_replace('
Glass Weihnachtskugeln
','Weihnachtskugeln aus Glass
',$homepage);
//poprawiam linki na pagerach
$homepage = str_replace('href="http://www.mag.info.pl/index.php?lang=de','href="/?lang=de',$homepage);
$homepage = str_replace('http://www.e-mag.com.pl/','/',$homepage); echo $homepage;
}
}
// wersja jezykowa polska
else {
function ss_buffer($f)
{
if ($_SERVER['REQUEST_URI'] == '/?id=produkty&cid=choinki-3')
{
$f = str_replace('Choinki
','Sztuczne choinki
',$f);
}
if ($_SERVER['REQUEST_URI'] == '/?id=galeria&gal=projekty-polska-1')
{
$f = str_replace('Projekty Polska
','Iluminacje i dekoracje świąteczne
',$f);
}
if ($_SERVER['REQUEST_URI'] == '/?id=produkty')
{
$f = str_replace('Produkty
','Dekoracje bożonarodzeniowe, ozdoby choinkowe
',$f);
}
if (strstr($_SERVER['REQUEST_URI'],'lang=en') OR strstr($_SERVER['REQUEST_URI'],'lang=de'))
{
$f = str_replace('','',$f);
}
if($_GET['id'] == 'aktualnosci'){ $f = str_replace('','',$f); }
$f = str_replace('http://www.e-mag.com.pl/','/',$f);
return $f;
}
ob_start("ss_buffer"); //emulacja headerow
require_once ('conf/db.php');
require_once ('conf/getlang.php');
require_once ('conf/config.php');
require_once ('inc/functions.php');
?>