MyBB Community Forums

Full Version: add a register button over there and disapears after logged in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Image: registervu.png]

how can i do that?
The "register" button disappears after login?
It is supposed to disappear, because, the script doesn't want a registered user to re-register.
Add the register button in header_welcomeblock_guest template.
You did not understand in the picture shows in the circle i wanna add a register button .but when someone is signing in that register button to disappear got it?
Open ./global.php and add the following code just below the global_start hook;
if ($mybb->user['uid'] == "0")
{
   $register_link = '<a href="member.php?action=register"><img src="images/register.gif" alt="Register"></a>';
}
else
{
   $register_link = '';
}
Now Open Header Templates > header > and add the following code where ever you want to show the Register Button;
{$register_link}

Now you just have to upload a register.gif image in ./images/ folder.
can you make me the code to be there at the imaged i showed you?

here is my header:
<a name="top" id="top"></a>

<div id="shadow">

<div class="top_menu">

<span id="btn" style="float: right;">
<a href="#"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toggle.png" alt="" /></a>
</span>



<div style="padding: 14px 0px 0px 0px;">
<div class="menu">

<ul>
<li><a href="{$mybb->settings['bburl']}/portal.php">
<img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/icons/portal.png" alt="" />{$lang->toplinks_portal}</a></li>


<li>
<a href="{$mybb->settings['bburl']}/upgrade.php"><img src="images/blueshire/icons/upgrade.png" alt="upgrade" />Upgrade</a>
</li>

<li><a href="{$mybb->settings['bburl']}/search.php">
<img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/icons/search.png" alt="" />{$lang->toplinks_search}</a></li>
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help">
<img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/icons/help.png" alt="" />{$lang->toplinks_help}</a></li>
<li><a href="{$mybb->settings['bburl']}/memberlist.php">
<img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/icons/memberlist.png" alt="" />{$lang->toplinks_memberlist}</a></li>
<li><a href="{$mybb->settings['bburl']}/calendar.php">
<img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/icons/calendar.png" alt="" />{$lang->toplinks_calendar}</a></li>
</ul>

</div>
</div>
</div>

<div id="header">



{$welcomeblock}
<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img class="forumtitle" src="{$theme['logo']}" alt="Register and login" title="Register and login" /></a></div>
</div>

<div id="sub_menu_out">

<span class="float_left"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/style/sub_menu_left.png" alt="" /></a></span>
<span class="float_right"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/style/sub_menu_right.png" alt="" /></a></span>

<div class="sub_menu">

<div class="sub_content">
<navigation>
			{$board_messages}

	{$board_messages}



</div>
</div>
</div>


<div id="container">

                <hr class="hidden" />
		<br class="clear" />
		<div id="content">
			{$pm_notice}
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}
In the code you gave, search;
<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img class="forumtitle" src="{$theme['logo']}" alt="Register and login" title="Register and login" /></a></div>
</div>
and Add the following code just after that;
<div style="float: right;">{$register_link}</div>

Then edit the global.php file as I've posted above.
i want in yellow dot to be my register

[Image: registeraj.png]
The above code (On post # 7) should work, you just need to align it with padding and margins though to fit it exactly on that area.
I tried putting that code in my global.php. as soon as I added it I received an error when trying to log in. Can you show exactly where the code needs to go. I added it below global_start

Thanks