the api is in need of a bit of attention as it stands it still used md5 passwords, which of course don't work with the newer version/s of SMF. I have posted part of the solution here: http://www.simplemachines.org/community/index.php?topic=154329.msg1008862#msg1008862
You are probably using the smf_api for the 1.0 version of the forum.
Here's one for 1.1:
http://www.simplemachines.org/community/index.php?action=dlattach;topic=42867.0;attach=9158
There might be a newer one around here, but the one above is the one I'm using and it's working.
There are several versions of smf_api.php floating around this forum, however, the newest one I've found is attached to this post :)
I'm not sure whether this is the very latest one, I'd need to ask a developer. However, it seems to work fine.
It's still quite a incomplete, I've had to hack mine quite a bit it was worth it though, SSI is way too slow.
the api pointed to by Remaker seems to have a bug on lines 590 and 597 - they read 'request' instead of 'result'.
haven't tested any fully. scared. :(
shmooth, please try the one that I attached above ;)
NoFear, what problems were you having with SSI? It shouldn't be that slow (it should probably be a bit quicker than SMF, as it loads less stuff)
I am trying to use the smf_api.php (SMF 1.1 Beta 1), but it seams like it is using functions located in Subs.php.
I have integrated the smf_api.php in my login function in my CMS (dolphin) so it checkes if the user exists in smf_members, otherwise tries to add it trough function smf_registerMember located in smf_api.php.
The problem is that when this is done this error appears:
"Fatal error: Call to undefined function db_insert_id() in C:\xampp\htdocs\fishmap2\forum\smf_api.php on line 401"
Isn“t the smf_api.php suppose to work as a external file not directly connected to the forum itself?
function syncForum($nickname,$forumPW) {
require_once('forum/smf_api.php');
$smfUsername = db_value("SELECT memberName FROM smf_members WHERE memberName = '$nickname'");
$array1 = array(0,0);
$array2 = array(0,0); // Arrays just because it needed that. ??
if(!$smfUsername) {
smf_registerMember($nickname, $email, $forumPW, $array1, $array1);
}
/// smf_api.php functions
smf_setLoginCookie( 3600, $nickname, $forumPW, false );
smf_authenticateUser();
smf_loadSession();
smf_logOnline();
}
If you're trying to integrate SMF into a CMS system, you might want to look at the integration hooks. Take a look at the A guide to the SMF integration hooks (http://www.simplemachines.org/community/index.php?topic=173483.0) topic and the Portals, Bridges, and Integrations (http://www.simplemachines.org/community/index.php?board=33.0) board. :)
It seems that the integration hooks don't offer what is needed in place of the registration portion of the SMF API. integrate_register is quoted as performing something like the following:
QuoteA user has registered in SMF, or an admin has created a user in the SMF admin panel, and the user needs to be created in the integrated system as well.
However, I'm actually attempting to perform this instead:
QuoteA user has registered in my custom CMS, and the user needs to be created in the SMF system as well.
Hmmm... I think some of the CMS bridges do that somehow? I'm not sure how; I've not looked into the code for it.
If I am right, The integration hooks are hooks for performing some specific action when some specific action happens in SMF
For ex. A user registers at SMF, then a action will be performed making the user's account in the CMS.
For doing the opposite action of the above, you'll be needing to modify the CMS.