X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fstatistiques.php;fp=www%2Fecrire%2Finc%2Fstatistiques.php;h=e83e702bed4872e23c3bac90c18acd2009bcd7d0;hp=26e1494f1275fd44de9ef7ed54b28b7d314c7cbb;hb=e99f0878011913365e49b30d90e496c24c301393;hpb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed diff --git a/www/ecrire/inc/statistiques.php b/www/ecrire/inc/statistiques.php index 26e1494..e83e702 100644 --- a/www/ecrire/inc/statistiques.php +++ b/www/ecrire/inc/statistiques.php @@ -3,7 +3,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2011 * + * Copyright (c) 2001-2014 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -584,27 +584,26 @@ function statistiques_moyenne($tab) // http://doc.spip.org/@statistiques_signatures_dist function statistiques_signatures_dist($duree, $interval, $type, $id_article, $serveur) { - $where = "id_article=$id_article"; + $where = "id_article=$id_article AND statut='publie'"; $total = sql_countsel("spip_signatures", $where); if (!$total) return ''; $order = 'date_time'; if ($duree) - $where .= " AND $order > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).",INTERVAL $duree $type)"; + $where2 = "$where AND $order > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).",INTERVAL $duree $type)"; - $log = statistiques_collecte_date('COUNT(*)', "(FLOOR(UNIX_TIMESTAMP($order) / $interval) * $interval)", 'spip_signatures', $where, $serveur); + $log = statistiques_collecte_date('COUNT(*)', "(FLOOR(UNIX_TIMESTAMP($order) / $interval) * $interval)", 'spip_signatures', $where2, $serveur); $script = generer_url_ecrire('controle_petition', "id_article=$id_article"); if (count($log) > 1) { - $res = statistiques_tous($log, $id_article, "spip_signatures", "id_article=$id_article", "date_time", $serveur, $duree, $interval, $total, 0, '', array(), $script); + $res = statistiques_tous($log, $id_article, "spip_signatures", $where, "date_time", $serveur, $duree, $interval, $total, 0, '', array(), $script); $res = gros_titre(_T('titre_page_statistiques_signatures_jour'),'', false) . cadre_stat($res, 'spip_signatures', $id_article); } else $res = ''; $mois = statistiques_collecte_date( "COUNT(*)", "DATE_FORMAT(date_time,'%Y%m')", "spip_signatures", - "date_time > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).",INTERVAL 2700 DAY)" - . (" AND id_article=$id_article"), + "$where AND date_time > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).",INTERVAL 2700 DAY)", $serveur); return "
"