11
krewl
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/26 3:37

  • krewl

  • Just popping in

  • Posts: 39

  • Since: 2006/3/14


I tried installing the Multix module and hack... Not sure if it is what I need, seems that should be implemented when you start your site.. I already have the main site up and running, this module requires that i change the first site. I would rather just call the user table from the first sites database and then the second site can have its own modules seperate from the first. Probably not possible.
-------------------
http://www.illinoisbmx.com

12
nekro
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/26 4:20

  • nekro

  • Quite a regular

  • Posts: 213

  • Since: 2005/11/9


Is not needed to have a fresh install to use MultiX

Make a backup of your site (all the files) for security ... follow the steps (tomorrow will be the english translation of the howto) to install multix... and then install the module Multix... the module will do the work of sharing the tables ... you will have all the files for both sites in the same directory, the module also administrates the modules and teams for each site, it donts care if they are in the same directory... the hack will make a module able or disable to be installed.

In other way, Skalpa had send to me ... a "trick" to share tables .. using MySQL 5 ... but i ve not tested it yet.

Send me a PM with your e-mail and i will send you the way to do it, ofcourse check first that you are usinf MySQL 5.


Luck!

13
krewl
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/27 3:28

  • krewl

  • Just popping in

  • Posts: 39

  • Since: 2006/3/14


Sent you a PM, I can't figure out the multisite or multix... The "trick" is next.
-------------------
http://www.illinoisbmx.com

14
nekro
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/27 4:49

  • nekro

  • Quite a regular

  • Posts: 213

  • Since: 2005/11/9


I ve sent you the email.

15
skalpa
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/27 5:12

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16


Quote:
I already have the main site up and running, this module requires that i change the first site. I would rather just call the user table from the first sites database and then the second site can have its own modules seperate from the first. Probably not possible.


Well, that's exactly what the system I described to nekro does. And to correct him: it doesn't require MySQL 5... it uses the MySQL MERGE storage engine which has been introduced in MySQL 3.23.25.

Here's how to use it:
- Install the 1st site, using the DB prefix "site1"
- Install the 2nd site, using the DB prefix "site2"
- Use phpMyAdmin to execute the following queries

