function _fblikebutton_field in Facebook Like Button 6.2
Same name and namespace in other branches
- 6 fblikebutton.module \_fblikebutton_field()
- 7.2 fblikebutton.module \_fblikebutton_field()
- 7 fblikebutton.module \_fblikebutton_field()
3 calls to _fblikebutton_field()
- fblikebutton_block in ./
fblikebutton.module - Implementation of hook_block()
- fblikebutton_link in ./
fblikebutton.module - Implements of hook_link().
- fblikebutton_nodeapi in ./
fblikebutton.module - Implements of hook_nodeapi().
File
- ./
fblikebutton.module, line 222 - Adds Facebook's "Like" button to each selected node type. Adds a block with a global static value where users can "Like" the URL set by admins.
Code
function _fblikebutton_field($webpage_to_like, $conf) {
$webpage_to_like = urlencode($webpage_to_like);
$width = $conf['width'];
$height = $conf['height'];
$layout = $conf['layout'];
$action = $conf['action'];
$colorscheme = $conf['color_scheme'];
$show_faces = $conf['show_faces'] ? 'true' : 'false';
$font = $conf['font'];
// $send = $conf['send'];
$other_css = $conf['other_css'];
$language = $conf['language'] ? '&locale=' . $conf['language'] : '';
$params = "href={$webpage_to_like}&layout={$layout}&show_faces={$show_faces}&width={$width}&font={$font}&height={$height}&action={$action}&colorscheme={$colorscheme}{$language}&send=false";
$src = htmlentities($params);
$output = '<iframe src="https://www.facebook.com/plugins/like.php?' . $src . '" scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: ' . $width . 'px; height: ' . $height . 'px;' . $other_css . '" allowTransparency="true"></iframe>';
return $output;
}