From 50bdbd4f5357a040a7536e31bc2843c5b30960cb Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 23 Dec 2022 15:53:17 +0100 Subject: [PATCH] cosmetic --- _install.php | 6 +++--- _widgets.php | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/_install.php b/_install.php index fa9d36d..b97de70 100644 --- a/_install.php +++ b/_install.php @@ -24,8 +24,8 @@ try { } // Table is the same for plugins pollsFactory, postTask, postWidgetText - $s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); - $s->{initPostWidgetText::PWT_TABLE_NAME} + $st = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); + $st->{initPostWidgetText::PWT_TABLE_NAME} ->option_id('bigint', 0, false) ->post_id('bigint', 0, false) ->option_creadt('timestamp', 0, false, 'now()') @@ -42,7 +42,7 @@ try { ->index('idx_post_option_type', 'btree', 'option_type'); $si = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); - $changes = $si->synchronize($s); + $changes = $si->synchronize($st); $current = dcCore::app()->getVersion(basename(__DIR__)); diff --git a/_widgets.php b/_widgets.php index 3859122..39ea547 100644 --- a/_widgets.php +++ b/_widgets.php @@ -53,11 +53,8 @@ class postWidgetTextWidget public static function display($w) { - if ($w->offline) { - return null; - } - - if (!dcCore::app()->blog->settings->get(basename(__DIR__))->get('active') + if ($w->offline + || !dcCore::app()->blog->settings->get(basename(__DIR__))->get('active') || !dcCore::app()->ctx->exists('posts') || !dcCore::app()->ctx->__get('posts')->post_id ) {