leto.net
Google
 
blog
code
freebsd
gitweb
math
pics
travel
writing

del.icio.us
Digg!
share

What is social bookmarking?

Social bookmarking is a type of "crowdsourcing," using the knowledge of the masses. One example of this is del.icio.us, which allows you to share your bookmarks with your friends and access them online from anywhere in the world. facebook is another site which organizes people by real-world affiliations like high school, college, workplace, etc... These two sites can actually talk to each other by using Facebook Platform, which allows you to add a little widget to your facebook profile with your newest bookmarks on del.icio.us. Another popular site is digg.com, which allows people to vote for a link and a tally of how many people have "dugg" it is usally placed next to link with a button to "digg it." It also allows comments to be attached to links and links to be "buried" or voted against.

How can I add these nifty buttons to my site?

In the middle of the left menu you will find some standard buttons that are freely available at the respect websites. You could just view the source on this page, copy, paste and edit some links and you would be done. But that is a static solution. What if you wanted each individual page to have a unique button with the URL of that page? Del.icio.us deals with this by using javascript: <a href="http://del.icio.us/post" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url=' + encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=700,height=400'); return false;"><img border=0 src="/pics/delicious.gif">del.icio.us</a>

Automatic URL's for digg and facebook

Here is some PHP code that can be copy and pasted to implement per-page buttons for digg and facebook:
digg

facebook

Is there a better way than copy and pasting this code to every page on my site?

Of course! There are two main paths, templates, which totally seperate logic and content, or modularized PHP with include() statements. The menu on the left is included on every page with a simple call like include("menu.php");, so I will stick with that approach. Now in your menu.php you can paste these PHP code snippets or better yet, put each into a seperate PHP file and include them, for example:
Now you easily put these buttons anywhere else on your page or other sites by including the proper file!


Jonathan Leto - jonathan at leto dot net

Generated Monday 06th of October 2008 07:30:49 AM
Clicky Web Analytics

Clicky