Il s’agit d’une modification du cœœur de SPIP.
Visuellement, elle donne ceci (noter la bulle d’aide sur fond jaune) :
Sur chaque colonne des stats, en passant la souris, on a dans une bulle d’aide :
- la date concernée
- le nombre de visites
- la moyenne de ce jour là
La copie d’écran ne montre que le graphe des jours, mais la contrib rajoute aussi des bulles d’aide informative sur le graphe des mois.
Voici le diff entre la version originale 1.7.2 et celle-ci.
--- --- D:\!2004\!200407\spip\SPIP-v1-7-2\SPIP-v1-7-2\ecrire\statistiques_visites.php3 Thu May 13 17:08:46 2004 UTC
+++ D:\wwwrootDev\jpyrat\ecrire\statistiques_visites.php3 Wed Sep 8 23:23:21 2004 UTC
@@ -266,6 +266,9 @@
while (list($key, $value) = each($log)) {
$n++;
+ //$ce_jour=date("Y-m-d", $key);
+ //$jour = nom_jour($ce_jour).' '.jour($ce_jour).' '.nom_mois($ce_jour).' '.annee($ce_jour);
+
if ($decal == 30) $decal = 0;
$decal ++;
$tab_moyenne[$decal] = $value;
@@ -279,6 +282,9 @@
$decal ++;
$tab_moyenne[$decal] = $value;
+ $ce_jour=date("Y-m-d", $jour_prec+(3600*24*($i+1)));
+ $jour = nom_jour($ce_jour).' '.jour($ce_jour).' '.nom_mois($ce_jour).' '.annee($ce_jour);
+
reset($tab_moyenne);
$moyenne = 0;
while (list(,$val_tab) = each($tab_moyenne))
@@ -288,15 +294,21 @@
$hauteur_moyenne = round(($moyenne) * $rapport) - 1;
echo "<td valign='bottom' width=$largeur>";
$difference = ($hauteur_moyenne) -1;
+ $moyenne = round($moyenne,2); // Pour affichage harmonieux
+ $tagtitle='"'.attribut_html(supprimer_tags("$jour | "._T('info_visites')." 0 | "._T('info_moyenne')." $moyenne")).'"';
if ($difference > 0) {
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur_moyenne>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur_moyenne title=$tagtitle>";
}
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;' title=$tagtitle>";
echo "</td>";
$n++;
}
}
+
+ $ce_jour=date("Y-m-d", $key);
+ $jour = nom_jour($ce_jour).' '.jour($ce_jour).' '.nom_mois($ce_jour).' '.annee($ce_jour);
+
$total_loc = $total_loc + $value;
reset($tab_moyenne);
@@ -307,37 +319,40 @@
$hauteur_moyenne = round($moyenne * $rapport) - 1;
$hauteur = round($value * $rapport) - 1;
+ $moyenne = round($moyenne,2); // Pour affichage harmonieux
echo "<td valign='bottom' width=$largeur>";
+
+ $tagtitle='"'.attribut_html(supprimer_tags("$jour | "._T('info_visites')." $value | "._T('info_moyenne')." $moyenne")).'"';
if ($hauteur > 0){
if ($hauteur_moyenne > $hauteur) {
$difference = ($hauteur_moyenne - $hauteur) -1;
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=$difference>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$difference title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;' title=$tagtitle>";
if (date("w",$key) == "0") // Dimanche en couleur foncee
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;' title=$tagtitle>";
else
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;' title=$tagtitle>";
} else if ($hauteur_moyenne < $hauteur) {
$difference = ($hauteur - $hauteur_moyenne) -1;
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;' title=$tagtitle>";
if (date("w",$key) == "0") // Dimanche en couleur foncee
$couleur = $couleur_foncee;
else
$couleur = $couleur_claire;
- echo "<img src='img_pack/rien.gif' width=$largeur height=$difference style='background-color:$couleur;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur_moyenne style='background-color:$couleur;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$difference style='background-color:$couleur;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur_moyenne style='background-color:$couleur;' title=$tagtitle>";
} else {
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;' title=$tagtitle>";
if (date("w",$key) == "0") // Dimanche en couleur foncee
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;' title=$tagtitle>";
else
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;' title=$tagtitle>";
}
}
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;' title=$tagtitle>";
echo "</td>\n";
$jour_prec = $key;
@@ -355,10 +370,12 @@
// basee sur la moyenne (site) ou popularite (article)
if (! $id_article) $val_popularite = $moyenne;
$prevision = (1 - (date("H")*60 - date("i"))/(24*60)) * $val_popularite;
- $prevision = ceil($prevision * $rapport);
- echo "<img src='img_pack/rien.gif' width=$largeur height=$prevision style='background-color:#eeeeee;'>";
+ $hauteurprevision = ceil($prevision * $rapport);
+ $prevision = round($prevision,0)+$visites_today; // Pour affichage harmonieux
+ $tagtitle='"'.attribut_html(supprimer_tags(_T('info_aujourdhui')." $visites_today → $prevision")).'"';
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteurprevision style='background-color:#eeeeee;' title=$tagtitle>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:#cccccc;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:#cccccc;' title=$tagtitle>";
}
echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
echo "</td>";
@@ -480,6 +497,8 @@
while (list($key, $value) = each($entrees)) {
$n++;
+ $mois = nom_mois($key).' '.annee($key);
+
if ($decal == 30) $decal = 0;
$decal ++;
$tab_moyenne[$decal] = $value;
@@ -495,44 +514,46 @@
$hauteur_moyenne = round($moyenne * $rapport) - 1;
$hauteur = round($value * $rapport) - 1;
echo "<td valign='bottom' width=$largeur>";
+ $moyenne = round($moyenne,2); // Pour affichage harmonieux
+ $tagtitle='"'.attribut_html(supprimer_tags("$mois | "._T('info_visites')." $value | "._T('info_moyenne')." $moyenne")).'"';
if ($hauteur > 0){
if ($hauteur_moyenne > $hauteur) {
$difference = ($hauteur_moyenne - $hauteur) -1;
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=$difference>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$difference title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;' title=$tagtitle>";
if (ereg("-01",$key)){ // janvier en couleur foncee
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;' title=$tagtitle>";
}
else {
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;' title=$tagtitle>";
}
}
else if ($hauteur_moyenne < $hauteur) {
$difference = ($hauteur - $hauteur_moyenne) -1;
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;' title=$tagtitle>";
if (ereg("-01",$key)){ // janvier en couleur foncee
$couleur = $couleur_foncee;
}
else {
$couleur = $couleur_claire;
}
- echo "<img src='img_pack/rien.gif' width=$largeur height=$difference style='background-color:$couleur;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;'>";
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur_moyenne style='background-color:$couleur;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$difference style='background-color:$couleur;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:#333333;' title=$tagtitle>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur_moyenne style='background-color:$couleur;' title=$tagtitle>";
}
else {
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:$couleur_foncee;' title=$tagtitle>";
if (ereg("-01",$key)){ // janvier en couleur foncee
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_foncee;' title=$tagtitle>";
}
else {
- echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=$hauteur style='background-color:$couleur_claire;' title=$tagtitle>";
}
}
}
- echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
+ echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;' title=$tagtitle>";
echo "</td>\n";
$jour_prec = $key;
Et pour ceux qui préféreraient remplacer directement le fichier, il est joint ci-dessous.
À placer dans le dossier ecrire/ (une fois décompressé, bien sûr !).
Discussions par date d’activité
Une discussion
Voici le diff entre la version originale 1.7.2 et celle-ci.
Ok ... est pour la 1.8 ...
Ca passe .
Reponse a mon propre message = apres installation de la 1.8.1 le 16.04.2005 cela est present dans la contribution ... et s’affiche tres bien .... autant pour moi ... desole ...
Répondre à ce message
Ajouter un commentaire
Avant de faire part d’un problème sur un plugin X, merci de lire ce qui suit :
Merci d’avance pour les personnes qui vous aideront !
Par ailleurs, n’oubliez pas que les contributeurs et contributrices ont une vie en dehors de SPIP.
Suivre les commentaires : |