Welcome Guest, Not a member yet? Register   Sign In
new to codeigniter - want try ci integrate with smf
#8

[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.


Messages In This Thread
new to codeigniter - want try ci integrate with smf - by El Forum - 01-04-2011, 03:10 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-04-2011, 05:23 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-05-2011, 03:06 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-05-2011, 11:35 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-05-2011, 03:32 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-05-2011, 06:29 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-06-2011, 04:26 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-06-2011, 09:46 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-08-2011, 11:15 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-08-2011, 01:14 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-08-2011, 03:20 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-10-2011, 07:45 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-10-2011, 09:51 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-11-2011, 06:00 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 01-11-2011, 09:55 AM
new to codeigniter - want try ci integrate with smf - by El Forum - 02-02-2011, 02:16 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 02-02-2011, 03:23 PM
new to codeigniter - want try ci integrate with smf - by El Forum - 02-02-2011, 03:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB