UBB.Dev
Mod Name / Version: Mambo UBB.threads Integration 1.0beta1

Description: UBB.threads Integration is a package that allows you to run both Mambo Open Source 4.5 and UBB.threads 6.4 from the same user database. Users logged in to one system are also logged in to the other. It is also possible to comment on articles directly into the forum system, all or only selected content get their own threads when commented on.

Working Under: UBB.Threads 6.4

Mod Status: Beta

Any pre-requisites: Mambo Open Source 4.5 1.0.8

Author(s): Gardener

Date: 06/17/04

Credits: chillin for some early code, all those who donated money tó get this done

Files Altered: addpost.php, login.php, logout.php, newuser.php

New Files: mambointegration.php + a whole lot of files for Mambo.

Database Altered: None

Info/Instructions: Please read the instructions carefully before trying this out.

The Mambo Component containing all that is need for this integration can be downloaded from my site.

There are changes needed to both Mambo and UBB.threads for this to work properly. I've tried to keep it to a minimum, and to make the changes easy to do to make it as easy as possible to install.

Features:
  • Total user database integration between Mambo and UBB.threads.
  • Article comment system that makes use of all UBB.threads posting features.
  • Search Engine Friendly links for all Mambo parts.
  • All language strings are separated into a language file for easy translation.
  • Templates and CSS to easily change appearence of article comments and comment form.
  • Automatic installation - When installing the component, as much as possible is automatically installed for you.
  • Easily change the configuration via the administrator.
  • Several modules available: Forum list, Private Messages, Latest Threads, Forum menu, Statistics
  • Merge user databases if you already run Mambo or UBB.threads, or both.
  • Some modules that use heavy MySQL queries caches information to disk to ease server load.



Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Looking forward to playing with this.
What exactly is Mambo?

Thanks for Info
Mambo Open Source is a CMS (Content Management System) that allows you to build an entire website very easily. It is very easy to install and setup and has very low requirements (standard PHP and MySQL installations) and allows you to easily change appearence and functionality. Extra features, templates, language files etc are added by simply uploading zip files in the administration interface.

Mambos official homepage: http://www.mamboserver.com
Mambos official development repository: http://mosforge.net
Mambo news and articles: http://www.mamboportal.com
Mambo community: http://www.mambers.com

Mambo can be used for building everything on your website, it even has several forum systems developed especially for it. It also has integration ability with phpBB and now UBB.threads, with vBulletin possibly on its way.

Other available components: Gallery, Guestbook, User blogs, Java IRC, Games, Link systems, Classifieds and much more.
any links to an actual site running w/ threads?

what about 6.5?

Why does the log in/out use the Mambo instead of threads?

Is there a fix for safari? The popup menus don't work w/ safari.
[]any links to an actual site running w/ threads?[/]

http://www.spelwebben.se

But it is in Swedish unfortunately. There might be an English one opening soon, I'll ask if I can post the link to it.

[]what about 6.5?[/]

Haven't had time to try it in 6.5 but I don't think there should be any problems. I'll get the instructions updated in time for the 6.5 release hopefully. I'm also planning on updating it for Mambo 4.6 when it is released.

[]Why does the log in/out use the Mambo instead of threads? [/]

To minimize the needed modifications to make the installation as easy as possible. Also, it is easier to find bugs if I only I have to check in one place. Internally, it's same database and cookies as before in both Mambo and UBB.threads, so everything works the same as before.

[]Is there a fix for safari? The popup menus don't work w/ safari.[/]

