Gravatar's


    Most wordpress people probably know what Gravatar is. This is a service that allows users to shine their avatar when commenting on any of the thousands of sites that support Gravatar, without registration or login.

    How it works?


    The user is registered on the Gravatar service and uploads avatars.

    ... some time passes ... The

    user comes to a blog and leaves a comment there. Of course, together with the comment in 90% of cases, he leaves his email.

    When a comment is displayed, the blog asks gravatar.com for the user's avatar by its soap. If an avatar exists, it is displayed. If it does not exist, a standard picture is displayed.

    For those who are familiar with Gravatar, all this, of course, is not news. However, there is news - at the very bottom.



    I want this! Where to begin?


    Registration on gravatar is extremely simple.

    1. Go to http://www.gravatar.com
    2. Click on the “sign up” link (above). We

    get : 3. Enter your email, and in a moment we receive a letter confirming and activating your account on Gravatar.
    4. Follow the instructions in the letter and activate the account.

    5. After activation, you need to devote your email addresses and avatars (yes, there may be several!)

    6. Avatars can be downloaded from disk or specify a URL.
    7. After adding, you can stretch or crop the picture as you like.


    8. After that, you will be asked to select a rating for this avatar. Let me explain what it is in a free translation:

    G - there is nothing obscene on the avatar, it can be used on all public sites.
    PG - there may be indecent gestures on the avatar, or something provocative
    R - the avatar contains elements of cruelty, naked bodies or pictures of hard drugs
    X - the avatar depicts scenes of a pornographic nature.

    So, select your category by clicking on the desired button.

    9. And the last - in fact, attach the avatar to the email address.


    You can add as many avatars and emails as you like, but this is a matter of taste.

    For site owners



    Gravatar can be embedded in any stand-alone blog (especially for Drupalists ).

    Right, using it is simple as a bagel. Here, for example, an implementation in PHP:
    $email = "someone©somewhere.com";
    $default = "http://www.somewhere.com/homestar.jpg";
    $size = 40; //1, 16, 77 ... 512

    $gravatar_uri = 'http://www.gravatar.com/avatar.php?'.
    'gravatar_id='.md5($email).
    '&default='.urlencode($default).
    '&size='.$size;

    print('');


    And now - a bonus



    Recently, Gravatar created a wonderful feature . Its essence is that for users who are not registered in Gravatar, instead of one standard picture (default = http ...), the generated one is shown.


    As you can see, this greatly enlivens the look of the discussion thread. Supported image variations:
    1. identicon

    2. wavatar

    3. monsterid


    In order to implant them in your code, you need to write not default = http ... , but, for example, default = monsterid

    That's all for today. I tried to open the topic completely. Judge you for success.

    Also popular now: