Multiple Sites - Sharing Several common tables

Your code modifications and patches you want to share with others.
User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Multiple Sites - Sharing Several common tables

Post by ircmaxell » Sat Sep 30, 2006 6:03 am

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: Select all

<?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: Select all

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: Select all

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: Select all

global $conf_igure;
$fname = $mos_Config_absolute_path . '/' . $conf_igure;
/administrator/includes/auth.php - Find include 'configuration.php'; and replace with

Code: Select all

global $conf_igure;
include ( $conf_igure );
/components/com_sef/sef.php and /includes/sef.php find include ( 'configuration.php' ); and replace with

Code: Select all

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: Select all

$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)...
Last edited by ircmaxell on Thu Jul 12, 2007 7:35 pm, edited 1 time in total.
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

JSalvador
Joomla! Intern
Joomla! Intern
Posts: 80
Joined: Sat Nov 26, 2005 2:59 am

Re: Multiple Sites - Sharing Several common tables

Post by JSalvador » Fri Oct 27, 2006 2:49 pm

Can this solution run mutiple sites on the same file structure? In otherwords, can I use just one basic install for all include files, module files, and component files?  Or do I have to install them again?

I'd like to have the same database (except content) and same file structure (except for configuration.php, /com_content/content.html.php, and template) Thanks

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Fri Oct 27, 2006 6:07 pm

Well, you can install any component you'd like.  If you want each site to use it, then install it on the main site, and copy it's tables into the common tables section...
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

woohoohoo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sat Nov 18, 2006 12:58 am

Re: Multiple Sites - Sharing Several common tables

Post by woohoohoo » Sat Nov 18, 2006 1:02 am

ircmaxell wrote: Well, you can install any component you'd like.  If you want each site to use it, then install it on the main site, and copy it's tables into the common tables section...

Hi ircmaxell,  thank you for your great hack!!  I got my two sites running as well. But for "artbanner" and "event_list" components, they didn't hook up... for CB, if I registered an account on "satellite site", it didn't pass to the main database. And I always got "session expired" problem if I logged into both backend at the same time...

Any ideas?? Thanks!!
Last edited by woohoohoo on Sat Nov 18, 2006 1:05 am, edited 1 time in total.

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Sat Nov 18, 2006 1:18 am

What tables do you have shared?
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

woohoohoo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sat Nov 18, 2006 12:58 am

Re: Multiple Sites - Sharing Several common tables

Post by woohoohoo » Sat Nov 18, 2006 1:39 am

ircmaxell wrote: What tables do you have shared?
$common_tables = array('#__artbannersplus'=>'jos_artbannersplus',
'#__artbannersplus_categories'=>'jos_artbannersplus_categories',
'#__artbannersplus_clients'=>'jos_artbannersplus_clients',
'#__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_plug_profilegallery'=>'jos_comprofiler_plug_profilegallery',
'#__comprofiler_tabs'=>'jos_comprofiler_tabs',
'#__comprofiler_userreports'=>'jos_comprofiler_userreports',
'#__comprofiler_views'=>'jos_comprofiler_views',
'#__eventlist_categories'=>'jos_eventlist_categories',
'#__eventlist_dates'=>'jos_eventlist_dates',
'#__eventlist_locate'=>'jos_eventlist_locate',
'#__eventlist_register'=>'jos_eventlist_register',
'#__eventlist_settings'=>'jos_eventlist_settings',
'#__eventlist_settings_jfish'=>'jos_eventlist_settings_jfish',
'#__events_registrations'=>'jos_events_registrations',
'#__events_registration_fields'=>'jos_events_registration_fields',
'#__events_registration_fields_options'=>'jos_events_registration_fields_options',
'#__events_registration_fields_values'=>'jos_events_registration_fields_values',
'#__events_sessions'=>'jos_events_sessions',
'#__events_venues'=>'jos_events_venues',
'#__users'=>'jos_users',
'#__usertypes'=>'jos_usertypes',
//'#__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 ) );


User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Sat Nov 18, 2006 1:44 am

Well, for one, you may need jos_sessions...

Also, some other components like the menus to be the same because of the id's... just play around with it (I don't know those components)...
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

