Index: /extensions/delete_rate/admin/admin.php
===================================================================
--- /extensions/delete_rate/admin/admin.php	(revision 7893)
+++ /extensions/delete_rate/admin/admin.php	(revision 7893)
@@ -0,0 +1,120 @@
+<?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', RATE_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'] = 'rateall';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('rateall',
+               l10n('rate_onglet_all'),
+               $my_base_url.'&amp;tab=rateall');
+$tabsheet->add('ratephoto',
+               l10n('rate_onglet_photo'),
+               $my_base_url.'&amp;tab=ratephoto');
+
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Onglet gestion par photo
+switch ($page['tab'])
+{
+ case 'rateall':
+
+  $template->assign(
+    'gestion',
+    array(
+
+      ));
+
+//purge photo
+if (isset($_POST['submitchoixall']) and !is_adviser())
+	{
+	$query = '
+UPDATE ' . IMAGES_TABLE . '
+  SET average_rate= \'NULL\'
+    ;';
+$result = pwg_query($query);
+
+	$query = '
+TRUNCATE ' . RATE_TABLE . '
+    ;';
+$result = pwg_query($query);
+
+	array_push( $page['infos'], l10n('rate_totalok') );
+	}
+	  
+    break;
+	
+  case 'ratephoto':
+
+//charge la liste des photos
+$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('rate_select_photo');
+	$options['a'] = '----------------------';
+	
+foreach($groups as $listid => $listid2)
+	{
+    $options[$listid] = $listid2;
+	}
+  $template->assign(
+    'gestionA',
+    array(
+	  'OPTIONS' => $options,
+      'SELECTED' => $selected
+      ));
+
+//purge photo
+if (isset($_POST['submitchoixphoto']) and is_numeric($_POST['delratephoto'])and (!$_POST['delratephoto'])==0 and !is_adviser())
+	{
+	$lire=$_POST['delratephoto'];
+	$query = '
+UPDATE ' . IMAGES_TABLE . '
+  SET average_rate = \'NULL\'
+  WHERE id = \''.$lire.'\'
+    ;';
+$result = pwg_query($query);
+
+	$query = '
+  DELETE FROM ' . RATE_TABLE . '
+  WHERE element_id = \''.$lire.'\'
+    ;';
+$result = pwg_query($query);
+	
+	array_push( $page['infos'], l10n('rate_photook') );
+	}
+	  
+    break;
+	
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/delete_rate/admin/admin.tpl
===================================================================
--- /extensions/delete_rate/admin/admin.tpl	(revision 7893)
+++ /extensions/delete_rate/admin/admin.tpl	(revision 7893)
@@ -0,0 +1,32 @@
+<div class="titrePage">
+  <h2>Delete Rate</h2>
+</div>
+
+{if isset ($gestion)}
+	  <h3>{'rate_all'|@translate}</h3>
+	<div>
+		<form method="post" >
+			<div style="text-align:center;">
+				<input class="submit" name="submitchoixall" type="submit" "onclick="return confirm('{'Are you sure?'|@translate}');" value="{'rate_purgeall'|@translate}" {$TAG_INPUT_ENABLED} />
+			</div>
+		</form>
+	</div>
+{/if}
+
+{if isset ($gestionA)}
+	  <h3>{'rate_photo'|@translate}</h3>
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'rate_listphoto'|@translate}</legend>
+				
+		{html_options name="delratephoto" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitchoixphoto" type="submit" "onclick="return confirm('{'Are you sure?'|@translate}');" value="{'rate_purgephoto'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+{/if}
Index: /extensions/delete_rate/admin/index.php
===================================================================
--- /extensions/delete_rate/admin/index.php	(revision 7893)
+++ /extensions/delete_rate/admin/index.php	(revision 7893)
@@ -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/delete_rate/index.php
===================================================================
--- /extensions/delete_rate/index.php	(revision 7893)
+++ /extensions/delete_rate/index.php	(revision 7893)
@@ -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/delete_rate/language/en_UK/description.txt
===================================================================
--- /extensions/delete_rate/language/en_UK/description.txt	(revision 7893)
+++ /extensions/delete_rate/language/en_UK/description.txt	(revision 7893)
@@ -0,0 +1,1 @@
+To purge the notes of photo or all photos
Index: /extensions/delete_rate/language/en_UK/index.php
===================================================================
--- /extensions/delete_rate/language/en_UK/index.php	(revision 7893)
+++ /extensions/delete_rate/language/en_UK/index.php	(revision 7893)
@@ -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/delete_rate/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/delete_rate/language/en_UK/plugin.lang.php	(revision 7893)
+++ /extensions/delete_rate/language/en_UK/plugin.lang.php	(revision 7893)
@@ -0,0 +1,18 @@
+<?php
+
+//onglet Purge Hit photo
+$lang['rate_onglet_all'] = 'Total Purge rate';
+$lang['rate_all'] = 'Purge all rate on all pictures gallery';
+$lang['rate_purgeall'] = 'Purge all the rate of the gallery';
+$lang['rate_totalok'] = 'Total Purge completed successfully';
+
+//onglet Purge Hit photo
+$lang['rate_onglet_photo'] = 'Purge rate of a photo';
+$lang['rate_select'] = 'Select a photo';
+$lang['rate_select_photo'] = 'Select photo';
+$lang['rate_photo'] = 'Choose the photo when you want to purge rate';
+$lang['rate_listphoto'] = 'Here is a list of your photos';
+$lang['rate_purgephoto'] = 'Purge rate of the picture select';
+$lang['rate_photook'] = 'Note purge completed successfully';
+
+?>
Index: /extensions/delete_rate/language/fr_FR/description.txt
===================================================================
--- /extensions/delete_rate/language/fr_FR/description.txt	(revision 7893)
+++ /extensions/delete_rate/language/fr_FR/description.txt	(revision 7893)
@@ -0,0 +1,1 @@
+Purger les notes de la photo ou de toutes les photos
Index: /extensions/delete_rate/language/fr_FR/index.php
===================================================================
--- /extensions/delete_rate/language/fr_FR/index.php	(revision 7893)
+++ /extensions/delete_rate/language/fr_FR/index.php	(revision 7893)
@@ -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/delete_rate/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/delete_rate/language/fr_FR/plugin.lang.php	(revision 7893)
+++ /extensions/delete_rate/language/fr_FR/plugin.lang.php	(revision 7893)
@@ -0,0 +1,18 @@
+<?php
+
+//onglet Purge Hit photo
+$lang['rate_onglet_all'] = 'Purge Total des notes';
+$lang['rate_all'] = 'Purge toutes les notes de toutes les photos de la galerie';
+$lang['rate_purgeall'] = 'Purge tous les notes de la galerie';
+$lang['rate_totalok'] = 'Purge total effectué avec succès';
+
+//onglet Purge Hit photo
+$lang['rate_onglet_photo'] = 'Purge les notes d\'une photos';
+$lang['rate_select'] = 'Sélectionne une photo';
+$lang['rate_select_photo'] = 'Sélectionne la photo';
+$lang['rate_photo'] = 'Choisiser la photo dont vous voulez purgerla note';
+$lang['rate_listphoto'] = 'Voici la liste de vos photos';
+$lang['rate_purgephoto'] = 'Purger la note de la photo sélectionner';
+$lang['rate_photook'] = 'Purge de la note effectué avec succès';
+
+?>
Index: /extensions/delete_rate/language/index.php
===================================================================
--- /extensions/delete_rate/language/index.php	(revision 7893)
+++ /extensions/delete_rate/language/index.php	(revision 7893)
@@ -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/delete_rate/main.inc.php
===================================================================
--- /extensions/delete_rate/main.inc.php	(revision 7893)
+++ /extensions/delete_rate/main.inc.php	(revision 7893)
@@ -0,0 +1,27 @@
+<?php
+/*
+Plugin Name: Delete Rate
+Version: auto
+Description: delete Rate
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=475
+Author: ddtddt
+Author URI: http://piwigo.org/
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+define('RATE_DIR' , basename(dirname(__FILE__)));
+define('RATE_PATH' , PHPWG_PLUGINS_PATH . RATE_DIR . '/');
+load_language('plugin.lang', RATE_PATH);
+
+add_event_handler('get_admin_plugin_menu_links', 'rate_admin_menu');
+function rate_admin_menu($menu)
+{
+  array_push($menu, array(
+	'NAME' => 'Delete Rate',
+    'URL' => get_admin_plugin_menu_link(RATE_PATH . 'admin/admin.php')));
+  return $menu;
+}
+?>
