Custom default Gravatar in WordPress 2.7

8

Posted on : 02-04-2009 | By : Japh

If you’ve been using WordPress for a little while, and don’t really much like the default options you have to choose from when a commenter doesn’t have their own Gravatar, why not make your own?

Make yourself a little square image to use that matches in with your theme, and then insert the following line of code:

<?php echo get_avatar( $comment, 86, 'http://example.com/custom-default-av.png' ); ?>

Note: you must provide the full absolute URL for your image.

What this line does, is show a Gravatar for the user if they have one, and if not, show your custom one instead. The number “86″ is the pixel width and height you want the Gravatars to display at.

Remember that this will only work in WordPress 2.7+, or possibly in older versions if you have the Gravatar plugin installed (not tested).

Update: If you don’t know what a Gravatar is, check out the comments. The avatar’s shown beside each comment are automatically pulled in from Gravatar’s service, so you upload your avatar once, and it appears everywhere when you comment etc. Get yourself one here: Gravatar

First NETTUTS Tutorial Posted!

5

Posted on : 26-02-2009 | By : Japh

I wrote my first tutorial for NETTUTS recently and it was published last night.

Title: Create a Slick Flickr Gallery with SimplePie
Description: I’ve wanted to write a tutorial for quite some time now, and APIs have always been a particular interest of mine. So with my wife’s recent foray into photography, I decided a Flickr tutorial would be first cab off the rank! Using RSS, Flickr and jQuery all together was pretty fun too.

Check it out! :)

Tracking memory usage

3

Posted on : 06-02-2009 | By : Japh

Recently I received a warning from my host that I was WAY over my memory limit. I had some long running processes going, and a few cron scripts that altogether were using about 220mb out of my 120mb of allowed memory usage… oops!

Anyway, there’s currently no way from my control panel to see how memory I’m currently using, I have to run a command from a terminal, and certainly no way to tell usage over time. So, after looking at a thread my hosting provider pointed me to, I decided to have a play with the Google Charts API!
Read the rest of this entry »

APIs and The Grey Album

1

Posted on : 07-01-2009 | By : Japh

Lately I’ve been playing around with a few different APIs. Getting the hang of using them and seeing what they can do. I’ve had a brief play with both the Flickr and Twitter APIs, and they’re both actually very user-friendly yet powerful.

I decided to build a simple photo album script using mostly PHP and jQuery to do the tricky parts, and the SimplePie library for actually importing the photo stream. I’ve called it The Grey Album, and though I probably wouldn’t call it a complete and comprehensive script, it seems to do the job. Any feedback is most welcome!

Fun with wild-card domain names

4

Posted on : 16-09-2008 | By : Japh

After seeing quite a few websites with dynamic content based on the domain name, I wanted to give it a try to see how difficult it was to achieve.

Here’s what I came up with: DueABootin.com

As it turns out, it wasn’t very difficult at all!  (Especially being hosted through WebFaction, they make it even easier!)
Read the rest of this entry »