From 536b98120288435055e5795730219055c1932d0c Mon Sep 17 00:00:00 2001 From: Jeremy Trojan Date: Sun, 27 Mar 2011 12:04:49 -0700 Subject: Committing changes that apparently never took effect. --- fblikebutton.module | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'fblikebutton.module') diff --git a/fblikebutton.module b/fblikebutton.module index a6b2a95..646b02a 100644 --- a/fblikebutton.module +++ b/fblikebutton.module @@ -11,7 +11,7 @@ */ function fblikebutton_menu() { $items['admin/settings/fblikebutton'] = array( - 'title' => 'FB Like settings', + 'title' => 'FB Like Button', 'description' => 'Control which content types the "like" button should appear on.', 'page callback' => 'drupal_get_form', 'page arguments' => array('fblikebutton_admin_settings'), @@ -26,21 +26,24 @@ function fblikebutton_menu() { * Implementation of hook_nodeapi(). * @todo * Add more config options for like button (size, etc). - * Should $likebutton be wrapped in t()? */ function fblikebutton_nodeapi(&$node, $op, $teaser, $page) { global $user; + global $base_url; + $likebase = $base_url . '/'; + $likepath = drupal_get_path_alias($_GET['q']); + $webpage_to_like = $likebase . $likepath; switch ($op) { case 'view': // Set which node types users can "like". $types_to_like = variable_get('fblikebutton_node_types', array('page')); - // Replace with drupal_get_path_alias() or something? - $likepath = $_SERVER['SCRIPT_URI']; - $likepath = urlencode($likepath); + $show_faces = variable_get('fblikebutton_show_faces', 'true'); // Facebook is doing away with FBML, so we use the iframe plugin option instead. $likebutton = ''; + $likebutton .= urlencode($webpage_to_like); + $likebutton .= '&layout=standard&show_faces='; + $likebutton .= $show_faces; + $likebutton .= '&width=450&action=like&font&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true">'; // Keep the fblikebutton button out of search results, etc. if (!$page) { break; -- cgit v1.2.3