feat : TrendingParser + flux RSS tendances + page publique /tendances (v1.6.4)

- TrendingParser : lit les logs Apache, compte les visiteurs uniques (IPs, HTTP 200),
  supporte plusieurs préfixes (/post/, /book/) et un seul parse via topGrouped()
- /trending?period=… : flux RSS des 50 articles les plus consultés, 10 périodes
  de 10 min à 1 an, cache TTL adaptatif
- /tendances : page publique avec sélecteur de période, top 20 articles,
  tableau des flux RSS et section méthodologie
- /admin/stats : remplace AccessLogParser (hits) par TrendingParser (visiteurs uniques)
- Page d'accueil : rubrique Tendances alimentée par les logs 1h (fallback DB)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 17:38:06 +02:00
parent 21f6e75878
commit 18b7194069
9 changed files with 624 additions and 38 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ $_activeGroup = trim($_GET['group'] ?? '');
</div>
<?php else: ?>
<p class="text-muted small mb-4">14 derniers jours · cache 10 min</p>
<p class="text-muted small mb-4">14 derniers jours · visiteurs uniques · cache 60 s</p>
<div class="row g-4">
@@ -61,7 +61,7 @@ $_activeGroup = trim($_GET['group'] ?? '');
<div class="progress-bar" style="width:<?= $pct ?>%"></div>
</div>
</td>
<td class="text-end fw-semibold pe-3"><?= number_format($hits, 0, ',', '\u{202F}') ?></td>
<td class="text-end fw-semibold pe-3"><?= number_format($hits, 0, ',', '\u{202F}') ?> <span class="text-muted fw-normal">vis.</span></td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -106,7 +106,7 @@ $_activeGroup = trim($_GET['group'] ?? '');
<div class="progress-bar bg-success" style="width:<?= $pct ?>%"></div>
</div>
</td>
<td class="text-end fw-semibold pe-3"><?= number_format($hits, 0, ',', '\u{202F}') ?></td>
<td class="text-end fw-semibold pe-3"><?= number_format($hits, 0, ',', '\u{202F}') ?> <span class="text-muted fw-normal">vis.</span></td>
</tr>
<?php endforeach; ?>
</tbody>