Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Phases on July 02, 2009, 06:26:42 PM

Title: SSI (maybe) Get Member ID/Context of currently logged in user.
Post by: Phases on July 02, 2009, 06:26:42 PM
I have gone over the SSI examples here, and I see a few examples on how to get the member's context by calling a function with the member's ID as an argument.

But how do I get the member's ID?

This has been my main reference point, but I am clearly missing something:


<?phprequire('SSI.php');// By ID:loadMemberData(1);loadMemberContext(1);// At this point, $memberContext[user_id] contains the user's detailsecho '<pre>', print_r($memberContext[1], true), '</pre>';// By username:$return = loadMemberData('Daniel15');$userID = $return[0];loadMemberContext($userID);echo '<pre>', print_r($memberContext[$userID], true), '</pre>';// If you really want a function to replicate that IPB-SDK functionality :-)function member_info($member_id){ loadMemberData($member_id); loadMemberContext($member_id); return $memberContext[$member_id];}?>
Title: Re: SSI (maybe) Get Member ID/Context of currently logged in user.
Post by: Phases on July 03, 2009, 12:07:50 AM
Thank you!

Is there possibly some documentation somewhere on all of the variables available through SSI?