Index: extensions/FacebookPlug/Plugin/main.inc.php
===================================================================
--- extensions/FacebookPlug/Plugin/main.inc.php	(revision 8200)
+++ extensions/FacebookPlug/Plugin/main.inc.php	(revision 8213)
@@ -23,5 +23,5 @@
 Version: auto
 Description: Plug your gallery to Facebook
-Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=481
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=481
 Author: Ruben ARNAUD
 Author URI: http://facebook.piwigo.net/
@@ -33,4 +33,17 @@
 }
 
+global $conf;
+
+$conf['fbp'] = unserialize($conf['fbp']);
+
+if (script_basename() == 'picture')
+{
+  include_once(dirname(__FILE__).'/picture.inc.php');
+}
+else
+if (script_basename() == 'admin')
+{
+  //~ include_once(dirname(__FILE__).'/admin.inc.php');
+}
 
 ?>
Index: extensions/FacebookPlug/Plugin/maintain.inc.php
===================================================================
--- extensions/FacebookPlug/Plugin/maintain.inc.php	(revision 8213)
+++ extensions/FacebookPlug/Plugin/maintain.inc.php	(revision 8213)
@@ -0,0 +1,52 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | FacebookPlug - a Piwigo Plugin                                        |
+// | Copyright (C) 2010 Ruben ARNAUD - rub@piwigo.org                      |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+  die('Hacking attempt!');
+}
+
+function plugin_install()
+{
+  $query = '
+replace into '.CONFIG_TABLE.'
+  (param, value, comment)
+values
+  (
+    \'fbp\',
+    \''.serialize(array('force' => true, 'day_number' => 1)).'\',
+    \'Parameters of "FacebookPlug" plugin\'
+  )
+;';
+
+  pwg_query($query);
+}
+
+function plugin_uninstall()
+{
+  $query = '
+delete from '.CONFIG_TABLE.'
+where param = \'fbp\'
+;';
+
+  pwg_query($query);
+}
+
+?>
Index: extensions/FacebookPlug/Plugin/picture.inc.php
===================================================================
--- extensions/FacebookPlug/Plugin/picture.inc.php	(revision 8213)
+++ extensions/FacebookPlug/Plugin/picture.inc.php	(revision 8213)
@@ -0,0 +1,53 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | FacebookPlug - a Piwigo Plugin                                        |
+// | Copyright (C) 2010 Ruben ARNAUD - rub@piwigo.org                      |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+  die('Hacking attempt!');
+}
+
+function fbp_AddSocial($content, &$smarty)
+{
+  $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>
+';
+  return $content.$fbp_content;
+}
+
+function fbp_loc_begin_picture()
+{
+  global $template;
+  // set prefilter
+  $template->set_prefilter('default_content', 'fbp_AddSocial');
+  // Always use full url for FB social plugin
+  set_make_full_url();
+}
+
+function fbp_loc_end_picture()
+{
+  // Restore url
+  unset_make_full_url();
+}
+
+add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
+add_event_handler('loc_end_picture', 'fbp_loc_end_picture');
+
+
+?>
