Gravatars

March 24, 2005 7:21pm 541 comments

I've updated my gravatar plugin to use the new Gravatar REST API. The new API makes it considerably easier for plugins to query the existence of a gravatar, which makes my plugin considerably easier! A few bugs have been squashed, too.

NOTE: this version is called gravatars.php, with an s. If you used a prior version, be sure to deactivate it first, else you'll have function collisions and your blog will break.

Download the gravatars tarball.
Download the gravatars zip.
Feel free to peruse the README.

INSTALLATION

First and foremost, if you have not yet done so, please fix Bug #902! WordPress versions 1.5.1.1 and above already contain the necessary fix.

Place the gravatars.php file into your wp-content/plugins directory, and activate it. Create the wp-content/gravatars/ directory, if it doesn't exist -- make sure this directory is writable by your web server! Click the Options link in your admin menu, select Gravatars, and set the default options. If you enable local gravatars, click the Users link in your admin menu, select Gravatar, and define a local gravatar image for yourself, if you want one.

Edit your theme's style.css, and add two new definitions:
.gravatar {
float:left;
padding: 3px;
border: 1px solid #000;
background: #fff;
}

.postgrav {
float: left;
padding: 3px;
margin-right: 5px;
margin-left: 5px;
border: 1px solid #000;
background: #fff;
}
note: these are the CSS declarations may not work for you. You may want something different.Edit your theme's comments.php file, like this. We wrap the entire thing inside an if (function_exists('gravatar')) { block to make sure your site doesn't totally break if you disable this plugin for some reason.

USING GRAVATARS

Commenters who have registered for a gravatar will have their gravatar image displayed next to their comments. Anyone who has not yet signed up for an account will receive the gravatar image you defined in your Options page. Registered users who have assigned themselves a local gravatar will automatically have that image assigned.You can insert a gravatar into any post or page with a simple tag: <gravatar skippy@skippy.net />. If the email address you supply does not have a gravatar, your default gravatar image will be used, instead.

CHANGELOG

2005-07-02: released version 2.6, adding an ALT attribute to the gravatar images used in posts. Thanks Mike for the heads-up.2005-07-02: released version 2.5 (skipping 2.4). This version should fix random gravatars2005-06-20: released version 2.3 (skipping 2.2). This version fixes the &s in the links when used to fetch images from gravatar.com -- thanks Gregory! Also included in this version is support for random default gravatars. Thanks to Shane for the impetus and testing. PLEASE read the updated documentation for details on how to use random gravatars. Also note that I am no longer offering or supporting one-click installs through the WP Plugin Manager.2005-05-21: released version 2.1. This contains a minor, but important, fix for handling allow_url_fopen. The plugin now uses ini_get instead of get_cfg_var, which should avoid some false positives that had been occuring. Thanks to Fredo for a German translation!2005-04-21: released version 1.9. Minor fixes for valid XHTML (thanks frozenstar) and local gravatar handling (thanks kiesow). This version also introduces support for localization of the text used in the administrative interface. Included in the archive is /wp-content/gravatars/gravatars.po, which you can use to translate the text as needed. Feel free to send translations to me, and I'll make them available for download.2005-04-05: released version 1.8. The plugin now checks for the value of the server's allow_url_fopen setting. If disabled, the plugin automatically disables caching gravatars. Updated the caching and looping, to hopefully improve performance. On some servers (like mine!), this plugin can introduce noticable delay. If that bothers you, simply disable caching and all gravatar images will be pulled from gravatar.com. (Note: this plugin is designed to make gravatars more reliable, not necessarily faster!) Updated comments.php template to properly assign gravatars to trackbacks and pingbacks.2005-04-02: released version 1.6, with special thanks to Adam for fixing a bug with how image sizes are handled.2005-03-29: released version 1.5, which significantly improves options storage in the database. Also introduces a new cache expiration verification method using the database, instead of the filesystem.


