blog date complète dans la liste des articles

This commit is contained in:
Fred Tempez 2022-10-07 19:48:04 +02:00
parent 98ab381b0e
commit fc4900c66b
2 changed files with 20 additions and 7 deletions

View File

@ -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,

View File

@ -13,7 +13,7 @@
$this->makeThumb( self::FILE_DIR . 'source/' . $article['picture'],
self::FILE_DIR . 'thumb/' . $thumb,
self::THUMBS_WIDTH);
}
}
?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $article['picture']; ?>">
@ -36,9 +36,16 @@
</div>
<div class="blogDate">
<?php echo template::ico('calendar-empty'); ?>
<?php echo mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y - %H:%M', $article['publishedOn']), 'UTF-8', true)
? \PHP81_BC\strftime('%d %B %Y', $article['publishedOn'])
: utf8_encode(\PHP81_BC\strftime('%d %B %Y', $article['publishedOn'])); ?>
<?php
// Date et heure
echo mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $article['publishedOn']), 'UTF-8', true)
? \PHP81_BC\strftime('%d %B %Y', $article['publishedOn'])
: utf8_encode(\PHP81_BC\strftime('%d %B %Y', $article['publishedOn']));
echo ' - ';
echo mb_detect_encoding(\PHP81_BC\strftime('%H:%M',$article['publishedOn']), 'UTF-8', true)
? \PHP81_BC\strftime('%H:%M', $article['publishedOn'])
: utf8_encode(\PHP81_BC\strftime('%H:%M', $article['publishedOn']));
?>
</div>
<p class="blogContent">
<?php echo helper::subword(strip_tags($article['content'],'<br><p>'), 0, 400); ?>...