ads

This is a blogger hack to add a delicious button with a counter which show the number of users that share the current link for each post.

The result is like this:

add to del.icio.us saved by 456 users

  • Update: november 13, 2007
  • I have solved an issue with the delicious counter when more posts are displayed in a single page november 5, 2007
  • I have solved an issue for Internet Explorer 6-7 november 5, 2007
  • If you use Internet Explorer you have a javascript error if current link is not added on del.icio.us. Add it first! november 13, 2007
In your blogger account, select modify HTML and check expand widget models. Find this code:
<p class="post-footer-line post-footer-line-3">
and add this code below:

<a expr:href='"http://del.icio.us/post?url="+ data:post.url + "&amp;title" + data:post.title' target='_blank'>add to del.icio.us</a>
saved by <span class='delsquare' expr:id='"a"+data:post.id'>0</span> users

<script type='text/javascript'>
function displayURL(data) {
var urlinfo = data[0];
if (!urlinfo.total_posts) return;
document.getElementById('a<data:post.id/>').innerHTML = urlinfo.total_posts;
}
</script>
<script expr:src = '"http://badges.del.icio.us/feeds/json/url/data?url= " + data:post.url + "&amp;callback=displayURL"'/>
Add CSS class
Copy this code in the <head> section of template to format the number of users that share the current link:
<style>
.delsquare{
font-family:Arial;
background:#0033CC;
padding:2px 4px;
font-weight:bold;
font-size:12px;
color:#FFFFFF;
}
</style>
Show comments
Hide comments
0 Komentar untuk : Add delicious button with counter in your blogger posts

Masukkan Komentar Disini