1
attock
two xoops on one database?
  • 2007/3/6 6:12

  • attock

  • Not too shy to talk

  • Posts: 138

  • Since: 2006/8/20


Scenario

I have to build a community website, and I already have one running. So lets say I have a running website A and the new website will be B.

I can launch B in the following ways:

1) Download and install a fresh copy with a new database. In this case ill have 2 databases.

2) Install a fresh copy with a new database, but update the xoops_users table of site A. This way I ll have all the users of site A and B on site A's database. However site B database will have only users registered on site B.

3) Dont install any thing, but do sutmhing like if the referred website is site A, then show launch\display modules for site A, if the ref. site is B launch\display for that.


Now I have the follwing questions

For 2nd option, i ll have to hack register.php. I was lookin for the line where it enteres data in xoops_users, but I wasnt able to find it. If i know in what file is it, I can hack the code to meet my needs.

I like 3rd option, I can include a website_assign.php in my theme.html. In website_assign.php i'll have the followings:

if ref site A, tpl->assign 'title' Site A
assign --> 'menu2' news
assign --> 'menu1' blog

else tpl->assign 'title' Site B
assign ---> menu whateva

etc etc..

I am good with assigning menus, as I have disabled them (uers menu). I am using customized menus using <{menu1}> in my theme.html file using smarty tags.


Final Question

- What would you recommend.
- Are number 2 and 3 doable?

2
eric235u
Re: two xoops on one database?
  • 2007/3/6 15:47

  • eric235u

  • Not too shy to talk

  • Posts: 149

  • Since: 2004/12/19


hi. i'm slightly confused by your question but hopfully this may be of assistance.

do you want both sites to have the same users? such as if somebody registers on site A they automatically are registered on site B? And if somebody registers on site B they are automatically registered on site A? i'm not sure on how to do this as several tables are effected by membership. i guess we would have to find all tables effected by membership and update those. you could set up a new site, export database to text, add a new member, export database to text, find differences. but a XOOPS developer may already have this answer already and save you some work.

i have two XOOPS sites on a single server. each XOOPS site uses a different database. each XOOPS site is in a different directory. each XOOPS site has seperate members. everything works. so running two XOOPS sites on a single host is not a problem.

good luck and let us know what you end up doing.

3
Quest
Re: two xoops on one database?
  • 2007/3/6 18:09

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


You may be able to find what you need from this search:

https://xoops.org/search.php?query=xoops+sites+sharing+same+database&action=results

HTHs
Quest

4
JMorris
Re: two xoops on one database?
  • 2007/3/7 1:35

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


attock,

What you are describing sounds like the multi-site hack. You can find out more from the search results mentioned above.

Unfortunately, there is no "ready made" multi-site hack for XOOPS 2.0.16. Multi-Site functionality is planed for the core, but not anytime soon.

With your requirements, you basically have 3 options:

1. Study the old multi-site hack and make a new version based on that.
2. Create a cron job that runs every so often (10 minutes) that syncronizes the necessary tables to allow for sign-on on both sites.
3. Use MySQL 5 which allows for table sharing across databases.

There are other options, of course, but I don't recommend them for 2 reasons.

1. You don't want to use out-dated, insecure code.
2. You don't want to be in a situation where you have to rely (and possible have to pay) on someone else to keep your site up to date.

HTH.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

5
attock
Re: two xoops on one database?
  • 2007/3/14 21:28

  • attock

  • Not too shy to talk

  • Posts: 138

  • Since: 2006/8/20


I finally decided to go with a fresh installment

Login

Who's Online

248 user(s) are online (161 user(s) are browsing Support Forums)


Members: 0


Guests: 248


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