View Full Version : MyBB intergration
exdiogene
10-20-2009, 02:52 PM
I would love Adoptables Script to be intergrated into MyBB! Would be great. It would mean users would only have one login and password. Any ideas/tutorial on how it would be done?
Thanks :D
Seapyramid
10-20-2009, 03:01 PM
Brandon has said that he might make a tutorial on this at some point. You best bet would be to research on the MyBB forums for support on intergration. You can intergrate MyBB with Joomla using JFusion & it is also possible to combine PHPAdoptables with Joomla using JFusion.
Sea
exdiogene
10-20-2009, 03:15 PM
ok thanks. So Jfusion seems to be the best bet then.
Arianna
10-23-2009, 02:37 PM
I'm still very interested in this, as I'm working with people to possibly convert a forum with 100,000+ posts and integrate it with the adoptables system. Though this isn't an exact plan, I'd love to see this project go further.
exdiogene
10-23-2009, 04:35 PM
Im learning PHP at the moment but have never worked with a script this complex before... I have a smaller forum that I want to intergrate before i get lots of members.
Arianna
10-24-2009, 02:27 AM
I think that we would be doing similar things, then. :D
I'm not good at PHP. I haven't bothered to take a tutorial or anything and I've just dived into editing all of the PHP files for this script. However, I will have no idea what to do for a bridge.
From my knowledge (which isn't much) it would take merging two tables, changing all of the prefixes, adding rows to the user table, changing 2 register pages, and... that's all, I think. I know there's more, but I don't know PHP. Any ideas?
exdiogene
10-24-2009, 04:36 AM
Well I think we would need to, like you say, edit the script so it takes users from MyBB_users. I was going to use the MyBB forum to register users.
Could we not just change (in login.php):
$query = "SELECT * FROM ".$prefix."users WHERE username = '$username'";
to
$query = "SELECT * FROM "mybb_"users WHERE username = '$username'";
Arianna
10-24-2009, 08:56 AM
That's a good idea, if they're in the same table. But how do we go about on stuff like passwords (don't they have different encryption?) and stuff.
I'm going to go compare tables for a minute, I'll be right back. :)[hr]
The fact that there are about 50 columns in the mybb user table makes me shudder. Thank goodness there are only 13 for myadopts.
How do we merge them, though? I have a feeling that all I'll do is mess everything up. xP
Seapyramid
10-24-2009, 09:17 AM
Well I think we would need to, like you say, edit the script so it takes users from MyBB_users. I was going to use the MyBB forum to register users.
Could we not just change (in login.php):
$query = "SELECT * FROM ".$prefix."users WHERE username = '$username'";
to
$query = "SELECT * FROM "mybb_"users WHERE username = '$username'";
That won't work alone because it wont set the cookies for the Adoptables script so therefore the script wont see them as being logged in.
Sea
Arianna
10-24-2009, 09:23 AM
I've tried to edit the member.php file for mybb, but it's so unbearably complicated I can't even tell what the actual 'register' action is. :P
Is it possible to remove some fields without damaging the complete forum structure, do you think? (I'm using a test part of the site, so it doesn't really matter that much, though. xP)
exdiogene
10-24-2009, 09:37 AM
I would think that it would be easier to edit the Adoptables script as MyBB has a lot more files depending on the integrety of the member.php
Arianna
10-24-2009, 09:52 AM
Yes, you do have a point. :)
However, it does set default values on stuff like that, I think. And another thing - banning might be a problem. xP
And yet another thing - I looked at the passwords on both things, and they are encoded differently. xP[hr]
Another thing, though - I think registering on the forum is more important for my needs. xP
exdiogene
10-24-2009, 10:00 AM
I tohught they were both MD5 encoded?
Arianna
10-24-2009, 10:04 AM
Maybe one is different. If I use a test password - 'password' the MD5 is '5f4dcc3b5aa765d61d8327deb882cf99' right? I'll edit and see what happens. :)
By the way, do you know what 'salt' is in the mybb table?[hr]
This is what I have, straight from phpmyadmin. This is the password encoding.
adopts_users: 5f4dcc3b5aa765d61d8327deb882cf99
mybb_users: 7370faafe822e685d2fe3e535f6fe78e
Certainly not the same...[hr]
The second one (mybb) doesn't fit, look.
Password | | | password
Crypt Hash | | | 1$s7aoXaH7NEs
MD5 Hash | | | 5f4dcc3b5aa765d61d8327deb882cf99
SHA Hash | | | 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
MD5 Salted Hash | | | 0fh3vXJhFAOnI
exdiogene
10-24-2009, 10:22 AM
i tihnk MyBB uses salt and hash, i have asked how to intergrate on the MyBB forum and nobody has replied.[hr]
It seems that (when you change the table it gets the name and pass from) it only has trouble decoding the pass. Any ideas anyone? Sea? Brandon?[hr]
MyBB Salt is the way it encodes the pass to make it more secure, anyone know how to use salts in the adoptables script?
Arianna
10-24-2009, 10:38 AM
I asked too - I hope they answer.
I don't know how to use salts in the adoptables script, sadly. It uses another column in the table - that's about all i know.
exdiogene
10-24-2009, 10:50 AM
well salts are just used ot make the bruteforcing of passwords a longer process, it simply takes the pass and adds the salt on the end, then converts it to MD5 (i think)
For example:
You have a password = "password" which has a MD5 hash of "5f4dcc3b5aa765d61d8327deb882cf99"
but if you add a salt = "eth7"
the string becomes = "passwordeth7"
which makes the MD5 = "804462e52e923941708106a10c6fb416"
So, unless the hacker has the correct salt in their dicitonary after the password then the time taken to crack is considerably longer.[hr]
I think it should be something like this, i know its not the right way round but...:
$password = md5($password,$salt);
$query = "SELECT * FROM mybb_users WHERE username = '$username'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$luser=@mysql_result($result,$i,"username");
$lpass=@mysql_result($result,$i,"password,");
$lsalt=@mysql_result($result,$i,"salt,");
$i++;
}
if($username == $luser and $password == $lpass, $lsalt){
$article_title = "Login Successful!";
Arianna
10-24-2009, 11:41 AM
I saw that it was something like
(md5(salt[$.password]))
Or the like. The problem is, it won't log in on both, I think.
exdiogene
10-24-2009, 12:03 PM
(md5(salt[$.password]))
On MyBB?
And yes sessions could be an issue. We could probably get it so the logins work on both.
So: in login.php
$password = md5($password);
should beocme:
$password= md5(salt[$password]));
Then the salt and pass need to be extracted form the database and matched to the string. Correct?
Seapyramid
10-24-2009, 12:35 PM
Session cookies are the hardest part to set up. They are quite confusing as well. Your bridge has to incorporate a simple cookis session for Adopts & a complicated one for the forum & even the simple one gets complicated. http://www.w3schools.com/PHP/php_sessions.asp gives you some background but it takes time to actually figure it all out.
Sea
exdiogene
10-24-2009, 12:53 PM
hey Sea, you got any idea how to just bridge the tables? So passwords work? Then I'll have a look at sesisons.
Arianna
10-24-2009, 12:55 PM
Gosh, I fail at this. xP
I learned cookies over the summer (not an easy feat for a 13 year old) and that was hard enough. I better go through the lessons before that before I get up to that, right? Having basic PHP knowledge would be useful here. x3
As for the cookies - I think so. The only problem, is even with the salt, I don't think that the first password thing is the same. So are we changing a function in both login.php and register.php?
exdiogene
10-24-2009, 01:03 PM
Well I was planning on removing the Registation from Adoptable script and using MyBB's to make the process simpler. With the salt the password will be exactly the same.
Here is how it works:
PASSWORD + Salt = saltPASSWORD which is then coded into MD5
Basically the script just needs to take the pass the user has entered into the form, query the salt from the database then add that to the front. Then convert ot MD5 and check if it matches the password hash in the MyBB_users table.
Off Topic: BTW arianna, I'm 16 ;) doing A-level Computing a year early.
Arianna
10-24-2009, 01:15 PM
I think that that idea is smarter. :) I won't remove the registration, I'll just rename it or something.
Ah, I get it now. That's why it doesn't work like that.
Hmm, so how do we now get this to work with the adoptables?
exdiogene
10-24-2009, 01:25 PM
Well we need to make it take the username and pass from the Mybb_users tbale instead of Adopt_users table. We then need it to take the salt from the database where the UID = the one we want. Then it needs to add the salt to the password we enter, and encode it in MD5. Then it matches that to the Password string in the Mybb_users table :D
So, Im guessing in login.php:
This:
$password = md5($password);
should become this:
$salt = "SELECT salt FROM mybb_users WHERE username = '$username'";
$password = md5($salt.($password));
Arianna
10-24-2009, 01:49 PM
Shouldn't everything be in one table? That way, if a user changes her/his password, they can still log on, right?
As for the code, where are we getting the actual password from. From the mybb table, or from the adopts user table?
exdiogene
10-24-2009, 01:53 PM
we are getting the username and password from the MyBB tables and using the Adopts tables for the levels and adopts etc...
The adopts_users tbale could be dropped as it wouldnt be needed any more and the fields form the Adopts_users table could be added into the MyBB_users table.
Arianna
10-24-2009, 02:24 PM
That's good - maybe dropping the table is necessary - I haven't found out how to merge, so I'll do it manually.
exdiogene
10-24-2009, 02:29 PM
It shouldnt be nessiccary to drpo it, just the tbale wont be used anymore so there is no point really having it. I would make sure you can bridge the scripts before you do anything with the database. ;)
Arianna
10-24-2009, 02:35 PM
Okay, that's a good idea. I'm using a test database, so it doesn't matter.
I'll catch up on this later, I'm sort of busy right now. Have you worked out anything about the sessions?
BMR777
10-24-2009, 02:53 PM
This might help. I just remembered that I sent an email to someone a long time ago on how to integrate the script possibly with PunBB, however a lot of the advise applies to MyBB as well:
As far as login integration goes, it is possible. What you can probably do is just disable registrations through the adoptables script and have all the registrations handled by PunBB by removing register.php. Now the adoptables script uses its own cookies for storing user data, so you can probably very easily change the login system to instead read from PunBB's database tables and write to the cookies rather than reading from the Adoptables database tables and write to the cookies.
In functions.php, look at the logincheck() function, which basically checks the cookie values against the database to see if a user is logged in. Rather then querying the adopts_users table for the username / password, just query through PunBB's database tables for this info.
Also, you'll want to look at login.php and change the database portions to read from the PunBB tables and not the adopts_ tables.
You'll also have to make some adjustments to the usergroups. In functions.php the cancp function handles if a user can access the site's Admin CP and the cando function determines what users can do, such as adopt pets, or which portions of the ACP they can access if they are admins. Basically for the usergroups what you need to do is edit the getgroup() function in functions.php to make it select the user's usergroup from PunBB's database tables. Then you need to make sure the numerical IDs of the adopts_groups table data MATCH the ones from PunBB, so in my script Root Admins are group 1, so if say in PunBB root admins are group 4, you need to change the root admins group on the adoptables script from group 1 to group 4.
Lastly, you'll need to edit the profile.php page to read the user's profile data from PunBB rather than from the adopts_users table.
That should be basically what you need to do for login integration. This way the forums handle all registrations of new and existing members and users just log in to the adoptables script with the same username / password as on the forums and it all should work fine. :)
Also, this code may help. It's some code I wrote for a custom CMS script to allow for MyBB integration. If you replace the logincheck() function in inc > functions.php with the following code this will help with MyBB integration.
function logincheck(){
include("forum/inc/functions_user.php");
if (isset($_COOKIE['ourusername']) and isset($_COOKIE['ourpass'])){
$username = $_COOKIE['ourusername'];
$password = $_COOKIE['ourpass'];
$username = secure($username);
$password = secure($password);
/*
//Don't check the salt of the password as we did this when we logged in...
//First we select the salt from the database where we have a username match...
$query = "SELECT * FROM mybb_users WHERE username = '$username'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$salt=@mysql_result($result,$i,"salt");
$i++;
}
//Now we salt the password...
$saltedpw = salt_password($password, $salt);
*/
//Run login operation
$query = "SELECT * FROM mybb_users WHERE username = '$username'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$luser=@mysql_result($result,$i,"username");
$lpass=@mysql_result($result,$i,"password");
$i++;
}
if($username == $luser and $password == $lpass){
$isloggedin = "yes";
}
else{
if (isset($_COOKIE['ourusername'])){
$past = time() - 10;
setcookie("ourusername",$username,$past);
}
if (isset($_COOKIE['ourpass'])){
$past = time() - 10;
setcookie("ourpass",$password,$past);
}
$isloggedin = "no";
}
}
else
{
//User is not logged in
$isloggedin = "no";
}
//Return our user data
$userdata[loginstatus] = $isloggedin;
$userdata[username] = $username;
return $userdata;
}
Then you may have to edit login.php and logout.php, but I am not sure. Then just make sure that the usergroups match up in the Adoptables Admin CP with the ones in MyBB and you are all set. :)
Whatever username users register for on the forums should be the one their adoptables are saved under. :)
I hope this helps,
Brandon
exdiogene
10-24-2009, 02:58 PM
Thnaks brandon, ill get into this tommorrow, for now i am going on my games sevrer :D see ya guys
Arianna
10-24-2009, 03:04 PM
Thanks, Brandon. I have to go to bed (Europe. xP) but I'll also look at it tomorrow.
exdiogene
10-25-2009, 01:23 PM
hey brandon when i add that code it says it cant reefine logincheck function... :(
BMR777
10-25-2009, 01:24 PM
Did you replace the existing one with that one? :)
exdiogene
10-25-2009, 01:47 PM
yes, then it gave php errors, causing me to reupload my adoptables script wich caused me all that hassle today with the DB lol XD
Arianna
10-25-2009, 01:49 PM
That's not good. :/
Arianna
10-30-2009, 01:07 PM
Have we forgotten about this? I'd still really like to implement this.
How about, in the mybb table, creating the columns:
uid (have they got something like this already?), email, usergroup, newmessagenotify, membersince, isbanned, website, profilepic, aim, yahoo, msn
And then what we do, is in mybb file member.php, in the action 'register' (on line 315 it starts with the 'register' action, ends at line 721), we change... I can't find where it actually INSERTS the thing into the table. Any help here?
The 1000+ lines in this php file are somewhat daunting.
kamrinjacobs
02-23-2010, 01:43 AM
Hello..
You say right that You can intergrate MyBB with Joomla using JFusion & it is also possible to combine PHPAdoptables with Joomla using JFusion.I have been tried to integrate mybb with joomla using jfusion It was integrate.thanks jfusion is best for integrate.
Arianna
02-24-2010, 12:04 AM
There is a mod for this in the premium members section.
Seapyramid
02-24-2010, 11:51 AM
Yes & if you look at http://mysticgrove.net .... That is a joomla master site with PHPBB3 & PHP Adoptables both itergrated as slaves using JFusion
Sea
Arianna
02-24-2010, 01:45 PM
I saw that. :D It's awesome!
ralgith
03-27-2010, 08:56 PM
There is a mod for this in the premium members section.
And it does not belong there. You commissioned it, but that does not give you the rights to it. It needs to be removed immediately and all persons using it owe me a subscription fee to my site or must remove it from usage. I did not charge you only $10 for this so you could cheat me by giving it away; or worse as it seems you're doing, charging others' for it! I demand its removal now. I put 4 hours of work @ $35/hr into this. You were supposed to link back to MY site so I could make this up in sales.
Anyone wishing to own this legally must subscribe to Skin City Designs (www.skincitydesigns.com)
Anyone wishing to dispute this claim simply needs to open the file and look at the copyright. To Dylan Myers and Skin City Designs.
Arianna
03-28-2010, 01:01 AM
I was under the impression that you said I could put it there, but if that's not so, I'll remove it right away.
From the MyBB forums you said I could share it with people on here, and the premium is not only for that mod. Thread's been removed, and the ONE person who used it has been contacted.
Ok, I'm still pretty booked up with plugin requests, but I'll see if I can squeeze it in anywhere. I'd have to charge you like $10, but then it would be yours to do whatever you wished with, even give to the community for free if you want.
And how I'd solve the salt issue is by making the adoptables script use the salt.
I have this PM in my inbox dated 11-19-2009. "it would be yours to do whatever you wished with" seems to imply I'd be able to give it to the members on here.
Tequila
03-28-2010, 08:25 AM
There is a mod for this in the premium members section.
And it does not belong there. You commissioned it, but that does not give you the rights to it. It needs to be removed immediately and all persons using it owe me a subscription fee to my site or must remove it from usage. I did not charge you only $10 for this so you could cheat me by giving it away; or worse as it seems you're doing, charging others' for it! I demand its removal now. I put 4 hours of work @ $35/hr into this. You were supposed to link back to MY site so I could make this up in sales.
Anyone wishing to own this legally must subscribe to Skin City Designs (www.skincitydesigns.com)
Anyone wishing to dispute this claim simply needs to open the file and look at the copyright. To Dylan Myers and Skin City Designs.
I was the only one that even tried it and I'll let you know that it never worked. If I may ask, what would the subscription cost and how long does it last? I might even be tempted to commission a skin for the forum as well, depending on pricing (I do have a toddler with a birthday coming up).
ralgith
03-28-2010, 04:08 PM
@Arianna
Yes, that was the initial estimate I gave you when you originally asked on MyBBoard.net. However once we actually followed through with this transaction I informed you that due to the complexities I would need to make it a subscription plugin. This is why I started requiring signed contracts for all my work. Too many misunderstandings/miscommunication. If I kept the email where I mentioned that I would need to make this a subscription plugin I will post that, but I doubt it. For now I'll just apologize for the miscommunication and ask you to please remove it.
@enddayne
I'm not sure why this didn't work for you, but support is available as a subscriber as well. It should work if all customizations to the Adoptables script are made as per the instructions. I may however have missed something that seems obvious to me but actually isn't to someone who isn't as tech savvy as I am. As for subscriptions, they are $10/yr and allow you to download a LOT. The Themes made by the owner of the site, and all my plugins she hosts. Which are all for MyBB of course :)
I will warn you though that TK's skins ARE expensive, because she actually makes custom icons and everything that fits the theme. Good high quality icons. I still owe her for my theme too, $150. But its SOOOO nice. She is also usually willing to give people a deal if what they want is simpler and just wants things like color changes for the button images and such.
Anyways, go ahead and join up/subscribe over there and we can see what needs done for the Adoptables bridge. I currently have someone who must be a member here asking me to bridge it to phpBB2, since that is how I found out about the MyBB bridge being here. But that is a discussion for there, not here.
My best to all, and sorry for the angst, I've just been getting cheated a lot lately... and usually on purpose.
Arianna
03-29-2010, 12:17 AM
Okay, I'm very sorry - I've removed the attachment and asked for the thread in the premium member forums to be removed. It's a shame, because I don't actually have a use for this plugin, but I guess we all learn.
cherylfoster
01-03-2011, 01:42 PM
Well, we need to do is take your name and will instead Mybb_users tbale Adopt_users table. Then there's the rooms that have a database with UID = what we want. Then it needs salt, we are entering a password, and codify its MD5. Then he replied that the password string table Mybb_users.
Hall of Famer
01-04-2011, 01:57 AM
lol spambot got pwned again...
Anyway I've seen how Kaeliah integrated her RA site with a PHPbb forum, so it is definitely possible to integrate with mybb and even commercial forum softwares like VB and IPB. The concept here is that you need to make sure the database table prefix_users has exactly the same structure for your adoptable site and forum. Whenever you upgrade your site's database table for users, make sure to do the same for the forum and vice versa. Just be careful running official forum upgrader scripts, which may change the structure of your database table that causes fatal error to your adoptable site.
Kaeliah
01-04-2011, 11:55 AM
Actually what I did was had my users register at the forum first. Then they had to go to the RA site register page and input their username and password as if they were logging in. The code then found their username in the forum users table and put all the necessary information into the RA users table.
However with my new site, Kaplushies I'm just scripting my own simple forum for complete integration.
I also managed to have a link in a 'bank' page that when you clicked on it, it would give the users a certain amount of currency per post, then update their last postcount. So say they made 8 posts in the forum, then clicked the link. They'd receive 2 coins per post so a total of 16 coins and their postcount in the user table updated from 0 to 8. Then they make another 2 posts, click the link get a total of 4 coins and the number updates to 10. It was basic, annoyingly partially integrated but my users who had never seen anything like that before(MA users) liked it. Now I'm just scripting my own forum which isn't actually that hard...
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.