From 6e681491de6733096e18a87399f64063207cc4cb Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Thu, 7 Mar 2024 16:46:07 +0000 Subject: [PATCH] Update file editpage.php --- html/editpage.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/html/editpage.php b/html/editpage.php index 77d5ff04..951b5407 100644 --- a/html/editpage.php +++ b/html/editpage.php @@ -92,19 +92,21 @@ if(isset($fichier)) { foreach($pages as $page) { if($page != "." && $page != "..") { if (is_file($repertoire . "content/" . $page)) { - echo "
" . pathinfo($page, PATHINFO_FILENAME) . "
"; + echo "
" . pathinfo($page, PATHINFO_FILENAME) . "
"; } } } echo "
"; $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("SELECT ID, titre FROM articles ORDER BY date DESC LIMIT 10"); + $req = $bdd->prepare("SELECT ID, titre, auteur, date FROM articles ORDER BY date DESC LIMIT 10"); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC); + $date = new Datetime($row['date']); + if ($resultat) { foreach($resultat as $row) { - echo "
" . $row['titre'] . "
"; + echo "

" . $row['titre'] . "

" . $row['auteur'] . "

" . $date->format('d/m/Y') . "
"; } } }