Update of /home/spip-cvs/spip/ecrire
In directory alan:/tmp/cvs-serv16563
Modified Files:
inc_presentation.php3 statistiques.php3 statistiques_lang.php3
Log Message:
Cosmetique: presentation des repartitions (par rubriques, par langues).
Index: statistiques_lang.php3
RCS file: /home/spip-cvs/spip/ecrire/statistiques_lang.php3,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- statistiques_lang.php3 26 May 2004 15:25:18 -0000 1.7
+++ statistiques_lang.php3 21 Sep 2004 12:17:14 -0000 1.8
@@ -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 @@
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 @@
$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>";
Index: inc_presentation.php3
RCS file: /home/spip-cvs/spip/ecrire/inc_presentation.php3,v
retrieving revision 1.444
retrieving revision 1.445
diff -u -d -r1.444 -r1.445
--- inc_presentation.php3 20 Sep 2004 20:39:00 -0000 1.444
+++ inc_presentation.php3 21 Sep 2004 12:17:14 -0000 1.445
@@ -2052,9 +2052,9 @@
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 @@
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>";
Index: statistiques.php3
RCS file: /home/spip-cvs/spip/ecrire/statistiques.php3,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- statistiques.php3 26 May 2004 15:25:18 -0000 1.13
+++ statistiques.php3 21 Sep 2004 12:17:14 -0000 1.14
@@ -6,9 +6,9 @@
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_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 @@
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>";