3.16.2009

Mybloglog Avatar Appears in The Comment Field

In fact, appearing the Mybloglog's avatars in the comment field is not a new thing, but some of the blogs that I visit that had little use. But according to my widget is enough better than the first tutorial I ever read, there is the difference, long tutorial that I read not to use the avatars through Mybloglog widget, but pick it up directly through Blogger Profile.
This is the trick to show MyBlogLog Avatar On Column Comments:

1. Make sure you are registered on Mybloglog,

2. If you are registered, now back to Blogger, and heading directly to the Edit HTML page. Search tag and then just copy-paste all the script below and place it above. (do not forget to save it)
<script type='text/javascript'>
//<![CDATA[
/*
Merlinox and Napolux MyBlogLog Avatar Creator
created by Merlinox (blog.merlinox.com)
helped by Napolux (www.napolux.com)


version 0.1 (20061214)
version 0.2 (20061215)
compatible with all blogger blog
*/


if(typeof(myLayer)!='function'){
function myLayer (x){
//individuo l'oggetto
if(document.layers){ // browser="NN4";
lay=document.layers[x];
}
if(document.all){ // browser="IE";
lay=eval("document.all." + x);
}
if(!document.all && document.getElementById){ // browser="NN6+ or IE5+ if you're willing to dump the !document.all stuff";
lay=document.getElementById(x);
}
return lay;
}
}


//lo prendo da blogger
function myBlogAvatar(codiceCommento,autore,stile){
//scrivo lo span
//var myBlogSpan = "myBlog-" + codiceCommento;
//document.write("<span id='" + myBlogSpan + "'><i>myBlogLog...</i></span>");


//metto tutto minuscolo perchè indexOf è case sensitive

if (autore != ""){
alt="MyBlogLog: " + autore;


myBlog = "<a target='_blank' href=\"http://www.mybloglog.com/buzz/co_redir.php?href=" + autore + "\" rel='nofollow'><img src=\"http://pub.mybloglog.com/coiserv.php?href=" + autore + "\" alt=\"" + alt + "\" title=\"" + alt + "\" border=\"1\" class=\"myBlogAvatar\"></a>";
//myLayer(myBlogSpan).innerHTML = myBlog + myLayer(myBlogSpan).innerHTML;
//myLayer(myBlogSpan).innerHTML = myBlog;
document.write(myBlog);
}
}
//]]>
</script>

3. Still on the Edit HTML, check the Expand Widget Templates. Then search the code below:

<b:loop values='data:post.comments' var='comment'>

Copy and paste all the code below and put back under the code above.

<div style='border:0;float:left;margin: 0 5px 0 0;'>
<script>
myBlogAvatar('<data:comment.id/>','<data:comment.authorUrl/>');
</script>
</div>


4. Save and see the results :)

1 comment:

Kalau kamu mau komentar tapi gak punya web, pilh aja bagian "Name/URL" trus di bagian name, tulis nama kamu. Di bagian URL, kamu kosongkan saja. Sebisa mungkin jangan pake anonim, karena bisa saja saya hapus.

Berkomentarlah "Sesuai Dengan Isi Posting". Terima kasih...