woohoohoo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sat Nov 18, 2006 12:58 am

Re: Multiple Sites - Sharing Several common tables

Post by woohoohoo » Sat Nov 18, 2006 3:11 am

ircmaxell wrote: Well, for one, you may need jos_sessions...

Also, some other components like the menus to be the same because of the id's... just play around with it (I don't know those components)...
Thanks!  Can I ask how did u solve the registration problem? Like if the user register account on "satellite site", how to pass the info to the main site database?  replacing all the #_users to jos_users(supposing the main site is Jos_ )?

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Sat Nov 18, 2006 11:28 am

It worked fine for me...  One registration across all sites....
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

gis
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Dec 29, 2006 6:05 pm

Re: Multiple Sites - Sharing Several common tables

Post by gis » Mon Jan 01, 2007 11:00 pm

this hack looks great, I was just wondering if it is useful just to make different sites share the same modules? like a forum shared between 4 sites?

techanuva
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 07, 2007 10:20 am

Re: Multiple Sites - Sharing Several common tables

Post by techanuva » Mon May 07, 2007 10:24 am

Hello, we are interested to develop a 'Website Builder' using Joomla.  I think this component could help but only thing is that we would like the customers to have their own access to the admin panel.  So basically, each site with a different admin panel.  Does this work like that?  Is there any other component which could help us in this?  Thanks in advance.

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Mon May 07, 2007 11:14 am

I had looked into that, and tried about a year ago.  It would require SO many modifications, that it's wouldn't be worth it in the least.
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

techanuva
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 07, 2007 10:20 am

Re: Multiple Sites - Sharing Several common tables

Post by techanuva » Mon May 07, 2007 1:44 pm

ircmaxell, thanks a lot for your prompt reply.  Would think of something else.

thaindian
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Oct 19, 2006 5:59 am

Re: Multiple Sites - Sharing Several common tables

Post by thaindian » Sun Jul 08, 2007 12:55 pm

this hack seems to look like exactly what i am looking for.
my website is currently getting cluttered and i am thinking of new divisions of the site. so seperate joomla installs would solve the problem.
was looking for a way to share user registrations...sessions... logins...  from what i read this is the ideal solution.

anyone still using this method? any fallouts? is there a better solution to accomplish the same?
im too lazy to set up a demo site, so will try it late tonight when there is no traffic.

for the satellite sites i understand i need to make a new db for each site... what structure should it have? i need to copy existing tables into the new db?

ircmaxell: I am a happy user of your page_cache component :-)

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Sun Jul 08, 2007 7:46 pm

Actually, you don't need different databases (just different table prefixes)...
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

thaindian
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Oct 19, 2006 5:59 am

Re: Multiple Sites - Sharing Several common tables

Post by thaindian » Thu Jul 12, 2007 5:01 pm

hmm... maybe a lil offtopic, not J! related ... but im trying to fine an easy way of copying the existing tables into new ones..
like copy jos_tablename to satelite1_tabelname  ... is there a simple mysql command to do that?

i found this

Code: Select all

CREATE TABLE MyEmployee SELECT * FROM Employee
but it only copies the data, not the indexes.

can phpmyadmin do it? then ill need to install one...

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Thu Jul 12, 2007 5:15 pm

Well, you could export all data, then open the file in notepad and do a string replace between "jos_" and "satelite1_"
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

thaindian
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Oct 19, 2006 5:59 am

Re: Multiple Sites - Sharing Several common tables

Post by thaindian » Thu Jul 12, 2007 7:16 pm

Found a bug!!!
ircmaxell wrote:
/administrator/index.php index2.php and index3.php find require('../configuration.php'); and replace with

Code: Select all

