From e2d218f36427f8fde84d057a60f9c6fd38a03f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= Date: Sat, 16 May 2026 11:18:55 +0200 Subject: [PATCH] =?UTF-8?q?feat=20:=20widget=20notation=20=C3=A9toiles=20+?= =?UTF-8?q?=20admin=20onglet=20flux=20RSS=20(v1.6.22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - post_view.php : widget ★ 1-5 étoiles pour les connectés, moyenne + nb votes pour tous (#13) - admin : onglet /admin/flux liste tous les flux rss_feeds avec suppression (#87) - case 'admin_delete_feed' : suppression admin d'un flux sans contrainte email (#87) Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 8 ++++++ public/index.php | 35 +++++++++++++++++++++++++- public/version.txt | 2 +- templates/admin.php | 55 +++++++++++++++++++++++++++++++++++++++++ templates/post_view.php | 31 +++++++++++++++++++++++ 5 files changed, 129 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b46804..bad1195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag --- +## [1.6.22] - 2026-05-16 + +### Ajouté +- Widget de notation ★ (1-5 étoiles) sur les articles, accessible aux utilisateurs connectés ; affiche la moyenne et le nombre de votes pour tous (#13) +- Admin `flux` : onglet listant tous les flux RSS agrégés avec action de suppression admin (#87) + +--- + ## [1.6.21] - 2026-05-16 ### Ajouté diff --git a/public/index.php b/public/index.php index 6618c23..8091305 100644 --- a/public/index.php +++ b/public/index.php @@ -45,7 +45,7 @@ $action = $_GET['action'] ?? 'list'; $uuid = $_GET['uuid'] ?? ''; $slug = $_GET['slug'] ?? ''; -$_noindexActions = ['create', 'edit', 'admin', 'categories', 'diff', 'add_files', 'import_image', 'import_image_step2', 'sources', 'profile', 'delete_file', 'delete_external_link', 'rename_category', 'delete_category', 'toggle_private_category', 'admin_save_site', 'not_found', 'add_feed', 'delete_feed', 'add_link', 'delete_link', 'reorder_links', 'react', 'comment', 'verify_comment', 'comment_moderate', 'comment_delete', 'comment_resend', 'create_tag_type', 'delete_tag_type', 'edit_tags', 'book_save', 'book_delete', 'admin_save_as_groups', 'admin_save_folio_config', 'run_engine_update', 'run_content_migrations']; +$_noindexActions = ['create', 'edit', 'admin', 'categories', 'diff', 'add_files', 'import_image', 'import_image_step2', 'sources', 'profile', 'delete_file', 'delete_external_link', 'rename_category', 'delete_category', 'toggle_private_category', 'admin_save_site', 'not_found', 'add_feed', 'delete_feed', 'add_link', 'delete_link', 'reorder_links', 'react', 'comment', 'verify_comment', 'comment_moderate', 'comment_delete', 'comment_resend', 'create_tag_type', 'delete_tag_type', 'edit_tags', 'book_save', 'book_delete', 'admin_save_as_groups', 'admin_save_folio_config', 'run_engine_update', 'run_content_migrations', 'admin_delete_feed', 'rate']; $metaRobots = in_array($action, $_noindexActions, true) ? 'noindex, nofollow' : null; unset($_noindexActions); @@ -2735,6 +2735,21 @@ switch ($action) { $adminData['tagTypes'] = $articles->getTagTypes(); } + if ($tab === 'flux') { + if (!isAdmin()) { + http_response_code(403); + exit; + } + $pdo = dbPdo(); + $adminData['flux_feeds'] = []; + if ($pdo) { + try { + $st = $pdo->query('SELECT id, user_email, feed_url, label, created_at FROM rss_feeds ORDER BY created_at DESC'); + $adminData['flux_feeds'] = $st->fetchAll(PDO::FETCH_ASSOC); + } catch (\Throwable) {} + } + } + if ($tab === 'books') { if (!isAdmin()) { http_response_code(403); @@ -3366,6 +3381,24 @@ switch ($action) { header('Location: /profile#feeds'); exit; + case 'admin_delete_feed': + requireAuth(); + if (!isAdmin() || $_SERVER['REQUEST_METHOD'] !== 'POST') { + http_response_code(403); + exit; + } + $feedId = (int)($_POST['id'] ?? 0); + if ($feedId > 0) { + $pdo = dbPdo(); + if ($pdo) { + try { + $pdo->prepare('DELETE FROM rss_feeds WHERE id = :id')->execute([':id' => $feedId]); + } catch (\Throwable) {} + } + } + header('Location: /admin/flux?deleted=1'); + exit; + case 'search_files': requireAuth(); header('Content-Type: application/json'); diff --git a/public/version.txt b/public/version.txt index 49e1fe3..d619516 100644 --- a/public/version.txt +++ b/public/version.txt @@ -1 +1 @@ -1.6.21 +1.6.22 diff --git a/templates/admin.php b/templates/admin.php index 6f6ff58..4cde464 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -69,6 +69,10 @@ function adminStatusBadge(array $a, int $now): string Livres +