1.14.02 Module blog bug de présentation, version 7.12

This commit is contained in:
Fred Tempez 2024-10-08 15:23:51 +02:00
parent a87d439282
commit 7862815f1f
5 changed files with 64 additions and 62 deletions

View File

@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '1.14.01';
const ZWII_VERSION = '1.14.02';
// URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';

View File

@ -16,7 +16,7 @@
class blog extends common
{
const VERSION = '7.11';
const VERSION = '7.12';
const REALNAME = 'Blog';
const DELETE = true;
const UPDATE = '0.0';

View File

@ -1,6 +1,8 @@
# Versions 7.11
# Version 7.12
- Corrige un bug d'affichage des articles lorsque le thème Moderne est sélectionné.
# Version 7.11
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
# Versions 7.10
# Version 7.10
- Empêche la validation d'un commentaire lorsque le contenu est vide.
# Versions 7.8 - 7.9
- Le flux RSS ne fonctionne pas si les méta de la page sont vides.

View File

@ -1 +1 @@
{"name":"blog","realName":"Blog","version":"7.10","update":"0.0","delete":true,"dataDirectory":""}
{"name":"blog","realName":"Blog","version":"7.12","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -95,70 +95,70 @@
<?php endif; ?>
</div>
</div>
</div>
<?php else: ?>
<div class="row">
<?php if (
$article['picture'] &&
file_exists(self::FILE_DIR . 'source/' . $article['picture'])
): ?>
<div class="col3">
<?php // Déterminer le nom de la miniature
$parts = pathinfo($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
$thumb = 'mini_' . $parts['basename'];
// 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>
</div>
<div class="col9">
<?php else: ?>
<div class="col12">
<?php endif; ?>
<h2 class="blogTitle">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<?php echo $article['title']; ?>
</a>
</h2>
<div class="blogComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
<?php if ($module::$comments[$articleId]): ?>
<?php echo $module::$comments[$articleId]; ?>
<?php echo template::ico('comment', ['margin' => 'left']); ?>
<?php endif; ?>
<?php else: ?>
<div class="row">
<?php if (
$article['picture'] &&
file_exists(self::FILE_DIR . 'source/' . $article['picture'])
): ?>
<div class="col3">
<?php // Déterminer le nom de la miniature
$parts = pathinfo($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
$thumb = 'mini_' . $parts['basename'];
// 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>
</div>
<div class="blogDate">
<!-- bloc signature et date -->
<?php echo template::ico('user'); ?>
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
<?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . '&nbsp;' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
</div>
<div class="blogContent">
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?>
<?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>...
<div class="readMoreContainer">
<div class="col9">
<?php else: ?>
<div class="col12">
<?php endif; ?>
<h2 class="blogTitle">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<button class="readMoreButton">
<?php echo helper::translate('Lire la suite'); ?>
</button>
<?php echo $article['title']; ?>
</a>
</h2>
<div class="blogComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
<?php if ($module::$comments[$articleId]): ?>
<?php echo $module::$comments[$articleId]; ?>
<?php echo template::ico('comment', ['margin' => 'left']); ?>
<?php endif; ?>
</a>
</div>
<div class="blogDate">
<!-- bloc signature et date -->
<?php echo template::ico('user'); ?>
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
<?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . '&nbsp;' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
</div>
<div class="blogContent">
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?>
<?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>...
<div class="readMoreContainer">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<button class="readMoreButton">
<?php echo helper::translate('Lire la suite'); ?>
</button>
</a>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</article>
<?php echo $module::$pages; ?>
<?php else: ?>