MyBB Community Forums

Full Version: Logout Link
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a custom page that is outside the forum directory and I wish to add a logout link but even when I include global.php, it doesn't seem to recognise the variables for the logout key.
<a href="<?php echo "forum/member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}";?>"><?php if($mybb->user['uid']) { echo "Logout"; } else { echo ""; }?></a>

However if you want to hide that logout button when a user is logged in you have to use an if/else statement.

If you need help with all that let me know,

However the if/else is included right there so you should be set.. That's what I have on my site Toungue

*edit: i edited out my code from my website so you don't get any stupid errors and missing classes
Use the welcomeblock_member template.
Thanks guys for the help! Smile