Trboule with tips

Discussion in 'Templates customization' started by mccuiswr, Jul 25, 2006.

  1. mccuiswr

    mccuiswr New Member

    Joined:
    Jul 25, 2006
    Messages:
    1
    You've listed this tip in the manual to add user info to pages:

    <?
    session_start();
    print "Welcome, " . $_SESSION['_amember_user']['name_f'] . " " .
    $_SESSION['_amember_user']['name_l'];
    ?>

    or this for the header html file:

    Welcome, {$smarty.session._amember_user.name_f}
    {$smarty.session._amember_user.name_l} !


    However, if you are not logged in you still see "Welcome, !"

    How can I make this text ONLY appear when a user is logged in?

    Thanks,

    Warren
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    it is easy

    PHP:
    <?php
    session_start
    ();
    if (isset(
    $_SESSION['_amember_user'])){
      print 
    "Welcome, " $_SESSION['_amember_user']['name_f'] . " " .
      
    $_SESSION['_amember_user']['name_l'];
    }
    ?>
  3. tteg

    tteg Guest

    Hi,

    I also would like the welcome code on my Member page, member.html? I am currently using v3.06. But I can't seem to get the above to work. Could you please advise me, maybe I'm editing the wrong page or area.

    Thanks
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    For a template, it should look like

    Welcome {$smarty.session._amember_user.name_f} {$smarty.session._amember_user.name_l}!

Share This Page