Changing Gravatar's default avatar to a custom picture

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Kinny
Posts: 3
Joined: 28 Mar 2019, 16:11

Changing Gravatar's default avatar to a custom picture

Post by Kinny »

Hi everybody,

Copy of the topic I started in the French board.

I got a Mantis 2.5 with the GRAVATAR plugin activated.
I'd like to change the default avatar to get a customized picture.
If the user have a Gravatar account, Mantis display his avatar. If not, it display the default customized picture.

Si I edit the file gravatar.php in /plugins/gravatar/ and I get this code :
------------------------------
function config() {
return array(
/**
* The rating of the avatar to show: 'G', 'PG', 'R', 'X'
* @link http://en.gravatar.com/site/implement/images/
*/
'rating' => self::GRAVATAR_RATING_G,

/**
* The kind of avatar to use:
*
* - One of Gravatar's defaults (mm, identicon, monsterid, wavatar, retro)
* @link http://en.gravatar.com/site/implement/images/
* - An URL to the default image to be used (for example,
* "http:/path/to/unknown.jpg" or "%path%images/avatar.png")
*/
'default_avatar' => self::GRAVATAR_DEFAULT_MYSTERYMAN
);
}
---------------------------

I tried to replace 'default_avatar' => self::GRAVATAR_DEFAULT_MYSTERYMAN par 'default_avatar' => "https://sitename.com/images/avatar.png" but Mantis doesn't display the picture, like it can't find it.
screenshot.442.jpg
screenshot.442.jpg (17.95 KiB) Viewed 2580 times
Off course the picture is can be accessed with any browser.
I don't get any error in Mantis so I think the syntax I used is correct.

When I click and open the picture in a new tab from Mantis, I get this message :
screenshot.443.jpg
screenshot.443.jpg (27.95 KiB) Viewed 2580 times
I think there's something about how Gravatar works that I don't know but I can't find any clear information about this subject (or I'm not skilled enough to understand them, that's also maybe true)

Can someone help me ?
It's not something critical but I don't like to stand dumb if front of an issue...
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Changing Gravatar's default avatar to a custom picture

Post by cas »

you cannot just make that change, it takes more.
Look at the docs and it will demonstrate you how to adjust the default script :mrgreen:
http://nl.gravatar.com/site/implement/images/php/
Post Reply