MyBB Community Forums

Full Version: Getting a user's username and displaying it in a div?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It's hard to explain what i want, so here's a picture.
[Image: fbfdbk.png]

I want to replace [Username] at the top with the logged in user's username. How would i go about doing this?

Here's my code for the header.
<div id="container">
        <a name="top" id="top"></a>
<script type="text/javascript">
function hideById( id )
{
	document.getElementById( id ).style.visibility="hidden";
}
</script>

<div id="alertbox">
<div class="yellow_alert">
Hi there [Username]. We're in the process of setting up the board. Feel free to close this box by using the red X.<a href="javascript:hideById('alertbox')"><img src="http://forums.theblueshoe.co.cc/images/cross.png" alt="Click me to close." /></a></div></div>
Also unrelated but is there a way to get the red X to the right of the div?
Assuming you are doing this in the template system, just use
{$mybb->user['username']}