Últimos comentários com ícone
Autor: Rhay_Fither | Publicado: 2011-12-11T10:46:00-08:00

Esse &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; é&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;um&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;script&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;de&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;últimos comentários&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;com&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;ícone&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;personalizados.&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;que&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;achei&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;em&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;um&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;site, e&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;irei disponibilizar &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;o&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;código&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;aqui&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;pra&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;vocês.Copie o código abaixo:&lt;script type="text/javascript"&gt;&nbsp;function showrecentcomments(json) {&nbsp;&nbsp; for (var i = 0; i &lt; numcomments; i++) {&nbsp;&nbsp;&nbsp;&nbsp; var entry = json.feed.entry[i];&nbsp;&nbsp;&nbsp;&nbsp; var alturl;&nbsp;&nbsp;&nbsp; if (i == json.feed.entry.length) break;&nbsp;&nbsp;&nbsp;&nbsp; for (var k = 0; k &lt; entry.link.length; k++) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (entry.link[k].rel == 'alternate') {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alturl = entry.link[k].href;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; var photoslink=new Array()&nbsp;&nbsp;&nbsp; photoslink[0]='&lt;img src="http://1.bp.blogspot.com/_8PJ-pgoBhWQ/SeJp1pMWkLI/AAAAAAAAGmo/ggSsVIrdtms/s320/otros.png"/&gt;';&nbsp;&nbsp;&nbsp;Fernando='&lt;img src="http://url-do-seu-icone/yo.png"/&gt;';&nbsp;&nbsp;&nbsp; anonymous='&lt;img src="http://3.bp.blogspot.com/_8PJ-pgoBhWQ/SeJp4vL4RKI/AAAAAAAAGmw/x20-2kKSkEU/s320/anonymous.png"/&gt;';&nbsp;&nbsp; alturl = alturl.replace("#", "#comment-");&nbsp;&nbsp;&nbsp; var postlink = alturl.split("#");&nbsp;&nbsp;&nbsp; postlink = postlink[0];&nbsp;&nbsp;&nbsp; var linktext = postlink.split("/");&nbsp;&nbsp;&nbsp; linktext = linktext[5];&nbsp;&nbsp; linktext = linktext.split(".html");&nbsp;&nbsp;&nbsp; linktext = linktext[0];&nbsp;&nbsp;&nbsp; var posttitle = linktext.replace(/-/g," ");&nbsp;&nbsp;&nbsp; posttitle = posttitle.link(postlink);&nbsp;&nbsp;&nbsp; var commentdate = entry.published.$t;&nbsp;&nbsp;&nbsp; var cdyear = commentdate.substring(0,4);&nbsp;&nbsp;&nbsp; var cdmonth = commentdate.substring(5,7);&nbsp;&nbsp;&nbsp; var cdday = commentdate.substring(8,10);&nbsp;&nbsp;&nbsp; var monthnames = new Array();&nbsp;&nbsp;&nbsp; monthnames[1] = "Jan";&nbsp;&nbsp;&nbsp; monthnames[2] = "Fev";&nbsp;&nbsp;&nbsp; monthnames[3] = "Mar";&nbsp;&nbsp;&nbsp; monthnames[4] = "Abr";&nbsp;&nbsp;&nbsp; monthnames[5] = "Mai";&nbsp;&nbsp;&nbsp; monthnames[6] = "Jun";&nbsp;&nbsp;&nbsp; monthnames[7] = "Jul";&nbsp;&nbsp;&nbsp; monthnames[8] = "Ago";&nbsp;&nbsp;&nbsp; monthnames[9] = "Set";&nbsp;&nbsp;&nbsp; monthnames[10] = "Out";&nbsp;&nbsp;&nbsp; monthnames[11] = "Nov";&nbsp;&nbsp;&nbsp; monthnames[12] = "Dez";&nbsp;&nbsp;&nbsp; if ("content" in entry) {&nbsp;&nbsp;&nbsp;&nbsp; var comment = entry.content.$t;}&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp;&nbsp; if ("summary" in entry) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var comment = entry.summary.$t;}&nbsp;&nbsp;&nbsp; else var comment = "";&nbsp;&nbsp;&nbsp; var re = /&lt;S[^&gt;]*&gt;/g;&nbsp;&nbsp;&nbsp; comment = comment.replace(re, "");&nbsp;&nbsp;&nbsp; if (!standardstyling) document.write('&lt;div class="bbrecpost"&gt;');&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;br/&gt;');&nbsp;&nbsp;&nbsp; if (showcommentdate == true) document.write('Dia ' + cdday + ' ' + monthnames[parseInt(cdmonth,10)] + ' ');if( entry.author[0].name.$t == 'Fernando'){ document.write(fernando)}&nbsp;else{&nbsp;if( entry.author[0].name.$t == 'Anonymous'){ document.write(anonymous)}else{document.write(photoslink)}&nbsp;}&nbsp;&nbsp;&nbsp; document.write('&lt;a href="' + alturl + '"&gt;' + entry.author[0].name.$t + ', disse' +'&lt;/a&gt;&nbsp;&nbsp; ');&nbsp;&nbsp;&nbsp; if (showposttitle == true) document.write(' em ' + posttitle);&nbsp;&nbsp;&nbsp; if (!standardstyling) document.write('&lt;/div&gt;&lt;div class="bbrecpostsum"&gt;');&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;div class="txtmsg"&gt;&lt;br/&gt;&lt;/div&gt;');&nbsp;&nbsp;&nbsp; if (comment.length &lt; numchars) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;i&gt;');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.write(comment);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;/i&gt;');}&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;i&gt;');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment = comment.substring(0, numchars);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var quoteEnd = comment.lastIndexOf(" ");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment = comment.substring(0, quoteEnd);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.write(comment + '...&lt;a href="' + alturl + '"&gt;(leia mais)&lt;/a&gt;');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;/i&gt;');}&nbsp;&nbsp;&nbsp; if (!standardstyling) document.write('&lt;/div&gt;');&nbsp;&nbsp;&nbsp; if (standardstyling) document.write('&lt;br/&gt;');&nbsp;&nbsp; }&nbsp;if (!standardstyling) document.write('&lt;div class="bbwidgetfooter"&gt;');&nbsp;if (standardstyling) document.write('&lt;br/&gt;');&nbsp;if (!standardstyling) document.write('&lt;/div&gt;');}&lt;/script&gt;&nbsp;&lt;script type="text/javascript"&gt;&nbsp;var numcomments = 8;&nbsp;var showcommentdate = true;&nbsp;var showposttitle = true;&nbsp;var numchars = 50;&nbsp;var standardstyling = true;&nbsp;&lt;/script&gt;&nbsp;&lt;script src="http://codigos-bloggerbr.blogspot.com/feeds/comments/default?alt=json-in-script&amp;callback=showrecentcomments"&gt;&lt;/script&gt;Vá em LAYOUT - Elementos da página - Adicionar um Gadget =&gt; HTML/Javascript &nbsp;e cole o código.Notas:AZUL = coloque o nome do autor (seu nome por exemplo)ROXO = é a URL ícone dos comentários comuns, onde vc pode trocarLARANJA = &nbsp;é o ícone dos comentários anônimos &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//VERMELHO = coloque a URL do seu blogCaso queira configurar:var numcomments = 8 Número máximo de comentários a ser exibido.var showcommentdate = true; Mostrar a data | true - mostra | false não mostra&nbsp;var showposttitle = true; O título do post comentado. false para esconder.numchars var = 50; Número máximo de caracteres&nbsp;Depois Salve e pronto! =D