Index: /extensions/FacebookPlug/Plugin/include/conf.inc.php
===================================================================
--- /extensions/FacebookPlug/Plugin/include/conf.inc.php	(revision 8247)
+++ /extensions/FacebookPlug/Plugin/include/conf.inc.php	(revision 8248)
@@ -31,5 +31,5 @@
   (
     'allow_fb_access_private_page' => true,
-    'async_script' => true,
+    'async_script' => false,
     'social_plugin_like_button' => array
       (
Index: /extensions/FacebookPlug/Plugin/include/picture.inc.php
===================================================================
--- /extensions/FacebookPlug/Plugin/include/picture.inc.php	(revision 8247)
+++ /extensions/FacebookPlug/Plugin/include/picture.inc.php	(revision 8248)
@@ -84,27 +84,4 @@
 }
 
-function fbp_add_social($content, &$smarty)
-{
-  global $conf;
-  $fbp_content .= '<div id="fb-xfbml">';
-
-  // iframe implementation
-/*  $fbp_content = '
-<iframe src="http://www.facebook.com/plugins/like.php?href={$SRC_IMG}&amp;layout=standard&amp;show_faces=true&amp;width={$WIDTH_IMG}&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:{$WIDTH_IMG}px; height:80px;" allowTransparency="true"></iframe>
-';*/
-
-  // XFBML implementation
-  /*$fbp_content .= '
-<fb:like href="{$SRC_IMG}" show_faces="true" width="{$WIDTH_IMG}"></fb:like>
-';*/
-  $fbp_content .= '
-<fb:like href="{$FBP_URL_PICTURE}" layout="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.layout}" show_faces="{if $FBP_SOCIAL_PLUGIN_LIKE_BUTTON.show_faces}true{else}false{/if}" width="{$WIDTH_IMG}" action="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.action}" colorscheme="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.colorscheme}"></fb:like>
-';
-
-  $fbp_content .= '</div>';
-
-  return $content.$fbp_content;
-}
-
 function fbp_loc_begin_picture()
 {
@@ -113,9 +90,4 @@
   // set prefilter
   $template->set_prefilter('header', 'fbp_header');
-  //~ $template->set_prefilter('header', 'fbp_add_fb_init');
-  if ($conf['fbp']['social_plugin_like_button']['enabled'])
-  {
-    $template->set_prefilter('default_content', 'fbp_add_social');
-  }
 }
 
@@ -125,6 +97,25 @@
   global $template, $user, $page, $conf, $picture;
 
+  if ($page['slideshow'])
+  {
+    // nothing to do on slideshow other media aren't usable
+    return $content;
+  }
+
   if ($conf['fbp']['social_plugin_like_button']['enabled'])
   {
+     // iframe implementation
+    /*  $$content = '
+    <iframe src="http://www.facebook.com/plugins/like.php?href={$SRC_IMG}&amp;layout=standard&amp;show_faces=true&amp;width={$WIDTH_IMG}&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:{$WIDTH_IMG}px; height:80px;" allowTransparency="true"></iframe>
+    ';*/
+    // XFBML implementation
+    $content .= '
+<div id="fb-xfbml">
+<fb:like href="{$FBP_URL_PICTURE}" layout="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.layout}" show_faces="{if $FBP_SOCIAL_PLUGIN_LIKE_BUTTON.show_faces}true{else}false{/if}" width="{$WIDTH_IMG}" action="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.action}" colorscheme="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.colorscheme}"></fb:like>
+</div>';
+    $content2 = '
+<fb:like href="{$FBP_URL_PICTURE}" layout="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.layout}" show_faces="{if $FBP_SOCIAL_PLUGIN_LIKE_BUTTON.show_faces}true{else}false{/if}" width="{$WIDTH_IMG}" action="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.action}" colorscheme="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.colorscheme}"></fb:like>
+';
+
     //~ $template->set_prefilter('default_content', 'fbp_add_social');
     // Always use full url for FB social plugin
@@ -146,4 +137,5 @@
     $template->assign('FBP_SOCIAL_PLUGIN_LIKE_BUTTON', $conf['fbp']['social_plugin_like_button']);
   }
+
   return $content;
 }
@@ -177,5 +169,5 @@
 {
   add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
-  add_event_handler('render_element_content', 'fbp_render_element_content', null, 2);
+  add_event_handler('render_element_content', 'fbp_render_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+1 /*in order to have picture content*/, 2);
   //~ add_event_handler('loc_end_picture', 'fbp_loc_end_picture');
   add_event_handler('loc_end_section_init', 'ftp_loc_end_section_init');
