Welcome Guest, Not a member yet? Register   Sign In
phpBB 3.0.1 session management in CodeIgniter
#1

[eluser]Kromack[/eluser]
Hi everybody,

I am trying to integrate the sessions of phpbb 3 in my controller but without success...

I have already try this both solutions :

http://ellislab.com/forums/viewthread/47689/
http://ellislab.com/forums/viewthread/45737/

I got a blank page, then I got the url_helper conflict.

But finally I have this error :

Quote:Fatal error: Call to a member function sql_query() on a non-object in C:\www\phpworkspace\forums\includes\cache.php on line 37

It seems that phpbb3 object are not loaded...

I am very confused, I used to integrate simply phpbb3 in my pages but with CI it is more difficult.

So, anybody have a good, complete, and recent way to integrate phpbb3 into CI ? Anything, a script or just help.

Thanks !

Here is my code :

Controller :

Code:
class Welcome extends Controller {

    public function __construct()
    {
        parent::Controller();
        $boxes1 = array();
        $boxes2 = array();
        $boxes3 = array();
        $data = array();
        $this->load->helper('url');    
        $this->load->library('phpbb');
        $this->phpbb->load();
    }

    public function index()
    {
        $this->load->database();
        $this->load->model('dossier');


        $this->load->view('header', $data);
        $this->load->view('welcome');
        $this->load->view('footer', $data);
        
        $this->output->enable_profiler(true);
    }
}

Library :

Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class Phpbb {

    
    
    function load()
    {    
        //Connexion a phpbb3
        
            define('IN_PHPBB', true);
            $phpbb_root_path = './forums/';
            $phpEx = substr(strrchr(__FILE__, '.'), 1);
            $GLOBALS['db'] = $db;
            $GLOBALS['lang'] = $lang;
            $GLOBALS['board_config'] = $board_config;
            $GLOBALS['theme'] = $theme;
            $GLOBALS['images'] = $images;
            $GLOBALS['template'] = $template;
            $GLOBALS['phpEx'] = $phpEx;
            $GLOBALS['phpbb_root_path'] = $phpbb_root_path;
            $GLOBALS['nav_links'] = $nav_links;
            //
            // Set page ID for session management
            //
            include($phpbb_root_path . 'common.'.$phpEx);
            //
            // End session management
            //
        
        //Fin de connexion phpbb3
    }    
    
    function isLogued() {
        return $user->data['is_registered'];        
    }
}

?>




Theme © iAndrew 2016 - Forum software by © MyBB