Thursday, May 27, 2010

Adding FaceBook Social plugins such as FaceBook 'Like' button and Activity Feed




Facebook has recently allowed its users to "Like" any content on the web and have that activity posted to their walls.

This facility helps to share content more readily and also gives web masters an estimate about how their contents are liked by Facebook visitors.

This "Like" button is something an addition to the FaceBook fans options.

This "Like" button can be added in any website or blog.

For adding this feature in your blogger blog you can follow the steps specified in this article

Or, you can just paste below coding your blogger templete code just under the <div class='post-footer'>


<iframe allowTransparency='true' expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=standard&show_faces=true&width=450&height=60&action=like&font&colorscheme=light"' frameborder='0' scrolling='no' style='border:none;overflow:hidden; width:450px; height:60px;'/>



You can see this feature in our blog also.

In our website, I used below coding for getting current url.


function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}

And, the code will look this below one.



<!-- start of facebook like-->
<tr><td>
<?php
$currentpageURL=curPageURL();
?>

<div align="center">
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $currentpageURL;?>&layout=standard&show_faces=true&width=550&action=like&font&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:550px; height:80px;" allowTransparency="true"></iframe>
</div>
</td></tr>
<!--End of Facebook like-->




The Activity Feed plug-in an another social plugin from Facebook. It displays the most interesting recent activity taking place on your site. It will show the details about both "likes" and "share" activities of your friends.

If you logged in with your facebook account then you can see the details about friends "likes" in any webpage.


If you haven't logged in with your Facebook account this plugin will show the most "liked" pages as recommendation.

We can easily get the acivity feed code from this page.

More Articles...
You can bookmark this blog for further reading, or you can subscribe to our blog feed.

1 comment:

Gerard said...

Facebook is a popular social networking site. Incorporating it in a certain site can boost traffic. Our company site is maintained by a (toronto) web design company. I will definitely recommend that we add this feature in our company site. Thanks!



Thanks for visiting our blog


twitterrss facebook linkedin YouTube subscribe




Subscribe via email

Enter your email address: