MyBB Community Forums

Full Version: Can't seem to integrate anything.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Version 1,8

I've done MyBB Integration numerous times before, but it's been a few months, so I don't know if I'm doing something wrong, or if there is just something wrong in general. 

At first I was using the old method:

<?php
chdir("./forum/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
chdir("../");

if(mybb->user['uid']) {
    echo "Logged in";
} else {
    echo "Not logged in";
}

?>

However, I couldn't get that to work, so I decided to give MyBBIntegrator a whirl.

<?php
define('IN_MYBB', NULL);
global $mybb, $lang, $query, $db, $cache, $plugins, $displaygroupfields;
require_once './forum/global.php';
require_once './inc/class.MyBBIntegrator.php';
$MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);
if($MyBBI->isLoggedIn()) {
		echo "You're logged on.";
} else { 
		echo "You're not logged in"; 
}
?>


Still no luck, always returning false.
Having the same issue.

It just does nothing - I know it is reaching the global.php correctly, but then the Mybb User ID cannot be pulled using the if(mybb->user['uid']) { code.
Look at the path of your second require: ./inc/class.MyBBIntegrator.php. I think you want to require ./forum/inc/class.MyBBIntegrator.php instead.
(2014-11-04, 07:12 PM)laie_techie Wrote: [ -> ]Look at the path of your second require: ./inc/class.MyBBIntegrator.php. I think you want to require ./forum/inc/class.MyBBIntegrator.php instead.

Nope, MyBBIntegrator is a 3rd-party script, it's stored in ./inc/