News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

unable to load user information

Started by SleePy, October 29, 2006, 08:23:17 PM

Previous topic - Next topic

SleePy

Ok.. Though SSI I can get $context['user'] and $User_Info.. Which returns some basics about the user.. But I want more.. So to do so I need to load the profile page up to get it..
I call summary page because it should contain all the user information..

if (!$context['user']['is_guest'] && $context['user']['is_admin'])
{
include($sourcedir . '/Profile.php');
summary($ID_MEMBER);
//print_r($context['user']);
//print_r($user_info);
print_r($context['member']);
$gname = $context['user']['name'];
$name = $context['user']['username'];
$email = $context['user']['email'];
}


I get an error that it can't load the user information from my id..
So I added
   loadMemberContext($ID_MEMBER);
before I do the summary function call..
I also tried $context['user']['id']

I don't understand what the problem could be..

I am trying to get information like msn, yahoo and other stuff that appears in the summary page to be on this page im making..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

JayBachatero

You can use this as guidance.

<?php
require_once('SSI.php');
error_reporting(E_ALL);

echo 
'<pre>';

if (!
$user_info['is_guest'])
{
loadMemberData($ID_MEMBER);
loadMemberContext($ID_MEMBER);

print_r($memberContext);
}

echo 
'</pre>';
?>

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

kL

wouldnt it be possible to load the info from the database? SELECT `YIM` FROM `smf_members` WHERE `ID_MEMBER` = $context['user']['id']
something like that ?

SleePy

#3
Thanks Jay,

didn't know I needed data as well..

That got it working..

Now My Script is able to pull user information so they dont have to fill out as much..

@k_talk..

Why do that when It already is there by smf.. just need the right function to get it loaded..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

JayBachatero

k_talk you can do that but why do that when the data is already there?

sleepy - Yea you need to load the data first.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: