3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
13 if (!defined("_ECRIRE_INC_VERSION")) return;
15 include_spip('inc/presentation');
17 // http://doc.spip.org/@statistiques_lang_ok
18 function affiche_stats_lang($critere) {
19 global $spip_lang_right;
23 // Statistiques par langue
27 $r = sql_fetsel("SUM($critere) AS total_visites", "spip_articles");
31 if ($r and $r['total_visites'] > 0) {
32 $total_visites = $r['total_visites'];
37 $result = sql_select("lang, SUM(".$critere.") AS cnt", "spip_articles", "statut='publie' ", "lang");
39 $out .= "\n<table cellpadding='2' cellspacing='0' border='0' width='100%' style='border: 1px solid #aaaaaa;'>";
43 while ($row = sql_fetch($result)) {
47 $visites = round($row['cnt'] / $total_visites * $taille);
48 $pourcent = round($row['cnt'] / $total_visites * 100);
62 $out .= "\n<tr style='background-color: $couleur'>";
63 $dir=lang_dir($lang,'',' dir="rtl"');
64 $out .= "<td style='width: 100%; border-bottom: 1px solid #cccccc;'><p $dir><span style='float: $spip_lang_right;'>$pourcent%</span>".traduire_nom_langue($lang)."</p></td>";
66 $out .= "<td style='border-bottom: 1px solid #cccccc;'>";
67 $out .= "\n<table cellpadding='0' cellspacing='0' border='0' width='".($taille+
5)."'>";
68 $out .= "\n<tr><td style='align:$spip_lang_right; background-color: #eeeeee; border: 1px solid #999999; white-space: nowrap;'>";
70 $out .= "<img src='" . chemin_image('rien.gif') . "' width='$visites_abs' height='10' alt=' ' />";
72 $out .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_langue' style='border: 0px;' width='$visites' height='8' alt=' ' />";
73 $out .= "</td></tr></table>\n";
77 $visites_abs +
= $visites;