plugins are now *really* ok
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Tue, 28 Dec 2004 17:42:29 +0000 (17:42 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:26:57 +0000 (23:26 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-164

plugins/insert.getNbIns.php
plugins/insert.mkStats.php

index c4ad872..1f9a742 100644 (file)
@@ -30,9 +30,9 @@
  */
 function smarty_insert_getNbIns($params, &$smarty)
 {
-    $result=mysql_query("select count(*) from auth_user_md5 where perms in ('admin','user') AND deces=0");
-    list($stats_count)=mysql_fetch_row($result);
-    mysql_free_result($result);
-    return number_format($stats_count, 0, ",", ".");
+    global $globals;
+    $res = $globals->xdb->query("SELECT COUNT(*) FROM auth_user_md5 WHERE perms IN ('admin','user') AND deces=0");
+    $cnt = $res->fetchOneCell();
+    return number_format($cnt, 0, ",", ".");
 }
 ?>
index 0b7ec42..e4b66d8 100644 (file)
@@ -31,9 +31,9 @@
  */
 function smarty_insert_mkStats($params, &$smarty)
 {
-    $req = mysql_query("select count(*) from requests");
-    list($stats_req) = mysql_fetch_row($req);
-    mysql_free_result($req);
-    return ($stats_req ? $stats_req : "-");
+    global $globals;
+    $res = $globals->xdb->query('select count(*) from requests');
+    $cnt = $res->fetchOneCell();
+    return ($cnt ? $cnt : '-');
 }
 ?>