feat: visiteurs uniques par article (7/14/30 j) stockés dans visitors.json
- AccessLogParser : suivi des IPs non-bot uniques par /post/ sur 3 fenêtres (7/14/30 j) - index.php : écriture de data/UUID/visitors.json à chaque recalcul des stats admin - post_view.php : affichage du compteur de lecteurs dans la zone hero Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+17
-3
@@ -178,15 +178,29 @@ $hasSources = (!empty($externalLinks) || !empty($files))
|
||||
<br><small class="opacity-75"><?= htmlspecialchars($modDate) ?></small>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php
|
||||
$_v30 = (int) ($articleVisitors['30'] ?? 0);
|
||||
$_v14 = (int) ($articleVisitors['14'] ?? 0);
|
||||
$_v7 = (int) ($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"> (<?= $_v14 ?> / 14 j · <?= $_v7 ?> / 7 j)</span>
|
||||
</span>
|
||||
</p>
|
||||
<?php endif;
|
||||
unset($_v30, $_v14, $_v7); ?>
|
||||
</div>
|
||||
<div class="article-hero-right">
|
||||
<?php if ($hasSources): ?>
|
||||
<a href="/sources/<?= rawurlencode($article['uuid']) ?>" class="hero-btn">ℹ Sources</a>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$_heroReactionDefs = [
|
||||
'useful' => ['👍', 'Utile'],
|
||||
];
|
||||
$_heroReactionDefs = [
|
||||
'useful' => ['👍', 'Utile'],
|
||||
];
|
||||
?>
|
||||
<div class="hero-reactions" id="reactions">
|
||||
<?php foreach ($_heroReactionDefs as $type => [$icon, $label]): ?>
|
||||
|
||||
Reference in New Issue
Block a user