Elxis CMS Forum

Support => Administration => Topic started by: bully on June 15, 2010, 23:34:56

Title: 4 sites with 1 database - is it so possible?
Post by: bully on June 15, 2010, 23:34:56
This is a question to Elxis admins and developers and a subject which did several times die.

A client of has 4 Sites (later possible more, it might go up to 20), which should simultaneous , data input should be minimised. Structure, naming, front end language, section, categories, users .. all the same. Each site holds several hundreds of records, section, categories are likely to change weekly. Each domain contains the country in it

The only differences are in fact the country , name and the email address by country and country specific keywords, almost always mentioned in the content.

So far my thoughts are:

- install Elxis 4 times ( no problem)
- point all sites to same data base (no problem)
- set a different language for each of the sites as default (no problem)
- replace the translated language.php with the English copy paste ( ???????????????????)
- ????
- ????


Might this work already, or must be anything else done to it? Or there maybe a more easy way, e.g. to add an extra line with a country code which could avoid the messing around with the language files?

I  appreciate any help and suggestion and also prepared to make a donation towards the Elxis team or a developer for a workable description to  add an extra line with a country code.

Many thanks for your responses.
Bully

Title: Re: 4 sites with 1 database - is it so possible?
Post by: datahell on June 15, 2010, 23:43:15
4 sites sharing the same database (same db tables for all) or 4 sites under the same database (different db tables for each one)?
Both cases are not recommended but the first one will also generate you problems. Not a good solution.

I guess you have 4 domain names, country based.
In your case I would build just 1 site and the three other domains would be pointers to this site different language versions.

mysite.com -> default (english language)
mysite.fr -> points to mysite.com/fr/ (french)
mysite.de -> points to mysite.com/de/ (german)
mysite.es -> points to mysite.com/es/ (spanish)

You can have diferrent layout for each language, different modules, etc....
Why to bother with 4 sites? It will be hard to maintain them...

To work with Elxis language you have to check the value of the $lang variable.

if ($lang == 'german') {
    //german template, stuff, etc...
} else if ($lang == 'spanish') {
    //spanish template, stuff, etc...
} else if ($lang == 'french') {
    //french template, stuff, etc...
} else {
    //english template, stuff, etc...
}
Title: Re: 4 sites with 1 database - is it so possible?
Post by: ks-net on June 16, 2010, 02:32:43
i don't get that with translated english.php ... copy-paste etc...

what you mean?
Title: Re: 4 sites with 1 database - is it so possible?
Post by: bully on June 16, 2010, 14:18:18
@ ks-net,
what I mean there, is tampering with the language files, that regardless of the chosen, an English interface appears.
Title: Re: 4 sites with 1 database - is it so possible?
Post by: bully on June 16, 2010, 14:36:10
4 sites sharing the same database (same db tables for all) or 4 sites under the same database (different db tables for each one)?
Both cases are not recommended but the first one will also generate you problems. Not a good solution.

I guess you have 4 domain names, country based.
In your case I would build just 1 site and the three other domains would be pointers to this site different language versions.

mysite.com -> default (english language)
mysite.fr -> points to mysite.com/fr/ (french)
mysite.de -> points to mysite.com/de/ (german)
mysite.es -> points to mysite.com/es/ (spanish)

You can have diferrent layout for each language, different modules, etc....
Why to bother with 4 sites? It will be hard to maintain them...

To work with Elxis language you have to check the value of the $lang variable.

if ($lang == 'german') {
    //german template, stuff, etc...
} else if ($lang == 'spanish') {
    //spanish template, stuff, etc...
} else if ($lang == 'french') {
    //french template, stuff, etc...
} else {
    //english template, stuff, etc...
}


- with the language files, it looks than more complicated :(

to clarify the sites status: - it is one owner, but running 4 + companies. The businesses are independent , working independent in each of the countries, modules, layouts.... .

- Visitors should NOT chose the country, each of the counties business should appear independent and not connected to a one in another country
- modules, layout ...., users . - all the same
- the only differences  - on the website countryX.com - it must the content specific for countryx, where the visitor on countryY.com only gets the content specified for countryY.


Despite being a greenhorn in php/mysql, I am able to understand some parts of the code. when connecting to the database, the is always a short reference - to the language. My thoughts are now even more going more towards an additional line in the config.php, OR some sort of php file, which would synchronise all 4 databases accordingly.

Many thanks for all responses and thoughts so far.

bully