What popup menus are you referring to? If it is the ones in Mambo, I think they are correct html so it's probably a bug in Safari. I know it works in msie/firefox/opera at least. The menus are a GPL:d javascript functions too called JSCookMenu I think, you might want to ask the authors of it as well.
i love the style sheets... think they care to share
What stylesheets? On www.spelwebben.se ?
I like the color scheme. I want to do a blue / green one
Posted By: Gardener German translation - 06/22/2004 2:02 PM
Someone is doing a German translation for the component and seems to need some help with doing a trial installation of it to test it live (he doesn't have UBB.threads himself I believe). So if someone who speaks English could help him out I'd be very grateful.

Here is the thread about it:
http://www.mambers.com/showthread.php?t=5203
Wow cool! Can't wait to check this out.
nice work Gardener
Thinking about testing this out....

But first, just want to make sure that I have the correct info so I can start to tool around with this.

In your write-up here on the site, you mention "Working Under: UBB.Threads 6.4", but in your readme.html file, you mention "The following is needed to run this integration properly: UBB.threads 6.4.2"

I never did do the minor upgrades on my v6.4 prior to my license expiring, which was only a few days short of when v6.5 was released as I wasa trying to hold out from doing the minor upgrades due to all my hacks.

So, can I install this on my v6.4 or do I need v6.4.2?

Thanks....Looks like you put some damn good effort in to this project!
I don't know, I've only tried it with 6.4.2 but there shouldn't be much changes since 6.4.0 that affects the modifications. The threads part of this is basically the same as for 6.1.x for which I've run the integration for quite some time.

I've taken a quick look at the changes since 6.4.0 and I can't see anything that should affect the integration, but I can't say for sure.
Thanks Gardner....I'll work on installing this on v6.4 and report back with how it worked.

Thanks again...
I run Mambo on one of my sites http://www.e-onlinesource.com/index.php even though I don't use threads on it because it's strictly for housing my interviews. It's great stuff with many options and it's really easy to hack in what you need.
where can I get some "FREE" templates...
Yes, it's very easy to extend and the code is very well written. It can run with full error_reporting without any notices as well, which is nice. But for a lot of the stuff no code changes is necessary, it's very customizable. I like it a lot and use it for a lot of websites, and I tend to use for every new one I setup.
There are a bunch to be found in the download section on www.mamboportal.com and you can find links to a lot of template designers in the weblinks at that site as well.

Other good template sites:
http://www.mambohut.com
http://www.allmambo.com
http://www.peekmambo.com
I assume the login will be done via Mambo mainly
How will this work with "MyPaymentPal" from Josh?
Can this work together?
I think it should work since the integation actually logs the user into both systems at the same time, so all user functionality in UBB.threads and Mambo should work just as before.
sweet gardener, glad you got this going!
I really like mambo and threads but they do not seem to work like one like mambo and simpleboard do...

Am I looking a the wrong samples?
The one I looked at always show threads in a new window, and not like built into mambo...

Another thing: can users, posts, etc, be exported from threads to simpleboard?
No, it's not a complete integration. To do something like that requires a lot of work and will probably not even be possible with a commercial system. The integration is for the user system and being able to comment on articles and such. If you want you can use UBB.threads in an iframe inside Mambo and you will have something similar to a complete integration.

I don't know of an exporter to get UBB.threads info to Simpleboard unfortunately.
Thanks for starting this project. Yesterday I take a first look and I will continue if Mambo support PHP5. Do you plan to enhance the integration ?
Well, I'm using it myself so I will need to keep it updated for future versions. As for enhancements I don't know, I'm not sure what could be enhanced as I have everything I need personally.
Has anyone else run into this:
Code
 <br /> <br />Warning: Invalid argument supplied for foreach() in <br />/home/wwwtsbiu/public_html/administrator/components/com_threadsintegration/admin.threadsintegration.php on line 85 <br /> <br />Warning: Invalid argument supplied for foreach() in <br />/home/wwwtsbiu/public_html/administrator/components/com_threadsintegration/admin.threadsintegration.php on line 142 <br />	   UBB.threads Integration - Merge User Information <br />Total number of users in UBB.threads: 0 <br />Number of users imported from UBB.threads: 0 <br /> <br />Total number of users in Mambo Open Source: 0 <br />Number of users exported to UBB.threads: 0 <br />


I got this error on my test board as well, and I thought that it might have been due to its table prefix not being w3t_ but, I am encountering this same error when trying to merge it with my production database.

While trying to install the intergration component into my production mambo I got the following two errors:
Couldn't backup mambo.php, please follow instructions in the readme on how to replace this file.
Couldn't find old usermenu link to Your Details, make sure it is unpublished.

Although, I don't remember getting any errors when I installed it in my test mambo, I thought that it might be a factor. Currently, I am at a loss as to why both users tables are refusing to load with the query right before the foreach loop.
Tip 1: If you get an error message with info on how to fix the problem, follow it.

Tip 2: Always read the readme.

=]

