Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Suggestions and Feature Requests (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=21)
-   -   MyBB intergration (http://www.mysidiaadoptables.com/forum/showthread.php?t=1144)

BMR777 10-24-2009 02:53 PM

RE: MyBB intergration
 
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:

Quote:

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.

PHP Code:

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

RE: MyBB intergration
 
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

RE: MyBB intergration
 
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

RE: MyBB intergration
 
hey brandon when i add that code it says it cant reefine logincheck function... :(

BMR777 10-25-2009 01:24 PM

RE: MyBB intergration
 
Did you replace the existing one with that one? :)

exdiogene 10-25-2009 01:47 PM

RE: MyBB intergration
 
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

RE: MyBB intergration
 
That's not good. :/

Arianna 10-30-2009 01:07 PM

RE: MyBB intergration
 
Have we forgotten about this? I'd still really like to implement this.
How about, in the mybb table, creating the columns:
Code:

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

RE: MyBB intergration
 
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

RE: MyBB intergration
 
There is a mod for this in the premium members section.


All times are GMT -5. The time now is 07:48 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.