◄ Min  Size Fonts: + | - | ± Color: Max ►

Recent Comments and Post

Bagaiamana, sudah ada yang berhasil mendapatkan ilmu hack dari blogger daratan china para sobat Beben si bloglang anu ganteng kalem tea :D Bingung sangkin bagus-bagusnya ;)) ya sudah kali ini Beben akan berbagi ilmu dari sana nih :-" Recent Comments dan recent post sobat kita dari negeri tirai bambu China ini gaya punya dan full stylish b-) Bisa menampilkan jumlah total postingan dan komentar dan dapat di next atau previous juga :-bd Kalau mau melihat aksinya silahkan masuk ke blog tools keren banget yaitu Ben-Tools dan perhatikan footer (bawahnya) :D

recent comments & postBagaimana, tertarik memiliki komentar dan postingan terbaru yg dapat dilihat semua dengan tombol next and previous :-/ Memberi kemudahan kita dalam cek dan riceknya toh ;) Caranya juga cukup mudah kita tinggal masukin saja script dan kode kedalam Add a GadgetHTML/Javascript :p

Recent Post

<div id="newposts">
<noscript>failed!<br/>javascript not supported here!</noscript>
</div>

<script>
var npoststartindex = 1;
var npostshow = 6;

function showrecentposts(nindex) {
if (!nindex)
nindex = npoststartindex;
var sfeedurl = '/feeds/posts/summary?orderby=published&start-index='+nindex+'&max-results='+(npostshow+1)+'&alt=json-in-script&callback=generateposts';
var script = document.createelement('script');
document.getelementbyid('newposts').innerhtml = 'loading <blink>...</blink>';
script.setattribute('src', sfeedurl);
script.setattribute('type', 'text/javascript');
document.documentelement.firstchild.appendchild(script);
}

function generateposts(json) {
function compareentry(a,b) {
order= date.parse(a.published.$t.replace(/^(\d{4})-(\d{2})-(\d{2})t([0-9:]*)([.0-9]*)(.)(.*)$/, '$1/$2/$3 $4 gmt')) - date.parse(b.published.$t.replace(/^(\d{4})-(\d{2})-(\d{2})t([0-9:]*)([.0-9]*)(.)(.*)$/, '$1/$2/$3 $4 gmt'));
return 0-order;
}

var shtml = '<ul>';
var sortentry = json.feed.entry.sort(compareentry);
var nindex = parseint(json.feed.opensearch$startindex.$t);
var ntotalpost = parseint(json.feed.opensearch$totalresults.$t);
for (var i = 0, post; post = sortentry[i]; i++) {
if (i >= npostshow)
break;
var title = post.title.$t;
var j = 0;
while (j < post.link.length && post.link[j].rel != "alternate")
j++;
var link = post.link[j].href;
var timestamp=post.published.$t.substr(0,10);
shtml += '<li><span class="item-title"><a href="'+link+'">'+ title +'</a> - '+timestamp+'</span></li>';
}
shtml += '</ul>';
shtml += generatepostlink(parseint(json.feed.entry.length), nindex, ntotalpost);
document.getelementbyid('newposts').innerhtml = shtml;
}

function generatepostlink(nfetch, nindex, ntotalpost) {
var bold = (nfetch > npostshow);
if (bold) nfetch = npostshow;
var sresult = '<p align="right">recent '+nindex+'-'+(nindex+nfetch-1)+', total: '+ntotalpost+'.  ';
if (nindex > npoststartindex)
sresult += '<a href="javascript:showrecentposts('+(nindex-npostshow)+');" title="newer posts"><<</a>  ';
if (bold)
sresult += '<a href="javascript:showrecentposts('+(nindex+npostshow)+');" title="older posts">>></a>';
sresult += '</p>';
return sresult;
}
</script>

<script>showrecentposts();</script>

Recent Comments

<div id="newcomments">
<noscript>failed!<br />javascript not supported here!</noscript>
</div>

<script>
var ncommentstartindex = 1;
var ncommentshow = 6;

function showrecentcomments(nindex) {
if (!nindex)
nindex = ncommentstartindex;
var sfeedurl = '/feeds/comments/summary?orderby=published&start-index='+nindex+'&max-results='+(ncommentshow+1)+'&alt=json-in-script&callback=generatecomments';
var script = document.createelement('script');
document.getelementbyid('newcomments').innerhtml = 'loading <blink>...</blink>';
script.setattribute('src', sfeedurl);
script.setattribute('type', 'text/javascript');
document.documentelement.firstchild.appendchild(script);
}

function generatecomments(json) {
function compareentry(a,b) {
order= date.parse(a.published.$t.replace(/^(\d{4})-(\d{2})-(\d{2})t([0-9:]*)([.0-9]*)(.)(.*)$/, '$1/$2/$3 $4 gmt')) - date.parse(b.published.$t.replace(/^(\d{4})-(\d{2})-(\d{2})t([0-9:]*)([.0-9]*)(.)(.*)$/, '$1/$2/$3 $4 gmt'));
return 0-order;
}

var shtml = '<ul>';
var sortentry = json.feed.entry.sort(compareentry);
var nindex = parseint(json.feed.opensearch$startindex.$t);
var ntotalcomment = parseint(json.feed.opensearch$totalresults.$t);
for (var i = 0, comment; comment = sortentry[i]; i++) {
if (i >= ncommentshow)
break;
var authorname = comment.author[0].name.$t;
var title = comment.title.$t.substr(0,100);
var j = 0;
while (j < comment.link.length && comment.link[j].rel != "alternate")
j++;
var link = comment.link[j].href.replace("#c", "#comment-");
var timestamp = comment.published.$t.substr(0,10);
shtml += '<li><span class="item-title">'+authorname+': <a href="'+link+'">'+ title +'</a> - '+timestamp+'</span></li>';
}
shtml += '</ul>';
shtml += generatecommentlink(parseint(json.feed.entry.length), nindex, ntotalcomment);
document.getelementbyid('newcomments').innerhtml = shtml;
}

function generatecommentlink(nfetch, nindex, ntotalcomment) {
var bold = (nfetch > ncommentshow);
if (bold) nfetch = ncommentshow;
var sresult = '<p align="right">recent '+nindex+'-'+(nindex+nfetch-1)+', total: '+ntotalcomment+'.  ';
if (nindex > ncommentstartindex)
sresult += '<a href="javascript:showrecentcomments('+(nindex-ncommentshow)+');" title="newer comments"><<</a>  ';
if (bold)
sresult += '<a href="javascript:showrecentcomments('+(nindex+ncommentshow)+');" title="older comments">>></a>';
sresult += '</p>';
return sresult;
}

</script>
<script>showrecentcomments();</script>
Disuruh terjemahin juga, eh malah dikasih tutorial ini yah ;;) ;))
See yah happy new year \m/
Loading...
XRecent Comments and Post

Subscribe my posts Register For Free!

6 comments

[?] g+ convert

DO NOT EVEN TRY ADD LINK [-X
You can use some HTML tags, such as
<b> - <i> - <a> - http://...jpg/gif/png/bmp - http://youtu.be/...


MISC

Resources

WANT BE HERE!!! CONTACT ME :P

FACEBOOK PAGE