X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fecrire%2Fexec%2Fstatistiques_lang.php;fp=www%2Fecrire%2Fexec%2Fstatistiques_lang.php;h=11dc7777afaf9199f10514a53982515cdb4c43f8;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hp=0000000000000000000000000000000000000000;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c;p=velocampus%2Fweb%2Fwww.git
diff --git a/www/ecrire/exec/statistiques_lang.php b/www/ecrire/exec/statistiques_lang.php
new file mode 100644
index 0000000..11dc777
--- /dev/null
+++ b/www/ecrire/exec/statistiques_lang.php
@@ -0,0 +1,121 @@
+
";
+ echo "
";
+
+ echo gros_titre(_T('onglet_repartition_lang'),'', false);
+
+//barre_onglets("repartition", "langues");
+
+ if (_request('critere') == "debut") {
+ $critere = "visites";
+// echo gros_titre(_T('onglet_repartition_debut','', false));
+ } else {
+ $critere = "popularite";
+// echo gros_titre(_T('onglet_repartition_actuelle','', false));
+}
+
+ echo ($critere == "popularite") ? barre_onglets("rep_depuis", "popularite"): barre_onglets("rep_depuis", "debut");
+
+
+//
+// Statistiques par langue
+//
+
+
+ echo debut_cadre_enfonce("langues-24.gif", true);
+
+ $r = sql_fetsel("SUM($critere) AS total_visites", "spip_articles");
+
+ $visites = 1;
+ if ($r)
+ $total_visites = $r['total_visites'];
+ else
+ $total_visites = 1;
+
+ $result = sql_select("lang, SUM(".$critere.") AS cnt", "spip_articles", "statut='publie' ", "lang");
+
+ echo "\n";
+ $ifond = 1;
+
+ $visites_abs = 0;
+ while ($row = sql_fetch($result)) {
+
+ $lang = $row['lang'];
+ $visites = round($row['cnt'] / $total_visites * $taille);
+ $pourcent = round($row['cnt'] / $total_visites * 100);
+
+ if ($visites > 0) {
+
+ if ($ifond==0){
+ $ifond=1;
+ $couleur="white";
+ }else{
+ $ifond=0;
+ $couleur="eeeeee";
+ }
+
+ echo "\n";
+ $dir=lang_dir($lang,'',' dir="rtl"');
+ echo "$pourcent%".traduire_nom_langue($lang)." | ";
+
+ echo "";
+ echo "\n";
+ echo "\n";
+ if ($visites_abs > 0) echo "";
+ if ($visites>0) echo "";
+ echo " | \n";
+
+ echo " | ";
+ echo " ";
+ $visites_abs += $visites;
+ }
+ }
+ echo " \n";
+
+
+//echo ""._T('texte_signification')."";
+
+ echo fin_cadre_enfonce(true);
+
+ echo " |
";
+ echo fin_page();
+}
+?>