MyBB Community Forums

Full Version: How to fetch user's details?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey. How can I fetch user's details? Like, I know $mybb->user['x'] but I want to fetch the user's profile's details.

Lets say I went to your profile, I want to display some stuff about your account. For example IP, email, name etc. What's the code for that? ._.

Thanks!
Use {$memprofile['field_name']}.
(2014-08-02, 01:05 PM)dragonexpert Wrote: [ -> ]Use {$memprofile['field_name']}.

It seems to work but how can I use this on plugin files?

I have this on banned_reason plugin file.

$bannedreason = $reason." | ".{$memprofile['lastip']}." | ".{$memprofile['email']}."<br/> Till:".$lift;

And it gives me this error

Parse error: syntax error, unexpected '{' 
^ obviously, remove the flower brackets !
(2014-08-02, 02:38 PM).m. Wrote: [ -> ]^ obviously, remove the flower brackets !

It's not obvious to someone who doesn't know PHP.

Try this:
$memprofile['field_name']

Instead of:
{$memprofile['field_name']}
(2014-08-02, 02:38 PM).m. Wrote: [ -> ]^ obviously, remove the flower brackets !

I knew the problem was something dumb that I missed ._.

Thanks! Big Grin
You only use curly brackets around the variable name if it is in a string within quotes. This is why they are used in templates.