Index: /extensions/AMetaData/amd_aip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip.class.inc.php	(revision 4914)
+++ /extensions/AMetaData/amd_aip.class.inc.php	(revision 4915)
@@ -149,7 +149,4 @@
         case 'makeStatsDoAnalyze':
           $result=$this->ajax_amd_makeStatsDoAnalyze($_REQUEST['imagesList']);
-          break;
-        case 'makeStatsConsolidate':
-          $result=$this->ajax_amd_makeStatsConsolidate($_REQUEST['step']);
           break;
         case 'makeStatsGetStatus':
@@ -477,24 +474,4 @@
   /**
    * display and manage the database page
-   */
-  private function displayDatabase()
-  {
-    global $template, $page;
-
-    $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_database.tpl');
-
-    $datas=array(
-      'urlRequest' => $this->page_link,
-      'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'],
-    );
-
-    $template->assign("datas", $datas);
-
-    $template->assign_var_from_handle('AMD_BODY_PAGE', 'body_page');
-  } // display_config
-
-
-  /**
-   * display and manage the status page on the stat page
    *
    * the function automatically update the AMD tables :
@@ -505,9 +482,7 @@
    * @return String : the content of the page
    */
-  protected function displayStatStatus()
-  {
-    $local_tpl = new Template(AMD_PATH."admin/", "");
-    $local_tpl->set_filename('body_page',
-                  dirname($this->filelocation).'/admin/amd_stat_status.tpl');
+  private function displayDatabase()
+  {
+    global $template, $page;
 
     /*
@@ -538,12 +513,17 @@
     pwg_query($sql);
 
+
+    $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_database.tpl');
+
     $datas=array(
       'urlRequest' => $this->page_link,
+      'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'],
     );
 
-    $local_tpl->assign('datas', $datas);
-
-    return($local_tpl->parse('body_page', true));
-  }
+    $template->assign("datas", $datas);
+
+    $template->assign_var_from_handle('AMD_BODY_PAGE', 'body_page');
+  } // displayDatabase
+
 
 
@@ -750,9 +730,4 @@
             'value' => addslashes($value)
           );
-
-          $sql="UPDATE ".$this->tables['used_tags']."
-                  SET numOfImg = numOfImg+1
-                  WHERE numId=$numId;";
-          pwg_query($sql);
         }
       }
@@ -859,4 +834,12 @@
       }
     }
+
+    $sql="UPDATE ".$this->tables['used_tags']." ut,
+            (SELECT COUNT(imageId) AS nb, numId
+              FROM ".$this->tables['images_tags']."
+              GROUP BY numId) nb
+          SET ut.numOfImg = nb.nb
+          WHERE ut.numId = nb.numId;";
+    pwg_query($sql);
 
     return(trim($returned).";");
@@ -970,39 +953,4 @@
 
   /**
-   * make some stat consolidation
-   *  "0" : consolidate "exif.%" tags
-   *  "1" : consolidate "iptc.%" tags
-   *  "2" : consolidate "xmp.%" tags
-   *
-   * @param String $step
-   */
-  private function ajax_amd_makeStatsConsolidate($step)
-  {/*
-    $sql="INSERT INTO ".$this->tables['used_tags']."
-            SELECT tagId, count(distinct imageId)
-              FROM ".$this->tables['images_tags']."
-              WHERE tagId LIKE '%s'
-              GROUP BY tagId";
-
-    switch($step)
-    {
-      case "0":
-        pwg_query("DELETE FROM ".$this->tables['used_tags']);
-        $sql=sprintf($sql, "exif.%");
-        pwg_query($sql);
-        break;
-      case "1":
-        $sql=sprintf($sql, "iptc.%");
-        pwg_query($sql);
-        break;
-      case "2":
-        $sql=sprintf($sql, "xmp.%");
-        pwg_query($sql);
-        break;
-    }*/
-  }
-
-
-  /**
    * return a formatted <table> (using the template "amd_stat_show_iListTags")
    * of used tag with, for each tag, the number and the percentage of pictures
Index: /extensions/AMetaData/amd_install.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_install.class.inc.php	(revision 4914)
+++ /extensions/AMetaData/amd_install.class.inc.php	(revision 4915)
@@ -26,5 +26,4 @@
   {
     private $tablef;
-    private $exportfile;
 
     public function AMD_install($prefixeTable, $filelocation)
@@ -32,5 +31,4 @@
       parent::__construct($prefixeTable, $filelocation);
       $this->tablef= new manage_tables($this->tables);
-      $this->exportfile=dirname($this->filelocation).'/'.$this->plugin_name_files.'.sql';
     }
 
@@ -103,5 +101,4 @@
     public function uninstall()
     {
-      $this->tablef->export($this->exportfile);
       $this->delete_config();
       $this->tablef->drop_tables();
