Index: /extensions/UserStat/admin/userstat_admin.tpl
===================================================================
--- /extensions/UserStat/admin/userstat_admin.tpl	(revision 5432)
+++ /extensions/UserStat/admin/userstat_admin.tpl	(revision 5433)
@@ -1,14 +1,8 @@
-<div class="titrePage">
-  <h2 style="position:absolute;right:0px;top:32px;height:auto;font-size:12px;font-weight:normal;">:: {$plugin.USERSTAT_VERSION} ::</h2>
-  <h2>{'us_titlePage'|@translate} <span style="font-size:-1;font-weight:normal;">{$TABSHEET_TITLE}</span></h2>
+<h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.USERSTAT_VERSION}</h2>
 
-  {$tabsheet}
+<div style="position:relative;top:-24px;clear:right;">
 </div>
 
-{if isset($datas)}
-  {$datas.USERSTAT_NFO_STAT}
-  <h3>{$datas.L_STAT_TITLE}</h3>
-
-{/if}
+{$tabsheet}
 
 {$USERSTAT_BODY_PAGE}
Index: /extensions/UserStat/admin/userstat_global.tpl
===================================================================
--- /extensions/UserStat/admin/userstat_global.tpl	(revision 5432)
+++ /extensions/UserStat/admin/userstat_global.tpl	(revision 5433)
@@ -53,5 +53,5 @@
   {foreach from=$datas.templatesUsers key=name item=data}
     <tr class="StatTableRow">
-      <td>{$data.template}</td>
+      <td>{$data.theme}</td>
       <td>{$data.nbUsers}</td>
     </tr>
Index: /extensions/UserStat/main.inc.php
===================================================================
--- /extensions/UserStat/main.inc.php	(revision 5432)
+++ /extensions/UserStat/main.inc.php	(revision 5433)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: UserStat
-Version: 1.0.0
+Version: 1.1.0
 Description: Statistiques utilisateurs / Users statistics
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=321
@@ -24,5 +24,5 @@
 | release | date       |
 | 1.0.0   | 2009/11/15 | * first public release
-|         |            |
+| 1.1.0   | 2010/03/28 | * compatibility with Piwigo 2.1
 |         |            |
 |         |            |
@@ -54,5 +54,5 @@
 define('USERSTAT_PATH' , PHPWG_PLUGINS_PATH . USERSTAT_DIR . '/');
 
-define('USERSTAT_VERSION' , '1.0.0'); // => ne pas oublier la version dans l'entête !!
+define('USERSTAT_VERSION' , '1.1.0'); // => ne pas oublier la version dans l'entête !!
 
 global $prefixeTable;
Index: /extensions/UserStat/maintain.inc.php
===================================================================
--- /extensions/UserStat/maintain.inc.php	(revision 5432)
+++ /extensions/UserStat/maintain.inc.php	(revision 5433)
@@ -16,6 +16,6 @@
 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
 
-define('USERSTAT_DIR' , basename(dirname(__FILE__)));
-define('USERSTAT_PATH' , PHPWG_PLUGINS_PATH . USERSTAT_DIR . '/');
+if(!defined('USERSTAT_DIR')) define('USERSTAT_DIR' , basename(dirname(__FILE__)));
+if(!defined('USERSTAT_PATH')) define('USERSTAT_PATH' , PHPWG_PLUGINS_PATH . USERSTAT_DIR . '/');
 
 
@@ -23,5 +23,5 @@
 
 /* -----------------------------------------------------------------------------
-AStat-2 needs the Grum Plugin Classe
+UserStat needs the Grum Plugin Classe
 ----------------------------------------------------------------------------- */
 $gpc_installed=false;
@@ -29,6 +29,6 @@
 {
   @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
-  // need GPC release greater or equal than 2.0.1
-  if(checkGPCRelease(2,0,1))
+  // need GPC release greater or equal than 2.0.5
+  if(checkGPCRelease(2,0,5))
   {
     @include_once("userstat_aim.class.inc.php");
@@ -39,5 +39,5 @@
 function gpcMsgError(&$errors)
 {
-  array_push($errors, sprintf(l10n('us_gpc2_not_installed'), "2.0.1"));
+  array_push($errors, sprintf(l10n('us_gpc2_not_installed'), "2.0.5"));
 }
 // -----------------------------------------------------------------------------
Index: /extensions/UserStat/userstat_aip.class.inc.php
===================================================================
--- /extensions/UserStat/userstat_aip.class.inc.php	(revision 5432)
+++ /extensions/UserStat/userstat_aip.class.inc.php	(revision 5433)
@@ -201,5 +201,5 @@
     if($result)
     {
-      while($row=mysql_fetch_assoc($result))
+      while($row=pwg_db_fetch_assoc($result))
       {
         $row['indent']=substr_count($row['global_rank'], '.');
@@ -243,5 +243,5 @@
     if($result)
     {
-      $row=mysql_fetch_assoc($result);
+      $row=pwg_db_fetch_assoc($result);
       return($row["username"]);
     }
@@ -277,5 +277,5 @@
     if($result)
     {
-      while($row=mysql_fetch_row($result))
+      while($row=pwg_db_fetch_row($result))
       {
         $returned[]=Array(
@@ -304,5 +304,5 @@
     if($result)
     {
-      while($row=mysql_fetch_assoc($result))
+      while($row=pwg_db_fetch_assoc($result))
       {
         $row["humanReadable"]=$list[$row["language"]];
@@ -323,9 +323,9 @@
     $returned = array();
 
-    $sql="SELECT count(user_id) as nbUsers, template FROM ".USER_INFOS_TABLE." GROUP BY template ORDER BY nbUsers DESC";
-    $result=pwg_query($sql);
-    if($result)
-    {
-      while($row=mysql_fetch_assoc($result))
+    $sql="SELECT count(user_id) as nbUsers, theme FROM ".USER_INFOS_TABLE." GROUP BY theme ORDER BY nbUsers DESC";
+    $result=pwg_query($sql);
+    if($result)
+    {
+      while($row=pwg_db_fetch_assoc($result))
       {
         $returned[]=$row;
@@ -359,5 +359,5 @@
     $sql="
 SELECT name,
-       MAX(id) AS id,
+       id,
        MAX(nbRates) AS nbRates,
        MAX(maxRate) AS maxRate,
@@ -409,5 +409,5 @@
     if($result)
     {
-      while($row=mysql_fetch_assoc($result))
+      while($row=pwg_db_fetch_assoc($result))
       {
         $returned[]=$row;
@@ -506,5 +506,5 @@
     if($result)
     {
-      while($row=mysql_fetch_assoc($result))
+      while($row=pwg_db_fetch_assoc($result))
       {
         $returned[$row['categoryId']]=$row;
