MyBB Community Forums

Full Version: Getting Username on Index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am in the process of creating a custom theme for a forum I an administrator of. I am wondering if there is a way to use PHP to get your username once you are logged in and insert it as html into a spot on the index.

Also, I am wondering if there is a way to do the same thing with your current avatar.

If it can't be done with PHP, is there any other way you can think of to accomplish this?
Username: {$mybb->user['username']}
Avatar: <img src="{$mybb->user['avatar']}" />

Just put that in your templates where you want it Smile
Thank you very much.
One additional thing, is there a way to resize the avatar after I've called it with PHP, possibly using Javascript?

EDIT: Nevermind, solved my own problem. Thanks for all the help.
Just specify the width and height in the img tag Smile
Like so: width="50" height="50"
Yup, that's what I did. I realized it almost right after I asked.