require_once ( 'sites.php' );
$conf_igure = $sites_name[$_SERVER['SERVER_NAME']];
require_once( '../' . $conf_igure );
It should actually be :-

Code: Select all

require_once ( ../'sites.php' );
$conf_igure = $sites_name[$_SERVER['SERVER_NAME']];
require_once( '../' . $conf_igure );
...as sites.php is in the root j! folder and not in the admin folder :-)

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Thu Jul 12, 2007 7:35 pm

You have a point...
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

thaindian
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Oct 19, 2006 5:59 am

Re: Multiple Sites - Sharing Several common tables

Post by thaindian » Thu Jul 12, 2007 8:33 pm

i think i have changed everything as per first post, and added the sessions table as a shared table. after stupidly overwriting the php.ini with an old one... APC ran into problems... fixed them... now back to joomla - multi sites...
my setup is as follows

joomla 1.0.11
using your page cache component but is dissabled for the time being.

facing following issues :-

1) Sessions are not carried over. loging in in main site doesnt log me into the satellite and vice versa.
2) Frontend of satelite site shows same page title as main site, however in admin pages it shows title of the satelite site.
3) This is wierd - since before the port, i copied all tables from main site into satellite. now on satellite, i unpublish a frontpage content item, effect, content vanished from satellite, however on main site it gets removed from the frontpage but is still seen in latest articles. backend of main site doesnt show any change. i think i have messed up somewhere?
4) on satelite site, in the administration if i change any global setting and do apply, it says configuration updated, but it remains the same.

nothing in error.log, ive turned on all error reporting.. no errors.

the session part is not too serious.. as we may not use user access for the satellite site at the moment (with page_cache enabled and no1 loged in its gonna be a kickass fast subdomain).

points 2 and 3 indicate there may be need for some more change in some joomla file.

FYI my sites.php looks like this :-

Code: Select all

<?php
defined('_VALID_MOS') or die('No Access');
$sites_name['www.domain.com']='configuration.php';
$sites_name['subdomain.domain.com']='configuration.travel.php';

?>
and if it matters.. im using opensef

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Thu Jul 12, 2007 8:38 pm

Well the sessions won't carry over (they are dependant on the site name).  For #2, this should not happen... did you manually change the site name in configuration.site2.php?  For #3, what tables do you have shared?  For #4, I have a feeling it's loading the default configuration.php (instead of the site specific one)... Check to make sure that the correct file is in $conf_igure...
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

thaindian
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Oct 19, 2006 5:59 am

Re: Multiple Sites - Sharing Several common tables

Post by thaindian » Thu Jul 12, 2007 9:37 pm

hi,

thanks a lot for taking time to help me out.

sessions - doesnt matter
#2 : Yes, i did change this manually in the satellite's config file. but even in the global configuration it shows the correct site name
#4 : for the backend, i added echo $conf_igure in the of the admin template, it shows the correct filename.
for the frontend, in joomla.php i  put the $conf_igure in the title... on both sites it shows the correct $conf_igure (only after doing global $conf_igure;  first)

#3 shared tables

Code: Select all

                        $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',
'#__sessions'=>'jos_sessions',
'#__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 ) );

thaindian
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Oct 19, 2006 5:59 am

Re: Multiple Sites - Sharing Several common tables

Post by thaindian » Fri Jul 13, 2007 1:23 pm

and also in the admin part of the satellite site on /administrator/index2.php?option=com_admin&task=sysinfo

it is showing the configuration file  of the main site.

User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by ircmaxell » Fri Jul 13, 2007 1:31 pm

I'm not sure... I had this working a long time ago... I havn't used it since I posted it (didn't have the need anymore)...
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

briging gap
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Tue Jun 13, 2006 4:25 pm
Location: Coventry - UK
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by briging gap » Tue Aug 14, 2007 7:22 pm

Having read through all of this post i'm a litle confused (it's been a long day)  when you say point the doc rooot at the main J installation, do you mean redirect

