This commit is contained in:
Fred Tempez 2023-06-12 11:45:03 +02:00
parent 5b82100c30
commit 3b77620511
4 changed files with 14 additions and 9 deletions

View File

@ -16,7 +16,7 @@
class blog extends common class blog extends common
{ {
const VERSION = '6.7'; const VERSION = '6.8';
const REALNAME = 'Blog'; const REALNAME = 'Blog';
const DELETE = true; const DELETE = true;
const UPDATE = '0.0'; const UPDATE = '0.0';
@ -565,7 +565,7 @@ class blog extends common
'feeds' => $this->getInput('blogOptionShowFeeds', helper::FILTER_BOOLEAN), 'feeds' => $this->getInput('blogOptionShowFeeds', helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('blogOptionFeedslabel', helper::FILTER_STRING_SHORT), 'feedsLabel' => $this->getInput('blogOptionFeedslabel', helper::FILTER_STRING_SHORT),
'layout' => $this->getInput('blogOptionArticlesLayout', helper::FILTER_BOOLEAN), 'layout' => $this->getInput('blogOptionArticlesLayout', helper::FILTER_BOOLEAN),
'articlesLenght' => $this->getInput('blogOptionArticlesLayout', helper::FILTER_BOOLEAN) === false ? $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT): 0, 'articlesLenght' => $this->getInput('blogOptionArticlesLayout', helper::FILTER_BOOLEAN) === false ? $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT) : 0,
'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true), 'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true),
'dateFormat' => $this->getInput('blogOptionDateFormat'), 'dateFormat' => $this->getInput('blogOptionDateFormat'),
'timeFormat' => $this->getInput('blogOptionTimeFormat'), 'timeFormat' => $this->getInput('blogOptionTimeFormat'),
@ -863,10 +863,13 @@ class blog extends common
if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) { if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) {
$articleIds[] = $articleId; $articleIds[] = $articleId;
// Nombre de commentaires approuvés par article // Nombre de commentaires approuvés par article
self::$comments[$articleId] = 0 ;
if (is_array($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment']))) { if (is_array($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment']))) {
self::$comments[$articleId] = count($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment'])); foreach ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment']) as $commentId => $commentValue) {
} else { if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment', $commentId, 'approval'])) {
self::$comments[$articleId] = '0'; self::$comments[$articleId] = self::$comments[$articleId] + 1;
}
}
} }
} }
} }

View File

@ -1,4 +1,6 @@
# version 6.8
- Erreur de décompte des commentaires approuvés ou non dans l'index
# version 6.7 # version 6.7
- Ancre article qui affiche le début de l'article au clic sur la barre de pages, fonction utile lorsque le module est sous la page - Ancre article qui affiche le début de l'article au clic sur la barre de pages, fonction utile lorsque le module est sous la page
# version 6.6 # version 6.6

View File

@ -1 +1 @@
{"name":"blog","realName":"Blog","version":"6.5","update":"0.0","delete":true,"dataDirectory":""} {"name":"blog","realName":"Blog","version":"6.8","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -133,11 +133,11 @@
</h2> </h2>
<div class="blogComment"> <div class="blogComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
<?php if ($article['comment']): ?> <?php if ($module::$comments[$articleId]): ?>
<?php echo count($article['comment']); ?> <?php echo $module::$comments[$articleId]; ?>
<?php echo template::ico('comment', ['margin' => 'left']); ?>
<?php endif; ?> <?php endif; ?>
</a> </a>
<?php echo template::ico('comment', ['margin' => 'left']); ?>
</div> </div>
<div class="blogDate"> <div class="blogDate">
<!-- bloc signature et date --> <!-- bloc signature et date -->