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]