From 3b77620511556aad4ee7b90e3487905b95c92f47 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 12 Jun 2023 11:45:03 +0200 Subject: [PATCH] Blog 6.8 --- module/blog/blog.php | 13 ++++++++----- module/blog/changes.md | 2 ++ module/blog/enum.json | 2 +- module/blog/view/index/index.php | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index a85a7f83..a8ffbad5 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -16,7 +16,7 @@ class blog extends common { - const VERSION = '6.7'; + const VERSION = '6.8'; const REALNAME = 'Blog'; const DELETE = true; const UPDATE = '0.0'; @@ -565,7 +565,7 @@ class blog extends common 'feeds' => $this->getInput('blogOptionShowFeeds', helper::FILTER_BOOLEAN), 'feedsLabel' => $this->getInput('blogOptionFeedslabel', helper::FILTER_STRING_SHORT), '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), 'dateFormat' => $this->getInput('blogOptionDateFormat'), 'timeFormat' => $this->getInput('blogOptionTimeFormat'), @@ -863,10 +863,13 @@ class blog extends common if ($articlePublishedOn <= time() and $articleIdsStates[$articleId]) { $articleIds[] = $articleId; // Nombre de commentaires approuvés par article + self::$comments[$articleId] = 0 ; 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'])); - } else { - self::$comments[$articleId] = '0'; + foreach ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment']) as $commentId => $commentValue) { + if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'comment', $commentId, 'approval'])) { + self::$comments[$articleId] = self::$comments[$articleId] + 1; + } + } } } } diff --git a/module/blog/changes.md b/module/blog/changes.md index 84d8d250..0022a6f5 100755 --- a/module/blog/changes.md +++ b/module/blog/changes.md @@ -1,4 +1,6 @@ +# version 6.8 +- Erreur de décompte des commentaires approuvés ou non dans l'index # 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 # version 6.6 diff --git a/module/blog/enum.json b/module/blog/enum.json index 8138ec10..7720ddcb 100644 --- a/module/blog/enum.json +++ b/module/blog/enum.json @@ -1 +1 @@ -{"name":"blog","realName":"Blog","version":"6.5","update":"0.0","delete":true,"dataDirectory":""} \ No newline at end of file +{"name":"blog","realName":"Blog","version":"6.8","update":"0.0","delete":true,"dataDirectory":""} \ No newline at end of file diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 77a6bf5a..221ae750 100755 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -133,11 +133,11 @@
- - + + + 'left']); ?> - 'left']); ?>