MyBB Community Forums

Full Version: Get Register/Login tabs back
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, I had to reinstall from an old backup of my forum because the host I was with went bankrupt or went down something was wrong there.
They didn't come back up so I had to go with some other host.
Luckily I had backups but these were old and I have fixed mostly everything except for some tabs that use to be there but now weren't.
I remember having this issue before but I can't remember how I solved it.
Here is an image of the issue:
[Image: tIcvytt.png]

Thank you.
Whats your URL?
(2014-05-30, 04:59 PM)marcus123 Wrote: [ -> ]Whats your URL?

Url: edited out Toungue
Thank you.
Please check your header template for {$welcomeblock}
(2014-05-31, 06:07 PM)marcus123 Wrote: [ -> ]Please check your header template for {$welcomeblock}

Thanks for your response Marcus.
Here is what I have for the header templates:
http://i.imgur.com/Ok1mR2a.png

The Login/Logout and Register is in the header, but it doesn't show Sad
<div id="topbar">

<h1 class="logo"><a href="/">Media Forums</a></h1>

<div id="memblock">

<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<div class="memblockavi"><img id="avatar" src="" alt="avatar" title="avatar" /></div>
You're a Guest!

<else>

<div class="memblockavi"><img id="avatar" src="" alt="avatar" title="avatar" /></div>

<a href="/member.php?action=profile&uid={$mybb->user['uid']}">{$mybb->user['username']}</a> <span class="ucontrols"><a href="/usercp.php" alt="User CP" title="User CP"><i class="fa fa-cog fa-1x"></i></a> <a href="/private.php" alt="Messages" title="Messages"><i class="fa fa-envelope-o fa-1x"></i></a>
</span>
<a href="{$mybb->settings['bburl']}/private.php" id="pm_notification">{$mybb->user['pms_unread']}</a>

</if>

</div>


</div>

<div style="clear: both;"></div>

<div id="topbarbottom">

<div id="navbar">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/search.php">Search</a></li>
<li><a href="/memberlist.php">Members</a></li>
<li><a href="/myawards.php">Awards</a></li>
<li><a href="/misc.php?action=help">Help</a></li>
<li><a href="/search.php?action=getnew">View New Content</a></li>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(2,3,4,6)) then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>
</ul>
</div>

</div>

	<div id="container">
		<a name="top" id="top"></a>
		<div id="header">
			<hr class="hidden" />
		</div>
		<hr class="hidden" />

		<div id="content">
			{$pm_notice}
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}
			{$pending_joinrequests}
			<navigation>
			<br />


<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<div id="guestwelcome">
<span style="color: #E8B546"><i class="fa fa-asterisk fa-3x pull-left"></i></span> Hey there Guest, it seems that you aren't logged in yet. You are more than welcome to view the board as a guest but we encourage you to take a moment and <a href="http://mediaforums.net/member.php?action=register">register</a> an account so you can participate in our community.
</div><br />
</if>

<script type="text/javascript">
jQuery.noConflict()
jQuery(function($) {
var pmcontents = jQuery("#pm_notification").text();
    if(pmcontents == 0){
        $("#pm_notification").hide();
    } else { return false; };
});
</script>

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
var user_avatar = "{$mybb->user['avatar']}";
var default_avatar = "{$theme['imgdir']}/defaultavatar.png";
jQuery( "#avatar" ).error(function() {
  jQuery(this).attr( "src", default_avatar );
}).attr( "src", user_avatar );
});
</script>

Wow, this thread has had over 7,000 views.
Still need help with this.
Thank you.
You have to remove:

<if in_array($GLOBALS['mybb']->user['usergroup'], array(2,3,4,6)) then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

And replace it with {$welcomeblock} then adjust the way it looks by adjusting header templates for guests, users and moderators.


BUT you can try replacing the code above with this one:

<if $mybb->user['uid'] then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if $mybb->user['uid'] <= '0' then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

You need to use these conditionals:

<if $mybb->user['uid'] then>
//Show only to logged it users
                     </if> 

<if $mybb->user['uid'] <= '0' then>
//Show to guests only
                     </if> 
(2014-06-01, 12:34 PM)marcus123 Wrote: [ -> ]You have to remove:

<if in_array($GLOBALS['mybb']->user['usergroup'], array(2,3,4,6)) then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

And replace it with {$welcomeblock} then adjust the way it looks by adjusting header templates for guests, users and moderators.


BUT you can try replacing the code above with this one:

<if $mybb->user['uid'] then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if $mybb->user['uid'] <= '0' then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

You need to use these conditionals:

<if $mybb->user['uid'] then>
//Show only to logged it users
                     </if> 

<if $mybb->user['uid'] <= '0' then>
//Show to guests only
                     </if> 

I don't understand if I expand Header Templates this is what I get :
[Image: EgJK1yH.png]

I'm confused why I need to remove that code if I want them to show :-/

Thanks for the reply :)

Bump, need some urgent help with this please :p
In the header template find:

<if in_array($GLOBALS['mybb']->user['usergroup'], array(2,3,4,6)) then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

Replace with:

<if $mybb->user['uid'] then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if $mybb->user['uid'] <= '0' then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>
(2014-06-02, 10:48 AM)marcus123 Wrote: [ -> ]In the header template find:

<if in_array($GLOBALS['mybb']->user['usergroup'], array(2,3,4,6)) then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

Replace with:

<if $mybb->user['uid'] then>
<li><a href="/member.php?action=logout&logoutkey={$mybb->user['logoutkey']}">Logout</a></li>
</if>
<if $mybb->user['uid'] <= '0' then>
<li><a href="/member.php?action=login">Login</a></li>
<li><a href="/member.php?action=register">Register</a></li>
</if>

Thanks so mch for the help bro Smile
Love you so much right now.