From 85abda8fbd74c7e912925e7f68e6a614210dda2c Mon Sep 17 00:00:00 2001 From: ARNO* <arno@rezo.net> Date: Tue, 21 Sep 2004 12:17:14 +0000 Subject: [PATCH] Cosmetique: presentation des repartitions (par rubriques, par langues). --- ecrire/inc_presentation.php3 | 8 +++-- ecrire/statistiques.php3 | 67 +++++++++++++++++++---------------- ecrire/statistiques_lang.php3 | 56 +++++++++++++++-------------- 3 files changed, 71 insertions(+), 60 deletions(-) diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3 index 40fee213b3..35a15f69b6 100644 --- a/ecrire/inc_presentation.php3 +++ b/ecrire/inc_presentation.php3 @@ -2052,9 +2052,9 @@ else { if ($connect_statut == "0minirezo") $req_where = " AND articles.statut IN ('prepa','prop','publie')"; else $req_where = " AND articles.statut IN ('prop','publie')"; $nombre_versions = spip_num_rows(spip_query(" -SELECT versions.*, articles.statut, articles.titre -FROM spip_versions AS versions, spip_articles AS articles -WHERE versions.id_article = articles.id_article AND versions.id_version > 1$req_where LIMIT 0,1")); + SELECT versions.*, articles.statut, articles.titre + FROM spip_versions AS versions, spip_articles AS articles + WHERE versions.id_article = articles.id_article AND versions.id_version > 1$req_where LIMIT 0,1")); if ($nombre_versions > 0 OR 1==1) { icone_bandeau_secondaire (_T('icone_suivi_revisions'), "suivi_revisions.php3", "historique-24.gif", "revisions", $sous_rubrique); } @@ -2131,6 +2131,8 @@ WHERE versions.id_article = articles.id_article AND versions.id_version > 1$req_ if ($connect_toutes_rubriques) bandeau_barre_verticale(); icone_bandeau_secondaire (_T('icone_repartition_visites'), "statistiques.php3", "rubrique-24.gif", "repartition", $sous_rubrique); + if (lire_meta('multi_articles') == 'oui' OR lire_meta('multi_rubriques') == 'oui') + icone_bandeau_secondaire (_T('onglet_repartition_lang'), "statistiques_lang.php3", "langues-24.gif", "repartition-langues", $sous_rubrique); icone_bandeau_secondaire (_T('titre_liens_entrants'), "statistiques_referers.php3", "referers-24.gif", "referers", $sous_rubrique); echo "</tr></table></div></div>"; diff --git a/ecrire/statistiques.php3 b/ecrire/statistiques.php3 index 6ef15ff65f..9aa2ec710f 100644 --- a/ecrire/statistiques.php3 +++ b/ecrire/statistiques.php3 @@ -6,9 +6,9 @@ include ("inc.php3"); debut_page(_T('titre_page_statistiques'), "suivi", "repartition"); echo "<br><br>"; -gros_titre(_T('icone_repartition_visites')); -if (lire_meta('multi_articles') == 'oui' OR lire_meta('multi_rubriques') == 'oui') - barre_onglets("repartition", "rubriques"); +gros_titre(_T('titre_page_statistiques')); +//if (lire_meta('multi_articles') == 'oui' OR lire_meta('multi_rubriques') == 'oui') +// barre_onglets("repartition", "rubriques"); if ($GLOBALS["critere"] == "debut") { $critere = "visites"; @@ -68,66 +68,71 @@ function enfants($id_parent){ } -function enfants_aff($id_parent,$decalage) { +function enfants_aff($id_parent,$decalage, $gauche=0) { global $total_vis; global $ifond; global $niveau; global $nombre_vis; global $nombre_abs; - global $couleur_claire; + global $couleur_claire, $spip_lang_right; global $abs_total; $query="SELECT id_rubrique, titre FROM spip_rubriques WHERE id_parent=\"$id_parent\" ORDER BY titre"; $result=spip_query($query); - - + while($row = spip_fetch_array($result)){ $id_rubrique = $row['id_rubrique']; $titre = typo($row['titre']); if ($nombre_vis[$id_rubrique]>0 OR $nombre_abs[$id_rubrique]>0){ - $largeur_rouge = floor(($nombre_vis[$id_rubrique] - $nombre_abs[$id_rubrique]) * 100 / $total_vis); - $largeur_vert = floor($nombre_abs[$id_rubrique] * 100 / $total_vis); + $largeur_rouge = floor(($nombre_vis[$id_rubrique] - $nombre_abs[$id_rubrique]) * 100 / $abs_total); + $largeur_vert = floor($nombre_abs[$id_rubrique] * 100 / $abs_total); if ($largeur_rouge+$largeur_vert>0){ - if ($ifond==0){ - $ifond=1; - $couleur="#FFFFFF"; - }else{ - $ifond=0; - $couleur="$couleur_claire"; - } if ($niveau==0) { - $couleur='#DDDDCC'; + $couleur="$couleur_claire"; $titre = majuscules($titre); } + else if ($niveau == 1) { + $couleur="#cccccc"; + } - echo "<TR BGCOLOR='$couleur' BACKGROUND='img_pack/rien.gif'><TD WIDTH=\"100%\">"; + else if ($niveau == 2) { + $couleur="#eeeeee"; + } + else { + $couleur="white"; + } + echo "<TR BGCOLOR='$couleur' BACKGROUND='img_pack/rien.gif'><TD WIDTH=\"100%\" style='border-bottom: 1px solid #cccccc;'>"; echo "<IMG SRC='img_pack/rien.gif' WIDTH='".($niveau*20+1)."' HEIGHT=8 BORDER=0>"; - echo "<FONT FACE='arial,helvetica,sans-serif' SIZE=2>"; - echo "<A HREF='naviguer.php3?coll=$id_rubrique'>$titre</A>"; + echo "<span class='verdana1'>"; + echo "<A HREF='naviguer.php3?coll=$id_rubrique' style='color: black;'>$titre</A>"; if ($niveau==0){ - $pourcent=round($nombre_vis[$id_rubrique]/$abs_total*100); - echo " $pourcent %"; + $pourcent = round($nombre_vis[$id_rubrique]/$abs_total*100); + echo "<div style='float: $spip_lang_right;'>$pourcent %</div>"; } - echo "</FONT>"; - echo "</TD><TD ALIGN='right'>"; + echo "</span>"; + echo "</TD><TD ALIGN='right' style='border-bottom: 1px solid #cccccc;'>"; - echo "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=".($decalage+1)." HEIGHT=8>"; - echo "<TR><TD BACKGROUND='img_pack/jauge-fond.gif' ALIGN='right'>"; - if ($largeur_vert>0) echo "<IMG SRC='img_pack/jauge-vert.gif' WIDTH=$largeur_vert HEIGHT=8 BORDER=0>"; + echo "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=".($decalage+1+$gauche)." HEIGHT=8>"; + echo "<TR>"; + if ($gauche > 0) echo "<td width='".$gauche."'></td>"; + echo "<TD BACKGROUND='img_pack/jauge-fond.gif'>"; + if ($visites_abs > 0) echo "<img src='img_pack/rien.gif' width='".$visites_abs."' height=8 border=0>"; if ($largeur_rouge>0) echo "<IMG SRC='img_pack/jauge-rouge.gif' WIDTH=$largeur_rouge HEIGHT=8 BORDER=0>"; + if ($largeur_vert>0) echo "<IMG SRC='img_pack/jauge-vert.gif' WIDTH=$largeur_vert HEIGHT=8 BORDER=0>"; echo "<IMG SRC='img_pack/rien.gif' HEIGHT=8 WIDTH=1 BORDER=0>"; echo "</TD></TR></TABLE>\n"; echo "</TD></TR>"; - } + } } $niveau++; - enfants_aff($id_rubrique,$largeur_rouge); + enfants_aff($id_rubrique,$largeur_rouge, $visites_abs+$gauche); $niveau--; + $visites_abs = $visites_abs + round($nombre_vis[$id_rubrique]/$abs_total*100); } } @@ -161,13 +166,13 @@ $result = spip_query($query); while($row = spip_fetch_array($result)) { $id_rubrique = $row['id_rubrique']; - if ($nombre_vis[$id_rubrique]>$total_vis) $total_vis=$nombre_vis[$id_rubrique]; + if ($nombre_vis[$id_rubrique] > $total_vis) $total_vis+=$nombre_vis[$id_rubrique]; } if ($total_vis<1) $total_vis=1; debut_cadre_relief("statistiques-24.gif"); -echo "<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0>"; +echo "<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0 style='border: 1px solid #aaaaaa;'>"; enfants_aff(0,100); echo "<TR><TD></TD><TD><IMG SRC='img_pack/rien.gif' WIDTH=100 HEIGHT=1 BORDER=0></TD>"; diff --git a/ecrire/statistiques_lang.php3 b/ecrire/statistiques_lang.php3 index a62cce4373..93469dd910 100644 --- a/ecrire/statistiques_lang.php3 +++ b/ecrire/statistiques_lang.php3 @@ -3,11 +3,11 @@ include ("inc.php3"); -debut_page(_T('titre_page_statistiques'), "suivi", "repartition"); +debut_page(_T('onglet_repartition_lang'), "suivi", "repartition-langues"); echo "<br><br>"; -gros_titre(_T('titre_statistiques')); -barre_onglets("repartition", "langues"); +gros_titre(_T('onglet_repartition_lang')); +//barre_onglets("repartition", "langues"); if ($GLOBALS["critere"] == "debut") { $critere = "visites"; @@ -75,7 +75,7 @@ function enfants_aff($id_parent,$decalage) { global $niveau; global $nombre_vis; global $nombre_abs; - global $couleur_claire; + global $couleur_claire, $spip_lang_right; global $abs_total; $query="SELECT id_rubrique, titre FROM spip_rubriques WHERE id_parent=\"$id_parent\" ORDER BY titre"; $result=spip_query($query); @@ -156,39 +156,43 @@ debut_cadre_enfonce("langues-24.gif"); $result = spip_query($query); - echo "<table cellpadding = 4 cellspacing = 0 border = 0 width='100%'>"; + echo "<table cellpadding = 2 cellspacing = 0 border = 0 width='100%' style='border: 1px solid #aaaaaa;'>"; $ifond = 1; while ($row = spip_fetch_array($result)) { $lang = $row['lang']; $visites = round($row['cnt'] / $total_visites * 100); - - if ($ifond==0){ - $ifond=1; - $couleur=""; - }else{ - $ifond=0; - $couleur="$couleur_claire"; - } - - echo "<tr bgcolor='$couleur'>"; - $dir=lang_dir($lang,'',' dir=rtl'); - echo "<td width='100%'><font face='verdana,arial,helvetica' size='2'><span$dir>".traduire_nom_langue($lang)." : $visites%</span></font></td>"; - echo "<td>"; - echo "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH='100' HEIGHT=8>"; - echo "<TR><TD BACKGROUND='img_pack/jauge-fond.gif' ALIGN='right'>"; - if ($visites>0) echo "<IMG SRC='img_pack/jauge-vert.gif' WIDTH=$visites HEIGHT=8 BORDER=0>"; - echo "<IMG SRC='img_pack/rien.gif' HEIGHT=8 WIDTH=1 BORDER=0>"; - echo "</TD></TR></TABLE>\n"; + if ($visites > 0) { - echo "</td>"; - echo "</tr>"; + if ($ifond==0){ + $ifond=1; + $couleur="white"; + }else{ + $ifond=0; + $couleur="eeeeee"; + } + + echo "<tr bgcolor='$couleur'>"; + $dir=lang_dir($lang,'',' dir=rtl'); + echo "<td width='100%' style='border-bottom: 1px solid #cccccc;'><span class='verdana2'$dir>".traduire_nom_langue($lang)."<div style='float: $spip_lang_right;'>$visites%</div></span></td>"; + + echo "<td style='border-bottom: 1px solid #cccccc;'>"; + echo "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH='100' HEIGHT=8>"; + echo "<TR><TD BACKGROUND='img_pack/jauge-fond.gif' style='align:$spip_lang_right'>"; + if ($visites_abs > 0) echo "<img src='img_pack/rien.gif' width='$visites_abs' height='8'>"; + if ($visites>0) echo "<IMG SRC='img_pack/jauge-vert.gif' WIDTH=$visites HEIGHT=8 BORDER=0>"; + echo "<IMG SRC='img_pack/rien.gif' HEIGHT=8 WIDTH=1 BORDER=0>"; + echo "</TD></TR></TABLE>\n"; + + echo "</td>"; + echo "</tr>"; + $visites_abs += $visites; + } } echo "</table>"; - //echo "<P><FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('texte_signification')."</FONT>"; -- GitLab