1
JMorris
Hacking XOSC
  • 2004/6/7 5:18

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


There didn't seem to be a forum that this would fit under, so I figured the Q&A forum was the most fitting.

After searching the ends of the 'net to try to find a *clean* way of sharing user info between XOOPS and XOSC (osCommerce module), I've come to the conclusion that without editing the XOSC core files to share the same _user table as Xoops, it just isn't going to happen.

Originally, I thought that it would be possible to setup a script that performed a join function on xoops_users and xoops_shop_customers, but there is no primary key shared between the two tables, and I didn't see another way of doing it.

This leads me to the following questions...

1. Is there a verified functioning hack available for this module? (I've been looking for days and haven't seen the first sign of one.)

If not.....

2. I've already read plenty about the reason why this modification has not been implemented into the module (it would create problems with future upgrades of Xoops). That's understandable to an extent. However, it stands to reason that, as long as XOOPS doesn't change its user table name, the tables affecting XOSC could be reconstructed from backup after upgrade. Are there any other reasons why someone *shouldn't* perform this hack?

3. Shared user info seems to be an issue for the XOSC module, but not for the IPB module. Why is it issue for one and not the other?

4. I've done a little hacking on modules before, but nothing quite this large. Is there anyone who would want to help me with this hack?

5. If a successful hack can be put together, is there anyone who would want to beta test it?

Just seems like there is an aweful large group of people posting on several sites about the ability of XOOPS and XOSC to share user data. Seems kinda strange that some kind of workaround hasn't been developed yet. Or am I missing something?

Thanks for any replies.

Best Regards,

JMorris

2
JMorris
Re: Hacking XOSC
  • 2004/6/7 16:37

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


::bump::

Sorry, but this is something I'm really interested in doing.

I'm not looking for anyone to do it for me. I'm trying to find out if there are any good reasons why I shouldn't do it. I'm not the least bit afraid of tackling a challenge. I like challenges.

Anybody got anything?
Reasons?
Warnings?
Suggestions?
Probability?
Volunteers for teting?

3
intel352
Re: Hacking XOSC
  • 2004/6/7 20:06

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


search out a post by tom, i know he had hired a developer to work on a properly linked user table, or something like that.

seems it should be possible, btw. if you wanted to do a join, you can join in sql, using a LEFT JOIN statement. shouldn't be too hard to find/replace all the user table references

4
JMorris
Re: Hacking XOSC
  • 2004/6/7 20:17

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Thanks for the reply.

Wouldn't a Left Join require a primary key? The two tables share no common fields. I agree that this would be the prefered method vs. altering core files.

I was considering doing a mod based on what was done with the IPB module. It appends its fields into xoops_users.

5
intel352
Re: Hacking XOSC
  • 2004/6/7 20:29

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


if i were you, i wouldn't touch the xoops_users table, try to keep the xosc unique data separate.

left join example from a non-xoops script (but it can be used in xoops):
SELECT d.groupidt.uid
        FROM nuke_users_groups_users d LEFT JOIN xoops_users t ON t
.uid=d.uid



you just specify what field to join on, doesn't matter if it's primary or not

6
JMorris
Re: Hacking XOSC
  • 2004/6/7 20:41

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Oooohh! That simplifies things a bit. Thanks!

Not sharing a table does create another problem though... Since MySQL doesn't support triggers (at this point), how would I go about making sure that the two tables are synchronized automatically? I've considered loops and cron jobs, but I'm concerned about server overhead.

7
intel352
Re: Hacking XOSC
  • 2004/6/7 21:14

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


if you're up to going through xosc and modifying all the sql, i would suggestion doing something like this:

UPDATE xosc_table dxoops_table t
SET d
.column_name new_valuet.another_column_name another_new_value
WHERE d
.column_name t.a_similar_column


or try

UPDATE xosc_table d LEFT JOIN xoops_table t ON d.similar_column1 t.similar_column2
SET d
.column_name new_valuet.another_column_name another_new_value
WHERE d
.column_name t.a_similar_column



one of those statements might work. i'm not sure, i haven't used 'update' with a left join before, but those statements look like they make sense, according to the MySQL manual...


btw, if you go to all the trouble to edit the sql calls, i'd recommend also altering the xosc table, to get rid of it's duplicated data columns (the columns that can just be referenced in xoops_users)


oh yeah, and the WHERE statement isn't necessary, just part of an example

8
tom
Re: Hacking XOSC
  • 2004/6/7 21:23

  • tom

  • Friend of XOOPS

  • Posts: 1359

  • Since: 2002/9/21


Thanks for the mention bd_CSMC lol, yeah I am paying for development of a subscription module with OSCommerce intergrated, however there is no set date as yet.

You may wish to look on the brandycoke.com site, they have made a bridge I believe:

http://www.brandycoke.com/about/our_work/djcomtw.php

Tuff from BrandyCoke is currently working one a couple of projects for me, I would highly recommend him should anyone have a budget.

For those who don't know BrandyCoke - Tuff, he developed the Liase module and a few others (Shoops)

Hope this is of some help.

9
intel352
Re: Hacking XOSC
  • 2004/6/7 21:26

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


i wish Emporium was gpl, i have access to it, but it'd be nice for it to be free so we could easily port it to XOOPS for the masses. it's an excellent shop, not totally feature-complete yet (compared to a been-here-forever shop like OSC), but pretty dang close.

10
JMorris
Re: Hacking XOSC
  • 2004/6/8 1:31

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Thanks guys. This will give me a good starter point on where to focus my research. Prior to your help, I was just reading through page after page after.... of the MySQL and php manuals and posts on several forums. It wasn't getting me anywhere.

As far as a paid programer goes...

I'm working on an double major in college, Network Administration and Software Engineering. I tend to want to learn vs. pay someone else to do it. Learning is good.


Login

Who's Online

191 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 191


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