Index: /extensions/FacebookPlug/Plugin/admin.config.php
===================================================================
--- /extensions/FacebookPlug/Plugin/admin.config.php	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/admin.config.php	(revision 8295)
@@ -38,6 +38,6 @@
 // Data
 $base_url = get_admin_plugin_menu_link(__FILE__);
-$url_type = array('page', 'image');
-$url_type_l10n = array_map('l10n', $url_type);
+$picture_url_type = array('page', 'image');
+$picture_url_type_l10n = array_map('l10n', $picture_url_type);
 $layout = array('standard', 'button_count', 'box_count');
 $layout_l10n = array_map('l10n', $layout);
@@ -67,5 +67,4 @@
       // Like button
       $conf['fbp']['social_plugin_like_button']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED']) ? false : true;
-      $conf['fbp']['social_plugin_like_button']['url_type'] = $url_type[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_URL_TYPE']];
       $conf['fbp']['social_plugin_like_button']['layout'] = $layout[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_LAYOUT']];
       $conf['fbp']['social_plugin_like_button']['show_faces'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_SHOW_FACES']) ? false : true;
@@ -75,4 +74,11 @@
       $conf['fbp']['social_plugin_facepile']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED']) ? false : true;
       $conf['fbp']['social_plugin_facepile']['max_rows'] = intval($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_MAX_ROWS']);
+      // Comments
+      $conf['fbp']['social_plugin_comments']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED']) ? false : true;
+      $conf['fbp']['social_plugin_comments']['numposts'] = intval($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS']);
+      $conf['fbp']['social_plugin_comments']['title'] = $_POST['FBP_SOCIAL_PLUGIN_COMMENTS_TITLE'];
+      $conf['fbp']['social_plugin_comments']['simple'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE']) ? false : true;
+      $conf['fbp']['social_plugin_comments']['reverse'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE']) ? false : true;
+      $conf['fbp']['social_plugin_comments']['publish_feed'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED']) ? false : true;
       // Like box
       $conf['fbp']['social_plugin_like_box']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED']) ? false : true;
@@ -88,4 +94,5 @@
     {
       $conf['fbp']['async_script'] = empty($_POST['FBP_ASYNC_SCRIPT']) ? false : true;
+      $conf['fbp']['picture_url_type'] = $picture_url_type[$_POST['FBP_PICTURE_URL_TYPE']];
       $conf['fbp']['allow_fb_access_private_page'] = empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']) ? false : true;
       break;
@@ -122,6 +129,4 @@
             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like/',
             'ENABLED' => ($conf['fbp']['social_plugin_like_button']['enabled'] ? 'checked="checked"' : ''),
-            'URL_TYPE_OPTIONS' => $url_type_l10n,
-            'URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['url_type'], $url_type),
             'LAYOUT_OPTIONS' => $layout_l10n,
             'LAYOUT_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['layout'], $layout),
@@ -137,4 +142,14 @@
             'ENABLED' => ($conf['fbp']['social_plugin_facepile']['enabled'] ? 'checked="checked"' : ''),
             'MAX_ROWS' => $conf['fbp']['social_plugin_facepile']['max_rows'],
+          ),
+       'comments' => array
+          (
+            'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/comments/',
+            'ENABLED' => ($conf['fbp']['social_plugin_comments']['enabled'] ? 'checked="checked"' : ''),
+            'NUMPOSTS' => $conf['fbp']['social_plugin_comments']['numposts'],
+            'TITLE' => $conf['fbp']['social_plugin_comments']['title'],
+            'SIMPLE' => ($conf['fbp']['social_plugin_comments']['simple'] ? 'checked="checked"' : ''),
+            'REVERSE' => ($conf['fbp']['social_plugin_comments']['reverse'] ? 'checked="checked"' : ''),
+            'PUBLISH_FEED' => ($conf['fbp']['social_plugin_comments']['publish_feed'] ? 'checked="checked"' : ''),
           ),
        'like_box' => array
@@ -158,4 +173,6 @@
       array(
         'FBP_ASYNC_SCRIPT'=> ($conf['fbp']['async_script'] ? 'checked="checked"' : ''),
+        'FBP_PICTURE_URL_TYPE_OPTIONS' => $picture_url_type_l10n,
+        'FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['picture_url_type'], $picture_url_type),
         'FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE'=> ($conf['fbp']['allow_fb_access_private_page'] ? 'checked="checked"' : ''),
         ));
Index: /extensions/FacebookPlug/Plugin/include/conf.inc.php
===================================================================
--- /extensions/FacebookPlug/Plugin/include/conf.inc.php	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/include/conf.inc.php	(revision 8295)
@@ -30,9 +30,11 @@
   array
   (
+    'async_script' => false,
+    'picture_url_type' => 'page',
     'allow_fb_access_private_page' => true,
-    'async_script' => false,
     'social_plugin_like_button' => array(),
+    'social_plugin_facepile' => array(),
+    'social_plugin_comments' => array(),
     'social_plugin_like_box' => array(),
-    'social_plugin_facepile' => array(),
   ),
   unserialize($conf['fbp']));
@@ -43,5 +45,4 @@
   (
     'enabled' => true,
-    'url_type' => 'page',
     'layout' => 'standard',
     'show_faces' => true,
@@ -51,4 +52,29 @@
   ),
   $conf['fbp']['social_plugin_like_button']);
+
+$conf['fbp']['social_plugin_facepile'] = array_merge(
+  // default values
+  array
+  (
+    'enabled' => true,
+    'max_rows' => 1,
+    'width' => null,
+  ),
+  $conf['fbp']['social_plugin_facepile']);
+
+$conf['fbp']['social_plugin_comments'] = array_merge(
+  // default values
+  array
+  (
+    'enabled' => false,
+    'numposts' => 5,
+    'css' => null,
+    'title' => null,
+    'simple' => true,
+    'reverse' => false,
+    'publish_feed' => true,
+    'width' => null,
+  ),
+  $conf['fbp']['social_plugin_comments']);
 
 $conf['fbp']['social_plugin_like_box'] = array_merge(
@@ -66,18 +92,4 @@
   $conf['fbp']['social_plugin_like_box']);
 
-$conf['fbp']['social_plugin_facepile'] = array_merge(
-  // default values
-  array
-  (
-    'enabled' => true,
-    //'url_type' => 'page',
-    'max_rows' => 1,
-    'width' => null,
-  ),
-  $conf['fbp']['social_plugin_facepile']);
-
-// Same value of like button
-$conf['fbp']['social_plugin_facepile']['url_type'] = $conf['fbp']['social_plugin_like_button']['url_type'];
-
 //~ print_r($conf['fbp']);
 
Index: /extensions/FacebookPlug/Plugin/include/picture.inc.php
===================================================================
--- /extensions/FacebookPlug/Plugin/include/picture.inc.php	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/include/picture.inc.php	(revision 8295)
@@ -34,10 +34,12 @@
   {
     $tpl = 'social.plugin.facepile';
-    $type = $conf['fbp']['social_plugin_facepile']['url_type'];
   }
   else if ($conf['fbp']['social_plugin_like_button']['enabled'])
   {
     $tpl = 'social.plugin.like.button';
-    $type = $conf['fbp']['social_plugin_like_button']['url_type'];
+  }
+  else if ($conf['fbp']['social_plugin_comments']['enabled'])
+  {
+    $tpl = 'social.plugin.comments';
   }
   else
@@ -50,5 +52,5 @@
   // Always use full url for FB social plugin
   set_make_full_url();
-  if ($type == 'image')
+  if ($conf['fbp']['picture_url_type'] == 'image')
   {
     $fbp_url_picture = get_element_url($current_picture);
@@ -60,4 +62,5 @@
   unset_make_full_url();
   $template->assign('fbp_url_picture', $fbp_url_picture);
+  $template->assign('fbp_urlencode_picture', urlencode($fbp_url_picture));
 
   // XFBML implementation
@@ -72,5 +75,5 @@
   global $conf;
 
-  if ($conf['fbp']['social_plugin_like_button']['enabled'])
+  if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled'])
   {
     if ($conf['fbp']['allow_fb_access_private_page'])
@@ -93,5 +96,5 @@
 }
 
-if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'])
+if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled'])
 {
   //~ add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
Index: /extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php	(revision 8295)
@@ -40,5 +40,5 @@
 $lang['Like button'] = 'Like button';
 $lang['Enabled'] = 'Enabled';
-$lang['URL type'] = 'URL type';
+$lang['Picture URL type'] = 'Picture URL type';
 $lang['Layout style'] = 'Layout style';
 $lang['Show faces'] = 'Show faces';
@@ -53,24 +53,14 @@
 $lang['Data updated with success'] = 'Data updated with success';
 $lang['Data updated with error'] = 'Data updated with error';
-
 $lang['Facepile'] = 'Facepile';
 $lang['on slideshow pages'] = 'on slideshow pages';
 $lang['Num rows'] = 'Num rows';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
+$lang['Comments'] = 'Comments';
+$lang['Num posts'] = 'Num posts';
+$lang['Title'] = 'Title';
+$lang['Simple'] = 'Simple';
+$lang['Reverse'] = 'Reverse';
+$lang['Publish feed'] = 'Publish feed';
+//~ $lang[''] = '';
 
 ?>
Index: /extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php	(revision 8295)
@@ -40,5 +40,5 @@
 $lang['Like button'] = 'Bouton "J\'aime"';
 $lang['Enabled'] = 'Activé';
-$lang['URL type'] = 'Type d\'URL';
+$lang['Picture URL type'] = 'Type d\'URL pour les images';
 $lang['Layout style'] = 'Style d\'affichage';
 $lang['Show faces'] = 'Voir les faces';
@@ -56,4 +56,10 @@
 $lang['on slideshow pages'] = 'sur les diaporamas';
 $lang['Num rows'] = 'Nombre de lignes';
+$lang['Comments'] = 'Commentaires';
+$lang['Num posts'] = 'Nombre de commentaires affichés';
+$lang['Title'] = 'Titre';
+$lang['Simple'] = 'Simple';
+$lang['Reverse'] = 'Ordre inversé';
+$lang['Publish feed'] = 'Publier les commentaires';
 
 ?>
Index: /extensions/FacebookPlug/Plugin/tpl/admin.config.tpl
===================================================================
--- /extensions/FacebookPlug/Plugin/tpl/admin.config.tpl	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/tpl/admin.config.tpl	(revision 8295)
@@ -20,12 +20,4 @@
       <li>
         <label>
-          <span class="property">{'URL type'|@translate}</span>
-          <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_URL_TYPE" size="1">
-            {html_options options=$social_plugin.like_button.URL_TYPE_OPTIONS selected=$social_plugin.like_button.URL_TYPE_OPTIONS_SELECTED}
-          </select>
-        </label>
-      </li>
-      <li>
-        <label>
           <span class="property">{'Layout style'|@translate}</span>
           <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_LAYOUT" size="1">
@@ -83,4 +75,49 @@
 <fieldset>
   <ul>
+    <h3><a href="{$social_plugin.comments.FB_PAGE}" onclick="window.open(this.href); return false;">{'Comments'|@translate}</a> {'on picture pages'|@translate}</h3>
+    <li>
+      <label>
+        <span class="property">{'Enabled'|@translate}</span>
+        <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED" {$social_plugin.comments.ENABLED} />
+      </label>
+    </li>
+
+    <div id='comments'>
+      <li>
+        <label>
+          <span class="property">{'Num posts'|@translate}</span>
+          <input type="text" size="3" maxlength="4" name="FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS" value="{$social_plugin.comments.NUMPOSTS}" />
+        </label>
+      </li>
+      <li>
+        <label>
+          <span class="property">{'Title'|@translate}</span>
+          <input type="text" size="39" name="FBP_SOCIAL_PLUGIN_COMMENTS_TITLE" value="{$social_plugin.comments.TITLE}" />
+        </label>
+      </li>
+      <li>
+        <label>
+          <span class="property">{'Simple'|@translate}</span>
+          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE" {$social_plugin.comments.SIMPLE} />
+        </label>
+      </li>
+      <li>
+        <label>
+          <span class="property">{'Reverse'|@translate}</span>
+          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE" {$social_plugin.comments.REVERSE} />
+        </label>
+      </li>
+      <li>
+        <label>
+          <span class="property">{'Publish feed'|@translate}</span>
+          <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED" {$social_plugin.comments.PUBLISH_FEED} />
+        </label>
+      </li>
+    </div>
+  </ul>
+</fieldset>
+
+<fieldset>
+  <ul>
     <h3><a href="{$social_plugin.like_box.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like box'|@translate}</a> {'on main pages'|@translate}</h3>
     <li>
@@ -139,4 +176,12 @@
     </li>
 *}
+    <li>
+      <label>
+        <span class="property">{'Picture URL type'|@translate}</span>
+        <select name="FBP_PICTURE_URL_TYPE" size="1">
+          {html_options options=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS selected=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED}
+        </select>
+      </label>
+    </li>
     <li>
       <label>
@@ -188,4 +233,5 @@
       init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "like_button");
       init_checkbox("FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED", "facepile");
+      init_checkbox("FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED", "comments");
       init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED", "like_box");
     });
Index: /extensions/FacebookPlug/Plugin/tpl/init.fb.tpl
===================================================================
--- /extensions/FacebookPlug/Plugin/tpl/init.fb.tpl	(revision 8294)
+++ /extensions/FacebookPlug/Plugin/tpl/init.fb.tpl	(revision 8295)
@@ -1,2 +1,3 @@
+<!-- By FacebookPlug a Piwigo Plugin -->
 {if $fbp.async_script}
 <div id="fb-root"></div>
@@ -12,5 +13,5 @@
   (function() {ldelim}
     var e = document.createElement(script);
-    e.src = document.location.protocol + //connect.facebook.net/{$LANGUAGE}/all.js;
+    e.src = document.location.protocol + //connect.facebook.net/{$LANGUAGE}/all.js#appId={$FACEBOOK_APP_ID}&amp;xfbml=1;
     e.async = true;
     document.getElementById(fb-root).appendChild(e);
@@ -19,5 +20,5 @@
 {else}
 <div id="fb-root"></div>
-<script src="http://connect.facebook.net/{$LANGUAGE}/all.js#xfbml=1"></script>
+<script src="http://connect.facebook.net/{$LANGUAGE}/all.js#appId={$FACEBOOK_APP_ID}&amp;xfbml=1"></script>
 <script>
   FB.init({ldelim}
Index: /extensions/FacebookPlug/Plugin/tpl/social.plugin.comments.tpl
===================================================================
--- /extensions/FacebookPlug/Plugin/tpl/social.plugin.comments.tpl	(revision 8295)
+++ /extensions/FacebookPlug/Plugin/tpl/social.plugin.comments.tpl	(revision 8295)
@@ -0,0 +1,12 @@
+<div id="fb-xfbml-comments">
+<fb:comments
+  xid="{$fbp_urlencode_picture}" url="{$fbp_url_picture}"
+  width="{$fbp.social_plugin_comments.width}"
+  numposts="{$fbp.social_plugin_comments.numposts}"
+  css="{$fbp.social_plugin_comments.css}"
+  title="{$fbp.social_plugin_comments.title}"
+  simple="{$fbp.social_plugin_comments.simple|@boolean_to_string}"
+  reverse="{$fbp.social_plugin_comments.reverse|@boolean_to_string}"
+  publish_feed="{$fbp.social_plugin_comments.publish_feed|@boolean_to_string}"
+></fb:comments>
+</div>
