[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins-dist / statistiques / prive / squelettes / contenu / stats_lang_fonctions.php
index cc56b36..834dd12 100644 (file)
@@ -10,7 +10,9 @@
  *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
 \***************************************************************************/
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined("_ECRIRE_INC_VERSION")) {
+       return;
+}
 
 include_spip('inc/presentation');
 
@@ -34,11 +36,11 @@ function affiche_stats_lang($critere) {
                $total_visites = 1;
        }
 
-       $result = sql_select("lang, SUM(".$critere.") AS cnt", "spip_articles", "statut='publie' ", "lang");
-               
+       $result = sql_select("lang, SUM(" . $critere . ") AS cnt", "spip_articles", "statut='publie' ", "lang");
+
        $out .= "\n<table cellpadding='2' cellspacing='0' border='0' width='100%' style='border: 1px solid #aaaaaa;'>";
        $ifond = 1;
-               
+
        $visites_abs = 0;
        while ($row = sql_fetch($result)) {
 
@@ -50,34 +52,35 @@ function affiche_stats_lang($critere) {
 
                if ($visites > 0) {
 
-                               if ($ifond==0){
-                                       $ifond=1;
-                                       $couleur="white";
-                               }
-                               else{
-                                       $ifond=0;
-                                       $couleur="eeeeee";
-                               }
-       
-                               $out .= "\n<tr style='background-color: $couleur'>";
-                               $dir=lang_dir($lang,'',' dir="rtl"');
-                               $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>";
-                               
-                               $out .= "<td style='border-bottom: 1px solid #cccccc;'>";
-                               $out .= "\n<table cellpadding='0' cellspacing='0' border='0' width='".($taille+5)."'>";
-                               $out .= "\n<tr><td style='align:$spip_lang_right; background-color: #eeeeee; border: 1px solid #999999; white-space: nowrap;'>";
-                               if ($visites_abs > 0)
-                                       $out .= "<img src='" . chemin_image('rien.gif') . "' width='$visites_abs' height='10' alt=' ' />";
-                               if ($visites>0)
-                                       $out .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_langue' style='border: 0px;' width='$visites' height='8' alt=' ' />";
-                               $out .= "</td></tr></table>\n";
-       
-                               $out .= "</td>";
-                               $out .= "</tr>";
-                               $visites_abs += $visites;
+                       if ($ifond == 0) {
+                               $ifond = 1;
+                               $couleur = "white";
+                       } else {
+                               $ifond = 0;
+                               $couleur = "eeeeee";
+                       }
+
+                       $out .= "\n<tr style='background-color: $couleur'>";
+                       $dir = lang_dir($lang, '', ' dir="rtl"');
+                       $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>";
+
+                       $out .= "<td style='border-bottom: 1px solid #cccccc;'>";
+                       $out .= "\n<table cellpadding='0' cellspacing='0' border='0' width='" . ($taille + 5) . "'>";
+                       $out .= "\n<tr><td style='align:$spip_lang_right; background-color: #eeeeee; border: 1px solid #999999; white-space: nowrap;'>";
+                       if ($visites_abs > 0) {
+                               $out .= "<img src='" . chemin_image('rien.gif') . "' width='$visites_abs' height='10' alt=' ' />";
+                       }
+                       if ($visites > 0) {
+                               $out .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_langue' style='border: 0px;' width='$visites' height='8' alt=' ' />";
+                       }
+                       $out .= "</td></tr></table>\n";
+
+                       $out .= "</td>";
+                       $out .= "</tr>";
+                       $visites_abs += $visites;
                }
        }
        $out .= "</table>\n";
+
        return $out;
 }
-?>