[eluser]Daniel Moore[/eluser]
I used the following and received no error. This is using CI 2.0, however, so some minor differences. I don't really have a controller like this, I just created it as a demonstration. Ignore the var_dump() and echo statements. I don't actually use those in controllers, just a quick and dirty way to help you test.
Code:
<?php
class Context extends CI_Controller {
var $context = array();
function __construct()
{
parent::__construct();
require_once (FCPATH.'/smf20/SSI.php');
$this->context = $context;
}
function index()
{
echo '<pre>';
var_dump($this->context['user']);
echo '</pre>';
}
}
/* End of file context.php */
/* Location: application/controllers/context.php */
Notice the line:
Code:
require_once (FCPATH.'/smf20/SSI.php');
This is what you are missing I believe. If you will change your require_once statement to include the FCPATH constant, then it should be able to find SSI.php. I believe you just aren't locating it properly. I had the same error until I included the FCPATH.
I happen to use this all the time, and utilize extending my core controller so that it automatically sets this up in every controller I have. About 3/4 of my sites have the SMF board, so that's actually the auth system that I use. I also have MediaWiki, with full integration to SMF's auth system there as well. Although I prefer to set up separate permission tables from SMF for things that won't involve SMF directly. I just add another table to the SMF database that's being used. Works out great as an auth system if you're going to have the forum anyway.