10.4.03 petites corrections

This commit is contained in:
fredtempez 2021-02-16 09:44:04 +01:00
parent 31173bcef3
commit 19825afe2d
7 changed files with 176 additions and 181 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## version 10.4.03
- Corrections :
- En-tête html : absence de la langue.
- Suppression de la balise sémantique <article>.
- Génération image Opengraph, mauvaise redirection.
- Nouvelle structure de données articles de blog dans le sitemap.
## version 10.4.02
- Corrections :
- Thème : aperçu du site amélioré.

View File

@ -1,5 +1,5 @@
# ZwiiCMS 10.4.02
# ZwiiCMS 10.4.03
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.

View File

@ -44,7 +44,7 @@ class common {
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '10.4.02';
const ZWII_VERSION = '10.4.03';
const ZWII_UPDATE_CHANNEL = "v10";
public static $actions = [];
@ -766,6 +766,16 @@ class common {
if ($this->getData(['page', $parentPageId, 'disable']) !== true ) {
$sitemap->addUrl ($parentPageId,$datetime);
}
// Articles du blog
if ($this->getData(['page', $parentPageId, 'moduleId']) === 'blog' &&
!empty($this->getData(['module',$parentPageId])) ) {
foreach($this->getData(['module',$parentPageId,'posts']) as $articleId => $article) {
if($this->getData(['module',$parentPageId,'posts',$articleId,'state']) === true) {
$date = $this->getData(['module',$parentPageId,'posts',$articleId,'publishedOn']);
$sitemap->addUrl( $parentPageId . '/' . $articleId , new DateTime("@{$date}",new DateTimeZone($timezone)));
}
}
}
// Sous-pages
foreach($childrenPageIds as $childKey) {
if ($this->getData(['page',$childKey,'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
@ -776,24 +786,15 @@ class common {
// La sous-page est un blog
if ($this->getData(['page', $childKey, 'moduleId']) === 'blog' &&
!empty($this->getData(['module',$childKey])) ) {
foreach($this->getData(['module',$childKey]) as $articleId => $article) {
if($this->getData(['module',$childKey,$articleId,'state']) === true) {
$date = $this->getData(['module',$childKey,$articleId,'publishedOn']);
foreach($this->getData(['module',$childKey,'posts']) as $articleId => $article) {
if($this->getData(['module',$childKey,'posts',$articleId,'state']) === true) {
$date = $this->getData(['module',$childKey,'posts',$articleId,'publishedOn']);
$sitemap->addUrl( $childKey . '/' . $articleId , new DateTime("@{$date}",new DateTimeZone($timezone)));
}
}
}
}
// Articles du blog
if ($this->getData(['page', $parentPageId, 'moduleId']) === 'blog' &&
!empty($this->getData(['module',$parentPageId])) ) {
foreach($this->getData(['module',$parentPageId]) as $articleId => $article) {
if($this->getData(['module',$parentPageId,$articleId,'state']) === true) {
$date = $this->getData(['module',$parentPageId,$articleId,'publishedOn']);
$sitemap->addUrl( $parentPageId . '/' . $articleId , new DateTime("@{$date}",new DateTimeZone($timezone)));
}
}
}
}
// generating internally a sitemap

View File

@ -1,7 +1,6 @@
<?php $layout = new layout($this);
$lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<?php $layout = new layout($this);?>
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="<?php echo $lan;?>">
<html prefix="og: http://ogp.me/ns#" lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -286,16 +286,20 @@ class config extends common {
$data = str_replace('_','/',$googlePagespeedData['lighthouseResult']['audits']['final-screenshot']['details']['data']);
$data = str_replace('-','+',$data);
$img = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
$success = file_put_contents( self::FILE_DIR.'source/screenshot.jpg',$img) ;
// Effacer la miniature png
if (file_exists(self::FILE_DIR.'source/screenshot.png')) {
unlink (self::FILE_DIR.'source/screenshot.png');
// Effacer l'image et la miniature png
if (file_exists(self::FILE_DIR.'thumb/screenshot.jpg')) {
unlink (self::FILE_DIR.'thumb/screenshot.jpg');
}
if (file_exists(self::FILE_DIR.'source/screenshot.jpg')) {
unlink (self::FILE_DIR.'source/screenshot.jpg');
}
$success = file_put_contents( self::FILE_DIR.'source/screenshot.jpg',$img) ;
}
// Valeurs en sortie
$this->addOutput([
'notification' => $success === false ? 'Service inaccessible ou erreur d\'écriture de l\'image' : 'Image générée avec succès',
'redirect' => helper::baseUrl() . 'advanced',
'redirect' => helper::baseUrl() . 'config/advanced',
'state' => $success === false ? false : true
]);
}
@ -376,13 +380,6 @@ class config extends common {
$this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true) {
$this->setData(['user',$users]);
}
/*
if ($version === '9' ) {
$this->importData($this->getInput('configManageImportUser', helper::FILTER_BOOLEAN));
$this->setData(['core','dataVersion',0]);
}*/
// Met à jours les URL dans les contenus de page
// Message de notification
$notification = $success === true ? 'Restauration réalisée avec succès' : 'Erreur inconnue';
@ -453,12 +450,7 @@ class config extends common {
'state' => $success
]);
}
// Initialisation du screen - APPEL AUTO DESACTIVE POUR EVITER UN RALENTISSEMENT
/*
if (!file_exists(self::FILE_DIR.'source/screenshot.jpg')) {
$this->configMetaImage();
}
*/
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',

View File

@ -1,5 +1,4 @@
<article>
<div class="row">
<div class="row">
<div class="col10">
<div class="blogDate">
<i class="far fa-calendar-alt"></i>
@ -42,17 +41,17 @@
]); ?>
<?php endif; ?>
</div>
</div>
</div>
<?php $pictureSize = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']); ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'hidePicture']) == false) {
echo '<img class="blogArticlePicture blogArticlePicture' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picturePosition']) .
' pict' . $pictureSize . '" src="' . helper::baseUrl(false) . self::FILE_DIR.'source/' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) .
'" alt="' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) . '">';
} ?>
<?php echo $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?>
<p class="clearBoth signature"><?php echo $module::$articleSignature;?></p>
<?php echo $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?>
<p class="clearBoth signature"><?php echo $module::$articleSignature;?></p>
<!-- Bloc RSS-->
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<?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'; ?> ">
<img src='module/news/ressource/feed-icon-16.gif' />
@ -61,10 +60,10 @@
?>
</a>
</div>
<?php endif; ?>
<?php if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?>
<?php endif; ?>
<?php if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?>
<p>Cet article ne reçoit pas de commentaire.</p>
<?php else: ?>
<?php else: ?>
<h3 id="comment">
<?php //$commentsNb = count($module::$comments); ?>
<?php $commentsNb = $module::$nbCommentsApproved; ?>
@ -135,8 +134,8 @@
</div>
</div>
</div>
<?php endif;?>
<div class="row">
<?php endif;?>
<div class="row">
<div class="col12">
<?php foreach($module::$comments as $commentId => $comment): ?>
<div class="block">
@ -149,6 +148,5 @@
</div>
<?php endforeach; ?>
</div>
</div>
<?php echo $module::$pages; ?>
</article>
</div>
<?php echo $module::$pages; ?>

View File

@ -21,7 +21,6 @@
</a>
</div>
<div class="col9">
<article>
<h1 class="blogTitle">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<?php echo $article['title']; ?>
@ -45,7 +44,6 @@
<?php echo helper::subword(strip_tags($article['content']), 0, 400); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a>
</p>
</article>
</div>
</div>
<?php endforeach; ?>