From: Pierre Habouzit (MadCoder Date: Tue, 28 Dec 2004 17:42:29 +0000 (+0000) Subject: plugins are now *really* ok X-Git-Tag: xorg/old~584 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=39c8d7d9aaa4c400878593ee79f2ab03bb405a55;p=platal.git plugins are now *really* ok git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-164 --- diff --git a/plugins/insert.getNbIns.php b/plugins/insert.getNbIns.php index c4ad872..1f9a742 100644 --- a/plugins/insert.getNbIns.php +++ b/plugins/insert.getNbIns.php @@ -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, ",", "."); } ?> diff --git a/plugins/insert.mkStats.php b/plugins/insert.mkStats.php index 0b7ec42..e4b66d8 100644 --- a/plugins/insert.mkStats.php +++ b/plugins/insert.mkStats.php @@ -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 : '-'); } ?>