36
adrock
Multisites hack help....
  • 2005/3/1 16:56

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


Does anyone that has the Multisite 'hack' working;
specifically seperate sites with seperate content sharing user tables, willing to post some instructions for those of us that are not very familiar with PHP?

I've tried all of the suggestions and only get errors and blank pages, and think that I am incorrectly editing the database.php file.

help! please....

Thanks!

**bump**

35
adrock
Re: TRUE Multisites hack.... at last!
  • 2005/3/1 0:39

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


Quote:

I've tried all of the suggestions and only get errors and blank pages, and think that I am incorrectly editing the database.php file.


reynaldos edits return this (for me):
Quote:

Parse error: parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/user/public_html/test1/class/database/database.php on line 134


Mikhails edits return this (for me):
Quote:

error.


...think my foreheads getting a bruise from bangin it.

34
adrock
Re: TRUE Multisites hack.... at last!
  • 2005/2/28 23:39

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


Does anyone that has the Multisite 'hack' working;
specifically seperate sites with seperate content sharing user tables, willing to post some instructions for those of us that are not very familiar with PHP?

I've tried all of the suggestions and only get errors and blank pages, and think that I am incorrectly editing the database.php file.

help! please....

Thanks!

33
fooups
Re: TRUE Multisites hack.... at last!
  • 2005/1/31 21:18

  • fooups

  • Just popping in

  • Posts: 82

  • Since: 2004/1/12


Hi,

Quote:

jorgebarrero wrote:
It woul be nice to develop a way so that it was possible to install the same module several times in the same site and each one could have a separate set of tables.


That's what we mean by "cloning" modules: changing names and module's prefix tables in order to install a module several times.

Quote:
develop the ability to set a different theme to a particular module. So you could change info on the fly and may be it is not needed to make many copies of the same site.


Take a look at this site for a demo. I don't know if the webmaster made a tutorial to explain how he did this (shame on me )

Happy Xoopsing

32
jorgebarrero
Re: TRUE Multisites hack.... at last!

It woul be nice to develop a way so that it was possible to install the same module several times in the same site and each one could have a separate set of tables.

Even better,

develop the ability to set a different theme to a particular module. So you could change info on the fly and may be it is not needed to make many copies of the same site.

31
blackout
Re: TRUE Multisites hack.... at last!
  • 2005/1/31 20:38

  • blackout

  • Just popping in

  • Posts: 1

  • Since: 2005/1/31


Quote:

reynaldo wrote:

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;
    }
}



hi, do *all* the tables pass through this function? i mean also third part modules functions etc..
it could be great if i can unshare forum, downloads, galleries too

30
BoDGie
Re:TRUE Multisites hack.... at last!
  • 2004/10/22 4:29

  • BoDGie

  • Just popping in

  • Posts: 65

  • Since: 2003/8/4 1


Ok.... Here's how you do it.

Say you have /home/mywebsite/public_html/
Upload your XOOPS installation there and install it, etc.
Make a copy of your mainfile.php and rename it to ABC.mainfile.php
Edit mainfile.php to have the modified code.
Point www.ABC.com to /home/mywebsite/public_html/

Basically when you goto www.ABC.com it will first goto read mainfile.php but mainfile.php has code in it to grab the domain name ABC and then direct it to ABC.mainfile.php

Next make a copy of the database and the ABC.mainfile.php but call it DEF.mainfile.php
Edit DEF.mainfile.php with the new database information.
Point www.DEF.com to /home/mywebsite/public_html/

Now when you goto www.DEF.com it will grab the information from DEF.mainfile.php

For every other site you want running of the same install just make a new copy of the database and a new mainfile.php to match it.

29
sgshell
Re:TRUE Multisites hack.... at last!
  • 2004/10/22 3:20

  • sgshell

  • Just popping in

  • Posts: 94

  • Since: 2004/10/4


i understand on the part of share database, as i have create for mutiple phpnuke site share same user database before...and i think XOOPS have a better, advance and easy solution on sharing database compare to phpnuke.

The only part confuse me....is the part on sharing of FILE which only "ABC" site have it and the "DEF" site have nothing but using the FILE(not database)of "ABC"?

If i surf to "DEF" , don't "DEF" need a index file??? it can't work for just having a mainfile.php in it....

Is it i have to do is to put the "index.php" and the modify "mainfile.php" in "DEF"???

28
BoDGie
Re:TRUE Multisites hack.... at last!
  • 2004/10/22 1:50

  • BoDGie

  • Just popping in

  • Posts: 65

  • Since: 2003/8/4 1


Yeah all depends on what tables you share... Some can get confused on file locations or group permissions - but most things if done right will work with no problems.

27
reynaldo
Re:TRUE Multisites hack.... at last!
  • 2004/10/17 18:02

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


I have about 10 sites running on XOOPS with independent databases and files and sharing just a few tables.

The way I did it was with a simple modification to the database.php file. Also the hack can be turned on/off editing a line at mainfile.php

I never had any problems caused by sharing tables.

Login

Who's Online

156 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 156


more...

Donat-O-Meter

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

Latest GitHub Commits