Advertisement:

Author Topic: No welcome "name" at top  (Read 1419 times)

Offline Ganx

  • Newbie
  • *
  • Posts: 7
No welcome "name" at top
« on: January 16, 2009, 11:25:05 AM »
Hi guys, Using extreme61 theme in SMF2 B4 At the top right, "Welcome guest" is fine but as soon as you are logged in, it no longer reflects WELCOME "YOUR USER" Not so i sure i like that!

This is the code related:
Quote
// If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      echo '
          <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
          <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

   }
   // Otherwise they're a guest - send them a lovely greeting...
   else
      echo sprintf($txt['welcome_guest'], $txt['guest_title']);

   // Now, onto our second set of info, are they logged in again?
   if ($context['user']['is_logged'])
   {
      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
            <b>', $txt['maintain_mode_on'], '</b><br />';

Anyone help with mod on this code please. Thanks!

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: No welcome "name" at top
« Reply #1 on: January 16, 2009, 11:59:15 AM »
Try this...

Code: [Select]
// If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      echo '
          <li id="name">', $txt['hello_member_ndt'], ' <em>', $context['user']['name'], '</em></li><br />
          <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
          <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

   }
   // Otherwise they're a guest - send them a lovely greeting...
   else
      echo sprintf($txt['welcome_guest'], $txt['guest_title']);

   // Now, onto our second set of info, are they logged in again?
   if ($context['user']['is_logged'])
   {
      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
            <b>', $txt['maintain_mode_on'], '</b><br />';

Offline Ganx

  • Newbie
  • *
  • Posts: 7
Re: No welcome "name" at top
« Reply #2 on: January 16, 2009, 12:34:37 PM »
Hi Kahnefan
Thanks for the reply and yes worked great!
So simple when you know how  :D
Cheers
Ganx

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: No welcome "name" at top
« Reply #3 on: January 16, 2009, 12:37:11 PM »
;)

As a tip, if you need something that you've seen on another theme, just take a look at that themes coding and you can probably pull it out.