I'm not sure if this is the problem, but if you haven't replaced the original classes/mambo.php file in Mambo the component will not work.

There is a whole bunch of things needed to be done, which are explained in somewhat detail in the readme. Try reading the installation information and see if that helps, if not I'll have to make further checks.

I'll try to add some checks in all scripts that the mambo.php file has been replaced and give warning if not for a future release.
Okay, I had lost track of the readme somewhere along the lines and I was flying kinda blind this time and had no idea where to find mambo.php. But, after a bit of back and forth and a few swings of the hammer the two databases are integrated.
Thanks.
Okay, I'm sure that this isn't in the readme.

I keep getting a pop up error message.
The title of the window is:
[JavaScript Application]

The text is:
_LOGIN_INCORRECT

And there is an okay button. This pops up sporadically when I go to mambo's index.php. It will then leave you on whatever page you were viewing. If you try a second time it works, but then you are logged out when you get to the mambo page. But, I will still be logged in if I go immediately back to threads.

This has been observed using both IE and Firefox by multiple users. My threads cookies are set to site wide. And both mambo's and thread's cookies have the same time for experation in the admin panels.

Any ideas on this would be appreciated. My mambo page is:
http://www.theiconsortium.com/index.php
and my forum is located at:
http://www.theiconsortium.com/iBASE

Any thoughts on this would be appreciated.

ETA:
Hmm, I just went to create a threadsdev user, but when I clicked on the New User link it took me to a page that said the following:
You are not authorized to view this resource.
You need to login.

Guess I will have to look and the instructions again.
I have that problem on my site too. Gardener thought he fixed it, but I still get it popping up.
That is a standard Mambo bug and I included the fix for it in the latest version of the integration. Could you possibly check with a clean install of Mambo 4.5 Stable 1.0.9 if you get the same problem? I've never encountered it myself so it's a bit hard for me to test it.
Okay, I've got a clean install and I have someone playing with it to see if the error will come up.

I just became a user through the Threads admin panel, but when I went to the mambo page it still saw me as the admin user. Is this a limitation of the integration or did I just completely mess up the integration?

ETA:
Is this the proper syntax for the link for registration:
http://www.theiconsortium.com/index.php?option=com_threadsintegration&task=register

Because that it is the URL it takes me to when I click the new user link.

ETA
Okay, I found out what I did wrong here. I had registrations turned off in Mambo.
My tester on the clean install has been playing with it on and off for a day. He has not encountered that error. The clean install is completely unmodified, and is using all default settings. Any ideas from there?
Nope, none. I don't even know what the bug was, how it happened and why the changes in the base code fixed it. But I did add the changes needed for it to the code for the integration. I can have a look at it and see if I see something, but I really have no idea what the problem can be and even less clue what to do it, and trial and error is more or less out of the question since it never happens to me. I'm really at a loss here.
Gardener, are you able to become a user through the Threads control panel and then go to the Mambo pages and still be recognized as the user that you became? It always recognizes me as the admin user that I logged in as when I go back to Mambo. Is this a limitation of the integration, or is this an indication of a fudged up implementation of the integration?
The integration doesn't support becoming a user at this time unfortunately.
What server platform are you on? LAMP, WAMP, if its a Linux server, would you please provide your version info? PHP version? Apache Version? I'm sorry to be such a pain, but perhaps it is something that I can have my host upgrade to fix.

I would appreciate any server related version info that you would be willing to offer.

Regards,
Jeff

ETA
Additionaly, does the integration support allowing users to choose their own password while registering?
Gardener, can you hook me up with whatever it is that makes that problem go away, because I'm still having it on my site.
I would if I had any clue to what it is. I just experienced it on an unaltered site so I'm guessing it's not really a problem with the integration.

