Pengen membuat Recent Comment/daftar komentar dengan Title POst/judul posting di Blog kita seperti dibawah ini :
caranya mudah kok :
1. Login ke Blogger lalu klik Layout -> Page Elements
2. Klik Add a Gadget -> HTML/Javascript
3. Copy kode dibawah ini lalu paste di element halaman tersebut :
<ul><script style="text/javascript">
function showrecentcomments(json) {
for (var i = 0; i < 5; i++) {
var entry = json.feed.entry[i];
var ctlink;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
ctlink = entry.link[k].href;
break;
}
}
ctlink = ctlink.replace("#", "#comment-");
var ptlink = ctlink.split("#");
ptlink = ptlink[0];
var txtlink = ptlink.split("/");
txtlink = txtlink[5];
txtlink = txtlink.split(".html");
txtlink = txtlink[0];
var pttitle = txtlink.replace(/-/g," ");
pttitle = pttitle.link(ptlink);
if ("content" in entry) {
var comment = entry.content.$t;}
else
if ("summary" in entry) {
var comment = entry.summary.$t;}
else var comment = "";
var re = /<\S[^>]*>/g;
comment = comment.replace(re, "");
document.write('<li>');
document.write('<a href="' + ctlink + '">' + entry.author[0].name.$t + '</a>');
document.write(' on ' + pttitle);
document.write('<br/>');
if (comment.length < 100) {
document.write(comment);
}
else
{
comment = comment.substring(0, 100);
var quoteEnd = comment.lastIndexOf(" ");
comment = comment.substring(0, quoteEnd);
document.write(comment + '...<a href="' + ctlink + '">(more)</a>');
}
}
document.write('</li>');
document.write('<div style="font-size:75%;text-align:center"><a
href="http://lolidsonline.blogspot.com/2009/08/membuat-daftar-komentar-disertai-judul.html">
Get this Widget</a></div>');
}
</script>
<script
src=http://NAMA-blogkamu.blogspot.com/feeds/comments/default?alt=json-in-script&callback=showr
ecentcomments>
</script></ul>
<noscript>You need to enable JavaScript to read this.</noscript>
function showrecentcomments(json) {
for (var i = 0; i < 5; i++) {
var entry = json.feed.entry[i];
var ctlink;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
ctlink = entry.link[k].href;
break;
}
}
ctlink = ctlink.replace("#", "#comment-");
var ptlink = ctlink.split("#");
ptlink = ptlink[0];
var txtlink = ptlink.split("/");
txtlink = txtlink[5];
txtlink = txtlink.split(".html");
txtlink = txtlink[0];
var pttitle = txtlink.replace(/-/g," ");
pttitle = pttitle.link(ptlink);
if ("content" in entry) {
var comment = entry.content.$t;}
else
if ("summary" in entry) {
var comment = entry.summary.$t;}
else var comment = "";
var re = /<\S[^>]*>/g;
comment = comment.replace(re, "");
document.write('<li>');
document.write('<a href="' + ctlink + '">' + entry.author[0].name.$t + '</a>');
document.write(' on ' + pttitle);
document.write('<br/>');
if (comment.length < 100) {
document.write(comment);
}
else
{
comment = comment.substring(0, 100);
var quoteEnd = comment.lastIndexOf(" ");
comment = comment.substring(0, quoteEnd);
document.write(comment + '...<a href="' + ctlink + '">(more)</a>');
}
}
document.write('</li>');
document.write('<div style="font-size:75%;text-align:center"><a
href="http://lolidsonline.blogspot.com/2009/08/membuat-daftar-komentar-disertai-judul.html">
Get this Widget</a></div>');
}
</script>
<script
src=http://NAMA-blogkamu.blogspot.com/feeds/comments/default?alt=json-in-script&callback=showr
ecentcomments>
</script></ul>
<noscript>You need to enable JavaScript to read this.</noscript>
Keterangan : Ganti "NAMA-blogkamu" dengan URL blog sobat.
4. Kalo sudah jangan lupa SAVE / Simpan.
5. Selesai dach.
Semoga Bermanfaat Kawan.
tag : Membuat daftar komentar, recent comment, daftar komentar terkini, daftar komentar, widget daftar komentar, recent comment widget, cara membuat daftar komentar terkini.
Article information:
Description: Membuat Daftar Komentar disertai Judul Posting
Rating: 4.5
- Reviewer: LolidsOfficialBlog
- ItemReviewed: Membuat Daftar Komentar disertai Judul Posting
Wah info mantab nih..makasih ya mas dah sharing.Aku emang lagi kebingungan nih mau pasang Daftar komentar.tengkiyu mas.
Oh ya mas Lolids saya ucapkan selamat tinggal ya.Mohon maaf lahir dan batin.
tipsnya bermanfaat nih kawan :). sip