42 if (
$helper =
Xoops\Module\Helper::getHelper(
'gravatars')) {
43 $v =
$helper->getConfig(
'pixel_size');
44 $s = (empty($v)) ? $s : $v;
45 $v =
$helper->getConfig(
'default_imageset');
46 $d = (empty($v)) ? $d : $v;
47 $d = ($d==
'default') ?
'' : $d;
48 $v =
$helper->getConfig(
'max_rating');
49 $r = (empty($v)) ? $r : $v;
52 $scheme = \Xoops\Core\HttpRequest::getInstance()->getScheme();
53 if ($scheme ==
'https') {
54 $url =
'https://secure.gravatar.com/avatar/';
56 $url =
'http://www.gravatar.com/avatar/';
59 $url .=
"?s=$s&d=$d&r=$r";
95 return 'Use gravatar.com for system avatars.';
111 if (is_object($userinfo)) {
112 if (is_a($userinfo,
'XoopsUser')) {
113 $email = $userinfo->getVar(
'email',
'e');
117 } elseif (is_array($userinfo)) {
118 if (!empty($userinfo[
'email'])) {
119 $response->setValue(self::getGravatar($userinfo[
'email']));
122 } elseif (is_scalar($userinfo)) {
124 if (is_object(
$user) && is_a(
$user,
'XoopsUser')) {
131 $response->setSuccess(
false)->addErrorMessage(
'User info is invalid');
147 if (is_object($userinfo)) {
148 if (is_a($userinfo,
'XoopsUser')) {
150 $link =
'http://www.gravatar.com/' . md5(strtolower(trim(
$email)));
156 $response->setSuccess(
false)->addErrorMessage(
'User info is invalid');
getAvatarEditUrl($response,\XoopsUser $userinfo)
getVar($key, $format= 's')
if(!$xoops->isUser()) $uid
static getGravatar($email)
if($xoops->isUser()&&$isAdmin) $response
getAvatarUrl($response, $userinfo)