Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
558fead4
Unverified
Commit
558fead4
authored
Jan 23, 2018
by
Scott
Committed by
GitHub
Jan 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #588 from pupi1985/patch-99
Fix qa_get_gravatar_url() function not found when using WordPress
parents
eec491f9
ad1584f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
users.php
qa-include/app/users.php
+26
-27
No files found.
qa-include/app/users.php
View file @
558fead4
...
...
@@ -566,31 +566,6 @@ if (QA_FINAL_EXTERNAL_USERS) {
/**
* Return the URL for the Gravatar corresponding to $email, constrained to $size
*
* @param string $email The email of the Gravatar to return
* @param int|null $size The size of the Gravatar to return. If omitted the default size will be used
* @return string The URL to the Gravatar of the user
*/
function
qa_get_gravatar_url
(
$email
,
$size
=
null
)
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$link
=
'https://www.gravatar.com/avatar/%s'
;
$params
=
array
(
md5
(
strtolower
(
trim
(
$email
))));
$size
=
(
int
)
$size
;
if
(
$size
>
0
)
{
$link
.=
'?s=%d'
;
$params
[]
=
$size
;
}
return
vsprintf
(
$link
,
$params
);
}
/**
* Return where the avatar will be fetched from for the given user flags. The possible return values are
* 'gravatar' for an avatar that will be fetched from Gravatar, 'local-user' for an avatar fetched locally from
* the user's profile, 'local-default' for an avatar fetched locally from the default avatar blob ID, and NULL
...
...
@@ -653,7 +628,6 @@ if (QA_FINAL_EXTERNAL_USERS) {
* @param string $email The user's email. Only needed to return the Gravatar HTML
* @param string $blobId The blob ID. Only needed to return the locally stored avatar HTML
* @param string $handle The handle of the user that the avatar will link to
* @param string $blobId The blob ID. Only needed to return the locally stored avatar
* @param int $width The width to constrain the image
* @param int $height The height to constrain the image
* @param int $size The size to constrain the final image
...
...
@@ -692,7 +666,7 @@ if (QA_FINAL_EXTERNAL_USERS) {
/**
* Return email address for user $userid (if not using single sign-on integration)
* @param $userid
* @return
* @return
string
*/
function
qa_get_user_email
(
$userid
)
{
...
...
@@ -1411,3 +1385,28 @@ function qa_check_form_security_code($action, $value)
return
(
empty
(
$silentproblems
)
&&
empty
(
$reportproblems
));
}
/**
* Return the URL for the Gravatar corresponding to $email, constrained to $size
*
* @param string $email The email of the Gravatar to return
* @param int|null $size The size of the Gravatar to return. If omitted the default size will be used
* @return string The URL to the Gravatar of the user
*/
function
qa_get_gravatar_url
(
$email
,
$size
=
null
)
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$link
=
'https://www.gravatar.com/avatar/%s'
;
$params
=
array
(
md5
(
strtolower
(
trim
(
$email
))));
$size
=
(
int
)
$size
;
if
(
$size
>
0
)
{
$link
.=
'?s=%d'
;
$params
[]
=
$size
;
}
return
vsprintf
(
$link
,
$params
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment