MyBB integration

Hi,

I’m trying to integrate MyBB forum in yii framework using MyBBIntegrator class.

For this situation, i use the follow code

[color="#FF0000"]chdir("mybb/");

define("IN_MYBB", 1);

include("./global.php");

chdir("../");

[/color]

and i $mybb->user[‘uid’] still zero…

Will be a problem the fact that the above code needs to be called immediately after the equivalent session_start () in the yii framework?

If so, how can I run the following code after session start?

If it is not the case, how can I make the integration of the MyBB forum on my main site?

my complete code in index.php yii file:

[color="#FF0000"]chdir("forum/");

define("IN_MYBB", 1);

include("./global.php");

chdir("../");

require_once("./protected/extensions/mybb/MyBBIntegrator.php");

$MyBBI=new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);

//echo $mybb->user[‘uid’];

// change the following paths if necessary

$yii=dirname(FILE).’/../yii/framework/yii.php’;

$yiiconfig=dirname(FILE).’/protected/config/main.php’;

// remove the following lines when in production mode

defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);

// specify how many levels of call stack should be shown in each log message

defined(‘YII_TRACE_LEVEL’) or define(‘YII_TRACE_LEVEL’,3);

require_once($yii);

Yii::createWebApplication($yiiconfig)->run();

[/color]

[color="#006400"]/* Moved from Tips, Snippets to Yii 1.1 General Discussion - it’s not a snippet nor a tutorial… */[/color]

I tried, but i exceed maximum edit posts for the first day. Thanks for this moving.

Ok… the problem was identified! All my code is correct, the problem is in mybb general configurations, specially the cookies configuration: cookie path must be "/" instead "/mysite/mybb_folder/".

Now, i have another problem… mybb forum logout doesn’t work…

Anybody knows what is the correct mybb forum paths configuration to mysite/mybb bridge works?