Display User ID in User Area

Discussion in 'Customization & add-ons' started by lipwebmaster, May 27, 2018.

  1. lipwebmaster

    lipwebmaster aMember Pro Customer

    Joined:
    Mar 17, 2011
    Messages:
    17
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Hello,

    You can use the following code in site.php to achieve your needs:
    http://www.amember.com/docs/Site.php_file

    PHP:
    Am_Di::getInstance()->blocks->add('member/main/left/top', new Am_Block_Base(null'welcome'null,
        function(
    Am_View $v) {
            
    $user $v->di->user;

            return <<<CUT
    <p>Welcome {$user->name_f}!<br/>
    Your Membership # <strong>
    {$user->pk()}</strong></p>
    </p>
    CUT;
    }));
    Best Regards.
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Another option - you can use our free Widget plugin:
    https://www.amember.com/amember/product/widget

    You can use the following html with placeholders for Widget content:
    HTML:
    <p>Welcome %user.name_f%!<br/>
    Your Membership # <strong>%user.user_id%</strong></p>
    </p>
    

Share This Page