It did however disappear when I logged out so it could be a cookie problem. You could either ask those who are having the problems to completely remove their cookies, or give them the Logout-link. That's my best tip for the moment.

I will try to investigate further.
Okay, I've noticed another symptom. When a new post is entered it returns the following error:
Warning: main(mambointegration.php): failed to open stream: No such file or directory in /home/wwwtsbiu/public_html/iBASE/addpost.php on line 153

Warning: main(): Failed opening 'mambointegration.php' for inclusion (include_path='') in /home/wwwtsbiu/public_html/iBASE/addpost.php on line 153

It enters the post just fine, but that error is displayed on the post entered screen every time. I have no idea why it is returning that error.

Gardner, I know that I must be really annoying by now, but if you'd be interested, I would be willing to pay you to straighten out our integration, if you can resolve the Login_incorrect error that we keep getting.
It sounds like you haven't uploaded the file mambointegration.php to your UBB.threads directory. Either that, or that it has the wrong permissions set.


As for the login problem, could you try to make to following changes to classes/mambo.php

Find this code:
Code
<br />if ( $bad == "yes" ) {<br />	echo "<script>alert(\""._LOGIN_INCORRECT."\"); window.history.go(-1); </script>\n";<br />	exit();<br />}<br />


Replace it with this:
Code
<br />if ( $bad == "yes" ) {<br />	if ( isset($bypost) ) {<br />		echo "<script>alert(\""._LOGIN_INCORRECT."\"); window.history.go(-1); </script>\n";<br />	} else {<br />		$this->logout();<br />		mosRedirect("index.php");<br />	}<br />	exit();<br />}<br />


That might do the trick, hopefully.
I was missing that file. Thanks for the quick response. I have tried you're snippet, I will see if it works.

Thanks again.
Since applying the above patch, I have not encountered the _Login_Incorrect message a single time. I do occasionally get logged out, but not nearly as often as I was getting the error.
That's good news. I'll soon get a new version out which has this fix along with some other changes as well.
Is there a way to disable the comments system?
Yes, just remove the file mambots/threadsbot.php
Thanks, that did the trick.

When I use the Forgot password option, it sends out a password that doesn't work and displays the following error:
tal error: Call to undefined function: sqtquery() in /home/wwwtsbiu/public_html/components/com_threadsintegration/threadsintegration.php on line 113

Any idea why that is happening?
Gardner, do you know if there will be any problem(i.e. will it break the integration) if I upgrade to 4.5.1a?

Thanks,
Jeff
[]
Thanks, that did the trick.

When I use the Forgot password option, it sends out a password that doesn't work and displays the following error:
tal error: Call to undefined function: sqtquery() in /home/wwwtsbiu/public_html/components/com_threadsintegration/threadsintegration.php on line 113

Any idea why that is happening?[/]

Seems that I've misspelled setquery. Try changing "sqtquery" on line 113 in the mentioned file to "setquery" instead.

[]Gardner, do you know if there will be any problem(i.e. will it break the integration) if I upgrade to 4.5.1a?[/]

No, it will not work. There have been some changes that I beleive will affect the integration. I would recommend not to upgrade until I've had the time to fully test the integration with Mambo 4.5.1.

I have several components that needs to be updated and I'm slowly working my way through them.
Okay, I made that change, now when I use the request password screen it takes me to a page with this:

SQL errorDB function failed with error number 1146
Table 'wwwtsbiu_abracket.Users' doesn't exist SQL= UPDATE Users SET U_Password = 'fdd3e4e464211b01567c93571860f45b' WHERE U_Number = ''
SQL =

UPDATE Users
SET U_Password = 'fdd3e4e464211b01567c93571860f45b'
WHERE U_Number = ''


It doesn't seem to be picking up the table prefix for some reason. And of coarse, the password that it sends doesn't work.
I've missed adding the threads configuration array to the function. A couple of lines above the last change (around line 56) you should change the following lines:

