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,

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

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..)

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)

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

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 :)

17
sgshell
Re:TRUE Multisites hack.... at last!
  • 2004/10/7 2:25

  • sgshell

  • Just popping in

  • Posts: 94

  • Since: 2004/10/4


Quote:

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


Hi, sorry i was confuse with above code for sharing file. Could someone explain abit more detail how it work?

If I have
A domain = >>> www.Adomain.com <<< main
B Domain = >>> www.Bdomain.com <<<like to use the file in www.Adomin.com

What are the file needed to change in Adomain and B domain to get it work?

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

  • BoDGie

  • Just popping in

  • Posts: 65

  • Since: 2003/8/4 1


That code will allow you to run several websites off the one install.. all with seperate databases etc.....

Basically the way it works is if you type www.domainA.com it will remove the www and the .com and then assign that to $subdominio the code will then instruct XOOPS to include the file called domainA.mainfile.php

If you do www.domainB.com it will include domainB.mainfile.php

You setup a seperate mainfile for each domain you wish to use..

19
sgshell
Re:TRUE Multisites hack.... at last!
  • 2004/10/7 11:04

  • sgshell

  • Just popping in

  • Posts: 94

  • Since: 2004/10/4


Quote:

BoDGie wrote:
That code will allow you to run several websites off the one install.. all with seperate databases etc.....

Basically the way it works is if you type www.domainA.com it will remove the www and the .com and then assign that to $subdominio the code will then instruct XOOPS to include the file called domainA.mainfile.php

If you do www.domainB.com it will include domainB.mainfile.php

You setup a seperate mainfile for each domain you wish to use..


Thanks....

I assume that
i need to create Bdomain.mainfile.php <==is this file going to be install in Adomain or Bdomain?


And what exact file needed for Bdomain?

20
intel352
Re:TRUE Multisites hack.... at last!
  • 2004/10/7 11:30

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


i believe for the method they are referring to here, you must have all php files stored in one place (a single XOOPS install)

Login

Who's Online

228 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 228


more...

Donat-O-Meter

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

Latest GitHub Commits