Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: aaron1234nz on March 16, 2007, 04:16:33 AM

Title: SMF_api.php in need of an update
Post by: aaron1234nz on March 16, 2007, 04:16:33 AM
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
Title: Re: SMF_api.php in need of an update
Post by: Remaker on March 16, 2007, 09:02:20 AM
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.
Title: Re: SMF_api.php in need of an update
Post by: Daniel15 on March 16, 2007, 09:39:23 AM
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.
Title: Re: SMF_api.php in need of an update
Post by: Ensiferous on March 16, 2007, 01:15:17 PM
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.
Title: Re: SMF_api.php in need of an update
Post by: shmooth on April 07, 2007, 02:46:16 AM
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.  :(
Title: Re: SMF_api.php in need of an update
Post by: Daniel15 on April 07, 2007, 05:18:33 AM
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)
Title: Re: SMF_api.php in need of an update
Post by: Lebaconi on March 12, 2008, 02:52:03 PM
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();
}
Title: Re: SMF_api.php in need of an update
Post by: Daniel15 on March 15, 2008, 10:19:23 PM
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. :)
Title: Re: SMF_api.php in need of an update
Post by: mhuggins on May 18, 2008, 02:04:07 AM
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.
Title: Re: SMF_api.php in need of an update
Post by: Daniel15 on May 23, 2008, 12:41:30 PM
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.
Title: Re: SMF_api.php in need of an update
Post by: Dragooon on May 23, 2008, 01:21:30 PM
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.