16
BoDGie
Re:TRUE Multisites hack.... at last!
  • 2004/10/6 6:00

  • BoDGie

  • Just popping in

  • Posts: 65

  • Since: 2003/8/4 1


Hi guys,

I created the original SubSite module - I relise it's quite outdated at the moment and is missing some much needed features.

Expect an update in the near future :)

15
intel352
Re:TRUE Multisites hack.... at last!
  • 2004/10/5 22:17

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


just a note: i've created a working multi-site modification of my own, based on XOOPS 2.0.7.3

this is a full modification, multiple files are affected.

you install the site from scratch, and are given the option to define the prefix for shared tables (default is 'xoops_all'), and define the unshared table prefix (default is 'xoops' like usual)


the tables that will be shared, are defined manually in mainfile.php, several are defined by default. installation commences, and all tables defined in mainfile.php are given the share prefix.

to create a second site, you clone all the 'xoops' prefixed tables, and reinsert them as 'xoops2' or something similar, copy the mainfile.php and define the new prefix (and site location, etc)

it works well, but is a bit of a manual process. i'm currently working on modifying the install procedure a bit further, so that if shared tables are detected as existing, it won't halt the install procedure (so, you can just install XOOPS like normal, with that modification)

i'm also considering implementing something to allow administrative control over which modules/module tables get shared as well. (this can be done now, but requires adding the table names to mainfile.php)

by default, groups, ranks, smilies, users, and a few others, are shared, which meets my needs, but i'd like to make this a more fluid process before releasing any files to the public

14
LazyBadger
Re: TRUE Multisites hack.... at last!

Sorry, I can be "terrible infant", but... Why not use existing module??? It works if all sites share commmon database (now only this way). It has admin-interface in which admin decide, which tables to share (or UNshare) between sites. and - it works

subsite module - with hacked class database.php (from April, but may work even now)

13
m0nty
Re: TRUE Multisites hack.... at last!
  • 2004/9/30 22:14

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


ok, if i understand this right?

i am currently designing a new site, but each site will cater for different countries..

they are to be hosted on the same server, with the same database

so i have:

server_home/uk XOOPS site 1 install
server_home/us xoops_site 2 install
server_home/ca xoops_site 3 install

each country will have it's own XOOPS installation in a folder as above

all 3 sites share the same database.. (maybe each will if pos have it's own database, but for now in designing it i am only using 1 database)

site1 (uk) has the prefix on all tables of 'uksite'
site2 (us) has the prefix of 'ussite'
site3 (ca) has the prefix of 'casite'

and so on....

so what i want basically is all 3 sites to share the user tables, and all relevant tables.

BUT, each site will have unique content to that site in various modules.. ie the news module and sections etc..

i want the forum and mylinks, and downloads modules to be shared so each site will see exactly the same..

it's only certain modules that need to have unique data specific to each country.. so i don't want uk news showin on the us site.. but all 3 sites should basically be using the exact same downloads, forum and links modules..

if i've confused you let me know and i'll try to explain more..

what i want to know is, would this hack allow me to do this???

ie i can tell database.php that for the news module it would use default site prefix..

but then tell each site that the forum is to use for example: uksite prefix for all sites (so everything goes into those tables..)

12
intel352
Re: TRUE Multisites hack.... at last!
  • 2004/6/28 3:28

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


what i would like to see, is a way to share module table data, but i wouldn't want someone to uninstall a module on one of the sites for some reason, and it wipe out all the sql data... that would really blow, lol

11
reynaldo
Re: TRUE Multisites hack.... at last!
  • 2004/2/23 19:41

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


I would like to add....
you have to be careful what tables you share among sites.

For example, you can share users,topics,groups, groups_users_links, but you SHOULDN'T share group_permissions or each time you make changes to a group permissions in one site, it would extend to the others.

You may think this is cool, but think about it:

Site 1: Modules A, B and C installed.
Site 2: Modules A, D, and F installed.

Each time you set permissions in Site 1, it would set permissions to module A in Site 2, but it would leave unaccessible modules D and F.

If you still don't get it, just try it and you will understand it inmediately,

10
reynaldo
Re: TRUE Multisites hack.... at last!
  • 2004/2/23 19:31

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Quote:

basby wrote:
What happens if there is a new XOOPS version. How to update your Xoops? In fact you need to chane more than one xoops-es,

Any ieas on that?


Basby:
I'm using it with several domains, each one of them having their installation of Xoops. That's my setup, but as you can see from previous posts, you can modify the mainfile.php to run more than one XOOPS site from the same directory.

Anyway, if you have all your sites running from the same XOOPS installation, you would only have to upgrade one site and all of them would be automatically upgraded, *unless* a new version of XOOPS brings updates to the DB, in that case you would have to reinstall XOOPS to each one of the domains even if they all use the same dir.

That is the main reason why I wouldnt like to run lots of XOOPS sites from the same dir. I don't know, it would make me nervous knowing that if something goes wrong, all my sites would be down at once. And of course I would have to upgrade every site anyway after any major XOOPS release. Just my opinion and my 2 cents

9
basby
Re: TRUE Multisites hack.... at last!
  • 2004/2/23 17:57

  • basby

  • Not too shy to talk

  • Posts: 109

  • Since: 2003/1/28


What happens if there is a new XOOPS version. How to update your Xoops? In fact you need to chane more than one xoops-es,

Any ieas on that?

8
apleks
Re: TRUE Multisites hack.... at last!
  • 2004/2/23 14:01

  • apleks

  • Just popping in

  • Posts: 2

  • Since: 2004/2/4 2


Ok, I tried this and at first sight it works, I can share whatever table I want, that was a simple hack, though, very effective for me now!

Anyone has found the caveats yet ? Is there any except the fact that this is not configurable via the XOOPS Admin interface ?

7
reynaldo
Re: TRUE Multisites hack.... at last!
  • 2004/2/20 5:35

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


It's interesting we arrived at the same solution with different code

My code is just a little different from yours:

Database.php:
function prefix($tablename='')
{
    
$myCommonTables = array('avatar''avatar_user_link''online''priv_msgs''stories''topics''users');
    
$myPrefix '';
    
    if (
in_array($tablename,$myCommonTables))
    {
        
$myPrefix 'xoops';
    }
    else 
$myPrefix $this->prefix;


    if ( 
$tablename != '' 
    {
        return 
$myPrefix .'_'$tablename;
    } 
    else 
    {
        return 
$myPrefix;
    }
}


As I don't use the same files with different domains/subdomains I didn't have to include the mainfile.php modification.

Login

Who's Online

152 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 152


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