DROP TABLE site2_groups;
CREATE TABLE site2_groups (
  
groupid smallint(5unsigned NOT NULL auto_increment,
  
name varchar(50NOT NULL default '',
  
description text NOT NULL,
  
group_type varchar(10NOT NULL default '',
  
KEY groupid (groupid),
  
KEY group_type (group_type)
TYPE=MERGE UNION=(site1_groupsINSERT_METHOD=FIRST;

DROP TABLE site2_groups_users_link;
CREATE TABLE site2_groups_users_link (
  
linkid mediumint(8unsigned NOT NULL auto_increment,
  
groupid smallint(5unsigned NOT NULL default '0',
  
uid mediumint(8unsigned NOT NULL default '0',
  
KEY linkid (linkid),
  
KEY groupid_uid (groupid,uid)
TYPE=MERGE UNION=(site1_groups_users_linkINSERT_METHOD=FIRST;

DROP TABLE site2_users;
CREATE TABLE site2_users (
  
uid mediumint(8unsigned NOT NULL auto_increment,
  
name varchar(60NOT NULL default '',
  
uname varchar(25NOT NULL default '',
  
email varchar(60NOT NULL default '',
  
url varchar(100NOT NULL default '',
  
user_avatar varchar(30NOT NULL default 'blank.gif',
  
user_regdate int(10unsigned NOT NULL default '0',
  
user_icq varchar(15NOT NULL default '',
  
user_from varchar(100NOT NULL default '',
  
user_sig tinytext NOT NULL,
  
user_viewemail tinyint(1unsigned NOT NULL default '0',
  
actkey varchar(8NOT NULL default '',
  
user_aim varchar(18NOT NULL default '',
  
user_yim varchar(25NOT NULL default '',
  
user_msnm varchar(100NOT NULL default '',
  
pass varchar(32NOT NULL default '',
  
posts mediumint(8unsigned NOT NULL default '0',
  
attachsig tinyint(1unsigned NOT NULL default '0',
  
rank smallint(5unsigned NOT NULL default '0',
  
level tinyint(3unsigned NOT NULL default '1',
  
theme varchar(100NOT NULL default '',
  
timezone_offset float(3,1NOT NULL default '0.0',
  
last_login int(10unsigned NOT NULL default '0',
  
umode varchar(10NOT NULL default '',
  
uorder tinyint(1unsigned NOT NULL default '0',
  
notify_method tinyint(1NOT NULL default '1',
  
notify_mode tinyint(1NOT NULL default '0',
  
user_occ varchar(100NOT NULL default '',
  
bio tinytext NOT NULL,
  
user_intrest varchar(150NOT NULL default '',
  
user_mailok tinyint(1unsigned NOT NULL default '1',
  
PRIMARY KEY  (uid),
  
KEY uname (uname),
  
KEY email (email),
  
KEY uiduname (uid,uname),
  
KEY unamepass (uname,pass)
TYPE=MERGE UNION=(site1_usersINSERT_METHOD=FIRST;


(if you didn't use site1/site2 when installing, edit the queries)

This will delete the site2 users/groups tables, and create "virtual" ones that point to the equivalent site1 tables. So, in the facts there is only 1 list of users/groups that is used by both sites.

There's no need to hack anything, and if the users table format is modified in a future version, there will be no problem to upgrade... just ensure you upgrade "site1" first, and the subsites after.

PS: I just wrote the queries while posting this, so make a backup of these 3 tables before trying, there might be a typo in the SQL... you never now.
PS2: If you have control over your MySQL permissions, you can even change the queries to have the site2 tables point to tables in another database, by replacing "site1_xxx" by "thesite1db.site1_xxx". Just ensure the MySQL user used by subsites have access to the users/groups/users_groups_link tables of the main site database.
PS3: If you don't understand PS2, forget about it... Just install all site using the same database/user/pwd, and use different prefixes.
Any intelligent fool can make things bigger, and more complex. It takes a touch of genius, a lot of courage, to move in the opposite direction.
Two things are infinite: the universe and human stupidity; and I'm not sure about the 1st one (A.Einstein)

16
krewl
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/27 15:56

  • krewl

  • Just popping in

  • Posts: 39

  • Since: 2006/3/14


Thanks. I attempted it... I have errors all are the same. Here is one:
Quote:
#1017 - Can't find file: 'xoops2_groups_users_link.MRG' (errno: 2)

Its related to parts or all of the table not being MyISAM. With the TYPE being merge for the second databse, not sure where to look. Would this be the first databse (xoops) or the second (xoops2) in my case? I tried changing the TYPE=MERGE to ENGINE=MERGE, same. Look more into it after work tonight.
-------------------
http://www.illinoisbmx.com

17
krewl
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/28 3:36

  • krewl

  • Just popping in

  • Posts: 39

  • Since: 2006/3/14


Got it. I had to export the users table, to make sure sure tables were identical and at the final instructions added this...
Quote:
TYPE= MyISAM ENGINE=MERGE UNION=(db1.tablename) INSERT_METHOD=FIRST;


Thanks for the help.
-------------------
http://www.illinoisbmx.com

18
nekro
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/28 15:22

  • nekro

  • Quite a regular

  • Posts: 213

  • Since: 2005/11/9


I also done it like skalpa explain but i had the same problems than krewl so i follow his/her steps and now is working perfectly.
I made a FAQ for the community.

19
davidl2
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/28 15:24

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Thank you

(btw - I think... but i'm not sure.. that Skalpa's a man ... mind you... there's still confusion if Ono is a man or lady )

20
banned
Re: MultiSite Hack for Xoops 2.0.13.2
  • 2006/10/28 16:02

  • banned

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/5/16


Within MySQL 5 you can also use the federated storage engine http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html

banned,

Login

Who's Online

342 user(s) are online (276 user(s) are browsing Support Forums)


Members: 0


Guests: 342


more...

Donat-O-Meter

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

Latest GitHub Commits