Comments so far: Atom feed of the comments for this post

  1. BeerLuver 2005-03-25 17:57:52

    Umm I tried adding editing the comments template as instructed here... and it didn't work. It brought up an error:

    Parse error: parse error, unexpected T_STRING

    And that was directly related to that code I added as per your instructions. Any thoughts on why this isn't working? Also in the Admin panel; I am using WP 1.5 with the default theme, when I click on Gravatars in Options, there is nothing there. No options, no anything... just a blank page. I'm lost here as to why this isn't working :(

  2. skippy 2005-03-25 18:19:54

    The blank option page is due to bug 902. Apply the patch attached to that bugnote, and your Options pages will work as expected.

    The T_STRING error you received is probably due to line breaks that snuck into my sample code. Refresh the example, and make sure you don't have a line break in your template.

  3. BeerLuver 2005-03-25 18:26:20

    OK.. thanks for the reply. Although, I have no clue HOW to apply the patch that's attached there o.O heh weird.

  4. Carsten 2005-03-25 18:42:15

    Yup, I also get a PHP parse error using exact code, and a blank Gravatar Options page in the admin menu.

    Thanks for any insight that you may be able to provide :-)

  5. Carsten 2005-03-25 18:44:06

    Nm... answered while I was typing... Darn I'm slow :-)

  6. BeerLuver 2005-03-25 18:45:27

    Got the Options page to work :) Thanks for that info.

    Now when I added that code to comments template... I get a new error:

    Parse error: parse error, unexpected $

    I'm about to just give up... too tedious just to get this working :( Plus is there a specifc location ON the comments.php file this code should be placed?

  7. skippy 2005-03-25 18:55:27

    Here is my complete comments.php file, which should serve as an example.

  8. BeerLuver 2005-03-25 19:17:48

    Cool. Got it working after it brought up another error in which I had to replace the time of day code with:

    (?php comment_time() ?) ...() in place of obviously heh

  9. skippy 2005-03-25 19:25:49

    Good catch, BeerLuver. I'm using the time of day plugin to provide fuzzy timestamps.

    Glad you got it working!

  10. ALbelly | .SLacKBLoG : Gravatar - Globally Recognized Avatar 2005-03-26 06:09:04

    [...] ngan plugin yang dibuat oleh bapak yang satu Ini. Dimana Plugin dan tutorialnya ada di url Ini. Saya sudah mencoba, tapi tidak mengerti dengan tutorialnya. Hasilnya, plugin tsb tidak bek [...]

  11. .SLacKBLoG: Gravatar - Globally Recognized Avatar 2005-03-26 14:20:39

    [...] ngan plugin yang dibuat oleh bapak yang satu Ini. Dimana Plugin dan tutorialnya ada di url Ini. Saya sudah mencoba, tapi tidak mengerti dengan tutorialnya. Hasilnya, plugin tsb tidak bek [...]

  12. cat 2005-03-26 19:56:35

    hmm... when i try to edit the comments.php i lose my entire comment page. HELP! what am i doing wrong? i was pasting that gravatar code right after the tag like you have in your php. i'm using the default kubrick theme and i'm trying to edit that.

    so far after about 2 weeks with wordpress all i have learned is that it hates me. :)

  13. cat 2005-03-26 20:03:09

    oh, wait! i got it to work! woo! (it would have probably gone a lot smoother had i actually activated to plugin. oops. *sheepish grin*)

    thanks for this plugin though. i have been fighting to try and get gravatars on my site for some time. this made it really easy for a gal who can't figure out php for the life of her! ;)

  14. Frederik 2005-03-26 20:09:17

    Hi there,

    I've just started to use your plugin and have several problems:
    1. The comment page takes about 0.5 sec. generation time per comment when the plugin is active. It seems that comments from authors without gravatars cause the delay.
    2. If I deactivate gravatar caching the img src is empty giving me missing gravatars.

  15. Frederik 2005-03-26 20:26:03

    And as a sidenote: 2. also happens if a user choses to use a local gravatar - even though it is correctly displayed in the gravatars-plugin-menu.

  16. skippy 2005-03-26 21:19:41

    I introduced a silly mistake, which broke gravatars when not being cached locally. The latest version fixes this. Download links in the post above are updated, and the one-click installation is updated, too.

    On some hosts, this plugin may slow things down a little. It introduces a modest delay here on skippy.net, but it's not too bad. If you're concerned about performance, contact me by email (or the Contact link in the sidebar), and we can discuss it.

  17. c. s. 2005-03-27 08:26:32

    That seems like a rather inefficient way to cache images if you ask me. Asking the page that displays the entire comments to access a remote site and process the information is not a very good implementation as it makes the entire page load much more slowly.

    There's no doubt that caching is good as is allowing users to have their own avatar for each site. I just don't think this implementation is the best way to go about it. Maybe I'm just opinionated because I wrote my own script back in November that emulates gravatar.com's avatar serving script.

  18. skippy 2005-03-27 09:42:02

    C.S.: there's no doubt that the cache mechanism could be improved. It's something I want to look into, for future updates.

    You're of course welcome to improve the caching in my plugin, since I released it under the GPL; but it'd be great if you could send me a patch with your improvements.

  19. s1amson 2005-03-29 02:47:00

    Warning: Invalid argument supplied for foreach() in /srv/www/htdocs/wp-content/plugins/gravatars.php on line 247

  20. s1amson 2005-03-29 02:54:35

    Fatal error: Call to undefined function: time_of_day() in /srv/www/htdocs/wp-content/themes/red-train/comments.php on line 19

  21. s1amson 2005-03-29 02:56:45

    Parse error: parse error, unexpected T_ELSE in /srv/www/htdocs/wp-content/themes/red-train/comments.php on line 37

    fun fun fun.

  22. Justin 2005-03-29 05:00:26

    Just like to say a big thank-you for writing this plugin. It works great :D

  23. skippy 2005-03-29 06:30:05

    s1amson:
    "invalid argument supplied for foreach()" is because a foreach loop was passed only one item. This is most likely to occur the first time you run the plugin, when you have only one cached gravatar. "Foreach one item" spits a warning.

    "Call to undefined function: time_of_day()" is because I'm using the fuzzy time plugin, as I mentioned above. I've edited my comments.php example to remove this.

    "parse error, unexpected T_ELSE" is a most likely due to a missing closing brace. Take another look at my comments.php file. If you still have problems, feel free to email me your comments.php file, so I can see what's happening.

    Justin: thank you for your feedback! I'm glad it's working for you.

  24. The Light of Crescent Moon 2005-03-29 08:20:30

    Implementing Gravatar Plugin by Skyppy

    Thx Skyp, your gravatar plugin work great on my WP 1.5 with default template, but i'm using Dunstan Orchard - Easy CSS drop shadows instead of your css. it's great combination. You are the guy!...

  25. Jennifer 2005-03-29 12:27:11

    Oh cool, I will have to try this out!!

    *gets excited*

  26. Justin 2005-03-29 19:54:00

    Hmm... it doesn't work well with Kubrick's oddcomment code, which makes alternate comments have different styles. Basically in Kubrick comments are done with list items, and your code just breaks it wherever I try to put it. Either the images refuse to stick to their respective comments, or the styling is screwed up from the 2nd comment onwards.
    Not sure if that makes sense, I'm not good at PHP either. :(

  27. skippy 2005-03-29 20:11:37

    Justin,
    Here's an example of how to use gravatars with Kubrick's comments.php. Style to taste.

  28. Justin 2005-03-29 21:12:14

    Thanks, I've settled that now. Only thing left is the words wrapping under the gravatars. How do you line up all your comments neatly and have the gravatars stick out on the left?

  29. skippy 2005-03-29 21:31:19

    Justin: my gravatars are lined up the way they are due to their use of the gravatar class, as declared in my stylesheet. I'm not a CSS guru, so I relied on Jennifer to properly integrate gravatars into my layout.

    A quick trick you can use is to put <br clear='all' /> right after the call to comment_text(), like this:

    <?php comment_text() ?>
    <br clear='all' />

  30. Justin 2005-03-29 22:29:31

    Alrighty, I've got the CSS layout done up nicely. Good stuff.

  31. BeerLuver 2005-03-30 09:37:19

    Ah dangit :( I updated this plugin to the 1.5 version you just put out... now my gravatars don't display the proper way I had them before. Before I set the gravatar size to 40 so it sized them down a bit... now that doesn't work and they show up out of alignment. Any clue as to why this occurred?

  32. BeerLuver 2005-03-30 09:44:56

    Nevermind, figured it out ;). I simply added a width statement to the CSS code and that worked perfectly. Example:

    .gravatar {
    float: right;
    padding: 3px;
    margin-right: 5px;
    margin-left: -50px;
    margin-bottom: 5px;
    width: 40px;
    border: 1px dashed #000;
    background: #fff;
    }

    .postgrav {
    float: right;
    padding: 3px;
    margin-right: 5px;
    margin-left: 5px;
    width: 40px;
    border: 1px dashed #000;
    background: #fff;
    }

    Shows up like this: http://www.mindwiped.com/gurlrider/?p=62 ... perfect heh.

  33. J.M. Hardin 2005-03-30 14:35:35

    I don't know what I was doing wrong, but every edit gave me the T_ELSE error. I'm using the Default (Kubrick) theme. I ended up having to copy everything from the example file between the "You can start editing here" and "if you delete this the sky will fall on your head" but I got it to work. Yea!

  34. Now using gravatars - If..Else Log 2005-03-31 19:45:40

    [...] April 01st 2005 Filed to Shorts by Phu Gravatars are now enabled courtesy of Skippy’s excellent plugin. The current styling and placement is temporary and will be chan [...]

  35. centripetalforces dot com 2005-04-02 06:29:11

    Grav-a-cache-a-tars

    I’ve implemented Skippy’s Gravatars plugin. Net result? All Gravatars are now cached (for 7 days) to improve performance and make use of the Gravatar REST API....

  36. Brendan 2005-04-02 08:27:03

    Right, well after fighting with this for a good hour or so I have given up. Is there any reason why setting the size in the gravatar options doesn't work? I get stuck with huge 80px gravatars.. I'm trying to use 15px gravatars in line with my layout, but no joy..

  37. skippy 2005-04-02 08:38:36

    The "size" option in my plugin is only used when requesting an image from gravatar.com. The gravatar request format tells gravatar.com what size images you want, so when my plugin requests an uncached image from gravatar.com, it should receive the size you requested. If you left the options at their default values and took a peek at your blog, you will have cached images at the plugin's default size. Simply change the default size, delete the locally cached images, and view your blog again.

    My plugin does not enforce image sizes, so you'll want to make your default gravatar image at the appropriate size.

    One way to enforce gravatar sizes would be to do something like this, in your comments.php:<?php
    $foo = get_option('gravatar_options');
    $gravatar_size = $foo['gravatar_size'];
    ?>
    Then, modify the gravatar img declaration to look something like this:<img src="<?php gravatar('$comment->comment_author_email'); ?>" size="<?php echo $gravatar_size; ?>" />

  38. If Else 2005-04-02 08:48:23

    Alternatively, it's probably a better idea to just use css to resize the gravatar images. BTW, thanks again Skippy for the brilliant plugin!

  39. Adam 2005-04-02 20:47:53
    If you left the options at their default values and took a peek at your blog, you will have cached images at the plugin’s default size.

    Wrong. If I manually append &size=32 to the $gravatar variable, the sizes work fine. Even with caching disabled, the size declared in $grav_options['gravatar_size'] does not do a thing.

    I will have a poke around the code a bit more and see if I can find out why.

  40. Adam 2005-04-02 20:57:53

    I found the bug.

    Line 350 of gravatars.php reads the following:

    if ($grav_option['gravatar_size'] != '')

    That should be:

    if ($grav_options['gravatar_size'] != '')

    Adam.

  41. skippy 2005-04-02 22:42:06

    Thanks, Adam! I'll update the archives immediately.

  42. Davyd 2005-04-03 07:16:24

    Hey Everyone

    I got it to work .. but for people without gravatars, it just shows "Get your own gravatar for comments by visiting gravatar.com" and the Alt text is "Visit (the comment's author name)"

    This is really weird, as I thought it shouldbe showing the default pic/gravatar (as set in the Options menu)....with the alt txt being: "Get your own gravatar for comments by visiting gravatar.com"

    Any ideas?

    Cheers
    D

  43. Ross 2005-04-04 23:36:38

    Thanks for the tips! It works fine!

  44. duard - Carlos Aquino 2005-04-05 12:30:18

    it´s very good :-D

  45. spoken for: a love divine » elijahhenry.org 2005-04-05 20:57:47

    [...] getting it working on that site let me to the new version of [...]

  46. Ozh 2005-04-06 14:45:51

    Rofl at beerluvr's headbanging avatar :))

  47. heriyanto binduni 2005-04-08 20:52:07

    hi, it was great but i found on line 23, add_options_page('Gravatars', 'Gravatars', 9, __FILE__, 'gravatar_manage');the __FILE__ make the option pluggin link error 404 on windows xp pro, apache 2, php 5.04. so, i just change it to simple 'gravatars.php' to make it work.
    same problem with line 25.

    also one point, could you just define one variable so it makes us easy to change the location of gravatar. right now i have to change all wp-content/gravatars if i want to put gravatar on different location.

    once again, thanks.

  48. Father Luke 2005-04-12 07:22:47

    Baby, it rawks.
    Skippy does it good.

    Okay,
    Father Luke

  49. Jeff Swanson 2005-04-13 04:59:05

    If someone doesn't have a Gravatar, is there a way to set a "Default" image to show in it's place...? If so, where do you place the code for it?

    My site address is: http://www.jeffswanson.com

    Thanks!

  50. skippy 2005-04-13 07:30:02

    Jeff: yes, you can absolutely define a default gravatar. In the Options admin menu, select Gravatars. The section labelled Default gravatar image allows you to specify either a local or remote image to use for all people without a gravatar.

    For example, anyone with an orange question mark next to their name in the list of comments above does not have a gravatar. The orange question mark is the defualt image I assign, which is located at /images/blank_gravatar.png.

  51. david 2005-04-13 11:30:39

    I'm getting the following error ... any suggestions?

    Warning: Unable to open 'http://www.gravatar.com/avatar.php?gravatar_id=1f41ce7b88907fcc4ed4ec751fe48241&rating=PG&size=40&default=http://david.fallingrock.net/wp-content/gravatars/blank_gravatar.png' for reading: No such file or directory in /home/david/fallingrock/david/trunk/wp-content/plugins/gravatars.php on line 465

  52. Jeff Swanson 2005-04-13 20:34:17

    "Options admin menu, select Gravatars"

    When I do that, I get a blank page.

    I log in, Select options, I then select gravatars, then blank page. I'm still in the wordpress interface, but a blank under gravatars. Is there a way to mod the gravatars.php file directly?

  53. skippy 2005-04-13 20:56:03

    Jeff: it sounds like you have not yet fixed bug 902. Fix that. If you still have problems, let me know.

  54. Jeff Swanson 2005-04-13 22:06:16

    How do you implement the patch? where does it go? thanks for all your help :-)

  55. Father Luke 2005-04-13 22:24:23

    Anyone ever seen this in the Gravatar section of the dashboard?

    Fatal error: Cannot redeclare gravatar_menu() (previously declared in /home/virtual/site197/fst/var/www/html/wp-content/plugins/gravatars.php:23) in /home/virtual/site197/fst/var/www/html/wp-content/plugins/gravatars.php on line 22

    I'm using Wordpress 1.5-beta-1 2005-01-25 if it matters, and I have implemented the patch.

    Funky, man ! Really wild.
    kay,
    Father Luke

  56. Jeff Swanson 2005-04-13 23:57:52

    Ok, I got the page to caome up...now I get this at the top...

    WARNING! WARNING! WARNING!
    allow_url_fopen is DISABLED on this host.

    What do I do about this?

  57. Jeff Swanson 2005-04-14 00:04:22

    ok, I got the default gravatar to work...wow, my brian hurts. I can calulate the distance's between stars quicker then I can do this! What is that warning about though?

    WARNING! WARNING! WARNING!
    allow_url_fopen is DISABLED on this host.

  58. Father Luke 2005-04-14 00:04:47

    Hi Jeff.

    I don't know anything, but I noticed that if you put this:
    http://www.jeffswanson.com/wp-content/gravatars/blank_gravatar.png

    Into your browser it works.

    But there is the problem: How to get your blamk Gravatar to show up.

    There is a dash ---> /

  59. Jeff Swanson 2005-04-14 00:05:46

    that would be "brain" hurts... can't spell any longer...just seeing code!

  60. Father Luke 2005-04-14 00:29:04

    Yeah, I know.

    If you look at the properties for the default image at your
    site you will see that it is missing a dash. I borked the code
    witing the explanation here.

    I dunn'o why you are missing a dash where it matters.

    Skippy is someplace resting, man, no doubt from all of our screaming and knashing of teeth.

    Hey? You ever see the get a gravatar plug-in they hae out now?

    It's here: http://txfx.net/2005/03/11/wp-gravatar-signup/

    It's rilly kewl, but I can't get it to work.
    Okay,
    Father Luke

  61. skippy 2005-04-14 06:21:17

    Jeff:allow_url_fopen is a setting for PHP that determines whether the filesystem operations (like copy, rename, etc) are allowed to operate on remote files (via URIs). On many hosts, this feature is enabled; but on some hosts (like yours), this feature is disabled. This is not something that can be changed at runtime, for security reasons. This gets set once, for the entire webserver.

    Having this option disabled at your host simply means that the parts of my script that copy the image from gravatar.com to your local cache will not work.

    The warning message (which may be a little dire, I guess) is my attempt to let you know that caching of gravatars is disabled. The plugin will still work, by fetching images directly from gravatar.com. You just won't be able to save local copies of them.

  62. Refleksi Diri 2005-04-15 05:12:09

    [...] April 15th, 2005 Plugins Sudah diinstall: FancyToolstips Gravatars Y!Q Lookup Posted in Blogging | Leave a Reply [...]

  63. InFnit 2005-04-16 21:39:02

    How do I remove the "Get your own Gravatar for comments by visiting Gravatar.com" bit?

    Great btw, just the annoying ad ;)

  64. Erin 2005-04-16 22:16:20

    Hey, did we ever get a solution to Father Luke's problem?:

    Anyone ever seen this in the Gravatar section of the dashboard?

    Fatal error: Cannot redeclare gravatar_menu() (previously declared in /home/virtual/site197/fst/var/www/html/wp-content/plugins/gravatars.php:23) in /home/virtual/site197/fst/var/www/html/wp-content/plugins/gravatars.php on line 22

    I’m using Wordpress 1.5-beta-1 2005-01-25 if it matters, and I have implemented the patch.

    Funky, man ! Really wild.
    kay,
    Father Luke

    Because that's the problem I'm having... I did what the read me said about bug #902 before getting this error, did I not do it right?

  65. Erin 2005-04-16 22:17:29

    Oops I forgot to close the blockquote x.x

  66. My Other Side of the Stories » Wordpress Plugin Meme 2005-04-16 23:11:48

    [...] blog nicer with the cool popup tooltips, but other than that, not really useful. (5/10) Gravatars, nice but not really useful. Show gravatar on comment. (6/10) Yahoo/MSN Style Smileys [...]

  67. InFnit 2005-04-17 04:15:04

    Ok got that fixed - dunno how :S

    I wanna modify this so it works for posts as well, I changed all the "comments" in the code that I inserted in the index.php to "post" like $comments to $post but it didnt work.

  68. skippy 2005-04-17 10:38:44

    Erin:
    The problem Father Luke had was caused by a beta version of WordPress 1.5. If you're using a beta version of 1.5, please upgrade. I have not tested my plugin against anything other than an official 1.5 release.

    InFnit:
    Tell me a little more about what you're trying to accomplish. Are you trying to display a gravatar for the post's author? Or are you trying to do something else?

    And a question for everyone:
    Given the growing number of comments in this thread, would a dedicated disussion forum be useful? I've been thinking of installing bbPress...

  69. InFnit 2005-04-17 16:01:58

    www.argetland.bobos.ca

    (Sorry bout teh cr4ppy h047 :P )

    See my comments show the authors gravatar but when I view single posts or posts on the index it shows a blank gravatar:

    <code snipped by skippy>

    Please help :)

  70. Andor 2005-04-17 19:53:21

    What a funny thing... I'll try it

  71. cat 2005-04-17 21:22:59

    for some reason gravatars of people who aren't in my "cached" images aren't showing up. if i click NO for cache gravatar, they show up - but the one i have set as a default goes away - it just becomes a text ad for gravatars.

    that wasn't explained very well, was it? sorry. only right now, everyone who comments gets my Question mark Gravatar..i seem to have made them all go away. HELP! (currently i have "cache gravatar" enabled...)

  72. SurfiOnline » Blog Archive » Tonights Experiments 2005-04-19 10:41:08

    [...] ow i’m running the following plugins: Auto Moderate Comments Flickr Gallery 0.7 Gravatars MF Favorites - Thanks Michele! SO Recent Activity - This plugin is actually a rewri [...]

  73. Memory for Me » Introducing Gravatars 2005-04-19 11:38:46

    [...] lisation and expression feature. I came across the idea on some guys website, who had them enabled and wrote a wordpress plugin for them. I’ve just realised I’ve uses his o [...]

  74. kiesow 2005-04-21 20:05:51

    hey,

    i just wanna tell you, that there's a bug with local gravatars in version 1.8
    to fix you have to go to line 276 "foreach ($commenters as $commenter) {"
    and add before this a new line with "$gravatar_local = get_option('gravatar_local');"

  75. skippy 2005-04-21 21:32:22

    kiesow: you're right. That was an oversight on my part. Fixed.

    Also fixed is a problem with valid XHTML formatting of the gravatar img when not caching.

  76. Elana 2005-04-22 09:02:33

    Could someone please put up directions on how to install the patch 902? There are a couple of people who had problems, and I can't figure it out myself.

  77. CLAMP Campus Adventures » Gravatars! 2005-04-22 12:19:59

    [...] odify the settings on several popular plug-ins, I’ve added a new plug-in to my site, Gravatars Plug-in. This plug-in allows people who comment in my entries on site to use avatars [...]

  78. CLAMP Campus Adventures » Gravatars! 2005-04-22 12:21:11

    [...] odify the settings on several popular plug-ins, I’ve added a new plug-in to my site, Gravatars Plug-in. This plug-in allows people who comment in my entries on site to use avatars [...]

  79. cat 2005-04-23 15:02:05

    my host has disabled allow_url_fopen so the caching is disabled. is there a way around this???

  80. skippy 2005-04-23 16:03:07

    Cat: no, allow_url_fopen is controlled solely through php.ini. If your host has disabled this, there is no provision to override it.

    You can still use my gravatars plugin, but local caching of the images will be disabled.

  81. Carina 2005-04-23 16:32:08

    Super cool!

  82. Bionic 2005-04-24 05:28:01

    I have some trouble with your Plugin an the kubrick Theme.
    When i post a comment to my own post,i can't see my Gravatar neither the default one :-(

  83. Bionic 2005-04-24 09:42:38

    Strange, i can see your gravatar on my site - but not mine on yours?!
    Does gravatar.com need some time to aktivate my gravatar? I have just signed on today at gravatar.com.

    Greets and thx for testing ;-)

  84. skippy 2005-04-24 10:10:39

    Bionic: yes, there is a delay for gravatars to be processed and rated. This is all done manually, still: Tom personally reviews each submitted gravatar to assign its rating before approving it.

  85. Bionic 2005-04-24 10:59:53

    Ah OK, now i'm still waiting for my gravatar :-D
    Thanks for your reply skippy ;-)

  86. cat 2005-04-26 10:32:46

    Thanks, Skippy! I guess I can survive without the caching. I love this plugin so I'm keeping it activated.

  87. tGriff 2005-04-28 00:54:00

    Say, I am getting the same error as a previous commenter stated:

    Fatal error: Cannot redeclare gravatar_menu() (previously declared in /home/griffhome/www/www/wp-content/plugins/gravatars.php:23) in /home/griffhome/www/www/wp-content/plugins/gravatars.php on line 22
    I get this error when I select "gravatar" in the options menu and also in the Users menu... I applied the patch as stated in the readme...

    The gravatar is inserting the "?" and my gravatar... and it slows down my pages considerable...
    Have you started the bbb yet? That could be good!

    Thanks!
    tGriff
  88. tGriff 2005-04-28 01:08:10

    using WP 1.5 stable release... :-)

  89. skippy 2005-04-28 05:42:33

    tGriff: I've only seen that error when someone is using a 1.5 beta release. Can you please confirm that you've installed the official 1.5 "strayhorn" release? If possible, delete all core WordPress files, and then put the 1.5 strayhorn files into place.

    As for speed: yes, my plugin can slow things down a wee bit. If you like, you can disable caching, insteading fetching all gravatars directly from gravatar.com -- that seems to improve speed for most poeople.

    I've not yet installed a bulletin board. You're the first person to mention it! Without a large interest, I'm terribly motivated to install it.

  90. Crow 2005-04-28 22:53:09

    So, do you need the gravatar.php plugin in addition to the gravatars.php plugin to make the gravatars plugin work?

    Thanks

    Crow

  91. Glutnix 2005-04-29 00:44:24

    Thanks Skippy! You did a really good job on this plugin! BTW, the default setting pointing to blank_gravatar.png is missing an initial / for some reason... I did install with one-click though :)

  92. Glutnix 2005-04-29 00:52:15

    Also, the comments.php code you provided doesn't use the default image size configured in settings :( it's hard-coded to 80x80

  93. Glutnix 2005-04-29 01:35:23

    Also the <gravatar foo@bar.com /> doesn't use the configured size. Would be nice to be able to apply a class or something to gravatars inserted this way.

    Also, the example <gravatar foo@bar.com> gravatar options page is missing the closing slash.

    Sorry to pick your plugin to pieces, but it's nearly there :D Keep it up :D

  94. Glutnix 2005-04-29 01:36:52

    Oops, just realised that post gravatars have class="postgrav" on them... cheers!

  95. Webfroot » Gravatars 2005-04-29 01:39:54

    [...] wait to see more of your faces For those with WordPress, I’m using Skippy’s Gravatars Plugin. It’s really good, but there’s a few little bugs that could do wit [...]

  96. skippy 2005-04-29 05:51:14

    crow: you do not need both gravatar.php and gravatars.php. The current version of my plugin is named gravatars.php, and that is the only one you need to use.

    Glutnix: thanks for pointing out the errors. The one-click version is currently lagging in updates. I neglected to package a new one-click version for several of the most recent changes. I'll try to remedy that shortly.

  97. blog.detlog.org » WP 1.5 Upgrade and Plugins 2005-04-29 12:42:26

    [...] are a list of plugins installed on blog.detlog.org (as of today). Live Comment Preview Gravatars Post Levels Subscribe To Comments WP Paginate Bad Behavior And I guess this isn [...]

  98. Crow 2005-04-29 19:09:08

    Skippy,

    I've installed the plugin, and I think I did everything right. I have a custom theme, but it doesn't have a comments.php file, so I am assuming it uses the file in the default themes folder. I pasted your example code into that and have pasted your css from the read me into my css file. So far, the only thing that is showing up in my comments is this:

    Get your own gravatar for comments..etc.

    Any idea what I did wrong?

    Thanks.

  99. Crow 2005-04-29 19:29:48

    he he he--nevermind. I'll come back with a real question when I can open my eyes. Sheesh. Didn't even see the Options/Gravatars menu.

    Like this chunky mess:

    Fatal error: Cannot redeclare gravatar_menu() (previously declared in /home/crowspea/public_html/wp-content/plugins/gravatars.php:23) in /home/crowspea/public_html/wp-content/plugins/gravatars.php on line 22

    I edited the 902 bug

  100. Crow 2005-04-29 19:50:22

    I'll just keep talking to myself. Fixed that last issue. Thank god I'm not in charge of anything dangerous.

  101. Crow 2005-04-29 20:43:42

    Okay, this time I mean it. My gravatar is showing up on my site (no one else there has signed up for a gravatar yet). I changed the default size parameter in Options/Gravatars to 40, but my gravatar is still displaying at full size. I saw someone else use css to force the size change. Is this the only way to do it?

    Also, how about a feature request? I have a folder of little gravatars I made locally in the same folder as my local gravatar. I wanted to randomly display them for users who don't have a gravatar. Any way to do that?

    Thanks. This plugin is very cool.

  102. Glutnix 2005-04-29 20:55:57

    Cheers for the drop-by on Webfroot, Skippy :)

    Another idea -- how about a different default gravatar for pings (trackbacks and pingbacks)?

  103. clint 2005-04-29 23:06:22

    cool stuff indeed skippy...only thing I'm wondering is using:

    going to be an open invitation to email spam?

  104. clint 2005-04-29 23:10:00

    heh using code on that last entry made it disappear.. doh...

    is using your email addy in the code going to be an open invitation to spam?

    actually i think i need to get some rest.. your tag is php right so it doesnt write to the source?

  105. skippy 2005-04-30 08:40:06

    Crow: My plugin doesn't actually enforce any size restrictions on gravatars. By specifying the default size, you are setting the size that will be requested from gravatar.com when a new gravatar is requested (and optionally cached). If your local gravatar is too large, you have two choices: manually set the size in the img code (or the CSS); or manually resize the image file to your preferred dimensions.

    As for random gravatars for people that have not yet signed up: you can do that using conditional logic in your template. That's not the kind of functionality that belongs in the plugin itself. There's several ways to acomplish this: feel free to email me if you'd like to discuss it. For now, I'll leave it as an exercise to the readers -- post the solution to your own blog and I'll link to it. =)

    Glutnix: It's actually pretty easy to add seperate gravatar images for pingbacks and trackbacks, and doing so requires no modifications to my plugin. This sort of thing should be done in your comments.php template, using conditional logic to check whether the comment is a comment, a pingback or a trackback. If one of the latter two, use whichever image you want. Again, feel free to email me if you'd like to discuss this; and please post your solution on your own blog so that I can link to it!

    clint: There's no real risk of email harvesting, because gravatar images are keyed off of the MD5 hash of your email address, and not the email address itself.

  106. Crow 2005-05-01 00:35:07

    Skippy,

    the plugin is working great. I'd love to try my hand at loading a random image, but have not had much luck figuring out where in the template to insert the random image.

  107. father Luke 2005-05-01 19:19:00

    Skippy.

    This is weird.
    I'm still futzing around with the plugin for Manji.

    On this page: http://fatherluke.com/?p=174

    I took the e-mail addy out from one of the
    non-gravatared (gravatard?) comments, wallflower,
    second entry, and the default gravatar shows up
    where there wasn't a default with a non-registered addy
    before taking out the addy.

    How is this possible?

    Since I cannot get the admin panel working,
    may I adjust the php file so that the non
    registered folks get the default gravatar?

    Howdy Skippy !
    Father Luke

  108. skippy 2005-05-01 20:12:57

    Father Luke: I'm not at all sure what's causing the problem you're experiencing.

    You're free to make any changes you feel are necessary to the plugin. If you make any improvements, please share them!

  109. Crow 2005-05-02 21:30:24

    Hey, I got random local gravatars to show up on my site.

    Here's a link:

    Scroll down to the bottom comment. Hit reload a few times.
    Here's what I did:

    comment_author_email);
    if ($blank_avatar == $check_avatar) {
    $show_avatar='/images/avatars/avatar' .rand(1,25) .'.jpg';}
    else {
    $show_avatar=$check_avatar;}

    It checks to see if the result from the gravatar function matches the default gravatar (if you changed it in the admin panel, change it here, too). If it doesn't match, it leaves it alone. If it DOES match, a random image is selected (I know I have 25 images in the directory). And then where the gravatar function used to be, substitute this:

    "

    Not terribly elegant, but then I'm not too fluent in PHP.

  110. Crow 2005-05-02 21:35:32

    Wow, that got severly munged.

    Here is is again

    I added this right after the check to see if the gravatar function exists:

    $show_avatar='';
    $blank_avatar='/wp-content/gravatars/blank_gravatar.png';
    $check_avatar=wp_gravatar($comment->comment_author_email);
    if ($blank_avatar == $check_avatar) {
    $show_avatar='/images/avatars/avatar' .rand(1,25) .'.jpg';}
    else {
    $show_avatar=$check_avatar;}

    ANd then, instead of calling the function in the img tag, I did this

    "

    And here's a link to see it.http://www.crowspeaker.com/2005/05/01/14/

    Scroll down to the bottom comment. Hit reload a few times.

  111. Crowspeaker » Grrr… Avatars! 2005-05-03 16:34:45

    [...] gravatar web site. These come to you thanks to folks at Gravatar and to the author of the Gravatars plugin for WordPress Those of you who have a gravatar should see them show up in the [...]

  112. BLOGGED ---at the-protagonist.net: affordable and reliable web hosting provider since 2002 2005-05-09 10:14:29

    [...] far: WP-amazon MiniPosts Plugin for WordPress WordPress 1.5 User Online Bad Behavior Gravatars Recent Comments Themes Switcher Contact Form Wordpress 1.5 Stats [...]

  113. Ajay D'Souza 2005-05-11 22:45:10

    Hi,

    I installed the plugin. It works fine but I get this error:

    allow_url_fopen is DISABLED on this host.

    I brought it to the notice of my host who say that the allow_url_fopen is enabled. Verified with phpinfo()

    Read the post here

    Please help!
    Thanks :)

  114. Lo Skyblog » Globally Recognized Avatar 2005-05-14 17:29:34

    [...] su questo blog. Da oggi ne ho ‘potenziato’ le funzionalita’, grazie al plugin di Skippy che, se pure necessiti ancora di qualche messa a punto per meglio integrarsi co [...]

  115. Lo Skyblog » Globally Recognized Avatar 2005-05-14 17:30:06

    [...] su questo blog. Da oggi ne ho ‘potenziato’ le funzionalita’, grazie al plugin di Skippy che, se pure necessiti ancora di qualche messa a punto per meglio integrarsi co [...]

  116. Chelle 2005-05-20 09:53:14

    First, this rawks so hard. Love the interface with the admin, my eyes thank you.

    Second, I may have missed it, does the latest version of your plug in allow the admin to go in and give a local garvatar to users already signed up? Orr mebbe I should be asking, how does the local gravatar work, so I can better understand before I go playing around and break something :D

    And lastly this is for Crow: how did you call your code for the random image, it's not showing in your comment.

  117. Julia 2005-05-20 18:46:42

    Thanks for the good work!

  118. Annabel Lee 2005-05-21 04:35:09

    Hi ! ^^
    I've got an error message in my gravatars admin saying :WARNING! WARNING! WARNING!
    allow_url_fopenis DISABLED on this host.

    Gravatar caching has been disabled.

    I've no idea what's wrong and what to do :-(

  119. Annabel Lee 2005-05-21 04:36:36

    oops !
    I've not seen the previous post about this problem, sorry ^^

  120. skippy 2005-05-21 09:04:33

    Chelle: users can add their own gravatar image through the "Users" admin menu. Users with a userlevel greater than zero have a new sub-menu titled "Gravatar", and here they can manage their local gravatar.

    I don't have plans to make an administrator interface to override gravatars. If you want to give someone a different gravatar (whether they're a registered user or not), simply find their cached gravatar and replace it with the image you want to use.

  121. Karl Bedingfield 2005-05-21 10:33:02

    Hi there,

    I just uploaded the revised plugin and now I get this error:

    Fatal error: Cannot instantiate non-existent class: cachedfilereader in /home/editor/public_html/news/wp-includes/wp-l10n.php on line 72

    Whats this? I am running 1.5.1.1

    Thanks

  122. Fredo 2005-05-21 11:49:16

    Hi, would you mind updating the entry on wp-plugins.net? Thanks!

  123. tinyau 2005-05-22 00:11:33

    I have encountered the similiar error as Karl Bedingfield. I'm using 1.5.1.1 and when I clicked 'Gravatar' in Option of Admin Panel, the following error is shown.

    Fatal error: Class 'CachedFileReader' not found in /var/www/localhost/htdocs/wordpress/wp-includes/wp-l10n.php on line 72

  124. chelle 2005-05-22 18:00:41

    Thanks muchly for the run down. Side effect of having ultimate cosmic admin powerZ- you don't think for a minute there isn't something you can interfere with ;)

  125. Gregory Wild-Smith 2005-05-24 03:46:02

    tinyau - I got that - deleting the mo and po files fixed it.

  126. Gregory Wild-Smith 2005-05-24 03:58:09

    So you know - the size things still seems to be broken.. which is kind of annoying.

  127. tinyau 2005-05-25 10:15:32

    Thanks Gregory Wild-Smith, it's worked now.

  128. A Family Guy » Gravatar 2005-05-28 14:19:58

    [...] der Web Site Update on 2005/05/28 at 15:28:36 I have abandoned Favatars in favor of Gravatars. You can see them in action when you make a comment. [...]

  129. Footsteps in the Mirror » The Very Long List Of Problems… 2005-06-02 02:59:58

    [...] e Day[ALPHA] Browser Sniff Category Image(s) Paged Comment Editing Enhanced Post List Gravatars Headline Images - not implemented yet because I’m [...]

  130. Sproke :0) 2005-06-02 19:28:24

    Hey there. Thanks so much for this wicked plugin. I have encountered a problem though. Am using WP 1.5.1.2. Local gravatars are working great, but ones being processed from gravatar.com are not showing up. I have copied your directions excactly, (copying and pasting code) and used the same layout that you suggest to use for the css style sheet. Is it something to do with 1.5.1.2?

    Thanks again!
    Heidi :0)

  131. Rehan 2005-06-03 00:39:54

    Thanks for this plugin! It works great!

  132. Unadulterated Arrogance 2005-06-04 15:16:41

    Excellent plugin, Kudos to you my friend.

    I have just one request for you, if the commenter does not have a gravatar profile, the default one is used.. its nice but what if you have many commenters without a gravatar profile? the same default gravatar numerous times makes it odd... would it be possible to have many gravatars which would be chosen at random if the commenter does not have a gravatar profile?

    Jinu Johnson
    www.arrogantly.com

  133. Nicki 2005-06-06 04:22:09

    I'm also getting the Fatal error: Cannot instantiate non-existent class: cachedfilereader in /home/.wadeheater/astralp6/creative-logic.net/wp/wp-includes/wp-l10n.php on line 72 issue with my admin menu. I'm running wordpress 1.5.1.2

    Line 72 of that particular file is $input = new CachedFileReader($mofile);

  134. Shelby 2005-06-08 06:56:07

    Wow, I'll try this at home. This may be a great improvement to what was initially released by Tom Werner. Sadly he is just providing a "plugin" for WP that barly deserves this name. Because I also did improvements on his basic code in the past I'll expect further branches of this cool feature. That probably will confuse WP-Admins and so may lead to not install any implementation at all.

  135. Rob 2005-06-09 19:39:35

    God, I must be an idiot or something. Can't get the Options page to show for the life of me. I get this:

    Fatal error: Cannot instantiate non-existent class: filereader in /home/olgas/public_html/wp-includes/wp-l10n.php on line 69

  136. Rob 2005-06-09 19:43:31

    I applied the 902 bug patch, assuming that the "-" signs meant that those lines were to be deleted and replaced with the "+" lines. And of course, the plus/minus signs were to be removed.

    I actually tried it both ways (leaving in the "-" lines on the menu-header.php. Neither worked. Something's broken with that wp-l10n.php file.

  137. skippy 2005-06-09 20:27:32

    Rob: I don't think you're an idiot, I think something fishy is going on with WP's localization, or with my attempt to localize my plugin. You're not the first person to report trouble, unfortunately.

    Others seem to have had success simply by deleting the gravatars.po file. Have you tried that?

  138. skippy 2005-06-09 22:19:47

    Rob: I'm beginning to suspect that it's a Windows-specific problem. You and at least one of the other people reporting problems are both on Windows hosts -- you using IIS and tinyau on Apache on Windows.

  139. Rob 2005-06-09 22:22:56

    Huh, sure enough! Had to delete both the gravatars-en_US.po and the gravatars-en_US.mo files though.

    Thanks for the tip!

  140. Rob 2005-06-09 22:25:40

    Oh yeah, that could be. To be honest, I wasn't sure what my host was set up with. At least it's working now. :-)

    Say, did my second question make sense about the correct procedure for the 902 patch?

  141. skippy 2005-06-09 22:44:06

    Rob: yes, your question made sense; and you did the right thing. The lines marked with "-" were to be replaced with the lines marked with "+"

  142. Joe 2005-06-10 14:21:01

    I love the plug-in. Thanks for the work done here. It's being used everywhere!

    I'm trying to implement it on my site before I really get my posts going, but I'm just having one problem:

    On the 1st comment of a post, the gravatar has the correct placement (the top lines up with the top of the comment area). However, the 2nd, 3rd, etc., etc. comments have the incorrect placement (the top is above the top of the comment area.

    Here's an example.

    I'd appreciate any help here.

    Oh, one more question...how long does it usually take for a gravatar to be approved by gravatar.com? I guess I could look that up on their site, huh?

  143. Joe 2005-06-10 15:07:19

    Okay...so, perseverance paid off. I've got it working now. I hadn't copied and pasted all of the code for the comments.php file.

    I hope I'll still be able to make it work once I've customized my site design (I'm using the wp Default theme now).

    Oh, and while I was on gravatar.com looking for the answer to how long does it usually take for a gravatar to be approved? (didn't find the answer btw), I happened upon the blog and saw this.

    Congrats, Skippy, on winning the contest (and the iPod Shuffle!).

  144. Jack 2005-06-12 18:45:10

    Great plugin, just want to confirm that deleting the .mo and .po files works for 1.5.1.2

  145. valerie 2005-06-13 00:21:42

    Hey there -
    Have you noticed any sporadic changing of sizes for any of the Gravatars versions? Suddenly started happening to me with 1.6 and also does with 2.1. I am running WP 1.5, I specify my Gravatars to be 40px but lately ones that aren't cached are coming in at 80px...

  146. Joe 2005-06-13 11:14:33
    Have you noticed any sporadic changing of sizes for any of the Gravatars versions? Suddenly started happening to me with 1.6 and also does with 2.1. I am running WP 1.5, I specify my Gravatars to be 40px but lately ones that aren’t cached are coming in at 80px…

    valerie -

    I've noticed that setting the 'Default gravatar size' in the Gravatar Options form does not actually control the display size of all gravatars (I think it only controls them if they are cached).

    You can control the size of gravatars in 2 ways.

    (1) Skippy gave the PHP way.

    Or

    (2) You can use the CSS way (I think this is simpler)...

    (a) In your style.css file, add width: 40px; to the .gravatar and .postgrav classes; and
    (2) In the wp-comments.php file, delete width='80' height='80' (If you don't do this step, the 80px size will override your width setting in the stylesheet.).

    If you use option #2 and ever want to change the display size of the gravatars later, you can do it by simply updating the width's in your style.css file.

    My style.css code looks like this:

    .gravatar {
    float:left;
    padding: 1px;
    margin-right: 5px;
    margin-left: -50px;
    margin-bottom: -10px;
    width: 30px;
    border: 1px solid #333;
    background: #fff;
    }

    .postgrav {
    float:left;
    padding: 1px;
    margin-right: 5px;
    margin-left: -50px;
    margin-bottom: -10px;
    width: 30px;
    border: 1px solid #333;
    background: #fff;
    }

  147. Jonathan 2005-06-13 14:30:21

    Cool plugin!

  148. valerie 2005-06-13 19:04:34

    Oh yes, thank you, Joe. For some reason I guess I thought I already had the CSS for it. I used td.thegravatar img for mine as that's how I have mine coded.
    Thanks :)

  149. Dimitris 2005-06-16 16:53:05

    I'm getting this :( please help asap

    Parse error: parse error, unexpected $ in /home/virtual/site249/fst/var/www/html/macephemera.dimmdesign.com/wp-content/themes/blix/comments.php on line 121

    Cheers

  150. Dimitris 2005-06-16 16:55:10

    I'm getting the below error please help...

    Parse error: parse error, unexpected $ in /home/virtual/site249/fst/var/www/html/macephemera.dimmdesign.com/wp-content/themes/blix/comments.php on line 121

    Cheers

  151. skippy 2005-06-16 17:02:57

    Dimitris: I won't be able to help without knowing how you've editing your comments.php file.

  152. Dimitris 2005-06-17 03:19:08

    I've found the error but looks how is showing the avatar now :(
    http://macephemera.dimmdesign.com/?p=8#comments (it's in greek but scroll down to the bottom to see the comment)
    cheers

  153. Dimitris 2005-06-17 03:24:54

    Also the page on the Admin>Options>Gravatar doesn't show up :(

  154. skippy 2005-06-17 06:13:45

    Dimitris: the display of the gravatar is controlled by the CSS you define. Not knowing how you want it to look, I'm unable to offer specific guidance.

    I don't know why the Options page won't show. I see that you're using WordPress 1.5.1.2, so you're not suffering Bug #902. Have you tried deleting the gravatars-en_US.mo and gravatars-en_US.po files from /wp-contnet/plugins ?

  155. Gregory Wild-Smith 2005-06-17 08:12:08

    I finally fixed the annoying size error in the plugin. It was to do with encoded ampersands - gravatar.com wasn't liking them in the url requested by the php.

    basically I changed the block of code that had lines like this in:

    if ($grav_options['gravatar_size'] != '')
    $gravatar .= "&amp;size=" . $grav_options['gravatar_size'];

    to this:

    if ($grav_options['gravatar_size'] != '')
    $gravatar .= "&size=" . $grav_options['gravatar_size'];

    then added a str_replace when its being passed directly to the page:

    if ('0' == $grav_options['gravatar_cache']) {
    // we're not using local cache, so give the gravatar.com URL
    $gravatar = str_replace("&", "&amp;", $gravatar);
    return $gravatar;
    }

  156. skippy 2005-06-17 08:48:17

    Gregory: nice work. I'll roll that into the official code, for inclusion with future releases. Thanks!

  157. Danny 2005-06-17 13:59:32

    you guys give any support on using it with "Threaded Comments"?
    I dont know where to implent and just did on "instinct" but broke everything.

    Anyone?

  158. skippy 2005-06-17 14:02:49

    Danny: I've never touched Threaded Comments, so I don't know how to best integrate Gravatars with them. If you figure it out, please share!

  159. Shane 2005-06-18 02:04:49

    I just decided to use Gravatars tonight, and so I found this plugin and went to work right away. Awesome job on it Skippy, there's lots of great options. However, I (like others) wanted to be able to use a random gravatar for people who don't have one, and so I took a look at the code and made all the changes necessary so that this is now a functional option on the Admin page. It's pretty easy to use, all you do is choose to enable it, then specify a basename, the number of random images and the extension, and away it goes. Works for both cached and non-cached options. It could use some more testing i'm sure, but it seems to work perfect for me (though i don't have any true gravatars to test it with, I've just been looking at the image src's it dumps out).

    I've made a UNIX diff of the changes from the version I downloaded tonight, and can give you the full working file too if that's easier. Seeing as I'm not 100% sure how to get you these files on the website, I've e-mailed them to you, if you don't get them for whatever reason, just e-mail me.

    Hope you (and others) find this useful!

  160. conc 2005-06-18 15:51:53

    can anyone help me here. my garavatar seems to work perfectly with mozilla firefox. but when i view it with internet explorer.. nothing appeared.. did i miss anything?

    Thanks..

  161. conc 2005-06-18 20:26:26

    fiiuhhh.. finally it working. I changed the value of the cache timing "How long (in seconds) to cache gravatars:...". to a smaller value. Is it a must to change the value?

    Thanks

  162. Angela 2005-06-19 07:08:30

    Great plugin!! Thanks so much!!

  163. abstrakone 2005-06-20 01:15:24

    You ever thing about having this displayed in the "Manage Comments" area? I think that would be very useful

  164. 天佑的自由天地 » Blog Archive » WordPress Plugin Q & A 2005-06-20 18:14:53

    [...]

  165. Grendel 2005-06-22 04:58:35

    Hi Skippy,
    great plugin! :-)
    I'm using it at my site, but there seems to be some kind of loop that causes the comments to indent - but that's a FF/css issue (IE and Opera display it properly).

    If you take a look at http://www.iroke.de/wp/2005/06/17/hello-world/ you'll notice that there's also an additional gravatar field at the comment form. I was logged in as the admin in the admin section, but was logged out before in the blog. The comment posted at June 22nd, 2005 | 11:45 am produced an Admin comment without his gravatar... how come? Cookies?
    regards,

    Grendel

  166. skippy 2005-06-22 21:31:48

    Grendel: the gravatar image on your Admin comment at 11:45 am is the same image as every other Admin comment on that page.

  167. Dimitris 2005-06-24 17:50:15

    It's me again. The previous problem has been corrected simply because the theme that I'm using was already ready for this lovely plugin :)

    Although there is another problem now. I've upgraded to the latest version 2.3 of your plugin but if you go here http://macephemera.gr/?p=5#comments you'll see that none of the gravatars can be shown :(

    What do you think is the problem?

    Cheers
    Dimitris

  168. skippy 2005-06-24 19:49:02

    Dimitris: The source of that page has following:img src="http://macpehemera.gr/wp-content/gravatars/blank_gravatar.png"

    You have mistype the URI for your default gravatar. Note carefully the domain name.

  169. Sy41ful Blog » Alhamdulillah..! Aku sihat Balik!! 2005-06-26 01:26:45

    [...] a tambah sendirik get_sidebar() jerk pat file tu.. tapi buat masa skang tak sempat lagi. Plugin Gravatar plak sekarang dan upgrade version kepada 2.3. Kelebihan versi baru ni.. Selain b [...]

  170. AJ 2005-06-29 00:08:26

    nice plugin here skippy!

    a little question if you may, how can you 'disable' the default gravatar from appearing if the user has no gravatar account?

    i tried leaving the 'Default Gravatar Image' field blank but it messes everything. Even my own gravatar would be changed to "Get your own avatar..."

    Thanks a bunch.

  171. Mystery Wolf 2005-06-29 03:52:30

    okay, got my own user gravatar working, but my comments.php file is just too hard to tackle. Comments flow down like a staircase instead of being listed down in a straight line... really bizarre stuff. It's okay, I'll live without it :\

  172. skippy 2005-06-29 06:27:06

    AJ: to disable the default gravatar for people without gravatars, you'd need to edit your comments.php template file, and use conditional logic to suppress output when no gravatar is present. The function wp_gravatar_info() accepts as input an md5 sum of an email address, and will return information about the gravatar associated with that email. If no gravatar is defined, it will return a 404 status message. Using this, you ought to be able to do what you want.

    Mystery Wolf: try something like <div style="clear: both;"> after each comment, to avoid the stair-step effect.

  173. Mystery Wolf 2005-06-29 09:37:51

    Thanks Skippy, looks good now, but is there a way to put some 'breathing space' between the gravatars and the comments? I tried using a but it's not working. Maybe I'm putting the codes in the wrong places.

  174. Mystery Wolf 2005-06-29 09:39:58

    sorry, i used a code... i said i tried using a code...

  175. Mystery Wolf 2005-06-29 09:46:16

    ugh, sorry all that mess, keep forgetting that I can't type in php codes. Anyways, problem fixed... added margin to the .gravatar style sheet. Sorry, and thanks again!

  176. Danny 2005-06-29 19:19:01

    Hey its me again :P I'm wondering if there's a way to just put the users Gravatar somewhere on a page, like in the sidebar?
    I tried things with md5 and some samples in your README.
    Even tried modifying the comment version but that ended up with a default gravatar.

    cheers

  177. skippy 2005-06-30 12:15:44

    Danny: You can call the gravatar() function anywhere, as long as you pass it a valid email address:gravatar('skippy@skippy.net');If you want to stick commenters' gravatars in the sidebar, though, you'll likely need to do a lot of CSS jiggery-pokery, all of which is beyond me.

  178. Danny 2005-06-30 14:32:57

    No its more like for the users that actually registered on my blog. SO they have like this avatar sticking in the sidebar with some shortcuts. Like you have by most forums with those welcome screens.
    im going back tweaking and playing. I prefer have it loaded from the cache created by this script. would be great

    cheers

  179. hyperpup » Gravatars 2005-07-01 03:23:04

    [...] なぜかIEでNo Gravatarの画像表示がうまくいってなかったので、もう1つのGravatarプラグインGravatarsを入れてみました。このプラグインはアドミンエリアで色々設定できます。 ダウンロードしたら、解凍してそのままWordPressのルートフォルダへアップロード。wp-content内にgravatarsというフォルダができるので、それをFTPソフト等を使って”777″に設定します。デフォルトのGravatar(Gravatarを設定してない人用に表示されるもの)はここに入れておきます。注意するのは、Gravatarの画像の大きさはアドミンエリアで設定できますが、このデフォルトGravatarの設定はできないので、サイトに表示したい大きさのGravatar画像を用意して下さい。 既に別のGravatarプラグインを使っている場合は、先にこれを無効にしてから新しくアップロードしたGravatarsプラグインを有効化して下さい。二つの違いは語尾の”s”です。 プラグインを有効にしたら、comments.phpを書き換えます。 <?php foreach ($comments as $comment) : if (function_exists(’gravatar’)) { if ('’ != get_comment_author_url()) { echo “<a href=’$comment->comment_author_url’ title=’Visit $comment->comment_author’>”; } else { echo “<a href=’http://www.gravatar.com’ title=’Create your own gravatar at gravatar.com!’>”; } echo “<img src=’”; if ('’ == $comment->comment_type) { echo gravatar($comment->comment_author_email); } elseif ( (’trackback’ == $comment->comment_type) || (’pingback’ == $comment->comment_type) ) { echo gravatar($comment->comment_author_url); } echo “‘ alt=’a gravatar’ class=’gravatar’ /></a>”; } ?> 私の場合は今まで <div class="gravatar"> から始まっていたGravatarを呼び出すコードの部分を <? if (function_exists('gravatar')) { if ('’ != get_comment_author_url()) { echo “<a href=’$comment->comment_author_url’ title=’Visit $comment->comment_author’>”; } else { echo “<a href=’http://www.gravatar.com’ title=’Create your own gravatar at gravatar.com!’>”; } echo “<img src=’”; if ('’ == $comment->comment_type) { echo gravatar($comment->comment_author_email); } elseif ( (’trackback’ == $comment->comment_type) || (’pingback’ == $comment->comment_type) ) { echo gravatar($comment->comment_author_url); } echo “‘ alt=’a gravatar’ class=’gravatar’ /></a>”; } ?> に入れ替えました。 <div class="gravatar"> はもう必要なくて、今まで通りスタイルは.gravatarクラスでつけられるので今回スタイルシートは変更していません。 Gravatarの設定(大きさを変更したり、デフォルトGravatarの変更)は、アドミンエリアのオプションのGravatarsタブメニューからできます。Permalinkを設定している場合、デフォルトGravatarを設定するには、URLをきちんとかかないと駄目のようでした。(デフォルトでは”wp-content”から始まってますが、http://www.yourdomain.com/wordpress/wp-content・・・”というようにしないと駄目でした) デフォルトGravatarをランダムに変更もできます。その場合はwp-contentのgravatarsフォルダに、例えばrandomという名前でフォルダを作ってそこへ画像を入れます。あとはそのフォルダをデフォルト画像設定にすればいいだけです(その場合,最初と最後は”/”で終わること。例)/wp-content/gravatars/random/) <gravatar email@yourdomain.com /> を書けば、記事の好きなところにgravatarを挿入できます。 こんな風に。 アドミンエリアのユーザメニューのGravatarメニューから、そのサイトで使いたいGravatarの設定もできるみたいです。フォーラムとかでそこで使うアバターを設定するみたいな感じなのかな?うちのサイトは私1人だけしか投稿してませんが、複数で投稿していたらそれぞれがログインしてからこれを設定したらGravatarで設定しなくても良いってことなのかな? 他にもRead Meファイルには色々書かれています。難しいのでおいおい試していこうと思います。 [...]

  180. Mayuko 2005-07-01 08:01:26

    Hi, I installed the plugin and almost made it except random images for default gravatar. I followed the instructions and set to "/wp-content/random_gravatars/" for the default images but they aren't shown on the site. When I set to "http://www.mysite.com/wp/wp-content/gravatars/nogravatar.gif", I can see it. I am not PHP expert and I don't know about the code. Could you help me to fix it?
    Thank you for the great plugin, I like it very much.

  181. skippy 2005-07-01 12:46:37

    Mayuko: thanks for the heads-up. I've found the problem, and believe I have fixed it. As you can see, I have random gravatars being displayed here, now. I'll get an updated release out shortly.

  182. Mayuko 2005-07-01 15:10:44

    Hi skippy, thank you for your quick reply and fixing the problem. I am looking forward to the updte release. Well, I have one more question. On my site, trackbacks and pingbacks are shown separately from comments with using another plugin. Is it still ok to use the code on your readme file for comments.php? I don't know the meaning but there is something about trackback and pingback in the code. elseif ( ('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type) ) I already have the code to separate them before it.

  183. ikoko 2005-07-02 12:31:03

    Yes.. i'm also got problems withf random default gravatar...

    please... really need the solution..

    thanks...

  184. skippy 2005-07-02 13:13:09

    Mayuko: you shouldn't need to modify my example code. If the comments are already seperated, then the check in my example code will not harm anything.

    You can use gravatars for trackbacks and pingbacks just as you would for regular comments. Just remember to call them as gravatars($comment->comment_author_url);.

    Also note that gravatars() accepts a second parameter after the email or URL, which can be used to override the system-wide default. I did this so that you could use a specific gravatar image for all pingbacks and trackbacks, if you want.

  185. Mayuko 2005-07-03 21:49:46

    Hi Skippy,

    Thank you for your reply and updating the plugin. It shows random gravatars now. And for trackbacks and pingbacks, I also used the same code in your ReadMe file and it works great. Thank you very much for your great plugin again.

  186. Matthew J. Stinson 2005-07-04 13:51:26

    Great plugin, but I've run into a weird, apparently Firefox-only, CSS quirk when implementing it. In IE the comment list boxes (I'm using a Connections-based theme) look fine but in Firefox they do this little dance before settling on a weird irregular pattern, which can be seen on this thread:

    http://matthewstinson.net/2005/07/04/smooth-sailing/

    I tried using clear: both, to no avail. Any ideas?

  187. Matthew J. Stinson 2005-07-04 14:10:08

    Slight addendum to my last post. On reload/refresh the dancing list item borders appear. The first time the post is loaded they look fine. It's weird. The problem seems to be how Firefox handles CSS as compared to IE.

  188. skippy 2005-07-04 14:12:20

    Matthew: sorry, I don't know how to help. CSS isn't my strong point. Incidentally, I think the display looks fine -- I see no irregular pattern.

  189. Ajay D'Souza 2005-07-04 23:25:10

    I am getting this error:

    Warning: is_file(): Stat failed for ...../wp-content/gravatars/95bc3e5fc853264108191bec33081874 (errno=13 - Permission denied) in ...../wp-content/plugins/gravatars.php on line 344

    This warning appears several times

  190. skippy 2005-07-05 07:00:25

    Ajay: the directory /wp-content/ on your site appears to be empty. My plugin uses the /wp-content/gravatars/ directory for all its caching. If you have caching enabled, you need to have this directory available for writing by the webserver.

    And congratulations! Your's is the 1,000th comment on my blog! =)

  191. rol@ndgu.de » noch nen feature 2005-07-07 14:46:37

    [...] aus der schieren menge der wordpress plugins die es so gibt habe ich nun auch noch das gravatars plugin installiert. das sorgt dafür, dass alle die sich einloggen in ihrem user menu einen unterpunkt gravatar haben wo sie ein 80x80 pixel großes bild verlinken können. das steht dann immer neben ihren posts oder kann auch mit oder sowas eingefügt werden. toll, oder? [...]

  192. Daven 2005-07-07 15:46:10

    Okay, I downloaded your plugin and configured it correctly. It's showing in my admin pannel.

    I add the text from your README file to the wp-comments.php file and it breaks. I am using the default template for 1.5.1.3:

    http://davensjournal.com/wordpress/wp-comments.php

    What keeps happening is that the blog reads through it and for some reason finds an "extra" } in there. I don't remove it since the code only breaks when the addition to it is in place, and it doesn't seem to matter where I put it.

    So I'm stuck. I'm officially throwing in the towel. I know NOTHING about PHP and if it comes to a choice between a broke blog and a blog that works but doesn't do what I want it to, guess which I'll choose?

  193. angel 2005-07-07 19:32:27

    Parse error: parse error, unexpected '}' in /home/yimin/public_html/angel/wordpress/wp-content/themes/mine/comments.php on line 125

    :P did anyone figure out how to do this with threaded comments? i have no clue where to insert the php code since the comments.php is really confusing...

    anyone sucessfully done it with threaded comments? please let me know...thanks

  194. skippy 2005-07-08 18:24:24

    Daven: you need to add the code to /wp-content/themes/<your theme>/comments.php and not /wp-comments.php.

    angel: I've not yet heard from anyone using threaded comments with gravatars; though I know it's possible. You might try asking on the WordPress Support Forum.

  195. Brett 2005-07-08 23:51:05

    I recently found this plugin, I had been using another on for gravatars but i liked your contact form so much i thought i would give yours a try, it installed fine but none of the gravatars are shopwing up on the posts that have them, the only thing tha appears is the default graphic. My site is http://gatewayy.net any ideas would be great! Thanks in advance. :)

  196. skippy 2005-07-09 09:34:16

    Brett: I'll need to know a little more about how you've implemented the gravatars code. My is not a drop-in replacement for the plugin available at gravatars.com. Did you read and follow the installation instructions included with my plugin? Feel free to send me you theme's comments.php, and I'll take a look.

  197. Brett 2005-07-09 14:53:25

    Skippy

    I do not remember if the code on my comments page is from the gravatars main site but I would assume that is most likley the case. I did attempt to replace my existing gravars code with the parts listed in the readme but I must have goofed something along the way, I will email the comments page to you, i appreciate your quick responce. :)

  198. Eiline 2005-07-10 07:58:16

    cool, this gravatars :-)

  199. Das walte Shelby » “Gravatars-Addenum” plugin 2005-07-10 11:35:46

    [...] A year ago when I started this Wordpress Blog I fooled around with a new service called Gravatars (Globally recognized avatars) but the provided WP plugin was very basic and missed all of the elegance known when installing other WP plugins. So I modified the original basic plugin to make things for others a little easier and published it (the post is almost comletely in german). Almost a year ago things have changed much and my initial plugin has been outdated because of a new, much better plugin also called “Gravatars” provided by Skippy. [...]

  200. admin 2005-07-10 19:20:56

    your site rockes

  201. gamemonn 2005-07-10 19:47:20

    your site rockes

  202. Daven 2005-07-11 09:37:11

    I'm now having problems with the random gravatars too. Don't know why. When I point the default setup to a specific image, it displays the icon, but when I leave it blank `/wordpress/wp-content/gravatars/random/` it will not display anything. It's not pulling the image.

  203. Webdiva » Throwing a Switcher-Roo 2005-07-12 18:52:00

    [...] I’m using a few plugins mainly gravatar so that any commenters with a gravatar account will show up in the comments section. [...]

  204. Webdiva » Throwing A Switcher-Roo 2005-07-13 16:40:23

    [...] I’m using a few plugins mainly gravatar so that any commenters with a gravatar account will show up in the comments section. [...]

  205. tom kim 2005-07-16 05:10:57

    I too am having trouble getting the default random directory feature to work. Like the previous commenter, it works fine when I specify a specific image, but doesn't pull random images if I just specify a local directory.

    Thanks for all the time you've put into this plugin.

  206. skippy 2005-07-16 08:37:57

    tom kim: I diagnosed a random gravatars problem with one user, and we finally narrowed it down to line 447:

    if (! is_dir(ABSPATH . $grav_options['gravatar_default'])) {
    return FALSE;
    }

    When told to serve a random gravatar, his system would always return a blank value.

    If you're absolutely sure that your random gravatars directory is properly defined, you might comment out the three lines above, by placing // at the beginning of each line.

  207. lâmpada azul [jcraveiro.com] » Gravatar.com em baixo 2005-07-16 19:56:46

    [...] Como a real razão do problema não me passou pela cabeça, fui logo olhar para o código, ver o que se passava, e não dei com nenhum gato. Fui ver se havia alguma actualização ao plugin, por alguma alteração à API: nada. Só mais tarde, já nem me lembro porquê, é que me lembrei de dar um salto ao site oficial dos gravatars (gravatar.com): down. [...]

  208. Jessica 2005-07-17 17:51:54

    Hi Skippy!
    I'm using WP 1.5.1.3 and inserted the code for the Kubrick theme into the comments.php. I get no errors, but not gravatar too. ;-) My local default avatar is displayed although I tested some user that did register at gravatar with the given email address.
    Any idea what might be the problem?

  209. Mystery Wolf 2005-07-18 11:49:47

    hey there skippy, been using your gravatars for about a month now and everything's fine. However, just lately my default gravatar for visitors isn't showing, but my own gravatar is. I'm not using the random gravatar feature, I specifically pin-pointed to only one gravatar for visitors. It's been showing properly before this. What could be the problem?

    By the way I at the time of writing this I can see that your gravatars aren't showing either. Am I not the only one?

  210. skippy 2005-07-18 12:14:12

    At this time, it looks like www.gravatars.com is offline. That'll cause everyone not caching gravatars to have trouble.

  211. The Lair » goldy and bronzy 2005-07-18 12:49:43

    [...] So, I first made the CSS changes required for displaying gravatars on my site. I had the plugin installed and running for weeks, but hadn’t gotten off my lazy rearend and added the appropriate function calls to make the darn thing display. So far, so good. Made the CSS and PHP changes, tried to test. [...]

  212. Alex 2005-07-18 21:08:12

    Apparently the Gravatar domain expired. if you hack the plugin a bit, and use their IP (see 64.124.231.223) you will see, they are indeed still up. hopefully, this will only need to be a temporary fix.

  213. lâmpada azul [jcraveiro.com] » Gravatar.com está de volta 2005-07-20 09:18:13

    [...] Muitos de nós, bloggers modernos, que temos suporte para os Gravatars nos nosos comentários, nos deparámos com o problema que foi, para o plugin que utilizamos, o facto de o domínio "gravatar.com" ter expirado. Duas soluções mais faladas: [...]

  214. Mystery Wolf 2005-07-20 10:25:28

    Yay gravatars is back!

  215. Viper007Bond.com » Blog Archive » More Gravatar Stuff 2005-07-25 01:54:56

    [...] Anyway, I installed two new Gravatar plugins. The first is a replacement for the one that I was using earlier. This one caches the Gravatars here on my server and allows people who are registered here on my forums to set a custom Gravatar for use only here. This though you probably don’t care much about. [...]

  216. LobsterMan 2005-07-28 10:20:10

    Hi, I'm not getting the default avatar to work, if the poster doesn't have a gravatar, it just leaves a bland image (in the source it looks like [img src=' '])