News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF_api.php in need of an update

Started by aaron1234nz, March 16, 2007, 04:16:33 AM

Previous topic - Next topic

aaron1234nz

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

Remaker

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.
Remaker - My blog - Actualitate.net

Daniel15

#2
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.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Ensiferous

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.
My Latest Blog Post: Debugging Nginx Errors

shmooth

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.  :(

Daniel15

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)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Lebaconi

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();
}

Daniel15

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 topic and the Portals, Bridges, and Integrations board. :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

mhuggins

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.

Daniel15

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.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Dragooon

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.

Advertisement: