Memasang Widget Komentar plus Gambar (Thumbnail) for Blogger
CB Blogger | October 28, 2015
Cara Memasang Kode Widget Komentar plus Gambar (Thumbnail) for Blogger.
MUNGKIN akan menarik pengunjung untuk berkomentar karena komentar dan foto/gambarnya muncul di sidebar blog. Demonya ada di sidebar blog ini. Keren kan?
KODE
(Pasang di Layout > Add a Gadget > HTML/Javascript)
<style scoped='' type="text/css">
ul.comments{list-style:none;margin:0;padding:0}.comments li{display:block;clear:both;overflow:hidden;list-style:none;border-bottom:0!important;word-break:break-all}.comments li .avatarImage{float:left;margin-right:10px;position:relative;overflow:hidden}.comments li img{position:relative;overflow:hidden;display:block;width:42px;height:42px}.comments li a{font-weight:700}.comments li span{margin-top:2px;color:#666;display:block;font-size:12px;line-height:1.4}
</style>
<script type="text/javascript">
//<![CDATA[
function comments(a){var e;e='<ul class="comments">';for(var t=0;numComments>t;t++){var r,o,n,i;if(t==a.feed.entry.length)break;e+="<li>";for(var d=a.feed.entry[t],s=0;s<d.link.length;s++)"alternate"==d.link[s].rel&&(r=d.link[s].href);for(var l=0;l<d.author.length;l++)o=d.author[l].name.$t,n=d.author[l].gd$image.src;n=-1!=n.indexOf("/s1600/")?n.replace("/s1600/","/s"+avatarSize+"-c/"):-1!=n.indexOf("/s220/")?n.replace("/s220/","/s"+avatarSize+"-c/"):-1!=n.indexOf("/s512-c/")&&0!=n.indexOf("http:")?"http:"+n.replace("/s512-c/","/s"+avatarSize+"-c/"):-1!=n.indexOf("blogblog.com/img/b16-rounded.gif")?"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Dz0s7-O1jc2UXjyrewwgYU14jLOAhu7fU_os3C163nPXOTlqwrVzW2o3WShTuHfdtG-umCH0isfxee7hdGta9kpp5jjjapAJE6unRc2ZEQMyQnaSObJ6G1M1uqbAP1p43QhL1vc6E8pp/"+avatarSize+"/blogger.png":-1!=n.indexOf("blogblog.com/img/openid16-rounded.gif")?"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPVPfD1wQLo_gm5l4hnRpqBLRfDO3QgtDrqWqZbVv24VYemktF0ZxBNGWR6cNmdydrtprWLvi-cyUElLZ_SL6niq78k9rpXKmqpWDXe9g6wYKJXagg2i0lQ1bCTc3rP3dVi_rY2xGhAxbg/"+avatarSize+"/openid.png":-1!=n.indexOf("blogblog.com/img/blank.gif")?-1!=defaultAvatar.indexOf("gravatar.com")?defaultAvatar+"&s="+avatarSize:defaultAvatar:n,1==showAvatar&&(i=1==roundAvatar?"avatarRound":"",e+='<div class="avatarImage '+i+'"><img class="'+i+'" src="'+n+'" alt="'+o+'" width="'+avatarSize+'" height="'+avatarSize+'"/></div>'),e+='<a href="'+r+'">'+o+"</a>";var A=d.content.$t,v=A.replace(/(<([^>]+)>)/gi,"");""!=v&&v.length>characters?(v=v.substring(0,characters),v+="…",1==showMorelink&&(v+='<a href="'+r+'">'+moreLinktext+"</a>")):v=v,e+="<span>"+v+"</span>",e+="</li>"}e+="</ul>";var c="";0==hideCredits&&(c="display:block;"),e+="",document.write(e)}var numComments=7,showAvatar=!0,avatarSize=42,roundAvatar=!0,characters=40,showMorelink=!1,defaultAvatar="http://2.bp.blogspot.com/-XjxrXKBPQqs/VYcGtLWPGUI/AAAAAAAAKaQ/5jr871JIwds/s1600/default-avatar.jpg",hideCredits=!0,numComments=numComments||5,avatarSize=avatarSize||60,characters=characters||40,defaultAvatar=defaultAvatar||"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheji5o9Ue697k3ckNAYi2W0mgOcfXh8iZixcHfAGpJjM9QoYUmMXPg7cI8A6WGW4hjJaYcKEuyzigAwQwfESrhaMSqD-MVXAfryJypQH9nlhnvddYMxvkV5N9FIC1Qw7nQGZO1jTjxXUO2/s1600/default-avatar.jpg",moreLinktext=moreLinktext||" More »",showAvatar="undefined"==typeof showAvatar?!0:showAvatar,showMorelink="undefined"==typeof showMorelink?!1:showMorelink,roundAvatar="undefined"==typeof roundAvatar?!0:roundAvatar,hideCredits="undefined"==typeof hideCredits?!1:roundAvatar;
//]]>
</script>
<script type="text/javascript" src="/feeds/comments/default?alt=json&callback=comments&max-results=5"></script>
Previous
« Prev Post
« Prev Post
Next
Next Post »
Next Post »
bagus sih.. cuman gk tau postingan yang dia komentar dimana...
ReplyDeleteklik aja nama komentatornya, langsung terbuka ke postingan yang dikomen
Deleteuntuk edit jumlah komentar gimana bang?
ReplyDeletemisal saya ingin jadi 10
gagal
ReplyDelete