Favatars

Paul James presents an intriguing, and quite usable idea to provide ubiquitous, decentralized avatars (graphic representations of a person, usually seen in Web forums, chat rooms and instant messaging programs) throughout the Web. Favatars, as he has dubbed them, are the favicons that so many people already use on their site (look in the address bar of your browser, and you should see an orange block, with a white ‘A’, that’s my favicon). The idea has a lot of potential, and as it is so easy to implement, I expect to see it added to various blogging packages and content management systems in the future. He has already provided the PHP he uses to create Favatars in the comments on his site.

I have implemented Favatars in the comments here on this site. So, if you have a favicon on your Web site, and want to test, just leave a comment to this post.

To implement this, cut and paste the code he provided within the first set of php tags at the top of your index.php, I would recommend you place it right after the require (blog header) line. Then, to place the icon next to a comment, place the following code in your wp_comments.php page, wherever you want it to appear (remove the line breaks, they are there for readability only):


  $CommentIcon = getFavicon($comment->comment_author_url);
  echo '<img src="' . $CommentIcon . '"
             alt="' . $comment->comment_author_url . '"
             class="CommentIcon" height="16" width="16" />';

Comments

  1. says

    Giving it a shot.

    I have something like this implemented on the baby blog (MT) but hadn’t looked into putting it on my WP blog.

  2. chris says

    I followed you instructions but nothing shows up. There’s no url in the img src. You can’t copy and paste the code of that guys site

  3. chris says

    I think the problem is with fopen. I tried adding the line ini_set(‘user_agent’,’MSIE 4\.0b2;’); but still nothing happens. I removed the @s and I keep getting: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

  4. says

    I found that the code is a bit flaky, sometimes it shows the icon, and sometimes it doesn’t. I haven’t had a chance to test the code, but I hope to in a week or two.

  5. says

    I’ve turned Paul James PHP code into a WordPress plugin, which can be found here:
    http://www.noscope.com/journal/2004/12/favatars

    It’s still flaky, but works better. I’ve increased the timeout to 1.0 rather than 0.1 – this makes the favatars show up almost every time. The delay can then be lessened using Matt’s Staticize Reloaded. It’s not perfect, but it works better for the time being.

  6. says

    Sounds like an excellent idea. I’ve been using something similar on one of the layouts on my site for some time, where when I link to news items, the favicon appears as the bullet in <UL>. When I get around to rewriting my blog, I’ll have to consider adding this too.

Trackbacks

  1. [...] I am, of course, writing about this because I have now implemented “favatars” on this very website. Leave a comment — try it out. 1. Technical Background The initial implementation of Favatars here on Noscope was based on work by Alex Jones that in turn relied on code by Paul James. The basic idea was to analyze the URL of commenters using regular expressions, looking for the presence of a favicon.ico. [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>