Skip to content

Commit 6e0904a

Browse files
committed
add facebook Like button below the node body
1 parent ddc94d1 commit 6e0904a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

opengraphprotocol.info

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; $Id: $
22
name = Open Graph Protocol
3-
description = Allows to annotate page with the Open Graph protocol and make them available in Facebook.
3+
description = Allows to annotate pages with the Open Graph protocol and make them available to Facebook.
44
package = Other
55
version = VERSION
66
core = 7.x

opengraphprotocol.module

+4-1
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ function opengraphprotocol_form_node_type_form_alter(&$form, $form_state) {
114114
*/
115115
function opengraphprotocol_preprocess_node(&$variables) {
116116
$node = $variables['node'];
117-
// Uses the mapping for og:type if it has been defined by the administrator.
118117

118+
// Uses the mapping for og:type if it has been defined by the administrator.
119119
$meta_tags[] = array(
120120
'property' => 'og:type',
121121
'content' => variable_get('opengraphprotocol_type_' . $node->type, $node->type),
@@ -171,4 +171,7 @@ function opengraphprotocol_preprocess_node(&$variables) {
171171
foreach ($meta_tags as $id => $meta_tag) {
172172
drupal_add_html_head(array('#tag' => 'meta', '#attributes' => $meta_tag), 'opengraphprotocol_' . $id);
173173
}
174+
175+
// Places a Facebook "Like" button below the body of the node.
176+
$variables['content']['body']['#suffix'] = '<iframe src="http://www.facebook.com/plugins/like.php?href=' . urlencode(url('node/' . $node->nid, array('absolute' => TRUE))) . '&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>';
174177
}

0 commit comments

Comments
 (0)