Hello everybody,
I have just created a short helper to create facebook like button dynamically for any content, by just giving-in the URL of the page. Hope this one also helps you like my other helpers
Helper function:
1 2 3 4 5 6 7 8 9 10 11 |
if(!function_exists('facebook_like')){
function facebook_like($url){
$formlink = '<iframe src="http://www.facebook.com/plugins/like.php?href=';
$formlink .= urlencode($url);
$formlink .= ';layout=button_count&show_faces=true&width=450&';
$formlink .= 'action=like&colorscheme=light&height=21" scrolling="no"';
$formlink .= 'frameborder="0" style="border:none; overflow:hidden;';
$formlink .= 'width:450px;height:21px;" allowTransparency="true"></iframe>';
return $formlink;
}
}
|
Usage:
1 2 3 4 |
<?php $url = current_url(); echo facebook_like($url); ?> |
Note:
As you can see the function requires you to use the codeigniter’s native URI helper.

I used your simple code and you can see the fb integration in the below url.
http://www.exploreinsta.com/view/377225224452406733_143699958
Thanks for your great tips and expecting other Social Network plugin integration also.