From b58113a8ef27a2cf2b8357ea072605f388b48d77 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 27 Apr 2021 09:25:54 +0200 Subject: [PATCH] Sitemap articles par date --- core/module/sitemap/view/index/index.css | 18 +++++++++++- core/module/sitemap/view/index/index.php | 37 ++++++++++++++++++------ 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/core/module/sitemap/view/index/index.css b/core/module/sitemap/view/index/index.css index d7c543b0..05c72d6a 100755 --- a/core/module/sitemap/view/index/index.css +++ b/core/module/sitemap/view/index/index.css @@ -1 +1,17 @@ -/* Vide */ \ No newline at end of file +/** + * This file is part of Zwii. + * + * For full copyright and license information, please see the LICENSE + * file that was distributed with this source code. + * + * @author Rémi Jean + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @copyright Copyright (C) 2018-2021, Frédéric Tempez + * @license GNU General Public License, version 3 + * @link http://zwiicms.fr/ + */ + + ul { + list-style-type: circle; + } \ No newline at end of file diff --git a/core/module/sitemap/view/index/index.php b/core/module/sitemap/view/index/index.php index 6ae5361c..e52b486c 100755 --- a/core/module/sitemap/view/index/index.php +++ b/core/module/sitemap/view/index/index.php @@ -23,13 +23,22 @@
    - getData(['page', $childId, 'moduleId']) === 'blog') { ?> - - getData(['module',$childId]) as $articleId => $article): ?> - getData(['module',$childId,'posts',$articleId,'state']) === true) {?> + getData(['page', $childId, 'moduleId']) === 'blog' && + !empty($this->getData(['module', $childId, 'posts' ])) ) { ?> + getData(['module', $childId,'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayCollumn($this->getData(['module', $childId, 'posts']), 'state', 'SORT_DESC'); + $articleIds = []; + foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { + if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { + $articleIds[] = $articleId; + } + } + foreach($articleIds as $articleId => $article): ?> + getData(['module',$childId,'posts',$article,'state']) === true) {?>
  • - + getData(['module',$childId,'posts',$article,'title']); ?>
  • getData(['page', $parentId, 'moduleId']) === 'blog' && !empty($this->getData(['module',$parentId, 'posts' ])) ) { ?> - getData(['module',$parentId, 'posts' ]) as $articleId => $article): ?> - getData(['module',$parentId,'posts',$articleId,'state']) === true ): ?> + getData(['module', $parentId,'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayCollumn($this->getData(['module', $parentId, 'posts']), 'state', 'SORT_DESC'); + $articleIds = []; + foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { + if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { + $articleIds[] = $articleId; + } + } + foreach($articleIds as $articleId => $article): ?> + getData(['module',$parentId,'posts',$article,'state']) === true ): ?>
  • - + getData(['module',$parentId,'posts',$article,'title']); ?>