• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

XenForo and CodeIgniter Integration

Digital Doctor

Well-known member
cixf.png

Jerry: why is CodeIgniter easier than ZendF ?
 

Jerry

Well-known member
Much more lightweight, easier to learn, no auto code generation so you know what's in there - because you wrote it - it's less capable with regard to libraries and community support and expansion I'd say.

Though for 80% of what people do, DX auth/tank auth/a3m & CodeIgniter and you're good to go.

ZF is very expansive and slow to get going on for most coders I've talked with about it.
 

CroNiX

Active member
Awesome. I have done the same type of thing with vb3 and also vb4 and was going to check this out. Thanks!
 
F

Floris

Guest
Jerry, for the epic win.
Now let's hope IB didn't have a CI+XenForo integration planned for vB5 !!
 

RickM

Well-known member
Sorry to bump up a year old thread. I'm trying to use Jerry's code on a Codeigniter based site however it looks like any code igniter commands that are run after loading in the xf_auth library dont work, as it is trying to run them as part of xenforo.

For example, a simple test controller in CI:

PHP:
class Test extends Public_Controller
{
    public $data;
 
    public function __construct()
    {
        parent::__construct();
       
    }
   
    function index()
    {
   
        $this->load->library('xf_auth');
       
        if($this->xf_auth->isLoggedIn())
        {
            echo "You're logged in to XenForo !" .
            " User id :: " . $this->xf_auth->getUserId() .
            " username :: " . $this->xf_auth->get('username') .
            " email :: " . $this->xf_auth->get('email');
        }
        else
        {
            echo "You are not logged in";
        }
       
        $this->load->model('some_model_name');
    }
   
}

With that model line there, I get this error:
Code:
You're logged in to XenForo ! User id :: 1 username :: Rick email :: xxxxxx@xxxxxx.com
An exception occurred: Only variables should be passed by reference in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/system/cms/libraries/MX/Loader.php on line 178
 
XenForo_Application::handlePhpError() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/system/cms/libraries/MX/Loader.php at line 178
MX_Loader->model() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/addons/shared_addons/modules/xxx/controllers/test.php at line 37
Test->index()
call_user_func_array() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/system/codeigniter/core/CodeIgniter.php at line 352
require_once() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/index.php at line 259

Any ideas? Completely stumped. The XenForo integration seems to be working, but anything after that fails.
 
Top