Index: /extensions/ID_switch/admin/admin.php
===================================================================
--- /extensions/ID_switch/admin/admin.php	(revision 10785)
+++ /extensions/ID_switch/admin/admin.php	(revision 10785)
@@ -0,0 +1,129 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+global $template, $conf, $user;
+include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
+load_language('plugin.lang', IDS_PATH);
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//-------------------------------------------------------- sections definitions
+
+// Gestion des onglets
+if (!isset($_GET['tab']))
+    $page['tab'] = 'IDS';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('IDS',
+               l10n('ids_tab1'),
+               $my_base_url.'&amp;tab=IDS');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+switch ($page['tab'])
+{
+// tab switch
+  case 'IDS':
+
+$groups = array();
+$query = '
+select id,name
+  FROM ' . IMAGES_TABLE . '
+  ORDER BY id ASC;';
+$result = pwg_query($query);
+
+while ($row = mysql_fetch_array($result))
+	{
+  $groups[$row['id']] = $row['id'].' : '.$row['name'];
+	}
+	
+	$selected = 0;
+	$options[] = l10n('ids_select');
+	$options['a'] = '----------------------';
+	
+foreach($groups as $listid => $listid2)
+	{
+    $options[$listid] = $listid2;
+	}
+  $template->assign(
+    'gestion',
+    array(
+	  'OPTIONS' => $options,
+      'SELECTED' => $selected
+      )); 
+
+//action
+if (isset($_POST['IDS'])and is_numeric($_POST['IDS1']) and (!$_POST['IDS1'])==0 and is_numeric($_POST['IDS2']) and (!$_POST['IDS2'])==0)
+	{
+
+$query = '
+select id
+  FROM ' . IMAGES_TABLE . '
+  ORDER BY id DESC;';
+$result = pwg_query($query);
+$row = mysql_fetch_array($result);	
+$tempoids=$row['id']+1000;
+
+	$query = '
+UPDATE ' . IMAGES_TABLE . '
+  SET id= \''.$tempoids.'\'
+  WHERE id = \''.$_POST['IDS1'].'\'
+    ;';
+$result = pwg_query($query);
+
+	$query = '
+UPDATE ' . IMAGES_TABLE . '
+  SET id= \''.$_POST['IDS1'].'\'
+  WHERE id = \''.$_POST['IDS2'].'\'
+    ;';
+$result = pwg_query($query);
+
+	$query = '
+UPDATE ' . IMAGES_TABLE . '
+  SET id= \''.$_POST['IDS2'].'\'
+  WHERE id = \''.$tempoids.'\'
+    ;';
+$result = pwg_query($query);
+
+$groups = array();
+$query = '
+select id,name
+  FROM ' . IMAGES_TABLE . '
+  ORDER BY id ASC;';
+$result = pwg_query($query);
+
+while ($row = mysql_fetch_array($result))
+	{
+  $groups[$row['id']] = $row['id'].' : '.$row['name'];
+	}
+	
+	$selected = 0;
+	$options[] = l10n('ids_select');
+	$options['a'] = '----------------------';
+	
+foreach($groups as $listid => $listid2)
+	{
+    $options[$listid] = $listid2;
+	}
+  $template->assign(
+    'gestion',
+    array(
+	  'OPTIONS' => $options,
+      'SELECTED' => $selected
+      )); 
+
+  array_push( $page['infos'], l10n('ids_ok') );
+	}  
+  
+	break;
+	
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/ID_switch/admin/admin.tpl
===================================================================
--- /extensions/ID_switch/admin/admin.tpl	(revision 10785)
+++ /extensions/ID_switch/admin/admin.tpl	(revision 10785)
@@ -0,0 +1,25 @@
+<div class="titrePage">
+  <h2>{'ids_h2'|@translate}</h2>
+</div>
+
+{if isset ($gestion)}
+	<div>
+		<form method="post">
+			<fieldset>
+				<legend>{'ids_select'|@translate}</legend>
+				{'ids_photo1'|@translate}	
+		{html_options name="IDS1" options=$gestion.OPTIONS selected=$gestion.SELECTED}
+				<br>
+				<br>
+				{'ids_photo2'|@translate}	
+		{html_options name="IDS2" options=$gestion.OPTIONS selected=$gestion.SELECTED}
+				<br>
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="IDS" type="submit" value="{'ids_action'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+{/if}
+
Index: /extensions/ID_switch/admin/index.php
===================================================================
--- /extensions/ID_switch/admin/index.php	(revision 10785)
+++ /extensions/ID_switch/admin/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/index.php
===================================================================
--- /extensions/ID_switch/index.php	(revision 10785)
+++ /extensions/ID_switch/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/initadmin.php
===================================================================
--- /extensions/ID_switch/initadmin.php	(revision 10785)
+++ /extensions/ID_switch/initadmin.php	(revision 10785)
@@ -0,0 +1,13 @@
+<?php
+
+//Aaded admin menu
+add_event_handler('get_admin_plugin_menu_links', 'ids_admin_menu');
+
+function ids_admin_menu($menu)
+	{
+  array_push($menu, array(
+	'NAME' => 'ID Swicht',
+    'URL' => get_admin_plugin_menu_link(IDS_PATH . 'admin/admin.php')));
+  return $menu;
+	}
+?>
Index: /extensions/ID_switch/language/en_UK/description.txt
===================================================================
--- /extensions/ID_switch/language/en_UK/description.txt	(revision 10785)
+++ /extensions/ID_switch/language/en_UK/description.txt	(revision 10785)
@@ -0,0 +1,1 @@
+Inverts the IDs of 2 Photos
Index: /extensions/ID_switch/language/en_UK/index.php
===================================================================
--- /extensions/ID_switch/language/en_UK/index.php	(revision 10785)
+++ /extensions/ID_switch/language/en_UK/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ID_switch/language/en_UK/plugin.lang.php	(revision 10785)
+++ /extensions/ID_switch/language/en_UK/plugin.lang.php	(revision 10785)
@@ -0,0 +1,13 @@
+<?php
+
+//ADMIN
+$lang['ids_tab1'] = 'Management';
+$lang['ids_h2'] = 'Reverse Photo Manager';
+$lang['ids_select'] = 'Select photos';
+$lang['ids_photo1'] = 'select photo 1';
+$lang['ids_photo2'] = 'select photo 2';
+$lang['ids_action'] = 'Reverse 2 photos';
+$lang['ids_select'] = 'Select a photo';
+$lang['ids_ok'] = 'Inversion performed successfully';
+
+?>
Index: /extensions/ID_switch/language/fr_FR/description.txt
===================================================================
--- /extensions/ID_switch/language/fr_FR/description.txt	(revision 10785)
+++ /extensions/ID_switch/language/fr_FR/description.txt	(revision 10785)
@@ -0,0 +1,1 @@
+Permet d'inverser les ID de 2 Photos
Index: /extensions/ID_switch/language/fr_FR/index.php
===================================================================
--- /extensions/ID_switch/language/fr_FR/index.php	(revision 10785)
+++ /extensions/ID_switch/language/fr_FR/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ID_switch/language/fr_FR/plugin.lang.php	(revision 10785)
+++ /extensions/ID_switch/language/fr_FR/plugin.lang.php	(revision 10785)
@@ -0,0 +1,12 @@
+<?php
+//ADMIN
+$lang['ids_tab1'] = 'Gestion';
+$lang['ids_h2'] = 'Gestionnaire d\'inversion de photos';
+$lang['ids_select'] = 'Sélection des photos';
+$lang['ids_photo1'] = 'sélectionner la photo 1';
+$lang['ids_photo2'] = 'sélectionner la photo 2';
+$lang['ids_action'] = 'Inverser les 2 photos';
+$lang['ids_select'] = 'Selectionner une photo';
+$lang['ids_ok'] = 'Inversion effectué avec succès';
+
+?>
Index: /extensions/ID_switch/language/hu_HU/description.txt
===================================================================
--- /extensions/ID_switch/language/hu_HU/description.txt	(revision 10785)
+++ /extensions/ID_switch/language/hu_HU/description.txt	(revision 10785)
@@ -0,0 +1,1 @@
+Két kép azonosítójának felcserésése
Index: /extensions/ID_switch/language/hu_HU/index.php
===================================================================
--- /extensions/ID_switch/language/hu_HU/index.php	(revision 10785)
+++ /extensions/ID_switch/language/hu_HU/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/language/hu_HU/plugin.lang.php
===================================================================
--- /extensions/ID_switch/language/hu_HU/plugin.lang.php	(revision 10785)
+++ /extensions/ID_switch/language/hu_HU/plugin.lang.php	(revision 10785)
@@ -0,0 +1,13 @@
+<?php
+
+//ADMIN
+$lang['ids_tab1'] = 'Kezelés';
+$lang['ids_h2'] = 'Felcserélés képkezelő';
+$lang['ids_select'] = 'Kép kiválasztása';
+$lang['ids_photo1'] = '1. kép kiválasztása';
+$lang['ids_photo2'] = '2. kép kiválasztása';
+$lang['ids_action'] = 'Két kép felcserélése';
+$lang['ids_select'] = 'Képek kiválasztása';
+$lang['ids_ok'] = 'Csere sikeresen végrehajtva';
+
+?>
Index: /extensions/ID_switch/language/index.php
===================================================================
--- /extensions/ID_switch/language/index.php	(revision 10785)
+++ /extensions/ID_switch/language/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/language/it_IT/description.txt
===================================================================
--- /extensions/ID_switch/language/it_IT/description.txt	(revision 10785)
+++ /extensions/ID_switch/language/it_IT/description.txt	(revision 10785)
@@ -0,0 +1,1 @@
+Permette d'intervertire gli ID di due foto
Index: /extensions/ID_switch/language/it_IT/index.php
===================================================================
--- /extensions/ID_switch/language/it_IT/index.php	(revision 10785)
+++ /extensions/ID_switch/language/it_IT/index.php	(revision 10785)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/ID_switch/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/ID_switch/language/it_IT/plugin.lang.php	(revision 10785)
+++ /extensions/ID_switch/language/it_IT/plugin.lang.php	(revision 10785)
@@ -0,0 +1,12 @@
+<?php
+//ADMIN
+$lang['ids_tab1'] = 'Gestione';
+$lang['ids_h2'] = 'Amministrazione per l\'inversione di ID di foto';
+$lang['ids_select'] = 'Selezione delle foto';
+$lang['ids_photo1'] = 'selezionare la foto 1';
+$lang['ids_photo2'] = 'selezionare la foto 2';
+$lang['ids_action'] = 'Intervertire les 2 photos';
+$lang['ids_select'] = 'Selezionare una foto';
+$lang['ids_ok'] = 'Inversione effettuata correttamente';
+
+?>
Index: /extensions/ID_switch/main.inc.php
===================================================================
--- /extensions/ID_switch/main.inc.php	(revision 10785)
+++ /extensions/ID_switch/main.inc.php	(revision 10785)
@@ -0,0 +1,26 @@
+<?php
+/*
+Plugin Name: ID_swicht
+Version: auto
+Description: Inverts the IDs of 2 Photos
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=532
+Author: ddtddt
+Author URI: 
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+define('IDS_DIR' , basename(dirname(__FILE__)));
+define('IDS_PATH' , PHPWG_PLUGINS_PATH . IDS_DIR . '/');
+
+
+
+  // Plugin for admin
+if (script_basename() == 'admin')   
+{
+  include_once(dirname(__FILE__).'/initadmin.php');
+}
+
+?>
