Favatars

12/8/2004 · 10 comments

in Web Development

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" />';

Did you like this? Please share it:

Add to Twitter Add to Delicious Add to Facebook Add to Stumble Upon Add to Digg Add to Reddit Add to Yahoo Buzz

1 trackback

noscope | Favatars (and Favatar Wordpress Plugin)
10/23/2005 at 10:48 am

9 comments so far… Jump into the discussion and tell us what you think.

Alex 12/8/2004 at 6:57 pm

Favatars in action. You should see the orange block with a white ‘A’, next to my name below this text.

Reply

pamela 12/9/2004 at 1:58 pm

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.

Reply

Alex 12/9/2004 at 2:29 pm

It seems to be a bit flaky… not sure why, but it won’t always show the image.

Reply

chris 12/14/2004 at 5:12 pm

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

Reply

chris 12/14/2004 at 7:02 pm

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

Reply

Alex 12/15/2004 at 9:18 am

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.

Reply

Joen 12/27/2004 at 6:25 am

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.

Reply

Alex 12/28/2004 at 9:49 am

That’s great Joen! I’ll download and install it as soon as I get a chance.

Reply

Greg Howley 4/4/2005 at 3:06 am

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.

Reply

Leave a Comment

You can 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>

Previous post:

Next post: