Wednesday, 31 October 2007

Add delicious button with counter in your blogger posts

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>



Add a retweet counter on your website with ReTweet.comAdd a retweet counter on your posts with TweetmemeHow to install Disqus comments into BloggerImprove the default comment system with Google Friend ConnectAdd TwitThis on your Blogger templateAdd Digg vote button on Blogger Template (update)Add delicious button with counter in your blogger postsPlace Google AdSense below post's title on BloggerAdd StumbleUpon button in your Blogger postsAdd reddit button with counter in your Blogger template Add Technorati blog reaction on your Blogger templateAdd Mixx button on Blogger templateAdd DZone button on Blogger templateAdd Design Float button on Blogger templateSome Blogger Tips you probably don't knowAdd Yahoo! Buzz button on Blogger Template

No comments:

Post a Comment