Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Suggestions and Feature Requests

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #21  
Old 10-24-2009, 02:53 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 18,802
BMR777 is on a distinguished road
Default 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
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Install MyBB Aasixx Tutorials and Tips 18 03-25-2016 05:59 PM
What does mybb intergration mean? Rovick Questions and Supports 3 06-18-2014 04:41 AM
Paypal ipn intergration? Skulldog Suggestions and Feature Requests 3 09-26-2010 10:26 PM
JOOMLA Intergration Seapyramid Mys v1.1.x Mods 32 07-24-2010 07:51 PM
Forum intergration, exdiogene Questions and Supports 6 10-08-2009 10:56 AM


All times are GMT -5. The time now is 01:21 PM.

Currently Active Users: 6909 (0 members and 6909 guests)
Threads: 4,081, Posts: 32,043, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636