40656631ba
- Admin stats : clic sur un réseau AS affiche les IPs avec mini sparkline 14 jours + articles/livres consultés - AccessLogParser : calcul ip_data (daily + top paths) inclus dans le cache stats - Suppression du tableau statique "Répartition par réseau" (fusionné dans accordéon pays) - PHP-CS-Fixer appliqué sur l'ensemble des fichiers modifiés Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50 lines
1.7 KiB
PHP
50 lines
1.7 KiB
PHP
<?php
|
|
ob_start();
|
|
?>
|
|
|
|
<div class="container py-4">
|
|
|
|
<div class="d-flex align-items-baseline justify-content-between mb-4">
|
|
<h1 class="h3 mb-0">Livres</h1>
|
|
<span class="text-muted small"><?= count($booksData) ?> livre<?= count($booksData) > 1 ? 's' : '' ?></span>
|
|
</div>
|
|
|
|
<?php if (empty($booksData)): ?>
|
|
<p class="text-muted">Aucun livre disponible pour l'instant.</p>
|
|
<?php else: ?>
|
|
|
|
<div class="book-grid">
|
|
<?php foreach ($booksData as $_bd):
|
|
$_book = $_bd['book'];
|
|
$_first = $_bd['first'];
|
|
$_count = $_bd['count'];
|
|
$_cover = $_first['cover'] ?? '';
|
|
$_cat = trim($_first['category'] ?? '');
|
|
$_coverStyle = $_cover !== ''
|
|
? "background-image:url('/file?uuid=" . rawurlencode($_first['uuid']) . '&name=' . rawurlencode($_cover) . "')"
|
|
: 'background:' . coverGradient($_cat !== '' ? $_cat : $_first['uuid'], $allCats ?? []);
|
|
?>
|
|
<a href="/book/<?= rawurlencode($_book['slug']) ?>" class="book-home-card">
|
|
<div class="book-home-card-cover" style="<?= $_coverStyle ?>"></div>
|
|
<div class="book-home-card-body">
|
|
<div class="book-home-card-title"><?= htmlspecialchars($_book['title']) ?></div>
|
|
<?php if (!empty($_book['description'])): ?>
|
|
<div class="book-home-card-desc"><?= htmlspecialchars(mb_strimwidth($_book['description'], 0, 100, '…')) ?></div>
|
|
<?php endif; ?>
|
|
<div class="book-home-card-meta"><?= $_count ?> page<?= $_count > 1 ? 's' : '' ?></div>
|
|
</div>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
$content = ob_get_clean();
|
|
$title = 'Livres — ' . siteTitle();
|
|
$metaRobots = 'index, follow';
|
|
$canonical = rtrim((string)($_ENV['APP_URL'] ?? getenv('APP_URL') ?: ''), '/') . '/books';
|
|
include BASE_PATH . '/templates/layout.php';
|