Ok, I did some coding mumbo jumbo, and got the gravatars to work even for people who didn’t use lowercase emails. If you want to geek out on it, this is how I got it to work.
The gravatar function creates an md5 hash of your email address, and tags it onto the end of the URL when it goes to get your icon from the gravatar server. That’s how it knows which icon to return. By using a hash encryption, your email address doesn’t show up in the html for the page. The reason the lowercase matters is because the hash is different based on the case of the letter. It’s all good and fine to tell everyone to only use lowercase email addresses for their comments, but we have several years worth of archives here, and I’m not about to go back and fix the letter case of every comment to make the gravatars work.
Fortunately, php allows us to alter a string return before we hash it. That way, regardless of how the email address was saved in the database, it always gets sent to the encryption process as lowercase. Locate the gravatars.php plugin in your WordPress install, in the plugins folder. On line 17, you will find the following code:
.md5($comment->comment_author_email);
You need to add an additional modifier ’strtolower’ to the function, so that it looks like this (remember the extra parenthesis!):
.md5(strtolower($comment->comment_author_email));
Save, reload your page, and check it out. It should return gravatars for people who left comments, even if they used capitalization in their email address.
Of course, this doesn’t explain why Chad is the only guy left who can’t get his to work … but that’s a whole ‘nother post.
Latest Comments
RSSsharolyn, michael lee, sharolyn, Sharolyn's Husband, Sharolyn's Husband, corey, corey, Sharolyn's Husband
Zack
Phreaky Phriday: Happy 4th Of July! | Addison Road, Chad, Sharolyn, Sharolyn's Husband, sharolyn, corey, david, sharolyn, michael lee, Chad [...]
Daniel Semsen, Chad, june, aly hawkins
Chad, Chad, Leonard, Chad, Leonard, Erica, Erica, michael lee, Bobby, Leonard [...]
Gretchen, aly hawkins, the ben