41
aharon
Re: TRUE Multisites hack.... at last!
  • 2005/6/15 17:50

  • aharon

  • Not too shy to talk

  • Posts: 172

  • Since: 2004/9/17


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




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

42
m0nty
Re: TRUE Multisites hack.... at last!
  • 2005/6/15 18:56

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


if you do a search for multisites i'm pretty certain you'll find a 2.0.9.3 and a 2.0.10 version done by mithrandir..

43
Mikhail
Re: TRUE Multisites hack.... at last!
  • 2005/6/15 19:02

  • Mikhail

  • Just can't stay away

  • Posts: 412

  • Since: 2003/1/19


yes, 'IS JUST AN EXPERIMENTAL HACK, NOT THE BEST WAY TO DO A XOOPS MULTISITE'. Look for another solutions from real developers, like Mithrandir.


And thanks for your comment about

44
aharon
Re: TRUE Multisites hack.... at last!
  • 2005/6/15 19:48

  • aharon

  • Not too shy to talk

  • Posts: 172

  • Since: 2004/9/17


Yes.. I have seen this one - but it seems f a r more complicated than the solution in this thread...

Hummm... Maybe I should get on with it and see how to change things with version 2.2...

Best wishes!

Aharon

45
izzzy
Re: TRUE Multisites hack.... at last!
  • 2005/6/17 15:39

  • izzzy

  • Just popping in

  • Posts: 43

  • Since: 2004/5/27


Hi aharon!

We are carrying through tests with multisite to integrate some sectors of the XOOPS Brasil Community in the addresshttp://multisite.xoops.net.br

I am using hack of the Mithrandir.

Thanks,
Izzy

46
monster
Re: TRUE Multisites hack.... at last!
  • 2005/11/29 13:01

  • monster

  • Just popping in

  • Posts: 58

  • Since: 2004/12/28



Login

Who's Online

145 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 145


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