The first thing to understand is how Blogger writes comments to your blog posts. It utilises the tag <$BlogCommentAuthor$> to write out the details of the author of the comment with a link to the profile. This is the bit of code that you need to tap. But for my hack to work, your entire comment (including the body with the <$BlogCommentBody$>) has to be included in one element. The author details can themselves be included in a subelement (span for my blog), with the respective style attached to it, but one comment block should be in one element. It doesn't matter what that element is, just has to be one which is not used randomly in the entire blog ... so that it can be referenced without creating too much interference with other similar elements. Now comes the dirty part. The Javascript code...
I'll write out the bit of code first, and then we'll understand how it works!
function author_change(){ var str=/*your profile number*/ var d=document.getElementsByTagName('*element name containing your comment author tag*') for(var i=0;i<d.length;i++){ if(d.item(i).innerHTML.match(str) && d.item(i).id=="comment"){ /* use CSS to Javascript properties to change the values, or assign it a different class using the 'className' property as d.item(i).className='something' */ } } }[Edit]: Sample Comment Display Code to make the above code work:
<BlogItemComments> <a name="<$BlogCommentNumber$>"></a> <div id="comment"> <$BlogCommentBody$> <span id="byline">By <$BlogCommentAuthor$>, at <a href="#<$BlogCommentNumber$>"><$BlogCommentDateTime$><$BlogCommentDeleteIcon$></a> </span> </div> </BlogItemComments>
The variable str holds the bit of data that you want to search your elements for, which is your profile ID. You can get it by going to your profile page, and selecting the entire set of numbers at the end, and pasting it there. The variable d, will hold an array of the element which you enter here. Notice that for my blog, my comments are stored in a p element, so my element searched for here is p. NOTE: The quotes are part of the syntax, do not remove them! Just replace only the coloured text.
The next stuff is pretty straight forward. Its completely automated, and all you have to do is enter the steps it should take everytime it finds your comment. That goes into the red part, and it will apply those settings everytime it finds a match!
Thats it! Simple! Now all you have to do is, in your body tag, you have add this bit of code: onload="author_change()"
You are set! Save and republish your blog. Then go to the individual post pages, and see if your comments are coloured or not! If they are, congratulations ... if they're not, drop me a line! :) Enjoy!
[Edit (5/3/2006)]: I realised that not a lot of people figured this out. This hack is only for inline comments, as has been implemented on my blog. There's a nice little tutorial to do that from Blogger (here), so first change your template to have that. The only way to use this hack on the existing comments page is to use a Greasemonkey script and Stylish for Firefox. I'll work on those later! :P