MyBB Community Forums

Full Version: Avatar on custom php page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

How do I display the user's avatar on a custom php page. What I'm looking for is the variables.

User logs in, gets directed to the home index page and see's his own avatar?
Add the following code in that page;
<img src="{$mybb->user['avatar']}" alt="Avatar" title="{$mybb->user['username']} 's Avatar">
I've added

<?php
define("IN_MYBB", 1);
require_once("topics/global.php");
?>

to the custompage.php for example and it doesn't seem to like your code.
Never mind, this I sussed it. Thanks! Big Grin