6
Mikhail
Re: TRUE Multisites hack.... at last!
  • 2004/2/15 13:19

  • Mikhail

  • Just can't stay away

  • Posts: 412

  • Since: 2003/1/19


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:
<?php
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");
}
?>



5
Herko
Re: TRUE Multisites hack.... at last!
  • 2004/2/15 12:00

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Can you send me the code changes please? I'll have our developers take a look at them

Herko

4
davidl2
Re: TRUE Multisites hack.... at last!
  • 2004/2/15 11:56

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


This is very exciting indeed!

I have actually recently done this by accident - using 1 database across two sites... except only with the same information on each (I accidently left a database pointing to the same location on both sites!)


3
reynaldo
Re: TRUE Multisites hack.... at last!
  • 2004/2/15 7:11

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Quote:
im running 5 diferent sites with the same users, same files, sabe db, diferent subdomains,... is easy: just edit some lines in "mainfile.php" and "database.php"...


Mikhail:

Those are specifically the two files I had to edit :)

Would you mind posting which lines you have to add/modify in order to get it to work, or the url where you found the info?

I decided to do this hack myself as I couldn't find any resource explaining this.

2
Mikhail
Re: TRUE Multisites hack.... at last!
  • 2004/2/15 7:00

  • Mikhail

  • Just can't stay away

  • Posts: 412

  • Since: 2003/1/19


Quote:

reynaldo wrote:
I'm working on a TRUE multisites hack for Xoops.
Currently I'm testing it on my sites to make sure it is error free before releasing it.

What I mean for "TRUE" is that you are able to share only those tables you want to share, you no longer have the share all/none situation.

This hack is so simple yet so powerful you only have to edit two files to make it work.

Keep checking and post any ideas you may have, I'll post the download link as soon as I'm sure everything is working as expected.


im running 5 diferent sites with the same users, same files, sabe db, diferent subdomains,... is easy: just edit some lines in "mainfile.php" and "database.php"...

Quote:

Now some keywords to make sure everybody looking for multisites help get to this post, LOL:
[size=xx-small]multisites, multi sites, multisite, multi site, multi-sites, multi-site, multiple site, multiple sites.[/size]

[/quote]


1
reynaldo
TRUE Multisites hack.... at last!
  • 2004/2/15 6:47

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


I'm working on a TRUE multisites hack for Xoops.
Currently I'm testing it on my sites to make sure it is error free before releasing it.

What I mean for "TRUE" is that you are able to share only those tables you want to share, you no longer have the share all/none situation.

This hack is so simple yet so powerful you only have to edit two files to make it work.

Keep checking and post any ideas you may have, I'll post the download link as soon as I'm sure everything is working as expected.

Now some keywords to make sure everybody looking for multisites help get to this post, LOL:
[size=xx-small]multisites, multi sites, multisite, multi site, multi-sites, multi-site, multiple site, multiple sites.[/size]

Login

Who's Online

173 user(s) are online (113 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits