WebCards Support Forums

WebCards Support Forums » General Support Requests

guest_member_bar amendment

(6 posts)
  1. dw1973
    Member

    The bar at the top of the page which (as far as I can see from template.html) is populated by {{guest_member_bar}} states "Welcome, login or register"

    I can't for the life of me find out how to edit this to remove the 'Welcome'

    Help!!

    Posted 2 years ago #
  2. corbyboy
    Key Master

    If you open up index.php and go to line 1777 and you will see the section for the member/guest welcome bar.

    It has to be defined inside the code rather than the template because it changes depending on whether the user is logged in.

    If you literally just want to just remove "Welcome", just delete the language variable $lang['welcome'].

    If you need some more specific instructions just let me know.

    Posted 2 years ago #
  3. dw1973
    Member

    Yes a little more specific please, the . and " are throwing me a little!

    I'd like to remove the or as well...

    Current code says...

    $member_bar = $lang['guest_bar'] = $lang['welcome'] . ". <a class=\"head_link\" href=\"" . $login_link . "\">" . $lang['login'] . "</a> " . $lang['or'] . " <a class=\"head_link\" href=\"" . $reg_link . "\">" . $lang['reg'] . "</a>";

    Posted 2 years ago #
  4. corbyboy
    Key Master

    Take this whole section at line 1781 of index.php

    if(valid_session())
    	{
    		$ac_link = $conf['friendly_urls'] ? $conf['url'] . "account/" : "index.php?act=account";
    		$logout_link = $conf['friendly_urls'] ? $conf['url'] . "logout/" : "index.php?act=logout";
    
    		$member_bar = $lang['welcome'] . ", " . $member_row['email'] . ". <a href="">" . $lang['view_ac'] . "</a>";
    		if($conf['enable_contacts'])
    		{
    			$member_bar .= " | <a href="contacts();">" . $lang['contacts'] . "</a>";
    		}
    		$member_bar .= " | <a href="">" . $lang['logout'] . "</a>";
    	}
    	else
    	{
    		$login_link = $conf['friendly_urls'] ? $conf['url'] . "login/" : "index.php?act=login";
    		$reg_link = $conf['friendly_urls'] ? $conf['url'] . "register/" : "index.php?act=register";
    
    		$member_bar = $lang['welcome'] . ". <a href="">" . $lang['login'] . "</a> " . $lang['or'] . " <a href="">" . $lang['reg'] . "</a>";
    	}

    And replace it with this:

    if(valid_session())
    	{
    		$ac_link = $conf['friendly_urls'] ? $conf['url'] . "account/" : "index.php?act=account";
    		$logout_link = $conf['friendly_urls'] ? $conf['url'] . "logout/" : "index.php?act=logout";
    
    		$member_bar = $member_row['email'] . ". <a class=\"head_link\" href=\"" . $ac_link . "\">" . $lang['view_ac'] . "</a>";
    		if($conf['enable_contacts'])
    		{
    			$member_bar .= " | <a class=\"head_link\" href=\"javascript:contacts();\">" . $lang['contacts'] . "</a>";
    		}
    		$member_bar .= " | <a class=\"head_link\" href=\"" . $logout_link . "\">" . $lang['logout'] . "</a>";
    	}
    	else
    	{
    		$login_link = $conf['friendly_urls'] ? $conf['url'] . "login/" : "index.php?act=login";
    		$reg_link = $conf['friendly_urls'] ? $conf['url'] . "register/" : "index.php?act=register";
    
    		$member_bar = "<a class=\"head_link\" href=\"" . $login_link . "\">" . $lang['login'] . "</a> " . $lang['or'] . " <a class=\"head_link\" href=\"" . $reg_link . "\">" . $lang['reg'] . "</a>";
    	}

    Let me know if you have any problems with this.

    Posted 2 years ago #
  5. dw1973
    Member

    Thanks that worked :)

    Posted 2 years ago #
  6. corbyboy
    Key Master

    No problem.

    Post again if you need any more help.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.