Monthly Archive for January, 2008Page 2 of 9

Fixing Gravatars for WordPress

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.

A Crappy Day (that will hopefully bring you a chuckle)

So the other day, my daughter threw up three times. After teaching a full day of elementary school and picking up my children, we headed straight to Costco. (It was a necessary errand.) That was the first - so of course most unexpected - event of barfness. If I ever hire a house cleaner, I am going to look for Costco on the resume, because it was cleaned up in 24.3 seconds. To be graphic, it was as if they were mopping the first hurl before the last hurl was over. Moving on…

After teaching several private music students after his full day at school, my beloved husband headed off to a rehearsal and returned at 11:30. He was up with the sick child until 1:00. All this is to say, the day needed to end.

Of course this would be the night when the phone rang at 3:30 AM. Now, we have new phones, and they are currently way too loud. Have you ever noticed that cordless phones are designed to break at about one year of age, so you keep having to purchase new ones? We have gone through several phone systems in our marriage. This obnoxious volume nearly scared the pee-pee out of us, our hearts racing from deep sleep.

My first thought was the health and safety of our family members. Once I realized those were in tact, I would have hung up on the stranger. But I actually hear said husband having a conversation with the man on the other end, in disbelief. The man was saying, “Calling All Batallions!”

No really. Calling All Batallions.

My husband was pretty sure it wasn’t a prank (and it wasn’t), and images of national tragedy flashed in his mind. I mean, why are they calling all batallions?! The natural next move is to turn on CNN. At 3:30. A. M.

Guess what CNN was saying? It was snowing in the mountains. Can you believe it? Snow. In the mountains.

I relied on Lamaze relaxation techniques to eventually fall back asleep, and the alarm went off what felt like five minutes later. (Insert witty last line here, followed by a group chuckle, freeze frame, and credits.)

Translation, please?

Sooooo ….

This site has a link back to Addison Road, to the post “Sex and the Bible“. I’m just dying to know what it actually says, though. Anybody want to give us a translation?

books that make you dumb

A distribution graph of favorite books listed by Facebook students, cross-indexed with the SAT/ACT averages for their school = Books that Make You Dumb.

Rainy Fridays

3 songs to listen to when it’s pouring down rain in LA.

Feel free to add your own suggestions in the comments. If it’s gonna feel like Seattle down here, we should at least put on a pot of coffee and listen to some good music.