Code
function sendNewPass( $option ) {<br />	global $database, $Itemid;<br />	global $mosConfig_live_site, $mosConfig_sitename;<br />	global $w3tuser;<br />

To this:
Code
function sendNewPass( $option ) {<br />	global $database, $Itemid;<br />	global $mosConfig_live_site, $mosConfig_sitename;<br />	global $w3tuser, $w3tconfig;<br />
Thanks for that patch, but it is still not working properly. You can now request the password without getting the error, but the password that it sends does not work. You get the following error in an ok box:
Incorrect username or password. Please try again.

If I use the old password it will let me log in.

Thanks for the help,
Jeff
If I uninstall the integration, will it rip apart the databases, or will all of the users still be in both databases?
Anyone had any luck with integrating UBBT6.5?
I am trying to install UBB threadintegration as component on Mambo 4.5.1

I get the following error during install process:

Fatal error: Cannot instantiate non-existent class: mosinstallermodule in /home/ac2/public_html/portal/administrator/components/com_threadsintegration/install.threadsintegration.php on line 60

What please can I do to solve this problem?

Also I must note that my Mambo 4.51 installation has no "classes" directory. mambo.php resides in "includes".

Thank you much in advance.
Can I also use this mod for 6.5 ?
What is the best way of seperating my Mambo and UBB Threads installs.
any word on whether Mambo 4.5.1 can integrate with Ubbt 6.5 yet?

Not to be repetitive, but I haven't yet seen an answer

Either way, we could always just link the forum up to Mambo, but i'd much rather have the username/pass the same - makes it easier for our users.
This will under no circumstances work under any other Mambo version than the one stated. Mambo 4.5.1 has (yet again) changed it's internal structure, so 4.5.1/4.5.2 will not work at all.

I don't have the time to update this at the moment, even though I don't think it should be very hard. I'll try to look at it sometime in April. If someone has some PHP hacking abilities and would like to give it a try I know more or less what needs to be done and can give instructions.

As for removing, just uninstalling the component should do it. If the file classes/mambo.php isn't replaced with the normal version you can just copy the file classes/mambo-orig.php over the classes/mambo.php. You will also need to follow the modification instructions backwards to remove the code changes that's been done on UBB.threads.
Thanks for the info on uninstalling. I wanted to make sure that that was the proper way to go about it.
After I uninstalled the integration and restored my original mambo.php. My 'registered users only' items don't show up. Whether I'm logged in as a standard user, an administrator, or not logged in at all, I see the same thing. Except that when I'm not logged in I don't see the user menu. Do you have any idea what I need to do to correct this?

Thanks,
Jeff
You didn't have this problem before you uninstalled the threadsintegration? Is it the same for all users? Did you use the "Merge User Databases" functionality when you installed the system? Can you log in to the Administrator? Are your uses showing up in the User list in the Mambo Administrator? Have you tried clearing all cookies before logging in again?

Uninstalling does absolutely nothing with the Mambo database, so it seems odd that the behavior should change.
No, I didn't have this problem before the uninstall. Yes it is the same for all users regardless of user type. I did use the "Merge User Databases" when I installed it. Yes, I can still log in to the Administrator by going to the url for it. Yes, the users are showing up the user list, including the new user that I signed up for testing purposes. I have tried clearing all cookies, but it didn't have any effect.

Before I uninstalled I could see the Menu items. After the uninstall, I still had the items visible until I clicked on a link which reloaded the page.

If I set the "Show UnAuthorized Links:" option to yes, the links show up, but they show up for non registered users as well. As it is now, registered users can only see public items, except that they can see the User Menu.
The script to Merge User Databases has a bug in it which means not all needed access control levels are set for the imported users. This would have been apparent before the uninstall though, and would only apply to the users imported from UBB.threads to Mambo. I'm attaching a script that hopefully can fix these which you might try, but you must do a database backup first. There are some database configuration options at the top of the script. But before you try it I'd like you to give me the information below:

Which Mambo version are you using? Could you send me a copy of your current mambo.php file so that I can have a look at it and see if the problem is with that script.

The result of these database queries might also help:
SELECT id, username, usertype, gid, block FROM mos_users ORDER BY id LIMIT 10;
SELECT * FROM mos_core_acl_groups_aro_map ORDER BY aro_id LIMIT 10;
SELECT * FROM mos_core_acl_aro ORDER BY aro_id LIMIT 10;

Attached File
125963-fixaromaps.txt  (96 downloads)
Mambo Open Source Version: 4.5 Stable-1.0.9 [Spider] 28/06/2004 16:51 GMT
I have attached the current mambo.php as mambo.txt

SELECT id, username, usertype, gid, block FROM mos_users ORDER BY id LIMIT 10;
62 admin superadministrator 25 0
63 iBASE superadministrator 25 0
64 Iceman administrator 25 0
65 bwilliams user 18 0
66 tbrackett administrator 25 0
67 REaston user 18 0
68 BDarr user 18 0
69 TBaade user 18 0
70 TAtchley user 18 0
71 BSundaram user 18 0

SELECT * FROM mos_core_acl_groups_aro_map ORDER BY aro_id LIMIT 10;
25 10
25 11
25 12
18 13
25 14
18 15
18 16
18 17
18 18
18 19

SELECT * FROM mos_core_acl_aro ORDER BY aro_id LIMIT 10;
10 users 62 0 Administrator 0
11 users 63 0 iBASE 0
12 users 64 0 Jeff Rhodman 0
13 users 65 0 Beth Williams 0
14 users 66 0 Tony Brackett 0
15 users 67 0 Richard Easton 0
16 users 68 0 BDarr 0
17 users 69 0 Tammy Baade 0
18 users 70 0 Tamara Atchley 0
19 users 71 0 Bala Sundaram 0

Thanks for your help.

Attached File
125965-mambo.txt  (108 downloads)
Everything looks perfectly fine, I can't see why it wouldn't work.

Make sure you are using the original Mambo login module.

I would probably need to do some debugging directly on your site to find out what the cause of the problem is.

I've done a small module that you can install though and then tell me what the output from it is with different users logged in. Just install the attached zip as a Mambo module and publish "Internal User Info" module and check it from the frontpage.

Edit: I've updated the script to fix a small bug.

Attached File
125967-fixaromaps.txt  (61 downloads)
As far as I can tell, I'm using the original login module.

I'll PM you the login info, I'd appreciate it if you'd take a look.

User: Iceman
Userid: 64
Usertype: Super Administrator
Gid: 2

User: admin
Userid: 62
Usertype: Super Administrator
Gid: 2

User: jrhodman
Userid: 73
Usertype: Registered
Gid: 1

User: tus
Userid: 157
Usertype: Registered
Gid: 1
I'm getting stumped... The scripts seem to be perfectly fine, the user database seem to be intact, and the user information is loaded correctly. I can't think of any reason why this wouldn't work. The "gid" value is what is used to check if the user is logged in and if they are a normal user or an admin.
Should I try running the DB repair script that you attached above? I held off because you said that you wanted to see the results of those other queries first.
I guess you could, but it didn't look like you needed it. It wouldn't hurt though, if it works properly it will fix any users that were imported to Mambo from UBB.threads. But that's not really the problem you're having so I don't think it will help. Remember to take a backup of the database first, and I guess you could post the output of the script as well.
When I ran that file from my root directory, it returned the following:

Export users from vBulletin 2.2.x to Mambo 4.5
Error on query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' FROM mos_users AS u LEFT OUTER JOIN `mos_core_acl_a
I've updated the script with a fix for that bug and replaced the old attachment. But I had a look at your user table and it doesn't seem like you need to use it. You didn't have any users in the UBB.threads database when you did the merge, right?
All of my users came from the UBB.threads database except for the user 'admin' that was created as part of the Mambo install.
That's odd, maybe the merger script works better than I thought it did. =]
darn! oh well...I wish i could help you hack it Gardener, but i'm just a little ol' newbie!

I'll keep a lookout (as I know others will be too) that someone will be able to help you out and we'll find a solution to this so we don't have to switch over to vbulletin or simpleforum (whatever that one is called).

Hopefully I will be able to look at it sometime in April but I can't say anything for sure.
© UBB.Developers