2022-03-18 07:50:13 +01:00
|
|
|
<?php
|
|
|
|
// Lexique
|
|
|
|
$text = [];
|
|
|
|
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
|
|
|
switch ($val) {
|
|
|
|
case 'fr' :
|
|
|
|
$text[0] = 'Lire la suite';
|
|
|
|
break;
|
|
|
|
case 'en' :
|
|
|
|
$text[0] = 'Read more';
|
|
|
|
break;
|
|
|
|
}
|
2022-05-01 11:45:17 +02:00
|
|
|
// Pour les dates suivant la langue d'administration
|
|
|
|
$lang = 'fr_FR';
|
|
|
|
$zone = 'Europe/Paris';
|
|
|
|
if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
|
|
|
|
$lang = 'en_GB';
|
|
|
|
$zone = 'Europe/London';
|
|
|
|
}
|
|
|
|
$fmt = datefmt_create(
|
|
|
|
$lang,
|
|
|
|
IntlDateFormatter::LONG,
|
|
|
|
IntlDateFormatter::SHORT,
|
|
|
|
$zone,
|
|
|
|
IntlDateFormatter::GREGORIAN
|
|
|
|
);
|
|
|
|
if($module::$articles): ?>
|
2022-01-31 09:10:49 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col12">
|
|
|
|
<?php foreach($module::$articles as $articleId => $article): ?>
|
|
|
|
<div class="row rowArticle">
|
|
|
|
<div class="col3">
|
|
|
|
<?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);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<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']; ?>">
|
|
|
|
</a>
|
|
|
|
<?php endif;?>
|
|
|
|
</div>
|
|
|
|
<div class="col9">
|
|
|
|
<h1 class="blogTitle">
|
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
|
|
|
|
<?php echo $article['title']; ?>
|
|
|
|
</a>
|
|
|
|
</h1>
|
|
|
|
<div class="blogComment">
|
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
|
|
|
|
<?php if ($article['comment']): ?>
|
|
|
|
<?php echo count($article['comment']); ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
</a>
|
|
|
|
<?php echo template::ico('comment', 'left'); ?>
|
|
|
|
</div>
|
|
|
|
<div class="blogDate">
|
|
|
|
<i class="far fa-calendar-alt"></i>
|
2022-05-01 11:45:17 +02:00
|
|
|
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$article['publishedOn']))); ?>
|
2022-01-31 09:10:49 +01:00
|
|
|
</div>
|
|
|
|
<p class="blogContent">
|
|
|
|
<?php echo helper::subword(strip_tags($article['content']), 0, 400); ?>...
|
2022-03-18 07:50:13 +01:00
|
|
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId;?>"><?php echo $text[0]; ?></a>
|
2022-01-31 09:10:49 +01:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php echo $module::$pages; ?>
|
|
|
|
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
|
|
|
|
<div id="rssFeed">
|
|
|
|
<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' />
|
|
|
|
<?php
|
|
|
|
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
|
|
|
|
?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<?php echo template::speech('Aucun article.'); ?>
|
|
|
|
<?php endif; ?>
|