Blog position RSS

This commit is contained in:
Fred Tempez 2023-03-23 07:43:23 +01:00
parent f6ec7dccd5
commit 169a30f449

View File

@ -1,5 +1,4 @@
<?php if ($module::$articles) : ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])): ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])) : ?>
<div id="rssFeed"> <div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" target="_blank"> <a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" target="_blank">
<img src='module/blog/ressource/feed-icon-16.gif' /> <img src='module/blog/ressource/feed-icon-16.gif' />
@ -8,10 +7,11 @@
?> ?>
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($module::$articles): ?>
<article> <article>
<?php foreach ($module::$articles as $articleId => $article) : ?> <?php foreach ($module::$articles as $articleId => $article): ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) === 0) : ?> <?php if ($this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) === 0): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<h2 class="blogTitle"> <h2 class="blogTitle">
@ -35,7 +35,7 @@
<?php if ( <?php if (
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) && $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) &&
file_exists(self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])) file_exists(self::FILE_DIR . 'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']))
) : ?> ): ?>
<?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']); ?> <?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'pictureSize']); ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'hidePicture']) == false) { <?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'hidePicture']) == false) {
echo '<img class="blogArticlePicture blogArticlePicture' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picturePosition']) . echo '<img class="blogArticlePicture blogArticlePicture' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picturePosition']) .
@ -70,16 +70,17 @@
and $this->getUser('group') >= $module::$actions['config'] and $this->getUser('group') >= $module::$actions['config']
) )
) )
) : ?> ): ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleId . '/' . $_SESSION['csrf']; ?>"> <a
href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleId . '/' . $_SESSION['csrf']; ?>">
<?php echo template::ico('pencil'); ?> Éditer <?php echo template::ico('pencil'); ?> Éditer
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col6 textAlignRight" id="comment"> <div class="col6 textAlignRight" id="comment">
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])) : ?> <?php if ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'commentClose'])): ?>
<p>Cet article ne reçoit pas de commentaire.</p> <p>Cet article ne reçoit pas de commentaire.</p>
<?php else : ?> <?php else: ?>
<p> <p>
<?php echo template::ico('comment', ['margin' => 'right']); ?> <?php echo template::ico('comment', ['margin' => 'right']); ?>
<?php <?php
@ -95,12 +96,12 @@
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<?php else : ?> <?php else: ?>
<div class="row rowArticle"> <div class="row rowArticle">
<?php if ( <?php if (
$article['picture'] && $article['picture'] &&
file_exists(self::FILE_DIR . 'source/' . $article['picture']) file_exists(self::FILE_DIR . 'source/' . $article['picture'])
) : ?> ): ?>
<div class="col3"> <div class="col3">
<?php // Déterminer le nom de la miniature <?php // Déterminer le nom de la miniature
$parts = pathinfo($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])); $parts = pathinfo($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
@ -115,11 +116,12 @@
} }
?> ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $article['picture']; ?>"> <img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>"
alt="<?php echo $article['picture']; ?>">
</a> </a>
</div> </div>
<div class="col9"> <div class="col9">
<?php else : ?> <?php else: ?>
<div class="col12"> <div class="col12">
<?php endif; ?> <?php endif; ?>
<h2 class="blogTitle"> <h2 class="blogTitle">
@ -129,7 +131,7 @@
</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 ($article['comment']): ?>
<?php echo count($article['comment']); ?> <?php echo count($article['comment']); ?>
<?php endif; ?> <?php endif; ?>
</a> </a>
@ -138,7 +140,7 @@
<div class="blogDate"> <div class="blogDate">
<!-- bloc signature et date --> <!-- bloc signature et date -->
<?php echo template::ico('user'); ?> <?php echo template::ico('user'); ?>
<?php echo $module->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']));?> <?php echo $module->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
<?php echo template::ico('calendar-empty'); ?> <?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?> <?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?>
</div> </div>
@ -153,6 +155,6 @@
<?php endforeach; ?> <?php endforeach; ?>
</article> </article>
<?php echo $module::$pages; ?> <?php echo $module::$pages; ?>
<?php else : ?> <?php else: ?>
<?php echo template::speech('Aucun article'); ?> <?php echo template::speech('Aucun article'); ?>
<?php endif; ?> <?php endif; ?>