This commit is contained in:
Prof Langues 2020-10-05 17:09:49 +02:00
parent 2171f1b6d6
commit 72b82aa071
2 changed files with 5 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class blog extends common {
public static $users = [];
const BLOG_VERSION = '3.02.dev';
const BLOG_VERSION = '3.03.dev';
/**
* Édition
@ -568,6 +568,8 @@ class blog extends common {
foreach( $commentsApproved as $key => $value){
if($value['approval']===false) unset($commentsApproved[$key]);
}
// Ligne suivante si affichage du nombre total de commentaires approuvés sous l'article
self::$comments['nbApproved'] = count($commentsApproved);
$commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC'));
// Pagination
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']),'#comment');

View File

@ -31,7 +31,8 @@
<p>Cet article ne reçoit pas de commentaire.</p>
<?php else: ?>
<h3 id="comment">
<?php $commentsNb = count($module::$comments); ?>
<?php // $commentsNb = count($module::$comments); ?>
<?php $commentsNb = $module::$comments['nbApproved']; ?>
<?php $s = $commentsNb === 1 ? '': 's' ?>
<?php echo $commentsNb > 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?>
</h3>