Customizing SMF > Portals, Bridges, and Integrations

New tools to help integrating SMF with something else

<< < (15/32) > >>

Andre N:

--- Quote from: frytec on February 29, 2012, 12:10:48 PM ---ok, im gona test the new version of api, justo to clarify, whats the correct usage of logout function?

smfapi_logout();

or

smfapi_logout($username);

or

smfapi_loadUserSettings(); smfapi_logout();

?



--- End quote ---
All of those will work, but to keep it simple just use smfapi_logout()

The function will call smfapi_loadUserSettings() itself if it needs to, and it will get the current user so there's no need to pass the username unless you're trying to log out someone who's not the current user from the who's online list :)

frytec:
@andre, i couldnt make the registration works via api, but with some sql queries i made the registration work thought.
so i think this is not an issue anymore,

but i would like help with something:

when i login into my website (and therefore automaticly login SMF), and them close the browser window for a long time, and than reopen it, i appears logged out of my website, but SFM still logged in.

Is there a way to fix this?

Andre N:

--- Quote from: frytec on March 02, 2012, 03:55:32 PM ---@andre, i couldnt make the registration works via api, but with some sql queries i made the registration work thought.
so i think this is not an issue anymore,

but i would like help with something:

when i login into my website (and therefore automaticly login SMF), and them close the browser window for a long time, and than reopen it, i appears logged out of my website, but SFM still logged in.

Is there a way to fix this?

--- End quote ---

Yes. When you call the login function, specify how long you want them logged into smf as the second parameter of the function. Example:

--- Code: ---smfapi_login('frytec', 60); //will log in user frytec for 60 minutes

--- End code ---

The second parameter should be the integer value of your site's session duration in minutes. So check how long your main site sets the cookie for and just match that :)

Why didn't the register function work for you? I tested it and it worked with the new version of the API, and the old version worked all the time for me too... Did you get any errors, or notice as to why it wouldn't work? That's one of the functions that will almost never fail because all it does is basically db queries and inserts, so as long as the db connection is made and the data you pass in is ok, it should never fail :p

Handmade:
Would like to take a sec a publicly thank Andre for all his assistance with integration, his work is spotless and functions spot on.
Thanks Andre!! 8)

jershell:
Hello, please tell me what the function sends a letter confirming email? when you call smfapi_registermember, the user is created, but the letter was not sent when the 'require' => 'activation'.
PS: Sorry my english, written by "Google Translator".

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version