Support » Plugin: Active Directory Integration » How to display AD user attributes in template

  • Hello,

    I am using the “Additional User Attributes” to get some additional data from Active Directory. Its displaying in the WordPress dashboard (on user profiles), but how can I display this in my template?

    I have a custom BuddyPress member loop, and would like to be able to display the “Additional User Attributes” next to each member.

    For buddypress profile fields I use :
    <?php bp_member_profile_data('field=fieldname'); ?>

    So what could I use to display the AD fields?

    Thanks,
    C.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Did you ever figure this out?

    Unfortunately no… Anything related to BuddyPress is usually pretty hard to get support for.

    If you ever figure it out, please do share.

    I believe I figured this out. In the database there is a table called wp_usermeta where there are keys stored under the meta field which are all the additional attributes that come in with AD. In wp-content/plugins/buyddypress/bp-themes/bp-default/members/single/profile/profile-loop.php you add the following code after line 25 where it has this:
    <td class="data"><?php bp_the_profile_field_value(); ?></td>

    Add the following after:

    <td>
    <?php
    global $bp;
    $adi_mail = get_user_meta( $bp->displayed_user->id, 'adi_mail', true );
    echo '<p>Email: ' . $adi_mail . '</p>';
    $adi_department = get_user_meta( $bp->displayed_user->id, 'adi_department', true );
    echo '<p>Department: ' . $adi_department . '</p>';
    ?>
    </td>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to display AD user attributes in template’ is closed to new replies.