diff --git a/CHANGES.md b/CHANGES.md index 713b4d54..d0afe0c9 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Changelog +## version 10.4.03 +- Corrections : + - En-tête html : absence de la langue. + - Suppression de la balise sémantique
. + - 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é. diff --git a/README.md b/README.md index cb9d1c5f..487b18c0 100755 --- a/README.md +++ b/README.md @@ -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. diff --git a/core/core.php b/core/core.php index 25468402..728c4ea3 100755 --- a/core/core.php +++ b/core/core.php @@ -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 diff --git a/core/layout/main.php b/core/layout/main.php index fb3eacfb..1f19cbc4 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -1,7 +1,6 @@ - + - + diff --git a/core/module/config/config.php b/core/module/config/config.php index 46fe9cf7..c60dc090 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -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', diff --git a/module/blog/blog.php b/module/blog/blog.php index 6b83a8db..e6843a1f 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -87,7 +87,7 @@ class blog extends common { public static $users = []; - const VERSION = '4.2'; + const VERSION = '4.3'; const REALNAME = 'Blog'; /** diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 7016c91c..6706ffa4 100755 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -1,154 +1,152 @@ -
-
-
-
- - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); - $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); - echo $date . ' à ' . $heure; - ?> -
-
-
- getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND - ( // Propriétaire - ( - $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER - AND ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'userId']) === $this->getUser('id') - OR $this->getUser('group') === self::GROUP_ADMIN ) - ) - OR ( - // Groupe - ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_ADMIN - OR $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_MODERATOR) - AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) - ) - OR ( - // Tout le monde - $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL - AND $this->getUser('group') >= $module::$actions['config'] - ) - ) - ): ?> - helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1) . '/' . $_SESSION['csrf'], - 'value' => 'Editer' - ]); ?> - +
+
+
+ + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + echo $date . ' à ' . $heure; + ?>
- getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']); ?> - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'hidePicture']) == false) { - echo '' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) . ''; - } ?> - getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?> -

- - getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?> - - - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?> -

Cet article ne reçoit pas de commentaire.

- -

- - - - 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?> -

- - 'Rédiger un commentaire...', - 'readonly' => true - ]); ?> -
- getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?> - 'Nom', - 'readonly' => true, - 'value' => $module::$editCommentSignature - ]); ?> - $this->getUser('id') - ]); ?> - -
-
- 'Nom' - ]); ?> -
-
-
Ou
-
-
- helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '__comment', - 'value' => 'Connexion' - ]); ?> -
-
- - 'Commentaire avec maximum '.$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']).' caractères', - 'class' => 'editorWysiwygComment', - 'noDirty' => true, - 'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']) +
+ getUser('password') === $this->getInput('ZWII_USER_PASSWORD') + AND + ( // Propriétaire + ( + $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER + AND ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'userId']) === $this->getUser('id') + OR $this->getUser('group') === self::GROUP_ADMIN ) + ) + OR ( + // Groupe + ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_ADMIN + OR $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_MODERATOR) + AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) + ) + OR ( + // Tout le monde + $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL + AND $this->getUser('group') >= $module::$actions['config'] + ) + ) + ): ?> + helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1) . '/' . $_SESSION['csrf'], + 'value' => 'Editer' ]); ?> -
- getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?> -
-
- $this->getData(['config','captchaStrong']) - ]); ?> -
-
- + +
+
+ getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']); ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'hidePicture']) == false) { + echo '' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) . ''; + } ?> +getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?> +

+ +getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?> + + +getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?> +

Cet article ne reçoit pas de commentaire.

+ +

+ + + + 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?> +

+ + 'Rédiger un commentaire...', + 'readonly' => true + ]); ?> +
+ getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?> + 'Nom', + 'readonly' => true, + 'value' => $module::$editCommentSignature + ]); ?> + $this->getUser('id') + ]); ?> +
-
- 'buttonGrey', - 'value' => 'Annuler' +
+ 'Nom' ]); ?>
-
- 'Envoyer', - 'ico' => '' +
+
Ou
+
+
+ helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '__comment', + 'value' => 'Connexion' ]); ?>
+ + 'Commentaire avec maximum '.$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']).' caractères', + 'class' => 'editorWysiwygComment', + 'noDirty' => true, + 'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']) + ]); ?> +
+ getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?> +
+
+ $this->getData(['config','captchaStrong']) + ]); ?> +
+
+ +
+
+ 'buttonGrey', + 'value' => 'Annuler' + ]); ?> +
+
+ 'Envoyer', + 'ico' => '' + ]); ?> +
- -
-
- $comment): ?> -
-

- le - -

-
+ +
+
+ $comment): ?> +
+

+ le + +

+
- -
\ No newline at end of file + + \ No newline at end of file diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 1434d5b7..ca0f24d7 100755 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -21,7 +21,6 @@
-