feat: affichage clair des visiteurs 7/14/30 jours pour tous

Remplace l'affichage "X lecteurs · 30 j (Y/14 j · Z/7 j)" par
"X / 7 j · Y / 14 j · Z / 30 j lecteurs" — trois valeurs explicites
visibles par tous les visiteurs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 22:54:17 +02:00
parent e12bbe1ef9
commit 9eab9ba7c3
3 changed files with 23 additions and 8 deletions
+7
View File
@@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag
---
## [1.6.38] - 2026-05-19
### Modifié
- Page article : stats visiteurs affichées clairement pour tous — trois valeurs explicites « X / 7 j · Y / 14 j · Z / 30 j lecteurs »
---
## [1.6.37] - 2026-05-19
### Corrigé
+1 -1
View File
@@ -1 +1 @@
1.6.37
1.6.38
+15 -7
View File
@@ -179,16 +179,24 @@ $hasSources = (!empty($externalLinks) || !empty($files))
<?php endif; ?>
</p>
<?php
$_v30 = (int) ($articleVisitors['30'] ?? 0);
$_v14 = (int) ($articleVisitors['14'] ?? 0);
$_v7 = (int) ($articleVisitors['7'] ?? 0);
$_v30 = (int) ($articleVisitors[30] ?? $articleVisitors['30'] ?? 0);
$_v14 = (int) ($articleVisitors[14] ?? $articleVisitors['14'] ?? 0);
$_v7 = (int) ($articleVisitors[7] ?? $articleVisitors['7'] ?? 0);
if ($_v30 > 0):
?>
<p class="article-hero-visitors" title="Visiteurs uniques (IPs non-bot) · <?= $_v7 ?> / 7 j · <?= $_v14 ?> / 14 j · <?= $_v30 ?> / 30 j">
<span class="opacity-75" style="font-size:.8rem">
<?= number_format($_v30, 0, ',', "\xE2\x80\xAF") ?> lecteurs · 30 j
<span class="opacity-50">&nbsp;(<?= $_v14 ?> / 14 j · <?= $_v7 ?> / 7 j)</span>
<p class="article-hero-visitors" style="margin-top:.4rem;font-size:.78rem;opacity:.9">
<span title="Lecteurs uniques sur 7 jours">
<strong><?= number_format($_v7, 0, ',', "\xE2\x80\xAF") ?></strong> <span style="opacity:.7">/ 7 j</span>
</span>
<span style="opacity:.4">&nbsp;·&nbsp;</span>
<span title="Lecteurs uniques sur 14 jours">
<strong><?= number_format($_v14, 0, ',', "\xE2\x80\xAF") ?></strong> <span style="opacity:.7">/ 14 j</span>
</span>
<span style="opacity:.4">&nbsp;·&nbsp;</span>
<span title="Lecteurs uniques sur 30 jours">
<strong><?= number_format($_v30, 0, ',', "\xE2\x80\xAF") ?></strong> <span style="opacity:.7">/ 30 j</span>
</span>
<span style="opacity:.55">&nbsp;lecteurs</span>
</p>
<?php endif;
unset($_v30, $_v14, $_v7); ?>