diff --git a/CHANGELOG.md b/CHANGELOG.md index b2c9036..0ecbef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +enhancePostContent 2023.10.13 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Upgrade to last minute change to Dotclear 2.28 + enhancePostContent 2023.10.11 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index c0e0cba..7bf7f4f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # README -[![Release](https://img.shields.io/badge/release-2023.10.08-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/enhancePostContent/releases) -![Date](https://img.shields.io/badge/date-2023.10.08-c44d58.svg) +[![Release](https://img.shields.io/badge/release-2023.10.13-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/enhancePostContent/releases) +![Date](https://img.shields.io/badge/date-2023.10.13-c44d58.svg) [![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/enhancePostContent) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/enhancePostContent/src/branch/master/LICENSE) diff --git a/_define.php b/_define.php index 041e56b..8d4e000 100644 --- a/_define.php +++ b/_define.php @@ -16,7 +16,7 @@ $this->registerModule( 'Enhance post content', 'Add features to words in post content', 'Jean-Christian Denis and Contributors', - '2023.10.11', + '2023.10.13', [ 'type' => 'plugin', 'requires' => [['core', '2.28']], diff --git a/dcstore.xml b/dcstore.xml index 537e4c8..04c4fe3 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Enhance post content - 2023.10.11 + 2023.10.13 Jean-Christian Denis and Contributors Add features to words in post content - https://git.dotclear.watch/JcDenis/enhancePostContent/releases/download/v2023.10.11/plugin-enhancePostContent.zip + https://git.dotclear.watch/JcDenis/enhancePostContent/releases/download/v2023.10.13/plugin-enhancePostContent.zip 2.28 https://git.dotclear.watch/JcDenis/enhancePostContent/src/branch/master/README.md https://git.dotclear.watch/JcDenis/enhancePostContent/issues diff --git a/src/Epc.php b/src/Epc.php index ad280fa..10701b6 100644 --- a/src/Epc.php +++ b/src/Epc.php @@ -420,12 +420,12 @@ class Epc */ public static function widgetContentEntryExcerpt(?WidgetsElement $widget = null): string { - if (!App::frontend()->ctx->exists('posts')) { + if (!App::frontend()->context()->exists('posts')) { return ''; } $content = ''; - while (App::frontend()->ctx->__get('posts')?->fetch()) { + while (App::frontend()->context()->__get('posts')?->fetch()) { $content .= App::frontend()->__get('posts')->f('post_excerpt'); } @@ -441,13 +441,13 @@ class Epc */ public static function widgetContentEntryContent(?WidgetsElement $widget = null): string { - if (!App::frontend()->ctx->exists('posts')) { + if (!App::frontend()->context()->exists('posts')) { return ''; } $content = ''; - while (App::frontend()->ctx->__get('posts')?->fetch()) { - $content .= App::frontend()->ctx->__get('posts')->f('post_content'); + while (App::frontend()->context()->__get('posts')?->fetch()) { + $content .= App::frontend()->context()->__get('posts')->f('post_content'); } return $content; @@ -462,13 +462,13 @@ class Epc */ public static function widgetContentCommentContent(?WidgetsElement $widget = null): string { - if (!App::frontend()->ctx->exists('posts')) { + if (!App::frontend()->context()->exists('posts')) { return ''; } $content = ''; - while (App::frontend()->ctx->__get('posts')->fetch()) { - $comments = App::blog()->getComments(['post_id' => App::frontend()->ctx->__get('posts')->f('post_id')]); + while (App::frontend()->context()->__get('posts')->fetch()) { + $comments = App::blog()->getComments(['post_id' => App::frontend()->context()->__get('posts')->f('post_id')]); while ($comments->fetch()) { $content .= $comments->__call('getContent', []); } diff --git a/src/Frontend.php b/src/Frontend.php index 8729a39..fa987fc 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -37,7 +37,7 @@ class Frontend extends Process 'publicBeforeContentFilterV2' => function (string $tag, array $args): void { foreach (Epc::getFilters()->dump() as $filter) { // test context - if (in_array((string) App::frontend()->ctx->__get('current_tpl'), $filter->page) + if (in_array((string) App::frontend()->context()->__get('current_tpl'), $filter->page) && in_array($tag, $filter->template) && $args[0] != '' //content && empty($args['encode_xml']) diff --git a/src/Widgets.php b/src/Widgets.php index 1c8e3d3..c1c7536 100644 --- a/src/Widgets.php +++ b/src/Widgets.php @@ -87,7 +87,7 @@ class Widgets # Page if (!My::settings()->get('active') - || !in_array(App::frontend()->ctx->__get('current_tpl'), ['post.html', 'page.html']) + || !in_array(App::frontend()->context()->__get('current_tpl'), ['post.html', 'page.html']) ) { return ''; }