Well, I've finished it... Right now, it's just a really rough hack, but I eventually plan on writing an administrative component for it and offering J! as a package. Here's how to do it... Create a subdomain or domain alias that has the docroot pointing to the main J! installation.
create a file sites.php in the root of J! containing the following :
Code:
<?php
defined('_VALID_MOS') or die('No Access');
$sites_name['main_domain']='configuration.php';
$sites_name['second_domain']='config_domain.php';
$sites_name['third_domain']='third_domain.php';
?>
make a copy of configuration.php, and rename it to each of the sites config (config_domain.php). Then edit config_domain.php to reflect the settings of the domain ($mosConfig_live_site = 'domain'; and $mosConfig_dbprefix = 'newprefix_'; and $mosConfig_site_name = "New Site Name";)
index.php and index2.php - find require('configuration.php'); and replace with
Code:
require_once ( 'sites.php' );
$conf_igure = $sites_name[$_SERVER['SERVER_NAME']];
require_once( $conf_igure );
/administrator/index.php index2.php and index3.php find require('../configuration.php'); and replace with
Code:
require_once ( '../sites.php' );
$conf_igure = $sites_name[$_SERVER['SERVER_NAME']];
require_once( '../' . $conf_igure );
/administrator/components/com_config/admin.config.php - find $fname = $mosConfig_absolute_path . '/configuration.php'; and replace with
Code:
global $conf_igure;
$fname = $mos_Config_absolute_path . '/' . $conf_igure;
/administrator/includes/auth.php - Find include 'configuration.php'; and replace with
Code:
global $conf_igure;
include ( $conf_igure );
/components/com_sef/sef.php and /includes/sef.php find include ( 'configuration.php' ); and replace with
Code:
global $conf_igure;
include ( $conf_igure );
That's all it takes to create multiple sites on J! as long as it uses independant databases... Now, if you want to share some common tables, you can do this...
/includes/database.php - Find
/includes/database.php - find the line $literal .= str_replace( $prefix , $this->_table_prefix , substr...; and replace with
Code:
$common_tables = array('#__banner'=>'jos_banner',
'#__bannerclient'=>'jos_bannerclient',
'#__bannerfinish'=>'jos_bannerfinish',
'#__components'=>'jos_components',
'#__comprofiler'=>'jos_comprofiler',
'#__comprofiler_fields'=>'jos_comprofiler_fields',
'#__comprofiler_field_values'=>'jos_comprofiler_field_values',
'#__comprofiler_lists'=>'jos_comprofiler_lists',
'#__comprofiler_members'=>'jos_comprofiler_members',
'#__comprofiler_plugin'=>'jos_comprofiler_plugin',
'#__comprofiler_tabs'=>'jos_comprofiler_tabs',
'#__comprofiler_userreports'=>'jos_comprofiler_userreports',
'#__comprofiler_views'=>'jos_comprofiler_views',
'#__contact_details'=>'jos_contact_details',
'#__core_acl_aro'=>'jos_core_acl_aro',
'#__core_acl_aro_groups'=>'jos_core_acl_aro_groups',
'#__core_acl_aro_sections'=>'jos_core_acl_aro_sections',
'#__core_acl_groups_aro_map'=>'jos_core_acl_groups_aro_map',
'#__groups'=>'jos_groups',
'#__mambots'=>'jos_mambots',
'#__messages'=>'jos_messages',
'#__messages_cfg'=>'jos_messages_cfg',
'#__modules'=>'jos_modules',
'#__templates_menu'=>'jos_templates_menu',
'#__template_positions'=>'jos_template_positions',
'#__users'=>'jos_users',
'#__usertypes'=>'jos_usertypes',
$search = array_keys($common_tables);
$replace = array_values($common_tables);
array_push($search,$prefix);
array_push($replace,$this->_table_prefix);
$literal .= str_replace( $search , $replace , substr( $sql, $startPos, $j - $startPos ) );
This will create multiple sites, with seperate content, templates, and polls, and such, but with a common user base, and a common place to upload components (installing a component/module/mambot/template/etc)... The set of tables included above include Community Builder...
There are other files that can be modified to help appearances, but this list is all it takes to get a working site (I have 2 running currently)...
_________________
Anthony Ferrara - Core Team - Development Coordinator - Bug Squad - JSST
http://moovum.com/ - The Bird is in the air! Get Mollom Anti-Spam on your Joomla! website with Moovur...
http://www.joomlaperformance.com For All Your Joomla Performance Needs