Displaying user's name in the admin user edit pages

Discussion in 'Customization & add-ons' started by underscoretom, Jan 2, 2007.

  1. underscoretom

    underscoretom Guest

    Joined:
    Aug 3, 2006
    Messages:
    22
    High level, when editing a user, I don't know who the user is when on the User Payments tab.

    Programatically, I see I have available in the code the user's first/last name on the User Info tab, but that info isn't then available on other tabs.

    How can I persist the user's name across all the user edit tabs?
  2. headeagle

    headeagle New Member

    Joined:
    Jan 18, 2006
    Messages:
    3
    Display User Info in Admin

    I had the same request and Alex, gave me the following, which work well. Thanks Alex.

    So, here is the code for you.

    edit /amember/admin/users.php file.
    Add these rows:
    $u = $db->get_user($member_id);
    $t->assign('u', $u);
    before:
    $t->display('admin/user_payments.html');

    Then add these rows to /amember/templates/admin/user_payments.html file:
    {u.name_f} {u.name_l}, {u.email}

    In the user_payments.html file, the above code jsut gives you all black text, which is fine, but I wanted it easier to see who and what. So, I modified the code a bit. The Login name and First and Last, are in Red, to show up better and easier.

    My code:
    <h3>{$title}</h3>
    <h4>Email/Login: <span class="style1">{$u.login}</span> Names:<span class="style1"> {$u.name_f} </span>&<span class="style1"> {$u.name_l}</span></h4>

    I am using Vers. 3.08 btw.

    Rusty
  3. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hi!

    I am also using 3.0.8 PRO.

    This little mod was something I was looking for and wonder why this is not in the script itself. I do consider it necessary to be included in the basic pakage which may help everyone.

    What I also find it interesting is to offer some more globle variables from aMember table fields - AND - other tables outside from aMemeber, like Joomla, etc. Hence the config could be:

    1.
    Field config, Name, ID, etc in ext_1.config.inc.php.

    2.
    Connection details to a different database and tables as

    $pc_ext_1 = array();
    $pc_ext_1['db'] =
    ...
    3.
    User of tags in the templates.
  4. draj

    draj New Member

    Joined:
    Dec 29, 2006
    Messages:
    252
    Hallo!

    May be the best is to add my suggestion in the default distribution of the aMember Pro.

    Well, I did insert the above solution and found out that it did not appear in all the modes, although the suggested solution is correct. I find the following to be a much better solution, which infact achieves much more:

    Add in the user_nb_inc.html the following:

    <table width=100% cellspacing=1 cellpadding=0 class=notebook><tr>
    <td width={$pc} class=notsel>
    First name: {$u.name_f}
    </td>
    <td width={$pc} class=notsel>
    Last name: {$u.name_l}
    </td>
    <td width={$pc} class=notsel>
    Username: {$u.login}
    </td>
    </tr>
    </table>

    before the following line:
    <table width=100% cellspacing=1 cellpadding=0 class=notebook><tr>

    And this will show details in each page of the user. Mind you that if a user has never logged in, the Access.log page will not show for some funny reasons any details!
  5. underscoretom

    underscoretom Guest

    Joined:
    Aug 3, 2006
    Messages:
    22
    Thanks, that works well.
  6. patsho

    patsho New Member

    Joined:
    May 24, 2007
    Messages:
    3
    To Draj

    I took your suggestion and used the following code in user_nb_inc.html.

    <table width=100% cellspacing=1 cellpadding=0 class=notebook><tr>
    <td width={$pc} class=notsel>
    First name: {$u.name_f}
    </td>
    <td width={$pc} class=notsel>
    Last name: {$u.name_l}
    </td>
    <td width={$pc} class=notsel>
    Username: {$u.login}
    </td>
    </tr>
    </table>

    I added it before the following line:
    <table width=100% cellspacing=1 cellpadding=0 class=notebook><tr>

    However, the fields are blank on the User Payments/Subscription page. They show on the Actions page and on User Info page.

    Do you know why?
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This will require /amember/admin/users.php modification and dependfs on version you have.
    Please contatc support we will help.

Share This Page