Skip to content
Extraits de code Groupes Projets
Valider a26a9b8c rédigé par ARNO*'s avatar ARNO*
Parcourir les fichiers

Correction bug en cas d'absence de visites.

parent 2017d451
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -62,55 +62,58 @@ else {
}
$visites_today = mysql_num_rows($result);
$max = max(max($log),$visites_today);
if ($max>10) $maxgraph = substr(ceil(substr($max,0,2) / 10)."000000000000", 0, strlen($max));
else $maxgraph = 10;
$rapport = 200 / $maxgraph;
if (count($log) < 365) $largeur = floor(365 / (count($log)+1));
if ($largeur < 1) $largeur = 1;
debut_cadre_relief();
echo "<table cellpadding=0 cellspacing=0 border=0><tr>";
if (count($log)>0){
$max = max(max($log),$visites_today);
if ($max>10) $maxgraph = substr(ceil(substr($max,0,2) / 10)."000000000000", 0, strlen($max));
else $maxgraph = 10;
$rapport = 200 / $maxgraph;
if (count($log) < 365) $largeur = floor(365 / (count($log)+1));
if ($largeur < 1) $largeur = 1;
debut_cadre_relief();
echo "<table cellpadding=0 cellspacing=0 border=0><tr>";
echo "<td bgcolor='black'><img src='img_pack/rien.gif' width=1 height=1></td>";
// Presentation graphique
while (list($key, $value) = each($log)) {
$hauteur = round($value * $rapport) - 1;
echo "<td valign='bottom' width=5>";
if ($hauteur > 0){
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=$hauteur style='background-color:$couleur_claire;'>";
}
echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
echo "</td>";
}
// Dernier jour
$hauteur = round($visites_today * $rapport) - 1;
echo "<td valign='bottom' width=5>";
if ($hauteur > 0){
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=$hauteur style='background-color:#e4e4e4;'>";
}
echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
echo "</td>";
echo "<td bgcolor='black'><img src='img_pack/rien.gif' width=1 height=1></td>";
echo "<td><img src='img_pack/rien.gif' width=5 height=1></td>";
echo "<td valign='top'><font face='verdana,arial,helvetica,sans-serif' size=2>";
echo "max&nbsp;: $max";
echo "<br>aujourd'hui&nbsp;: $visites_today";
echo "</font></td>";
echo "</tr></table>";
fin_cadre_relief();
// Presentation graphique
while (list($key, $value) = each($log)) {
$hauteur = round($value * $rapport) - 1;
echo "<td valign='bottom' width=5>";
if ($hauteur > 0){
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=$hauteur style='background-color:$couleur_claire;'>";
}
echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
echo "</td>";
}
// Dernier jour
$hauteur = round($visites_today * $rapport) - 1;
echo "<td valign='bottom' width=5>";
if ($hauteur > 0){
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=$hauteur style='background-color:#e4e4e4;'>";
}
echo "<img src='img_pack/rien.gif' width=$largeur height=1 style='background-color:black;'>";
echo "</td>";
echo "<td bgcolor='black'><img src='img_pack/rien.gif' width=1 height=1></td>";
echo "<td><img src='img_pack/rien.gif' width=5 height=1></td>";
echo "<td valign='top'><font face='verdana,arial,helvetica,sans-serif' size=2>";
echo "max&nbsp;: $max";
echo "<br>aujourd'hui&nbsp;: $visites_today";
echo "</font></td>";
echo "</tr></table>";
fin_cadre_relief();
// Affichage des referers
$query = "SELECT * FROM spip_visites_referers WHERE type = '$page' ORDER BY visites DESC LIMIT 0,100";
$result = spip_query($query);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter