You are here

function invite_user_view_alter in Invite 7.2

File

./invite.module, line 432
Allows your users to send and track invitations to join your site.

Code

function invite_user_view_alter(&$build) {
  if (variable_get('invite_profile_inviter', TRUE)) {
    $inviter = db_select('invite', 'i')
      ->fields('i', array(
      'uid',
    ))
      ->condition('invitee', $build['#account']->uid)
      ->execute()
      ->fetchField();
    if ($inviter) {
      $inviter = user_load($inviter);
      $build['summary']['invited_by'] = array(
        '#type' => 'user_profile_item',
        '#title' => t('Invited by'),
        '#markup' => theme('username', array(
          'account' => $inviter,
        )),
      );
    }
  }
}