Main install in www/subsite1 (subsite1.domain.com)
sub site on subsite2.domain.com with url redirection to subsite1.domain.com

Also in the index.php file where exactly do I need to change the code (j1.13)

Code: Select all

// checks for configuration file, if none found loads installation page
if (!file_exists( 'configuration.php' ) || filesize( 'configuration.php' ) < 10) {
	$self = rtrim( dirname( $_SERVER['PHP_SELF'] ), '/\\' ) . '/';
	header("Location: http://" . $_SERVER['HTTP_HOST'] . $self . "installation/index.php" );
	exit();
}

require( 'globals.php' );
require_once( 'configuration.php' );

// SSL check - $http_host returns <live site url>:<port number if it is 443>
$http_host = explode(':', $_SERVER['HTTP_HOST'] );
if( (!empty( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) != 'off' || isset( $http_host[1] ) && $http_host[1] == 443) && substr( $mosConfig_live_site, 0, 8 ) != 'https://' ) {
	$mosConfig_live_site = 'https://'.substr( $mosConfig_live_site, 7 );
}

require_once( 'includes/joomla.php' );
Another question which I think I know teh eanser to is do I have to install joomla in the new subdomain or not (think the answer is not

Help appreciated

Nigel
Joomla Based community Website - http://www.business4brunch.com

hamzahali
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Sep 12, 2008 11:51 pm

Re: Multiple Sites - Sharing Several common tables

Post by hamzahali » Mon Oct 20, 2008 11:47 pm

I wanted to change the name of jos_content to jos_apps?
Is it possible ircmaxell ?
Please help.
I have wasted 2 days on this.

User avatar
agbert
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Aug 25, 2008 5:25 am
Location: Folsom, CA
Contact:

Re: Multiple Sites - Sharing Several common tables

Post by agbert » Sat Dec 13, 2008 12:06 am

Does this hack work for 1.5?

Just checking, and am about to dive in and try ;-)

tianrurieza
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jan 21, 2009 2:19 am

Re: Multiple Sites - Sharing Several common tables

Post by tianrurieza » Wed Jan 21, 2009 4:37 am

mmmh . well . do you have all sample files . i really want to follow this , but i'm still confused . :(

webbyhull
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Mon Jun 04, 2007 2:29 pm

Re: Multiple Sites - Sharing Several common tables

Post by webbyhull » Thu Jan 22, 2009 2:10 pm

hi there

will this work with joomla 1.5 ?

sprinteroz
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Feb 14, 2009 2:11 am

Re: Multiple Sites - Sharing Several common tables

Post by sprinteroz » Tue Feb 17, 2009 2:15 pm

Hi after reading a lot on the net its hard to tell is the stuff you are reading is for J! 1.0 or J! 1.5

I come across this post and seen all the questions about if this is for 1.5 I believe it would not be as the original post date was 2006 (but 1.5 might have been out back then). Also note i'm only new to joomla about 2 weeks and I have built 2 templates into 1 template manually but found i need to have more User modules as joomla 1.5 only gos up to user9 and i also need to find a hack to make a 2nd left module and a 2nd right module and banner 2 module as if i add the normal modules names (left right)to the 2nd template it just clones the top as it reading left and right module and not left2 and right2 module.

But once I found this post it got me thinking, I have been going about this all the wrong way i'm trying to use this template like the old html and php template and joomla just dose not work like this unless you know how to hack the core or make modules and i'm no where near that good at coding but i'm learning and i'm also starting to like the code structure and beginning to understand it alot more.

Well to save all the hair pulling I looked around for a few hours on search engines looking for a module that will do this, and wow yes I finally found one that should let you do this function in 1.5 but it costs.

Hope this helps you out.

Joomla Multi Sites
Ps. EDIT oops forgot to place the link. http://extensions.joomla.org/extensions ... 50/details

here is a link to the documents if you want to read more on it.

Joomla Multi Sites Documents
http://www.jms2win.com/documentation


Locked

Return to “Core Hacks and Patches”