Merge branch 'master' into 10500

This commit is contained in:
fredtempez 2021-02-17 08:50:04 +01:00
commit 688c923214
8 changed files with 175 additions and 180 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

@ -767,6 +767,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) {
@ -777,24 +787,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

@ -285,16 +285,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
]);
}
@ -375,13 +379,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';
@ -452,12 +449,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

@ -87,7 +87,7 @@ class blog extends common {
public static $users = [];
const VERSION = '4.2';
const VERSION = '4.3';
const REALNAME = 'Blog';
/**

View File

@ -1,4 +1,3 @@
<article>
<div class="row">
<div class="col10">
<div class="blogDate">
@ -151,4 +150,3 @@
</div>
</div>
<?php echo $module::$pages; ?>
</article>

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; ?>