From fc4900c66b94d280b6f7cb9484ee43b5c41dd079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Fri, 7 Oct 2022 19:48:04 +0200 Subject: [PATCH] =?UTF-8?q?blog=20date=20compl=C3=A8te=20dans=20la=20liste?= =?UTF-8?q?=20des=20articles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/blog/blog.php | 12 +++++++++--- module/blog/view/index/index.php | 15 +++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index 1c7d0fa7..23690d0f 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -278,10 +278,16 @@ class blog extends common { 'value' => $comment['approval'] === true ? 'A' : 'R' ]); } + //Date et heure + $gdh = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $comment['createdOn']), 'UTF-8', true) + ? \PHP81_BC\strftime('%d %B %Y ', $comment['createdOn']) + : utf8_encode(\PHP81_BC\strftime('%d %B %Y', $comment['createdOn'])); + $gdh .= ' - '; + $gdh .= mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $comment['createdOn']), 'UTF-8', true) + ? \PHP81_BC\strftime('%H:%M', $comment['createdOn']) + : utf8_encode(\PHP81_BC\strftime('%H:%M', $comment['createdOn'])); self::$comments[] = [ - mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true) - ? \PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']) - : utf8_encode(\PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn'])), + $gdh, $comment['content'], $comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'], $buttonApproval, diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 292182d4..6707f704 100644 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -13,7 +13,7 @@ $this->makeThumb( self::FILE_DIR . 'source/' . $article['picture'], self::FILE_DIR . 'thumb/' . $thumb, self::THUMBS_WIDTH); - } + } ?> <?php echo $article['picture']; ?> @@ -36,9 +36,16 @@
- +

'), 0, 400); ?>...