EllisLab text mark
Advanced Search
     
CodeIgniter SMF 1.1.x Integration v0.1
Posted: 23 June 2009 11:53 AM   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-12
420 posts

Oh interesting! Gonna check it out.

 Signature 

- Simon

 
Posted: 24 June 2009 09:57 AM   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-12
420 posts

Alright I have tried it.

I put the helper and config files on the server then edited the controller example to use my login. It doesn’t produce any output, something must be wrong.

My forum url is in ‘/forum’ while CI app is in ‘/system’

/
/forum
/system

Like so.

I changed the config file to ‘phpci/forum’. I wonder if that is the problem.

UPDATE: I found this bit of code in the helper file:

// Hopefully the forum is in the same place as this script.
$ci =& get_instance();
$ci->config->load('smf');
$path $ci->config->item('smf_path');
require_once(
'./'.$path'/Settings.php'); 

I am pretty sure helpers are in the helper dir of the application while the smf installation is going to be in the ‘root’ of the application, it can’t find that Settings.php.

Like so:

domain.com/phpci/forum/Settings.php
domain.com/phpci/system/application/helpers/smf_auth_helper.php

 Signature 

- Simon

 
Posted: 24 June 2009 01:06 PM   [ # 13 ]   [ Rating: 0 ]
Joined: 2008-12-02
29 posts

Ok i change code that line to this

require_once($_SERVER['DOCUMENT_ROOT'].'/'.$path.'/Settings.php'); 

and your config file may be like this

$config['smf_path'"phpci/forum"

Thank for your test smile

P.S. I changed my old code to like this now.

 
Posted: 24 June 2009 04:31 PM   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-09
234 posts

Interesting…  I’ve got a project I’ll be starting sometime next week that would require integration with SMF.  I’ll take a look within the next few days, as I get time.

 Signature 

Daniel Moore
http://www.danielwmoore.com
Using .htaccess to remove index.php

 
Posted: 25 June 2009 04:05 AM   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-12
420 posts

Changed it in my local version as well. I am just not getting anything from the controller example. Not even a echo, something must be wrong.

Are you pulling any PHP5 specific things?

 Signature 

- Simon

 
Posted: 25 June 2009 12:31 PM   [ # 16 ]   [ Rating: 0 ]
Joined: 2008-12-02
29 posts

Hmmm… I don’t know but I think I didn’t do any PHP5 specific.

You can try just download SMF 1.1 API at http://download.simplemachines.org/?tools

and make it to helper like “smf_auth_helper.php”

and load it like my example.

I think you must see some errors and fix it step by step.

 
Posted: 26 June 2009 05:14 AM   [ # 17 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-12
420 posts

Don’t want to re-invent the wheel if it works for you though. smile

 Signature 

- Simon

 
Posted: 22 July 2009 04:22 AM   [ # 18 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-12
420 posts

Well I have it working pretty much, but I didnt write a library.

It’s pretty easy, put this in a header or config or whatever:

require_once('forum/SSI.php'); 

You can now call still like ‘ssi_login()’

If you want to detect if someone is logged in you define:

global $context 

Then $context[‘user’][‘id’] = user_id

There is also all kinds of stuff like ‘is_admin’ etc. I have chosen to only use the login/account stuff. I then have a table of my own with personal settings of which the ID matches the ID of the forum accounts. Works perfectly fine for me.

 Signature 

- Simon

 
Posted: 22 July 2009 04:56 AM   [ # 19 ]   [ Rating: 0 ]
Joined: 2008-12-02
29 posts

That’s very nice and simple.

 
Posted: 22 July 2009 05:20 PM   [ # 20 ]   [ Rating: 0 ]
Joined: 2006-12-22
84 posts

I’m really interested in the integration between codeigniter and smf, so I’m in love with them smile

 
Posted: 04 February 2011 09:18 PM   [ # 21 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-02
6 posts

The link is broken? Does this work for newer version of CI and smf?

 
Posted: 17 July 2011 06:59 PM   [ # 22 ]   [ Rating: 0 ]
Joined: 2011-06-23
15 posts
valajbeg - 05 February 2011 02:18 AM

The link is broken? Does this work for newer version of CI and smf?

ditto…..anyone have a download link?