MyBB Community Forums

Full Version: How to create custom Username and signup button?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If a guest visitor has come, I want to display him Sign in and Signup button, and if a user has logged in, I want to show his name and logout, instead of the above 2.

How can I do this?
Its been used in the below forum(on the top):
http://freekaamaal.com/discuss/index.php
that is already available in MyBB. you can modify available system to your requirement.

admin control panel >> templates >> active theme's templates >> Header Templates
header_welcomeblock_guest template has login & register links for the guests.
header_welcomeblock_member template has greeting for members.
If you want the default panel and these buttons as addition, try this:

1. Download Template Conditionals plugin http://mybbhacks.zingaburga.com/showthread.php?tid=464 (tplcond-1.7.7z)
2. Activate it
3. In header template put this:
<if $mybb->user['uid'] then>
{$mybb->user['username']}
<a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}">{$lang->welcome_logout}</a>
<else>
<a href="{$mybb->settings['bburl']}/member.php?action=login">Sign in</a>
<a href="{$mybb->settings['bburl']}/member.php?action=register">Sign up</a>
</if>
4. Change the links, CSS, etc. to suit your needs
Thank you Destroyer...that helped me a lot, thank u so much Smile