Was using <?php if ($au=$_SESSION['_amember_user']): ?> to find amember user

Discussion in 'aMember Pro v.4' started by chriswallace, Mar 14, 2012.

  1. chriswallace

    chriswallace New Member

    Joined:
    Feb 6, 2010
    Messages:
    16
    I'm working on upgrading my local dev machine to v.4.

    My WP theme uses this in it's header.php to see if there is an amember user:

    PHP:
                        <?php if ($au=$_SESSION['_amember_user']): ?>
                            <li class="logged-in-amember">
                                <a href="<?php bloginfo('url'?>/amember/profile.php"><span>Signed in as</span> <?php echo $au['name_f'] . " " $au['name_l']; ?></a>
                            </li>

    ...
    I was using this in my WP theme's header to see if there was a current amember user, and if so display their name, now this is breaking my local WP theme. Anyone have a fix for this for v.4?
  2. chriswallace

    chriswallace New Member

    Joined:
    Feb 6, 2010
    Messages:
    16
  3. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    replace to
    PHP:
    require_once '/home/myusername/public_html/amember/library/Am/Lite.php';
    if (
    Am_Lite::getInstance()->isLoggedIn() )
    {
        echo 
    "Logged-in" Am_Lite::getInstance()->getName();
    } else {
      echo 
    "Not Logged-in";
    }

Share This Page