24 May 2008

Top Commentators, Most Commented, and Show HTML Code Hacks for bloggers

If you look at my sidebars, you can see that now I have put there the top commentators and most commented posts of this blog. You can also do the same with your blogger/blogspot blog in a very simple way. Just follow these steps:
  1. Go to the dashboard and choose layout.
  2. Click 'add a page element'
  3. Click 'html/javascripts'
  4. Copy the code below and paste it there.
  5. Change BLOGNAME.blogspot.com with your blog address.
  6. Important: Merge everything between the last <script src> and </span> - make sure it is not broken.
  7. Adjust the layout and then save.
To show Most Commented Posts:
<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ol style="text-transform: capitalize;">');
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write('</ol>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&
_callback=pipeCallback&_id=
1cf38ae68efbe859c4ba1ee239cec099&
url=http%3A%2F%2FBLOGNAME.blogspot.com&num=10" type="text/javascript"></script>
<span style="gt;<a href="http://jed.revolutia.info/
2008/05/top-commentators-most-commented-and.html
">How To Install This One? </a></span>
Or just copy-paste from this page.

To Show Top 10 Commentators of your blog:

<script type="text/javascript">
function pipeCallback(obj) {
document.write("<ol>");
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write("</ol>");
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json
&_callback=pipeCallback&_id=
c92ac21897d8b56e61cfa85930dd89a1
&url=http%3A%2F%2FBLOGNAME.blogspot.com
&num=10" type="text/javascript"></script>
<span style="gt;<a href="http://jed.revolutia.info/
2008/05/top-commentators-most-commented-and.html
">How To Install This One? </a></span>

Or just copy-paste from this page.


To show HTML/Javascripts Code Hacks in your blogger post like what I did above, follow these steps:

  1. Open Notepad. Paste your code there.
  2. Go to Edit->Replace (or Ctrl+H) and in the Find what: box write < and in the Replace with: box write
  3. and click Replace All (or Alt+A).
  4. Now go to Edit->Replace (or Ctrl+H) again and in the Find what: box write > and in the Replace with: box write
  5. and click Replace All (or Alt+A) again
  6. Paste the resultant code in the post editing box and preview it to make sure its showing fine.

3 comments:

Fida Abbott said...

Hi Jed, I have a TAG for you.

Have greatd day!

miTadRiani said...

Gak bisa dipake di WP yaa??

awan_clickerz said...

Uhuuy..kemaren dah lama bikin sobat..tapi kok tiba2 ilang..pas dimasukin lagi codenya..gk bisa muncul lagi tuh top commentnya..
mohon bimbingannya..

Yup !

Post a Comment