You are here

function _fblikebutton_field in Facebook Like Button 7

Same name and namespace in other branches
  1. 6.2 fblikebutton.module \_fblikebutton_field()
  2. 6 fblikebutton.module \_fblikebutton_field()
  3. 7.2 fblikebutton.module \_fblikebutton_field()
2 calls to _fblikebutton_field()
fblikebutton_block_view in ./fblikebutton.module
Implementation of hook_block_view()
fblikebutton_node_view in ./fblikebutton.module
Implements of hook_node_view().

File

./fblikebutton.module, line 258
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'];
  $font = $conf['font'];

  //  $send = $conf['send'];
  $other_css = $conf['other_css'];
  $language = $conf['language'];
  $params = "href={$webpage_to_like}&layout={$layout}&show_faces={$show_faces}&width={$width}px&font={$font}&height={$height}px&action={$action}&colorscheme={$colorscheme}&locale={$language}";
  $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;
}