You are here

function fb_social_like_init in Facebook social plugins integration 6

Implementation of hook init @todo Implement block settings form @todo og:image (http://developers.facebook.com/docs/reference/plugins/like)

File

modules/fb_social_like/fb_social_like.module, line 9

Code

function fb_social_like_init() {
  if (variable_get('fb_social_like_opengraph_tags', 1)) {
    $object = menu_get_object();
    if (is_object($object) && fb_social_like_type($object->type)) {

      //add fbml header meta information
      $data = '<meta property="og:title" content="' . check_plain($object->title) . '"/>' . "\n";
      $data .= '<meta property="og:site_name" content="' . variable_get('site_name', '') . '"/>' . "\n";

      // @todo maybe look for images/imagefields uploaded/attached to the node ?
      // $data .= '<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>';
      drupal_set_html_head($data);
    }
  }
}