MyBB Community Forums

Full Version: Echo back the user name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello $player,

See what I did there?
I want to echo back the user who is currently reading the thread.

Thank you for your time.

Regards,

Senethic
You can use {$mybb->user['username']} in templates. Smile
(2012-11-28, 09:39 PM)Nathan Malcolm Wrote: [ -> ]You can use {$mybb->user['username']} in templates. Smile

Hey Nathan,

Thanks for the quick reply, Will i be able to use this in a postbit ?
You can use it in any template, it's a global variable. Smile
(2012-11-28, 09:43 PM)Nathan Malcolm Wrote: [ -> ]You can use it in any template, it's a global variable. Smile

Let me correct myself, would I be able to use it in a post* ?
I know that you can use variables in the back-end but I wonder how I could call up that variable on the frontend in a post Big Grin.
You'd have to create a custom plugin which uses the parser to create dynamic MyCodes. Being able to echo arbitrary variables in posts would be a cause for concern.
(2012-11-28, 09:49 PM)Nathan Malcolm Wrote: [ -> ]You'd have to create a custom plugin which uses the parser to create dynamic MyCodes. Being able to echo arbitrary variables in posts would be a cause for concern.

Alright, my friend is a PHP Dev, I'll get this sorted.
Thank you for your awesome support Nathan.