Comment avatar for people who don't have one ?

Some peoples ask me how to add an image for people who don't enable their avatar in comments . Yes, I missed this function when making template . In my templates, you see nothing in avatar frame if people who comment don't enable their avatar . Why don't we add an image in avatar frame for them instead of using blank ?  Like this





or like this (^^make it look like Gravatar)


the trick here is very simple .
Just find this code :
<b:if cond='data:blog.enabledCommentProfileImages'>
<data:comment.authorAvatarImage/>
</b:if>


and replace it with

<b:if cond='data:blog.enabledCommentProfileImages'>
<data:comment.authorAvatarImage/>
<b:else/>
<img src="http://img844.imageshack.us/img844/3447/unknownuser.jpg"/>
</b:if>

with this code ,if people don't enable their profile images (or their Blogger avatar in comment ) it will show image <img src="http://img844.imageshack.us/img844/3447/unknownuser.jpg"/>
you can replace image which I marked in bold to your own

Share this post

Advertisement

0 comments:

Post a Comment