From d86cc8d72e473d4d500978dee0b21daa84b70f35 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 26 May 2021 17:37:08 +0200 Subject: [PATCH 1/3] =?UTF-8?q?News=203.3=20=20rss=20sur=20page=20affich?= =?UTF-8?q?=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/news/news.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/news/news.php b/module/news/news.php index d8c0d94d..e3b74254 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -15,7 +15,7 @@ class news extends common { - const VERSION = '3.2'; + const VERSION = '3.3'; const REALNAME = 'Actualités'; const DELETE = true; const UPDATE = '0.0'; @@ -101,8 +101,6 @@ class news extends common { $feeds->addGenerator(); // Corps des articles $newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); - // Articles de la première page uniquement - $newsIdsPublishedOns = array_slice($newsIdsPublishedOns, 0, $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) ); $newsIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) { if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) { From 8b156674efb38a06281aa8d7a7ce56f03116edcd Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 26 May 2021 17:57:16 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Num=C3=A9ro=20de=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 ++++ README.md | 2 +- core/core.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d089513a..d562ea2a 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## version 10.6.03 +- Correction : + - Module actualités (news), version 3.3, le flux RSS affiche l'ensemble des articles plutôt que ceux de la page courante. + ## version 10.6.02 - Correction : - Débordement lors du téléchargement des fichiers journaux. diff --git a/README.md b/README.md index a4ce499d..e10d3f42 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# ZwiiCMS 10.6.02 +# ZwiiCMS 10.6.03 Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. diff --git a/core/core.php b/core/core.php index da4ad5dc..3144a376 100755 --- a/core/core.php +++ b/core/core.php @@ -44,7 +44,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.6.02'; + const ZWII_VERSION = '10.6.03'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; From 3720e017c60142bf095d007f63e6a021d349cda0 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 26 May 2021 18:16:35 +0200 Subject: [PATCH 3/3] Blog 5.1 RSS Check image --- module/blog/blog.php | 12 +++++++----- module/blog/view/index/index.php | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index e9959dfb..dd1284a5 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -15,7 +15,7 @@ class blog extends common { - const VERSION = '5.0'; + const VERSION = '5.1'; const REALNAME = 'Blog'; const DELETE = true; const UPDATE = '0.0'; @@ -142,8 +142,8 @@ class blog extends common { // Corps des articles $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC'); - foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { - if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { + foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) { + if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) { // Miniature $parts = explode('/',$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])); $thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])); @@ -163,11 +163,13 @@ class blog extends common { $newsArticle->setAuthor($author,'no@mail.com'); $newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId); $newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']))); - $imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb); + if ( file_exists($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])) ) { + $imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb); $newsArticle->addEnclosure( helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb, $imageData[0] * $imageData[1], $imageData['mime'] - ); + ); + } $feeds->addItem($newsArticle); } } diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 319d7a54..30baca8a 100755 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -4,21 +4,21 @@ $article): ?>
- makeThumb( self::FILE_DIR . 'source/' . $article['picture'], - self::FILE_DIR . 'thumb/' . $thumb, - self::THUMBS_WIDTH); - } - - ?> + + makeThumb( self::FILE_DIR . 'source/' . $article['picture'], + self::FILE_DIR . 'thumb/' . $thumb, + self::THUMBS_WIDTH); + } + ?> <?php echo $article['picture']; ?> +