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

Main Menu

Simple User integration, SMF 1.1 RC2

Started by Enc0der, March 21, 2006, 03:47:58 AM

Previous topic - Next topic



I'm planning on adding a users-commenting system on some of the pages on my site.
I want to use this simple script:
It's a great script example for me because it's simple, elegant and I can use a custom 'id' for each page.

The only thing I want to add is an integration with SMF's users database.
Instead of asking the user for it's Nickname, I want to allow posting only to SMF-logged-in users, and automatically use their UserID value.
If the user is not logged-in (or not registered at all), it should just tell them to do so, and send them to the forum.. it's not really necessary to integrate the login/register stuff as well, but if it's a simple manner, well.. :P

I want to use the UserID and not UserName/RealName because I'm planning on displaying the comments with links to the poster's profile.
I will, however, must be able to display the poster's RealName, from it's ID that is saved on the database.

I was searching the forum for docs about SSI.php and SMF_API.PHP, but didn't found anything relevant..
I just need some simple "functions": is_logged_in(), get_logged_user_id(), get_user_realname($user_id)

I use SMF 1.1 RC2.

any help ?
many thanks! :)


I'm also looking for a function that will display a user name or some way to access the cookie to shoot into a mysql statement for a shout box im writing outside of the forum.