function fb_social_init in Facebook social plugins integration 6.2
Same name and namespace in other branches
- 6 fb_social.module \fb_social_init()
Implementation of hook init
File
- ./
fb_social.module, line 194
Code
function fb_social_init() {
// Add simple OpenGraph metatags
$data = "";
if (variable_get('fb_social_opengraph', 1)) {
$content = drupal_set_title();
$content = $content ? strip_tags($content) : variable_get('site_name', 'Drupal');
//add fbml header meta information
$data = '<meta property="og:title" content="' . $content . '"/>' . "\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"/>';
}
/**
* from facebook ..
* If your site has many comments boxes, we strongly recommend you specify a Facebook app id
* as the administrator (all administrators of the app will be able to moderate comments).
* Doing this enables a moderator interface on Facebook where comments from all plugins
* administered by your app id can be easily moderated together.
*/
$data .= '<meta property="fb:app_id" content="' . check_plain(variable_get('fb_social_appid', '')) . '"/>' . "\n";
drupal_set_html_head($data);
}