CodeIgniter SMF 1.1.x Integration v0.1 |
[eluser]DominixZ[/eluser]
This is my little helper that integrate SMF 1.1.x with CodeIgniter by smf 1.1 api. I'm thai so may be my language may not be good. How to Install 1. Download this file and unzip to your application folder. 2. change smf.php config file at config folder you will see $config['smf_path'] change it to your smf path. 3. See an example in controller/cismf.php. 4. Just change username and password to your smf account. 5. Enter your SMF board to see the result. To Solve Log off bug I have found bug that I cannot log off my smf account in smf board if I logged in by this api but It easy to fix. 1.Just go to your SMF Admin. 2.Go to Server Setting->Feature Configuration. 3.Tick "Enable local storage of cookies" off. 4.The problem are gone. The bug that I didn't fix right now (and may be I cannot fix) First, when u enter smf board without log in and then you log in by API you will see you have 1 guest and 1 user in users online that cause it doesn't delete the first session. I don't know how to fix this right now. Please enjoy my little helper, and give me some comment about my helper. P.S. My Environment : SMF 1.1.9 , PHP 5.2.6 , MySQL 5.0.51b Download Here : CodeIgniter SMF 1.1.x Integration
[eluser]Maglok[/eluser]
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: Code: // Hopefully the forum is in the same place as this script. 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
[eluser]DominixZ[/eluser]
Ok i change code that line to this Code: require_once($_SERVER['DOCUMENT_ROOT'].'/'.$path.'/Settings.php'); and your config file may be like this Code: $config['smf_path'] = "phpci/forum"; Thank for your test ![]() P.S. I changed my old code to like this now.
[eluser]Daniel Moore[/eluser]
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.
[eluser]Maglok[/eluser]
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?
[eluser]DominixZ[/eluser]
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.
[eluser]Maglok[/eluser]
Don't want to re-invent the wheel if it works for you though. ![]()
[eluser]Maglok[/eluser]
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: Code: 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: Code: 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.
|
Welcome Guest, Not a member yet? Register Sign In |