2018-04-02 08:29:19 +02:00
|
|
|
<?php if($module::$articles): ?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col12">
|
2020-05-30 12:04:45 +02:00
|
|
|
<?php foreach($module::$articles as $articleId => $article): ?>
|
2020-04-23 19:55:47 +02:00
|
|
|
<div class="row rowArticle">
|
2019-02-22 22:38:06 +01:00
|
|
|
<div class="col3">
|
2021-05-26 19:14:53 +02:00
|
|
|
<?php if ( file_exists(self::FILE_DIR . 'source/' . $article['picture']) ): ?>
|
|
|
|
<?php // Déterminer le nom de la miniature
|
|
|
|
$parts = explode('/',$article['picture']);
|
|
|
|
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $article['picture']);
|
|
|
|
// Créer la miniature si manquante
|
|
|
|
if (!file_exists( self::FILE_DIR . 'thumb/' . $thumb) ) {
|
|
|
|
$this->makeThumb( self::FILE_DIR . 'source/' . $article['picture'],
|
|
|
|
self::FILE_DIR . 'thumb/' . $thumb,
|
|
|
|
self::THUMBS_WIDTH);
|
|
|
|
}
|
|
|
|
?>
|
2019-02-22 22:38:06 +01:00
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
|
2020-04-07 10:17:42 +02:00
|
|
|
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $article['picture']; ?>">
|
2019-02-22 00:12:33 +01:00
|
|
|
</a>
|
2021-05-26 19:14:53 +02:00
|
|
|
<?php endif;?>
|
2019-02-22 00:12:33 +01:00
|
|
|
</div>
|
|
|
|
<div class="col9">
|
2019-02-22 22:38:06 +01:00
|
|
|
<h1 class="blogTitle">
|
2019-02-22 00:12:33 +01:00
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
|
|
|
|
<?php echo $article['title']; ?>
|
|
|
|
</a>
|
|
|
|
</h1>
|
2018-04-02 08:29:19 +02:00
|
|
|
<div class="blogComment">
|
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
|
2020-10-11 18:36:20 +02:00
|
|
|
<?php if ($article['comment']): ?>
|
|
|
|
<?php echo count($article['comment']); ?>
|
|
|
|
<?php endif; ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
</a>
|
|
|
|
<?php echo template::ico('comment', 'left'); ?>
|
2020-05-30 12:04:45 +02:00
|
|
|
</div>
|
2019-02-22 22:38:06 +01:00
|
|
|
<div class="blogDate">
|
2022-02-04 09:12:07 +01:00
|
|
|
<?php echo template::ico('calendar-empty'); ?>
|
2020-11-01 13:38:25 +01:00
|
|
|
<?php echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $article['publishedOn']), 'UTF-8', true)
|
|
|
|
? strftime('%d %B %Y', $article['publishedOn'])
|
|
|
|
: utf8_encode(strftime('%d %B %Y', $article['publishedOn'])); ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
</div>
|
2019-02-22 12:19:38 +01:00
|
|
|
<p class="blogContent">
|
2022-02-15 10:58:08 +01:00
|
|
|
<?php echo helper::subword(strip_tags($article['content'],'<br><p>'), 0, 400); ?>...
|
2019-02-22 12:19:38 +01:00
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a>
|
|
|
|
</p>
|
2019-02-22 00:12:33 +01:00
|
|
|
</div>
|
2018-04-02 08:29:19 +02:00
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php echo $module::$pages; ?>
|
2020-11-17 10:31:08 +01:00
|
|
|
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
|
|
|
|
<div id="rssFeed">
|
2021-04-02 15:24:30 +02:00
|
|
|
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" target="_blank">
|
2021-03-09 14:26:09 +01:00
|
|
|
<img src='module/blog/ressource/feed-icon-16.gif' />
|
|
|
|
<?php
|
2020-11-17 10:31:08 +01:00
|
|
|
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
|
|
|
|
?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
<?php else: ?>
|
|
|
|
<?php echo template::speech('Aucun article.'); ?>
|
2021-03-09 14:26:09 +01:00
|
|
|
<?php endif; ?>
|