2
Hi,
I hope I have understood your needs. There is a site I look after and we have 3 domains on one website, and I use a small PHP script to check which domain it is, and then set various variables and constants, to control what is done. In fact I force the directory path to a specific language. Your case is slightly different, but I'm sure you can modify the script below, and then use the same script on each domain.
You will need to ensure though, that the script gets executed for EVERY other script that is run, this was easy for me, because the product I was using already had a script that was included with every other PHP file, so I simply added an include to point to the small script, which checked the domains.
Anyway, I made up a sample one, hope it helps .......
// Constants prefixed with string "MLP" indicate Multi Language Pack constants
// If user comes to site with preceeding string "www." , remove it, not required
$httphostname = $_SERVER['HTTP_HOST'];
$hostname = str_replace("www.", "", $httphostname);
define('MLP_HOSTNAME', $hostname);
$domains['xoops.de'] = array(
'language'=>'de',
'domain_no'=>'1',
'partner_logo'=>'logo_german.jpg'
);
$domains['xoops.jp'] = array(
'language'=>'jp',
'domain_no'=>'2',
'partner_logo'=>'logo_japanese.jpg'
);
$domains['xoops.fr'] = array(
'language'=>'fr',
'domain_no'=>'3',
'partner_logo'=>'logo_french.jpg'
);
//Default to german language if not found
if (isset($domains[$hostname]['language'])) {
$language = $domains[$hostname]['language'];
$domain_number = $domains[$hostname]['domain_no'];
$logo = $domains[$hostname]['partner_logo'];
} else {
$language = 'de';
$domain_number = '1';
$logo = 'logo_german.jpg';
}
define('MLP_LANGUAGE', $language);
define('MLP_DOMAIN_NUMBER', $domain_number);
define('MLP_LOGO', $logo);
//Then set any other variables or constants needed for the Multi langauge pack
?>
Peter