getGravatar() static public method

* |--------------------------------------------------------------------------- | Get gravatar |---------------------------------------------------------------------------
static public getGravatar ( $email, $size = '50' )
Esempio n. 1
0
<?php

//$statement_lrs = $statement['lrs']['_id'];
$statement = $statement['statement'];
$json = $statement;
if (isset($statement['actor']['mbox'])) {
    $avatar_id = substr($statement['actor']['mbox'], 7);
} else {
    $avatar_id = '*****@*****.**';
}
$avatar = \Locker\Helpers\Helpers::getGravatar($avatar_id, '20');
if (isset($statement['actor']['name']) && $statement['actor']['name'] != '') {
    $name = $statement['actor']['name'];
} elseif (isset($statement['actor']['mbox']) && $statement['actor']['mbox'] != '') {
    $name = $statement['actor']['mbox'];
} elseif (isset($statement['actor']['openid']) && $statement['actor']['openid'] != '') {
    $name = $statement['actor']['openid'];
} elseif (isset($statement['actor']['account']['name']) && $statement['actor']['account']['name'] != '') {
    $name = $statement['actor']['account']['name'];
} else {
    $name = 'no name available';
}
if (isset($statement['verb']['display'])) {
    $verb = $statement['verb']['display'];
    if (!is_array($verb)) {
        $verb = [$verb];
    }
    $verb = reset($verb);
} else {
    $verb = $statement['verb']['id'];
}
<?php

//grab gravatar if available
$grav_url = \Locker\Helpers\Helpers::getGravatar($user['email'], '50');
?>
<div class='user-list'>
  @if ( $lrs->owner['_id'] != $user['_id'] )
    <div class="meta pull-right">
      @include('partials.lrs.forms.removeUser', array('lrs' => $lrs, 'user' => $user))
    </div>
  @endif
  <div class="user-avatar">
    <img src="{{ $grav_url }}" alt="Avatar" class="pull-left avatar img-circle" />
  </div>
  <div class="user-details">
    <div class="user-details-item">
      {{ $user['email'] }}
    </div>
    <div class="user-details-item">
      @if ( $lrs->owner['_id'] != $user['_id'] )
        <select class="form-control lrs-user-role" data-user="******">
          <option value="admin" @if($user['role'] == 'admin') selected @endif>Admin</option>
          <option value="observer" @if($user['role'] != 'admin') selected @endif>Observer</option>
        </select>
      @else
        <b>Owner</b>
      @endif
    </div>
  </div>
</div>
Esempio n. 3
0
<?php

//grab gravatar if available
$grav_url = \Locker\Helpers\Helpers::getGravatar($user->email, '50');
?>
<div class='user-list clearfix'>
  @if($user->verified == 'yes')
    <span class="label label-success pull-right">
      {{ Lang::get('users.verified') }} <i class="icon icon-check"></i>
    </span>
  @else
    <span class="label label-default pull-right">
      {{ Lang::get('users.unverified') }}
    </span>
  @endif
  <div class="user-avatar">
    <img src="{{ $grav_url }}" alt="Avatar" class="pull-left avatar img-circle" />
    @if ( Auth::user()->_id != $user['_id'] )
      @include('partials.users.forms.delete', array('user' => $user))
    @endif
    @if( $user->verified != 'yes')
      @include('partials.site.forms.verifyUser', array('user' => $user))
    @endif
  </div>
  <div class="user-details">
    <div class="user-details-item">
      {{ $user->name }}
    </div>
    <div class="user-details-item">
      {{ $user->email }}
    </div>
Esempio n. 4
0
 private function setAvatar($mbox)
 {
     if (isset($mbox)) {
         $avatar = \Locker\Helpers\Helpers::getGravatar(substr($mbox, 7), '20');
         $avatar = '<img src="' . $avatar . '" alt="User gravatar" />';
     } else {
         $avatar = '';
     }
     return $avatar;
 }