V: 2.0.19
Hello, ii have a new doubt. I intend to load all the user information, that is, what is shown in $profile in the load.php function, for this i have the following:
$id_u = $context['user']['id'];
loadMemberContext($id_u);
$context['member'] = $memberContext[$id_u];
Yes, i use $context and $memberContext like global variable.
Where is the wrong?
Thnx!!
Did you declare those as globals?
Can you post the code to help us identify the problem? A snippet of three lines doesn't tell us much.
EDIT: You're missing loadMemberData($id_u). There might be a related error in the php error log file stating such.
Quote from: live627 on March 10, 2024, 12:16:43 AMDid you declare those as globals?
Can you post the code to help us identify the problem? A snippet of three lines doesn't tell us much.
EDIT: You're missing loadMemberData($id_u). There might be a related error in the php error log file stating such.
Hello, thank you very much for responding, Live!! So do I have to ALWAYS use loadmembercontext() and loadmemberdata() together for it to work? I have tried and adding loadmemberdata() works for me.
And finally, loadmemberdata() use the global variable $memberContext or $user_info? Thnxx
loadMemberData must always come first, and it doesn't use either of those two things. It uses $user_profile however not in a particularly nice way, which is why you use loadMemberContext to move it to $memberContext.
You are not supposed to use $user_profile directly without understanding what state it is in (which is primarily for how the profile area updates data when you're not the current user whose data is being updated)