41
Quote:
Mikhail Miguel wrote:
OBS:
IS JUST AN EXPERIMENTAL HACK,
IT IS NOT THE IDEAL WAY TO DO A "XOOPS MULTISITE".
database.php
function prefix($tablename='') {
if ( $tablename == '' ) {
return $this->prefix;
}
elseif ( $tablename == 'users' ) {
return 'same_users';
}
elseif ( $tablename == 'groups_users_link' ) {
return 'same_groups_users_link';
}
elseif ( $tablename == 'priv_msgs' ) {
return 'same_priv_msgs';
}
elseif ( $tablename == 'session' ) {
return 'same_session';
}
else {
return $this->prefix .'_'. $tablename;
}
}
to use the same files with diferent sites/subdomains, just replace the mainfile.php for:
if (!(isset($subdominio))) {
$subdominio = $HTTP_HOST;
$subdominio = str_replace("www.","",$subdominio);
$subdominio = str_replace(".com","",$subdominio);
$subdominio = str_replace(".net","",$subdominio);
$subdominio = str_replace(".org","",$subdominio);
}
if (!(empty($subdominio))) {
include($subdominio."mainfile.php");
}
?>
This looks great and easy enough, but a meddling non-programmer like me, might have questions such as:
* Should
$subdominio = str_replace("www.","",$subdominio);
be written as :
$subdominio = str_replace("www.","",$THE_SUB_DOMAIN_NAME);
Otherwise, where do I tell XOOPS the name of the subdomain? (e.g. sub1.site.com, sub2.site.com, etc..)
* Where is database.php ?
Thanks!
Best wishes!
Aharon