From 2cb88bfc335268714e33fbec9d5774dda436cfa1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 2 Jul 2025 21:20:46 +0200 Subject: [PATCH 01/14] =?UTF-8?q?=F0=9F=90=9B=20Add=20basic=20support=20fo?= =?UTF-8?q?r=20Bludit=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 5d1c3743..2c5fe278 100644 --- a/index.php +++ b/index.php @@ -21,6 +21,7 @@ $loadTime = microtime(true); // Security constant define('KOBLOG', true); +define('BLUDIT', true); // Directory separator define('DS', DIRECTORY_SEPARATOR); -- 2.39.5 From 57d9043f0e614c2377d00b382908a49883ec0516 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 2 Jul 2025 21:21:12 +0200 Subject: [PATCH 02/14] =?UTF-8?q?=E2=9C=A8=20Auto-load=20plugins=20in=20bl?= =?UTF-8?q?-modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-kernel/boot/init.php | 2 ++ bl-kernel/boot/rules/60.plugins.php | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index ddd10687..47edb0f9 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -34,6 +34,7 @@ if (DEBUG_MODE) { define('PATH_LANGUAGES', PATH_ROOT . 'bl-languages' . DS); define('PATH_THEMES', PATH_ROOT . 'bl-themes' . DS); define('PATH_PLUGINS', PATH_ROOT . 'bl-plugins' . DS); +define('PATH_MODULES', PATH_ROOT . 'bl-modules' . DS); define('PATH_KERNEL', PATH_ROOT . 'bl-kernel' . DS); define('PATH_CONTENT', PATH_ROOT . 'bl-content' . DS); @@ -188,6 +189,7 @@ define('HTML_PATH_UPLOADS_PAGES', HTML_PATH_UPLOADS . 'pages/'); define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS . 'profiles/'); define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS . 'thumbnails/'); define('HTML_PATH_PLUGINS', HTML_PATH_ROOT . 'bl-plugins/'); +define('HTML_PATH_MODULES', HTML_PATH_ROOT . 'bl-modules/'); // --- Objects with dependency --- $language = new Language($site->language()); diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index d6c48e74..484bd7d0 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -49,7 +49,7 @@ $pluginsInstalled = array(); // Functions // ============================================================================ -function buildPlugins() +function buildPlugins($path, $autoActivate = false) { global $plugins; global $pluginsEvents; @@ -61,7 +61,7 @@ function buildPlugins() $currentDeclaredClasess = get_declared_classes(); // List plugins directories - $list = Filesystem::listDirectories(PATH_PLUGINS); + $list = Filesystem::listDirectories($path); // Load each plugin clasess foreach ($list as $pluginPath) { // Check if the directory has the plugin.php @@ -100,7 +100,7 @@ function buildPlugins() $plugins['all'][$pluginClass] = $Plugin; // If the plugin is installed insert on the hooks - if ($Plugin->installed()) { + if ($Plugin->installed() || $autoActivate) { // Include custom hooks if (!empty($Plugin->customHooks)) { foreach ($Plugin->customHooks as $customHook) { @@ -131,4 +131,5 @@ function buildPlugins() // Main // ============================================================================ -buildPlugins(); +buildPlugins(PATH_PLUGINS); +buildPlugins(PATH_MODULES, true); -- 2.39.5 From aaaddc84d9972e9da9db57b92b9290016ceed3f1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 2 Jul 2025 21:32:24 +0200 Subject: [PATCH 03/14] =?UTF-8?q?=F0=9F=92=84=20Don't=20show=20module=20in?= =?UTF-8?q?=20the=20plugin=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They're always active anyway --- bl-kernel/abstract/plugin.class.php | 4 ++++ bl-kernel/admin/views/plugins.php | 2 +- bl-kernel/boot/rules/60.plugins.php | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bl-kernel/abstract/plugin.class.php b/bl-kernel/abstract/plugin.class.php index e514748e..9d2a1c46 100644 --- a/bl-kernel/abstract/plugin.class.php +++ b/bl-kernel/abstract/plugin.class.php @@ -191,6 +191,10 @@ class Plugin return $this->getMetadata('releaseDate'); } + public function isModule() { + return $this->getMetadata('isModule'); + } + public function className() { return $this->className; diff --git a/bl-kernel/admin/views/plugins.php b/bl-kernel/admin/views/plugins.php index ec8a6cb9..ee659935 100644 --- a/bl-kernel/admin/views/plugins.php +++ b/bl-kernel/admin/views/plugins.php @@ -37,7 +37,7 @@ echo ' // Show installed plugins foreach ($pluginsInstalled as $plugin) { - if ($plugin->type() == 'theme' || $plugin->type() == 'widget') { + if ($plugin->type() == 'theme' || $plugin->type() == 'widget' || $plugin->isModule()) { // Do not display theme's plugins continue; } diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index 484bd7d0..87a80198 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -77,9 +77,9 @@ function buildPlugins($path, $autoActivate = false) $Plugin = new $pluginClass; // Check if the plugin is translated - $languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$site->language().'.json'; + $languageFilename = $path.$Plugin->directoryName().DS.'languages'.DS.$site->language().'.json'; if (!Sanitize::pathFile($languageFilename)) { - $languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.DEFAULT_LANGUAGE_FILE; + $languageFilename = $path.$Plugin->directoryName().DS.'languages'.DS.DEFAULT_LANGUAGE_FILE; } $database = file_get_contents($languageFilename); @@ -88,6 +88,7 @@ function buildPlugins($path, $autoActivate = false) // Set name and description from the language file $Plugin->setMetadata('name',$database['plugin-data']['name']); $Plugin->setMetadata('description',$database['plugin-data']['description']); + $Plugin->setMetadata('isModule',$autoActivate); // Remove name and description from the language file loaded and add new words if there are // This function overwrite the key=>value -- 2.39.5 From edf71f9a40a1515c053118d137408c3b6907d59d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 2 Jul 2025 21:33:13 +0200 Subject: [PATCH 04/14] =?UTF-8?q?=F0=9F=9A=9A=20Make=20the=20canonical=20u?= =?UTF-8?q?rl=20plugin=20a=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {bl-plugins => bl-modules}/canonical/languages/da.json | 0 {bl-plugins => bl-modules}/canonical/languages/de_CH.json | 0 {bl-plugins => bl-modules}/canonical/languages/de_DE.json | 0 {bl-plugins => bl-modules}/canonical/languages/en.json | 0 {bl-plugins => bl-modules}/canonical/languages/es.json | 0 {bl-plugins => bl-modules}/canonical/languages/fa_IR.json | 0 {bl-plugins => bl-modules}/canonical/languages/fr_FR.json | 0 {bl-plugins => bl-modules}/canonical/languages/it.json | 0 {bl-plugins => bl-modules}/canonical/languages/ja_JP.json | 0 {bl-plugins => bl-modules}/canonical/languages/nl_NL.json | 0 {bl-plugins => bl-modules}/canonical/languages/ru.json | 0 {bl-plugins => bl-modules}/canonical/languages/ru_RU.json | 0 {bl-plugins => bl-modules}/canonical/metadata.json | 0 {bl-plugins => bl-modules}/canonical/plugin.php | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {bl-plugins => bl-modules}/canonical/languages/da.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/de_CH.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/de_DE.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/en.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/es.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/fa_IR.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/fr_FR.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/it.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/ja_JP.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/nl_NL.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/ru.json (100%) rename {bl-plugins => bl-modules}/canonical/languages/ru_RU.json (100%) rename {bl-plugins => bl-modules}/canonical/metadata.json (100%) rename {bl-plugins => bl-modules}/canonical/plugin.php (100%) diff --git a/bl-plugins/canonical/languages/da.json b/bl-modules/canonical/languages/da.json similarity index 100% rename from bl-plugins/canonical/languages/da.json rename to bl-modules/canonical/languages/da.json diff --git a/bl-plugins/canonical/languages/de_CH.json b/bl-modules/canonical/languages/de_CH.json similarity index 100% rename from bl-plugins/canonical/languages/de_CH.json rename to bl-modules/canonical/languages/de_CH.json diff --git a/bl-plugins/canonical/languages/de_DE.json b/bl-modules/canonical/languages/de_DE.json similarity index 100% rename from bl-plugins/canonical/languages/de_DE.json rename to bl-modules/canonical/languages/de_DE.json diff --git a/bl-plugins/canonical/languages/en.json b/bl-modules/canonical/languages/en.json similarity index 100% rename from bl-plugins/canonical/languages/en.json rename to bl-modules/canonical/languages/en.json diff --git a/bl-plugins/canonical/languages/es.json b/bl-modules/canonical/languages/es.json similarity index 100% rename from bl-plugins/canonical/languages/es.json rename to bl-modules/canonical/languages/es.json diff --git a/bl-plugins/canonical/languages/fa_IR.json b/bl-modules/canonical/languages/fa_IR.json similarity index 100% rename from bl-plugins/canonical/languages/fa_IR.json rename to bl-modules/canonical/languages/fa_IR.json diff --git a/bl-plugins/canonical/languages/fr_FR.json b/bl-modules/canonical/languages/fr_FR.json similarity index 100% rename from bl-plugins/canonical/languages/fr_FR.json rename to bl-modules/canonical/languages/fr_FR.json diff --git a/bl-plugins/canonical/languages/it.json b/bl-modules/canonical/languages/it.json similarity index 100% rename from bl-plugins/canonical/languages/it.json rename to bl-modules/canonical/languages/it.json diff --git a/bl-plugins/canonical/languages/ja_JP.json b/bl-modules/canonical/languages/ja_JP.json similarity index 100% rename from bl-plugins/canonical/languages/ja_JP.json rename to bl-modules/canonical/languages/ja_JP.json diff --git a/bl-plugins/canonical/languages/nl_NL.json b/bl-modules/canonical/languages/nl_NL.json similarity index 100% rename from bl-plugins/canonical/languages/nl_NL.json rename to bl-modules/canonical/languages/nl_NL.json diff --git a/bl-plugins/canonical/languages/ru.json b/bl-modules/canonical/languages/ru.json similarity index 100% rename from bl-plugins/canonical/languages/ru.json rename to bl-modules/canonical/languages/ru.json diff --git a/bl-plugins/canonical/languages/ru_RU.json b/bl-modules/canonical/languages/ru_RU.json similarity index 100% rename from bl-plugins/canonical/languages/ru_RU.json rename to bl-modules/canonical/languages/ru_RU.json diff --git a/bl-plugins/canonical/metadata.json b/bl-modules/canonical/metadata.json similarity index 100% rename from bl-plugins/canonical/metadata.json rename to bl-modules/canonical/metadata.json diff --git a/bl-plugins/canonical/plugin.php b/bl-modules/canonical/plugin.php similarity index 100% rename from bl-plugins/canonical/plugin.php rename to bl-modules/canonical/plugin.php -- 2.39.5 From 4d207bcdd87a5c95fdb8f50c5671e5ef6d076191 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 09:24:58 +0200 Subject: [PATCH 05/14] =?UTF-8?q?=F0=9F=9A=9A=20Make=20RSS=20a=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rss/languages/da.json | 0 .../rss/languages/de_CH.json | 0 .../rss/languages/de_DE.json | 0 .../rss/languages/en.json | 0 .../rss/languages/es.json | 0 .../rss/languages/fa_IR.json | 0 .../rss/languages/fr_FR.json | 0 .../rss/languages/it.json | 0 .../rss/languages/ja_JP.json | 0 .../rss/languages/nl_NL.json | 0 .../rss/languages/ru_RU.json | 0 .../rss/languages/tr_TR.json | 0 {bl-plugins => bl-modules}/rss/metadata.json | 0 {bl-plugins => bl-modules}/rss/plugin.php | 29 +------------------ 14 files changed, 1 insertion(+), 28 deletions(-) rename {bl-plugins => bl-modules}/rss/languages/da.json (100%) rename {bl-plugins => bl-modules}/rss/languages/de_CH.json (100%) rename {bl-plugins => bl-modules}/rss/languages/de_DE.json (100%) rename {bl-plugins => bl-modules}/rss/languages/en.json (100%) rename {bl-plugins => bl-modules}/rss/languages/es.json (100%) rename {bl-plugins => bl-modules}/rss/languages/fa_IR.json (100%) rename {bl-plugins => bl-modules}/rss/languages/fr_FR.json (100%) rename {bl-plugins => bl-modules}/rss/languages/it.json (100%) rename {bl-plugins => bl-modules}/rss/languages/ja_JP.json (100%) rename {bl-plugins => bl-modules}/rss/languages/nl_NL.json (100%) rename {bl-plugins => bl-modules}/rss/languages/ru_RU.json (100%) rename {bl-plugins => bl-modules}/rss/languages/tr_TR.json (100%) rename {bl-plugins => bl-modules}/rss/metadata.json (100%) rename {bl-plugins => bl-modules}/rss/plugin.php (77%) diff --git a/bl-plugins/rss/languages/da.json b/bl-modules/rss/languages/da.json similarity index 100% rename from bl-plugins/rss/languages/da.json rename to bl-modules/rss/languages/da.json diff --git a/bl-plugins/rss/languages/de_CH.json b/bl-modules/rss/languages/de_CH.json similarity index 100% rename from bl-plugins/rss/languages/de_CH.json rename to bl-modules/rss/languages/de_CH.json diff --git a/bl-plugins/rss/languages/de_DE.json b/bl-modules/rss/languages/de_DE.json similarity index 100% rename from bl-plugins/rss/languages/de_DE.json rename to bl-modules/rss/languages/de_DE.json diff --git a/bl-plugins/rss/languages/en.json b/bl-modules/rss/languages/en.json similarity index 100% rename from bl-plugins/rss/languages/en.json rename to bl-modules/rss/languages/en.json diff --git a/bl-plugins/rss/languages/es.json b/bl-modules/rss/languages/es.json similarity index 100% rename from bl-plugins/rss/languages/es.json rename to bl-modules/rss/languages/es.json diff --git a/bl-plugins/rss/languages/fa_IR.json b/bl-modules/rss/languages/fa_IR.json similarity index 100% rename from bl-plugins/rss/languages/fa_IR.json rename to bl-modules/rss/languages/fa_IR.json diff --git a/bl-plugins/rss/languages/fr_FR.json b/bl-modules/rss/languages/fr_FR.json similarity index 100% rename from bl-plugins/rss/languages/fr_FR.json rename to bl-modules/rss/languages/fr_FR.json diff --git a/bl-plugins/rss/languages/it.json b/bl-modules/rss/languages/it.json similarity index 100% rename from bl-plugins/rss/languages/it.json rename to bl-modules/rss/languages/it.json diff --git a/bl-plugins/rss/languages/ja_JP.json b/bl-modules/rss/languages/ja_JP.json similarity index 100% rename from bl-plugins/rss/languages/ja_JP.json rename to bl-modules/rss/languages/ja_JP.json diff --git a/bl-plugins/rss/languages/nl_NL.json b/bl-modules/rss/languages/nl_NL.json similarity index 100% rename from bl-plugins/rss/languages/nl_NL.json rename to bl-modules/rss/languages/nl_NL.json diff --git a/bl-plugins/rss/languages/ru_RU.json b/bl-modules/rss/languages/ru_RU.json similarity index 100% rename from bl-plugins/rss/languages/ru_RU.json rename to bl-modules/rss/languages/ru_RU.json diff --git a/bl-plugins/rss/languages/tr_TR.json b/bl-modules/rss/languages/tr_TR.json similarity index 100% rename from bl-plugins/rss/languages/tr_TR.json rename to bl-modules/rss/languages/tr_TR.json diff --git a/bl-plugins/rss/metadata.json b/bl-modules/rss/metadata.json similarity index 100% rename from bl-plugins/rss/metadata.json rename to bl-modules/rss/metadata.json diff --git a/bl-plugins/rss/plugin.php b/bl-modules/rss/plugin.php similarity index 77% rename from bl-plugins/rss/plugin.php rename to bl-modules/rss/plugin.php index 0482f997..705c314b 100644 --- a/bl-plugins/rss/plugin.php +++ b/bl-modules/rss/plugin.php @@ -3,33 +3,6 @@ class pluginRSS extends Plugin { - public function init() - { - // Fields and default values for the database of this plugin - $this->dbFields = array( - 'numberOfItems' => 5 - ); - } - - // Method called on the settings of the plugin on the admin area - public function form() - { - global $L; - - $html = '
'; - $html .= ''; - $html .= '' . Theme::rssUrl() . ''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '' . $L->get('Amount of items to show on the feed') . ''; - $html .= '
'; - - return $html; - } - private function encodeURL($url) { return preg_replace_callback('/[^\x20-\x7f]/', function ($match) { @@ -44,7 +17,7 @@ class pluginRSS extends Plugin global $url; // Amount of pages to show - $numberOfItems = $this->getValue('numberOfItems'); + $numberOfItems = $site->itemsPerPage(); // Get the list of public pages (sticky and static included) $list = $pages->getList( -- 2.39.5 From 944638fa85b1a25b4fe4da984fada66633f608d6 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 11:01:37 +0200 Subject: [PATCH 06/14] =?UTF-8?q?=F0=9F=9A=9A=20Make=20sitemap=20a=20modul?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-kernel/admin/views/settings.php | 13 +++++ bl-kernel/site.class.php | 6 +++ .../sitemap/languages/da.json | 0 .../sitemap/languages/de_CH.json | 0 .../sitemap/languages/de_DE.json | 0 bl-modules/sitemap/languages/en.json | 11 ++++ .../sitemap/languages/es.json | 0 .../sitemap/languages/fa_IR.json | 0 .../sitemap/languages/fr_FR.json | 5 +- .../sitemap/languages/it.json | 0 .../sitemap/languages/ja_JP.json | 4 +- .../sitemap/languages/nl_NL.json | 4 +- .../sitemap/languages/ru_RU.json | 0 .../sitemap/languages/tr.json | 0 .../sitemap/languages/uk_UA.json | 0 .../sitemap/metadata.json | 0 {bl-plugins => bl-modules}/sitemap/plugin.php | 52 +++---------------- bl-plugins/sitemap/languages/en.json | 10 ---- 18 files changed, 43 insertions(+), 62 deletions(-) rename {bl-plugins => bl-modules}/sitemap/languages/da.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/de_CH.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/de_DE.json (100%) create mode 100644 bl-modules/sitemap/languages/en.json rename {bl-plugins => bl-modules}/sitemap/languages/es.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/fa_IR.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/fr_FR.json (58%) rename {bl-plugins => bl-modules}/sitemap/languages/it.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/ja_JP.json (52%) rename {bl-plugins => bl-modules}/sitemap/languages/nl_NL.json (50%) rename {bl-plugins => bl-modules}/sitemap/languages/ru_RU.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/tr.json (100%) rename {bl-plugins => bl-modules}/sitemap/languages/uk_UA.json (100%) rename {bl-plugins => bl-modules}/sitemap/metadata.json (100%) rename {bl-plugins => bl-modules}/sitemap/plugin.php (56%) delete mode 100644 bl-plugins/sitemap/languages/en.json diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index 0f2d6022..a7500e70 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -334,6 +334,19 @@ echo Bootstrap::formInputHidden(array( 'disabled' => Text::isEmpty($site->uriFilters('blog')) )); + echo Bootstrap::cardEnd(); + + echo Bootstrap::cardBegin($L->g('Ping Search Engine')); + + echo Bootstrap::formSelect(array( + 'name' => 'pingSearchEngine', + 'label' => $L->g('Ping Search Engine'), + 'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')), + 'selected' => ($site->pingSearchEngine() ? 'true' : 'false'), + 'class' => '', + 'tip' => $L->g('notifies-google-when-you-created') + )); + echo Bootstrap::cardEnd(); ?> diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php index d340895b..177e5c67 100644 --- a/bl-kernel/site.class.php +++ b/bl-kernel/site.class.php @@ -27,6 +27,7 @@ class Site extends dbJSON 'dateFormat' => 'F j, Y', 'timeFormat' => 'g:i a', 'currentBuild' => 0, + 'pingSearchEngine' => false, 'twitter' => '', 'facebook' => '', 'codepen' => '', @@ -181,6 +182,11 @@ class Site extends dbJSON return $this->getField('markdownParser'); } + public function pingSearchEngine() + { + return $this->getField('pingSearchEngine'); + } + public function twitter() { return $this->getField('twitter'); diff --git a/bl-plugins/sitemap/languages/da.json b/bl-modules/sitemap/languages/da.json similarity index 100% rename from bl-plugins/sitemap/languages/da.json rename to bl-modules/sitemap/languages/da.json diff --git a/bl-plugins/sitemap/languages/de_CH.json b/bl-modules/sitemap/languages/de_CH.json similarity index 100% rename from bl-plugins/sitemap/languages/de_CH.json rename to bl-modules/sitemap/languages/de_CH.json diff --git a/bl-plugins/sitemap/languages/de_DE.json b/bl-modules/sitemap/languages/de_DE.json similarity index 100% rename from bl-plugins/sitemap/languages/de_DE.json rename to bl-modules/sitemap/languages/de_DE.json diff --git a/bl-modules/sitemap/languages/en.json b/bl-modules/sitemap/languages/en.json new file mode 100644 index 00000000..b5391396 --- /dev/null +++ b/bl-modules/sitemap/languages/en.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "Sitemap", + "description": "This plugin generates a sitemap.xml file, which provides the list of pages on your website, this helps search engines organize and filter content from their website." + }, + "sitemap-url": "Sitemap URL", + "notifies-google-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site.", + "notifies-bing-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site.", + "ping-search-engine": "Ping Search Engines" +} diff --git a/bl-plugins/sitemap/languages/es.json b/bl-modules/sitemap/languages/es.json similarity index 100% rename from bl-plugins/sitemap/languages/es.json rename to bl-modules/sitemap/languages/es.json diff --git a/bl-plugins/sitemap/languages/fa_IR.json b/bl-modules/sitemap/languages/fa_IR.json similarity index 100% rename from bl-plugins/sitemap/languages/fa_IR.json rename to bl-modules/sitemap/languages/fa_IR.json diff --git a/bl-plugins/sitemap/languages/fr_FR.json b/bl-modules/sitemap/languages/fr_FR.json similarity index 58% rename from bl-plugins/sitemap/languages/fr_FR.json rename to bl-modules/sitemap/languages/fr_FR.json index b9a9c6ce..cf8bfc66 100644 --- a/bl-plugins/sitemap/languages/fr_FR.json +++ b/bl-modules/sitemap/languages/fr_FR.json @@ -5,6 +5,7 @@ "description": "Ce plugin génère un fichier sitemap.xml, qui fournit la liste des pages de votre site, ce qui aide les moteurs de recherche à organiser et filtrer le contenu de votre site." }, "sitemap-url": "URL de votre sitemap.", - "notifies-google-when-you-created": "Notifie à Google lorsque vous avez créé, modifié ou supprimé du contenu sur votre site.", - "notifies-bing-when-you-created": "Notifie Bing lorsque vous avez créé, modifié ou supprimé du contenu sur votre site." + "notifies-google-when-you-created": "Notifie à Google/Bing lorsque vous avez créé, modifié ou supprimé du contenu sur votre site.", + "notifies-bing-when-you-created": "Notifie Google/Bing lorsque vous avez créé, modifié ou supprimé du contenu sur votre site.", + "ping-search-engine": "Ping moteurs de recherche" } diff --git a/bl-plugins/sitemap/languages/it.json b/bl-modules/sitemap/languages/it.json similarity index 100% rename from bl-plugins/sitemap/languages/it.json rename to bl-modules/sitemap/languages/it.json diff --git a/bl-plugins/sitemap/languages/ja_JP.json b/bl-modules/sitemap/languages/ja_JP.json similarity index 52% rename from bl-plugins/sitemap/languages/ja_JP.json rename to bl-modules/sitemap/languages/ja_JP.json index 56af2a7c..adb3168d 100644 --- a/bl-plugins/sitemap/languages/ja_JP.json +++ b/bl-modules/sitemap/languages/ja_JP.json @@ -5,6 +5,6 @@ "description": "This plugin generates a sitemap.xml file, which provides the list of pages on your website, this helps search engines organize and filter content from their website." }, "sitemap-url": "Sitemap URL", - "notifies-google-when-you-created": "Notifies Google when you created, modified or deleted content from your site.", - "notifies-bing-when-you-created": "Notifies Bing when you created, modified or deleted content from your site." + "notifies-google-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site.", + "notifies-bing-when-you-created": "Notifies Google/Bing when you created, modified or deleted content from your site." } diff --git a/bl-plugins/sitemap/languages/nl_NL.json b/bl-modules/sitemap/languages/nl_NL.json similarity index 50% rename from bl-plugins/sitemap/languages/nl_NL.json rename to bl-modules/sitemap/languages/nl_NL.json index 923baef9..4ca30c8a 100644 --- a/bl-plugins/sitemap/languages/nl_NL.json +++ b/bl-modules/sitemap/languages/nl_NL.json @@ -5,6 +5,6 @@ "description": "Deze plugin genereert het bestand sitemap.xml met daarin de structuur van deze website. Zoekmachines kunnen hiervan gebruikmaken bij het organiseren en filteren van de inhoud." }, "sitemap-url": "URL sitemap", - "notifies-google-when-you-created": "Stel Google op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website.", - "notifies-bing-when-you-created": "Stel Bing op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website." + "notifies-google-when-you-created": "Stel Google/Bing op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website.", + "notifies-bing-when-you-created": "Stel Google/Bing op de hoogte bij het aanmaken, bewerken of verwijderen van inhoud op de website." } diff --git a/bl-plugins/sitemap/languages/ru_RU.json b/bl-modules/sitemap/languages/ru_RU.json similarity index 100% rename from bl-plugins/sitemap/languages/ru_RU.json rename to bl-modules/sitemap/languages/ru_RU.json diff --git a/bl-plugins/sitemap/languages/tr.json b/bl-modules/sitemap/languages/tr.json similarity index 100% rename from bl-plugins/sitemap/languages/tr.json rename to bl-modules/sitemap/languages/tr.json diff --git a/bl-plugins/sitemap/languages/uk_UA.json b/bl-modules/sitemap/languages/uk_UA.json similarity index 100% rename from bl-plugins/sitemap/languages/uk_UA.json rename to bl-modules/sitemap/languages/uk_UA.json diff --git a/bl-plugins/sitemap/metadata.json b/bl-modules/sitemap/metadata.json similarity index 100% rename from bl-plugins/sitemap/metadata.json rename to bl-modules/sitemap/metadata.json diff --git a/bl-plugins/sitemap/plugin.php b/bl-modules/sitemap/plugin.php similarity index 56% rename from bl-plugins/sitemap/plugin.php rename to bl-modules/sitemap/plugin.php index 753264bd..19d01d93 100644 --- a/bl-plugins/sitemap/plugin.php +++ b/bl-modules/sitemap/plugin.php @@ -2,45 +2,6 @@ class pluginSitemap extends Plugin { - public function init() - { - $this->dbFields = array( - 'pingGoogle'=>false, - 'pingBing'=>false - ); - } - - // Method called on the settings of the plugin on the admin area - public function form() - { - global $L; - - $html = '
'; - $html .= ''; - $html .= ''.Theme::sitemapUrl().''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''.$L->get('notifies-google-when-you-created').''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= ''.$L->get('notifies-bing-when-you-created').''; - $html .= '
'; - - return $html; - } - private function createXML() { global $site; @@ -80,14 +41,13 @@ class pluginSitemap extends Plugin { private function ping() { - if ($this->getValue('pingGoogle')) { - $url = 'https://www.google.com/ping?sitemap='.Theme::sitemapUrl(); - TCP::http($url, 'GET', true, 3); - } + global $site; + if ($site->pingSearchEngine()) { + $urlGoogle = 'https://www.google.com/ping?sitemap='.Theme::sitemapUrl(); + $urlBing = 'https://www.bing.com/ping?sitemap='.Theme::sitemapUrl(); - if ($this->getValue('pingBing')) { - $url = 'https://www.bing.com/ping?sitemap='.Theme::sitemapUrl(); - TCP::http($url, 'GET', true, 3); + TCP::http($urlGoogle, 'GET', true, 3); + TCP::http($urlBing, 'GET', true, 3); } } diff --git a/bl-plugins/sitemap/languages/en.json b/bl-plugins/sitemap/languages/en.json deleted file mode 100644 index 56af2a7c..00000000 --- a/bl-plugins/sitemap/languages/en.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugin-data": - { - "name": "Sitemap", - "description": "This plugin generates a sitemap.xml file, which provides the list of pages on your website, this helps search engines organize and filter content from their website." - }, - "sitemap-url": "Sitemap URL", - "notifies-google-when-you-created": "Notifies Google when you created, modified or deleted content from your site.", - "notifies-bing-when-you-created": "Notifies Bing when you created, modified or deleted content from your site." -} -- 2.39.5 From 713534fe45098e9e14e36ae79c764e66dc2ad20c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 11:02:09 +0200 Subject: [PATCH 07/14] =?UTF-8?q?=F0=9F=94=A5=20Remove=20the=20API=20plugi?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-plugins/api/languages/da.json | 10 - bl-plugins/api/languages/de_CH.json | 11 - bl-plugins/api/languages/de_DE.json | 11 - bl-plugins/api/languages/en.json | 11 - bl-plugins/api/languages/es.json | 11 - bl-plugins/api/languages/fa_IR.json | 11 - bl-plugins/api/languages/fr_FR.json | 11 - bl-plugins/api/languages/it.json | 11 - bl-plugins/api/languages/ja_JP.json | 11 - bl-plugins/api/languages/nl_NL.json | 11 - bl-plugins/api/languages/ru.json | 11 - bl-plugins/api/languages/tr_TR.json | 11 - bl-plugins/api/metadata.json | 10 - bl-plugins/api/plugin.php | 766 ---------------------------- 14 files changed, 907 deletions(-) delete mode 100644 bl-plugins/api/languages/da.json delete mode 100644 bl-plugins/api/languages/de_CH.json delete mode 100644 bl-plugins/api/languages/de_DE.json delete mode 100644 bl-plugins/api/languages/en.json delete mode 100644 bl-plugins/api/languages/es.json delete mode 100644 bl-plugins/api/languages/fa_IR.json delete mode 100644 bl-plugins/api/languages/fr_FR.json delete mode 100644 bl-plugins/api/languages/it.json delete mode 100644 bl-plugins/api/languages/ja_JP.json delete mode 100644 bl-plugins/api/languages/nl_NL.json delete mode 100644 bl-plugins/api/languages/ru.json delete mode 100644 bl-plugins/api/languages/tr_TR.json delete mode 100644 bl-plugins/api/metadata.json delete mode 100644 bl-plugins/api/plugin.php diff --git a/bl-plugins/api/languages/da.json b/bl-plugins/api/languages/da.json deleted file mode 100644 index 0b308cc7..00000000 --- a/bl-plugins/api/languages/da.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "amount-of-pages": "Antal af sider", - "api-token": "API-token", - "plugin-data": { - "description": "Grænseflade til interaktion med Koblog ved hjælp af HTTP-protokol.
Læs mere om denne udvidelse i API-introduktion.", - "name": "API" - }, - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Dette er det maksimale antal sider, der skal returneres, når du lavet et kald til / api / sider", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Denne token er kun læsbar og regenereres hver gang du installerer udvidelsen." -} diff --git a/bl-plugins/api/languages/de_CH.json b/bl-plugins/api/languages/de_CH.json deleted file mode 100644 index d53bb1ab..00000000 --- a/bl-plugins/api/languages/de_CH.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Schnittstelle, für den Datenaustausch mit Koblog über das HTTP-Protokoll. Informationen zur Verwendung des Plugins unter API Introduction." - }, - "api-token": "API-Token", - "amount-of-pages": "Anzahl Seiten", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Maximum der Seiten bei einem Aufruf /api/pages.", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Der Token kann für Leserechte verwendet werden. Er wird bei bei einer Neuinstallation des Plugins erneuert." -} diff --git a/bl-plugins/api/languages/de_DE.json b/bl-plugins/api/languages/de_DE.json deleted file mode 100644 index d53bb1ab..00000000 --- a/bl-plugins/api/languages/de_DE.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Schnittstelle, für den Datenaustausch mit Koblog über das HTTP-Protokoll. Informationen zur Verwendung des Plugins unter API Introduction." - }, - "api-token": "API-Token", - "amount-of-pages": "Anzahl Seiten", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Maximum der Seiten bei einem Aufruf /api/pages.", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Der Token kann für Leserechte verwendet werden. Er wird bei bei einer Neuinstallation des Plugins erneuert." -} diff --git a/bl-plugins/api/languages/en.json b/bl-plugins/api/languages/en.json deleted file mode 100644 index d69099b9..00000000 --- a/bl-plugins/api/languages/en.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Interface to interact with Koblog using HTTP protocol.
Read more about this plugin on API Introduction." - }, - "api-token": "API Token", - "amount-of-pages": "Amount of pages", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "This is the maximum of pages to return when you call to /api/pages", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "This token is for read only and is regenerated every time you install the plugin" -} \ No newline at end of file diff --git a/bl-plugins/api/languages/es.json b/bl-plugins/api/languages/es.json deleted file mode 100644 index 4832b0cc..00000000 --- a/bl-plugins/api/languages/es.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Interfaz para interactuar con Koblog mediante el protocolo HTTP.
Leer más sobre este plugin en API introducción." - }, - "api-token": "API Token", - "amount-of-pages": "Cantidad de paginas", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Este es el máximo de páginas a devolver cuando llame a /api/pages.", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Este token es para sólo lectura y se regenera cada vez que se instala el plugin." -} \ No newline at end of file diff --git a/bl-plugins/api/languages/fa_IR.json b/bl-plugins/api/languages/fa_IR.json deleted file mode 100644 index 14db32bf..00000000 --- a/bl-plugins/api/languages/fa_IR.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "رابطی برای ارتباط با بلودیت با استفاده از پروتکل HTTP.
اطلاعات بیشتر را درمورد این پلاگین از API Introduction مطالعه کنید." - }, - "api-token": "رمز توکن API", - "amount-of-pages": "تعداد صفحات", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "این حداکثر صفحاتی بازگشتی است هنگامی که /api/pages را بازخوانی می‌کنید", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "این توکن تنها خواندی است و هر زمانی که پلاگین را نصب می کنید بازسازی می شود" -} diff --git a/bl-plugins/api/languages/fr_FR.json b/bl-plugins/api/languages/fr_FR.json deleted file mode 100644 index 8add4c62..00000000 --- a/bl-plugins/api/languages/fr_FR.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Interface pour interagir avec Koblog en utilisant le protocole HTTP.
En savoir plus sur ce plugin, en lisant l’introduction sur l’API." - }, - "api-token": "Jeton de l’API", - "amount-of-pages": "Nombre de pages", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "C’est le nombre maximal de pages à renvoyer lorsque vous appelez l’api par pages.", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Ce jeton est en lecture seule et est régénéré à chaque fois que vous installez le plugin." -} \ No newline at end of file diff --git a/bl-plugins/api/languages/it.json b/bl-plugins/api/languages/it.json deleted file mode 100644 index d41041a7..00000000 --- a/bl-plugins/api/languages/it.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Interfaccia per interagire con Koblog utilizzando il protocollo HTTP.
Leggi di più su questo plugin su API Introduction." - }, - "api-token": "Token API", - "amount-of-pages": "Quantità di pagine", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Questo è il numero di pagine di ritorno quando effetui una chiamata /api/pages", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Questo token è di sola lettura e viene rigenerato ogni volta che installi il plugin" -} \ No newline at end of file diff --git a/bl-plugins/api/languages/ja_JP.json b/bl-plugins/api/languages/ja_JP.json deleted file mode 100644 index 26a1ebc7..00000000 --- a/bl-plugins/api/languages/ja_JP.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "HTTPを使用してKoblogとやり取りするインターフェース。
このプラグインについては API Introduction<\/a> を参照してください。" - }, - "api-token": "APIトークン", - "amount-of-pages": "ページ数", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "これは \/api\/pages 呼び出し時に返される最大ページ数です", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "このトークンは読み取り専用トークンで、プラグインをインストールするたびに再生成されます" -} \ No newline at end of file diff --git a/bl-plugins/api/languages/nl_NL.json b/bl-plugins/api/languages/nl_NL.json deleted file mode 100644 index f339943b..00000000 --- a/bl-plugins/api/languages/nl_NL.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Interface om met Koblog te communiceren via het HTTP-protocol.
Lees meer over deze plugin op
API Introduction." - }, - "api-token": "API-token", - "amount-of-pages": "Aantal pagina's", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Het maximum aantal door te sturen pagina's via een call naar /api/pages", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Dit token is niet aan te passen en wordt automatisch ververst wanneer de plugin opnieuw wordt geïnstalleerd" -} \ No newline at end of file diff --git a/bl-plugins/api/languages/ru.json b/bl-plugins/api/languages/ru.json deleted file mode 100644 index fd59ee4a..00000000 --- a/bl-plugins/api/languages/ru.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "Интерфейс для взаимодействия с Koblog по HTTP-протоколу.
Узнайте больше про этот плагин в разделе Введение в API для Koblog (раздел на английском)." - }, - "api-token": "API Tокен", - "amount-of-pages": "Количество страниц", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Максимальное количество возвращаемых страниц при обращении к /api/pages", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Данный токен используется только для чтения, токен обновляется при каждой переустановке плагина." -} diff --git a/bl-plugins/api/languages/tr_TR.json b/bl-plugins/api/languages/tr_TR.json deleted file mode 100644 index 5390a590..00000000 --- a/bl-plugins/api/languages/tr_TR.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "API", - "description": "HTTP protokolünü kullanarak Koblog ile etkileşimde bulunmak için arabirim.
Bu eklenti hakkında daha fazla bilgi için API Tanıtımı (ingilizce)." - }, - "api-token": "API Token", - "amount-of-pages": "Sayfa miktarı", - "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Bu /api/pages sayfasını çağırdığınızda gösterilecek maksimum sayfa sayısıdır.", - "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Bu token salt okunur amaçlıdır ve eklentiyi her yüklediğinizde yeniden oluşturulur." -} diff --git a/bl-plugins/api/metadata.json b/bl-plugins/api/metadata.json deleted file mode 100644 index c4539610..00000000 --- a/bl-plugins/api/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Koblog", - "email": "", - "website": "https://plugins.koblog.com", - "version": "kb_0.0.1", - "releaseDate": "2024-08-23", - "license": "MIT", - "compatible": "kb_0.0.1", - "notes": "" -} diff --git a/bl-plugins/api/plugin.php b/bl-plugins/api/plugin.php deleted file mode 100644 index 2e175cdc..00000000 --- a/bl-plugins/api/plugin.php +++ /dev/null @@ -1,766 +0,0 @@ -dbFields = array( - 'token' => $token, // API Token - 'numberOfItems' => 15 // Amount of items to return - ); - } - - public function getToken() - { - return $this->getValue('token'); - } - - public function form() - { - global $L; - - $html = ''; - - $html .= '
'; - $html .= ''; - $html .= '

' . DOMAIN_BASE . 'api/{endpoint}

'; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '' . $L->get('This token is for read only and is regenerated every time you install the plugin') . ''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '' . $L->get('This is the maximum of pages to return when you call to') . ''; - $html .= '
'; - - return $html; - } - - - // API HOOKS - // ---------------------------------------------------------------------------- - - public function beforeAll() - { - global $url; - global $pages; - global $users; - - // CHECK URL - // ------------------------------------------------------------ - $URI = $this->webhook('api', $returnsAfterURI = true, $fixed = false); - if ($URI === false) { - return false; - } - - // METHOD - // ------------------------------------------------------------ - $method = $this->getMethod(); - - // METHOD INPUTS - // ------------------------------------------------------------ - $inputs = $this->getMethodInputs(); - if (empty($inputs)) { - $this->response(400, 'Bad Request', array('message' => 'Missing method inputs.')); - } - - // ENDPOINT PARAMETERS - // ------------------------------------------------------------ - $parameters = $this->getEndpointParameters($URI); - if (empty($parameters)) { - $this->response(400, 'Bad Request', array('message' => 'Missing endpoint parameters.')); - } - - // API TOKEN - // ------------------------------------------------------------ - // Token from the plugin, the user can change it on the settings of the plugin - $tokenAPI = $this->getValue('token'); - - // Check empty token - if (empty($inputs['token'])) { - $this->response(400, 'Bad Request', array('message' => 'Missing API token.')); - } - - // Check if the token is valid - if ($inputs['token'] !== $tokenAPI) { - $this->response(401, 'Unauthorized', array('message' => 'Invalid API token.')); - } - - // AUTHENTICATION TOKEN - // ------------------------------------------------------------ - $writePermissions = false; - if (!empty($inputs['authentication'])) { - - // Get the user with the authentication token, FALSE if doesn't exit - $username = $users->getByAuthToken($inputs['authentication']); - if ($username !== false) { - try { - $user = new User($username); - if (($user->role() == 'admin') && ($user->enabled())) { - // Loggin the user to create the session - $login = new Login(); - $login->setLogin($username, 'admin'); - // Enable write permissions - $writePermissions = true; - } - } catch (Exception $e) { - // Continue without permissions - } - } - } - - // Clean inputs - // ------------------------------------------------------------ - unset($inputs['token']); - unset($inputs['authentication']); - - // ENDPOINTS - // ------------------------------------------------------------ - - // (GET) /api/pages - if (($method === 'GET') && ($parameters[0] === 'pages') && empty($parameters[1])) { - $data = $this->getPages($inputs); - } - // (GET) /api/pages/ - elseif (($method === 'GET') && ($parameters[0] === 'pages') && !empty($parameters[1])) { - $pageKey = $parameters[1]; - if (isset($parameters[2])) { - $pageKey = $parameters[1] . '/' . $parameters[2]; - } - $data = $this->getPage($pageKey); - } - // (PUT) /api/pages/ - elseif (($method === 'PUT') && ($parameters[0] === 'pages') && !empty($parameters[1]) && $writePermissions) { - $pageKey = $parameters[1]; - $data = $this->editPage($pageKey, $inputs); - } - // (DELETE) /api/pages/ - elseif (($method === 'DELETE') && ($parameters[0] === 'pages') && !empty($parameters[1]) && $writePermissions) { - $pageKey = $parameters[1]; - $data = $this->deletePage($pageKey); - } - // (POST) /api/pages - elseif (($method === 'POST') && ($parameters[0] === 'pages') && empty($parameters[1]) && $writePermissions) { - $data = $this->createPage($inputs); - } - // (GET) /api/settings - elseif (($method === 'GET') && ($parameters[0] === 'settings') && empty($parameters[1]) && $writePermissions) { - $data = $this->getSettings(); - } - // (PUT) /api/settings - elseif (($method === 'PUT') && ($parameters[0] === 'settings') && empty($parameters[1]) && $writePermissions) { - $data = $this->editSettings($inputs); - } - // (POST) /api/images - elseif (($method === 'POST') && ($parameters[0] === 'images') && $writePermissions) { - $data = $this->uploadImage($inputs); - } - // (GET) /api/tags - elseif (($method === 'GET') && ($parameters[0] === 'tags') && empty($parameters[1])) { - $data = $this->getTags(); - } - // (GET) /api/tags/ - elseif (($method === 'GET') && ($parameters[0] === 'tags') && !empty($parameters[1])) { - $tagKey = $parameters[1]; - $data = $this->getTag($tagKey); - } - // (GET) /api/categories - elseif (($method === 'GET') && ($parameters[0] === 'categories') && empty($parameters[1])) { - $data = $this->getCategories(); - } - // (GET) /api/categories/ - elseif (($method === 'GET') && ($parameters[0] === 'categories') && !empty($parameters[1])) { - $categoryKey = $parameters[1]; - $data = $this->getCategory($categoryKey); - } - // (GET) /api/users - elseif (($method === 'GET') && ($parameters[0] === 'users') && empty($parameters[1])) { - $data = $this->getUsers(); - } - // (GET) /api/users/ - elseif (($method === 'GET') && ($parameters[0] === 'users') && !empty($parameters[1])) { - $username = $parameters[1]; - $data = $this->getUser($username); - } - // (GET) /api/files/ - elseif (($method === 'GET') && ($parameters[0] === 'files') && !empty($parameters[1])) { - $pageKey = $parameters[1]; - $data = $this->getFiles($pageKey); - } - // (POST) /api/files/ - elseif (($method === 'POST') && ($parameters[0] === 'files') && !empty($parameters[1])) { - $pageKey = $parameters[1]; - $data = $this->uploadFile($pageKey); - } else { - $this->response(401, 'Unauthorized', array('message' => 'Access denied or invalid endpoint.')); - } - - $this->response(200, 'OK', $data); - } - - // PRIVATE METHODS - // ---------------------------------------------------------------------------- - - private function getMethod() - { - // METHODS - // ------------------------------------------------------------ - // GET - // POST - // PUT - // DELETE - - $this->method = $_SERVER['REQUEST_METHOD']; - return $this->method; - } - - private function getMethodInputs() - { - switch ($this->method) { - case "POST": - $inputs = $_POST; - break; - case "GET": - case "DELETE": - $inputs = $_GET; - break; - case "PUT": - $inputs = ''; - break; - default: - $inputs = json_encode(array()); - break; - } - - // Try to get raw/json data - if (empty($inputs)) { - $inputs = file_get_contents('php://input'); - } - - return $this->cleanInputs($inputs); - } - - // Returns an array with key=>value with the inputs - // If the content is JSON is parsed to array - private function cleanInputs($inputs) - { - $tmp = array(); - if (is_array($inputs)) { - foreach ($inputs as $key => $value) { - $tmp[$key] = Sanitize::html($value); - } - } elseif (is_string($inputs)) { - $tmp = json_decode($inputs, true); - if (json_last_error() !== JSON_ERROR_NONE) { - $tmp = array(); - } - } - - return $tmp; - } - - private function getEndpointParameters($URI) - { - // ENDPOINT Parameters - // ------------------------------------------------------------ - // /api/pages | GET | returns all pages - // /api/pages/{key} | GET | returns the page with the {key} - // /api/pages | POST | create a new page - - $URI = ltrim($URI, '/'); - $parameters = explode('/', $URI); - - // Sanitize parameters - foreach ($parameters as $key => $value) { - $parameters[$key] = Sanitize::html($value); - } - - return $parameters; - } - - private function response($code = 200, $message = 'OK', $data = array()) - { - header('HTTP/1.1 ' . $code . ' ' . $message); - header('Access-Control-Allow-Origin: *'); - header('Content-Type: application/json'); - $json = json_encode($data); - exit($json); - } - - private function getTags() - { - global $tags; - $tmp = array( - 'status' => '0', - 'message' => 'List of tags.', - 'data' => array() - ); - foreach ($tags->keys() as $key) { - $tag = $tags->getMap($key); - array_push($tmp['data'], $tag); - } - return $tmp; - } - - // Returns the tag information and the pages releated to the tag - // The array with the pages has the complete information of each page - private function getTag($key) - { - try { - $tag = new Tag($key); - } catch (Exception $e) { - return array( - 'status' => '1', - 'message' => 'Tag not found by the key: ' . $key - ); - } - - $list = array(); - foreach ($tag->pages() as $pageKey) { - try { - $page = new Page($pageKey); - array_push($list, $page->json($returnsArray = true)); - } catch (Exception $e) { - } - } - - $data = $tag->json($returnsArray = true); - $data['pages'] = $list; - - return array( - 'status' => '0', - 'message' => 'Information about the tag and pages related.', - 'data' => $data - ); - } - - private function getPages($args) - { - global $pages; - - // Parameters and the default values - $published = (isset($args['published']) ? $args['published'] == 'true' : true); - $static = (isset($args['static']) ? $args['static'] == 'true' : false); - $draft = (isset($args['draft']) ? $args['draft'] == 'true' : false); - $sticky = (isset($args['sticky']) ? $args['sticky'] == 'true' : false); - $scheduled = (isset($args['scheduled']) ? $args['scheduled'] == 'true' : false); - $untagged = (isset($args['untagged']) ? $args['untagged'] == 'true' : false); - - $numberOfItems = (isset($args['numberOfItems']) ? $args['numberOfItems'] : 10); - $pageNumber = (isset($args['pageNumber']) ? $args['pageNumber'] : 1); - $list = $pages->getList($pageNumber, $numberOfItems, $published, $static, $sticky, $draft, $scheduled); - - $tmp = array( - 'status' => '0', - 'message' => 'List of pages', - 'numberOfItems' => $numberOfItems, - 'data' => array() - ); - - foreach ($list as $pageKey) { - try { - // Create the page object from the page key - $page = new Page($pageKey); - if ($untagged) { - if (empty($page->tags())) { - // Push the page to the data array for the response - array_push($tmp['data'], $page->json($returnsArray = true)); - } - } else { - array_push($tmp['data'], $page->json($returnsArray = true)); - } - } catch (Exception $e) { - // Continue - } - } - - return $tmp; - } - - private function getPage($key) - { - try { - $page = new Page($key); - return array( - 'status' => '0', - 'message' => 'Page filtered by key: ' . $key, - 'data' => $page->json($returnsArray = true) - ); - } catch (Exception $e) { - return array( - 'status' => '1', - 'message' => 'Page not found.' - ); - } - } - - private function createPage($args) - { - // Unsanitize content because all values are sanitized - if (isset($args['content'])) { - $args['content'] = Sanitize::htmlDecode($args['content']); - } - - // This function is defined on functions.php - $key = createPage($args); - if ($key === false) { - return array( - 'status' => '1', - 'message' => 'Error trying to create the new page.' - ); - } - - return array( - 'status' => '0', - 'message' => 'Page created.', - 'data' => array('key' => $key) - ); - } - - private function editPage($key, $args) - { - // Unsanitize content because all values are sanitized - if (isset($args['content'])) { - $args['content'] = Sanitize::htmlDecode($args['content']); - } - - $args['key'] = $key; - $newKey = editPage($args); - - if ($newKey === false) { - return array( - 'status' => '1', - 'message' => 'Error trying to edit the page.' - ); - } - - return array( - 'status' => '0', - 'message' => 'Page edited.', - 'data' => array('key' => $newKey) - ); - } - - private function deletePage($key) - { - if (deletePage($key)) { - return array( - 'status' => '0', - 'message' => 'Page deleted.' - ); - } - - return array( - 'status' => '1', - 'message' => 'Error trying to delete the page.' - ); - } - - /* - | Upload an image and generate the thumbnails - | Returns the image and thumbnail URL - | - | @inputs array - | @inputs['uuid'] string Page UUID - | @_FILE array https://www.php.net/manual/en/reserved.variables.files.php - | - | @return array - */ - private function uploadImage($inputs) - { - // Set upload directory - if (isset($inputs['uuid']) && IMAGE_RESTRICT) { - $imageDirectory = PATH_UPLOADS_PAGES . $inputs['uuid'] . DS; - $thumbnailDirectory = $imageDirectory . 'thumbnails' . DS; - $imageEndpoint = DOMAIN_UPLOADS_PAGES . $inputs['uuid'] . '/'; - $thumbnailEndpoint = $imageEndpoint . 'thumbnails' . '/'; - if (!Filesystem::directoryExists($thumbnailDirectory)) { - Filesystem::mkdir($thumbnailDirectory, true); - } - } else { - $imageDirectory = PATH_UPLOADS; - $thumbnailDirectory = PATH_UPLOADS_THUMBNAILS; - $imageEndpoint = DOMAIN_UPLOADS; - $thumbnailEndpoint = DOMAIN_UPLOADS_THUMBNAILS; - } - - if (!isset($_FILES['image'])) { - return array( - 'status' => '1', - 'message' => 'No image sent.' - ); - } - - if ($_FILES['image']['error'] != 0) { - return array( - 'status' => '1', - 'message' => 'Error uploading the image, maximum load file size allowed: ' . ini_get('upload_max_filesize') - ); - } - - // Move from PHP tmp file to Koblog tmp directory - Filesystem::mv($_FILES['image']['tmp_name'], PATH_TMP . $_FILES['image']['name']); - - // Transform image and create thumbnails - $image = transformImage(PATH_TMP . $_FILES['image']['name'], $imageDirectory, $thumbnailDirectory); - if ($image) { - $filename = Filesystem::filename($image); - return array( - 'status' => '0', - 'message' => 'Image uploaded.', - 'image' => $imageEndpoint . $filename, - 'thumbnail' => $thumbnailEndpoint . $filename - ); - } - - return array( - 'status' => '1', - 'message' => 'Image extension not allowed.' - ); - } - - /* - | Get the settings - | - | @args array - | - | @return array - */ - private function getSettings() - { - global $site; - return array( - 'status' => '0', - 'message' => 'Settings.', - 'data' => $site->get() - ); - } - - /* - | Edit the settings - | You can edit any field defined in the class site.class.php variable $dbFields - | - | @args array - | - | @return array - */ - private function editSettings($args) - { - if (editSettings($args)) { - return array( - 'status' => '0', - 'message' => 'Settings edited.' - ); - } - return array( - 'status' => '1', - 'message' => 'Error trying to edit the settings.' - ); - } - - /* - | Returns the categories in the system - | Included the category name, key, description and the list of pages - | The list of pages are the page's key - | - | @return array - */ - private function getCategories() - { - global $categories; - $tmp = array( - 'status' => '0', - 'message' => 'List of categories.', - 'data' => array() - ); - foreach ($categories->keys() as $key) { - $category = $categories->getMap($key); - array_push($tmp['data'], $category); - } - return $tmp; - } - - /* - | Returns information about the category and pages related - | The pages are expanded which mean the title, content and more fields are returned in the query - | This can degrade the performance - | - | @key string Category key - | - | @return array - */ - private function getCategory($key) - { - try { - $category = new Category($key); - } catch (Exception $e) { - return array( - 'status' => '1', - 'message' => 'Category not found by the key: ' . $key - ); - } - - $list = array(); - foreach ($category->pages() as $pageKey) { - try { - $page = new Page($pageKey); - array_push($list, $page->json($returnsArray = true)); - } catch (Exception $e) { - } - } - - $data = $category->json($returnsArray = true); - $data['pages'] = $list; - - return array( - 'status' => '0', - 'message' => 'Information about the category and pages related.', - 'data' => $data - ); - } - - /* - | Returns the user profile - | - | @username string Username - | - | @return array - */ - private function getUser($username) - { - try { - $user = new User($username); - } catch (Exception $e) { - return array( - 'status' => '1', - 'message' => 'User not found by username: ' . $username - ); - } - - $data = $user->json($returnsArray = true); - return array( - 'status' => '0', - 'message' => 'User profile.', - 'data' => $data - ); - } - - /* - | Returns all the users - | - | @return array - */ - private function getUsers() - { - global $users; - $data = array(); - foreach ($users->db as $username => $profile) { - try { - $user = new User($username); - $data[$username] = $user->json($returnsArray = true); - } catch (Exception $e) { - continue; - } - } - - return array( - 'status' => '0', - 'message' => 'Users profiles.', - 'data' => $data - ); - } - - /* - | Returns all files uploaded for a specific page, includes any type of file. - | - | @return array - */ - private function getFiles($pageKey) - { - $chunk = false; - $sortByDate = true; - $path = PATH_UPLOADS_PAGES . $pageKey . DS; - $listFiles = Filesystem::listFiles($path, '*', '*', $sortByDate, $chunk); - - $files = array(); - foreach ($listFiles as $file) { - $info = array('thumbnail' => ''); - $info['file'] = $file; - $info['filename'] = basename($file); - $info['mime'] = Filesystem::mimeType($file); - $info['size'] = Filesystem::getSize($file); - - // Check if thumbnail exists for the file - $thumbnail = $path . 'thumbnails' . DS . $info['filename']; - if (Filesystem::fileExists($thumbnail)) { - $info['thumbnail'] = $thumbnail; - } - - array_push($files, $info); - } - - return array( - 'status' => '0', - 'message' => 'Files for the page key: ' . $pageKey, - 'data' => $files - ); - } - - /* - | Upload a file to a particular page - | Returns the file URL - | - | @inputs array - | @inputs['uuid'] string Page UUID - | @_FILE array https://www.php.net/manual/en/reserved.variables.files.php - | - | @return array - */ - private function uploadFile($pageKey) - { - if (!isset($_FILES['file'])) { - return array( - 'status' => '1', - 'message' => 'File not sent.' - ); - } - - if ($_FILES['file']['error'] != 0) { - return array( - 'status' => '1', - 'message' => 'Error uploading the file.' - ); - } - - $filename = $_FILES['file']['name']; - $absoluteURL = DOMAIN_UPLOADS_PAGES . $pageKey . DS . $filename; - $absolutePath = PATH_UPLOADS_PAGES . $pageKey . DS . $filename; - if (Filesystem::mv($_FILES['file']['tmp_name'], $absolutePath)) { - return array( - 'status' => '0', - 'message' => 'File uploaded.', - 'filename' => $filename, - 'absolutePath' => $absolutePath, - 'absoluteURL' => $absoluteURL - ); - } - - return array( - 'status' => '1', - 'message' => 'Error moving the file to the final path.' - ); - } -} -- 2.39.5 From 9a4e606607abe5662040a0949b97c8f759312dcd Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 11:02:33 +0200 Subject: [PATCH 08/14] =?UTF-8?q?=F0=9F=94=A5=20Remove=20the=20disqus=20pl?= =?UTF-8?q?ugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-plugins/disqus/languages/da.json | 11 --- bl-plugins/disqus/languages/de_CH.json | 12 --- bl-plugins/disqus/languages/de_DE.json | 12 --- bl-plugins/disqus/languages/en.json | 12 --- bl-plugins/disqus/languages/es.json | 12 --- bl-plugins/disqus/languages/fa_IR.json | 12 --- bl-plugins/disqus/languages/fr_FR.json | 12 --- bl-plugins/disqus/languages/it.json | 12 --- bl-plugins/disqus/languages/ja_JP.json | 12 --- bl-plugins/disqus/languages/nl_NL.json | 12 --- bl-plugins/disqus/languages/pl_PL.json | 12 --- bl-plugins/disqus/languages/ru_RU.json | 12 --- bl-plugins/disqus/languages/tr_TR.json | 12 --- bl-plugins/disqus/languages/uk_UA.json | 12 --- bl-plugins/disqus/metadata.json | 10 --- bl-plugins/disqus/plugin.php | 108 ------------------------- 16 files changed, 285 deletions(-) delete mode 100644 bl-plugins/disqus/languages/da.json delete mode 100644 bl-plugins/disqus/languages/de_CH.json delete mode 100644 bl-plugins/disqus/languages/de_DE.json delete mode 100644 bl-plugins/disqus/languages/en.json delete mode 100644 bl-plugins/disqus/languages/es.json delete mode 100644 bl-plugins/disqus/languages/fa_IR.json delete mode 100644 bl-plugins/disqus/languages/fr_FR.json delete mode 100644 bl-plugins/disqus/languages/it.json delete mode 100644 bl-plugins/disqus/languages/ja_JP.json delete mode 100644 bl-plugins/disqus/languages/nl_NL.json delete mode 100644 bl-plugins/disqus/languages/pl_PL.json delete mode 100644 bl-plugins/disqus/languages/ru_RU.json delete mode 100644 bl-plugins/disqus/languages/tr_TR.json delete mode 100644 bl-plugins/disqus/languages/uk_UA.json delete mode 100644 bl-plugins/disqus/metadata.json delete mode 100644 bl-plugins/disqus/plugin.php diff --git a/bl-plugins/disqus/languages/da.json b/bl-plugins/disqus/languages/da.json deleted file mode 100644 index 9d69b63c..00000000 --- a/bl-plugins/disqus/languages/da.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "disqus-shortname": "Disqus kortnavn", - "enable-disqus-on-pages": "Disqus på sider", - "enable-disqus-on-static-pages": "Disqus på statiske sider", - "enable-disqus-on-sticky-pages": "Disqus på fastgjorde sider", - "get-the-shortname-from-the-disqus-general-settings": "Hent det korte navn fra Disqus generelle indstillinger", - "plugin-data": { - "description": "Disqus er en kommentar hostingstjeneste til websteder.
Det er nødvendigt at være registreret på Disqus for at bruge denne service.", - "name": "Disqus" - } -} diff --git a/bl-plugins/disqus/languages/de_CH.json b/bl-plugins/disqus/languages/de_CH.json deleted file mode 100644 index 5ccdbe8f..00000000 --- a/bl-plugins/disqus/languages/de_CH.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "Disqus ist eine Kommentar-Plattform für Websites. Um das Plugin verwenden zu können, muss ein Konto bei Disqus eingerichtet werden." - }, - "disqus-shortname": "Disqus-Kurzname (Shortname)", - "enable-disqus-on-pages": "Disqus auf Seiten", - "enable-disqus-on-static-pages": "Disqus auf statischen Seiten", - "enable-disqus-on-sticky-pages": "Disqus bei fixierten Inhalten", - "get-the-shortname-from-the-disqus-general-settings": "Der Kurzname wird bei Disqus unter \"Settings\" > \"General\" angezeigt." -} diff --git a/bl-plugins/disqus/languages/de_DE.json b/bl-plugins/disqus/languages/de_DE.json deleted file mode 100644 index 5ccdbe8f..00000000 --- a/bl-plugins/disqus/languages/de_DE.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "Disqus ist eine Kommentar-Plattform für Websites. Um das Plugin verwenden zu können, muss ein Konto bei Disqus eingerichtet werden." - }, - "disqus-shortname": "Disqus-Kurzname (Shortname)", - "enable-disqus-on-pages": "Disqus auf Seiten", - "enable-disqus-on-static-pages": "Disqus auf statischen Seiten", - "enable-disqus-on-sticky-pages": "Disqus bei fixierten Inhalten", - "get-the-shortname-from-the-disqus-general-settings": "Der Kurzname wird bei Disqus unter \"Settings\" > \"General\" angezeigt." -} diff --git a/bl-plugins/disqus/languages/en.json b/bl-plugins/disqus/languages/en.json deleted file mode 100644 index 17cd2339..00000000 --- a/bl-plugins/disqus/languages/en.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "Disqus is a comment hosting service for web sites.
It's necessary to be registered on Disqus to use this service." - }, - "disqus-shortname": "Disqus shortname", - "enable-disqus-on-pages": "Disqus on pages", - "enable-disqus-on-static-pages": "Disqus on static pages", - "enable-disqus-on-sticky-pages": "Disqus on sticky pages", - "get-the-shortname-from-the-disqus-general-settings": "Get the shortname from the Disqus general settings" -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/es.json b/bl-plugins/disqus/languages/es.json deleted file mode 100644 index 9119cf0d..00000000 --- a/bl-plugins/disqus/languages/es.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "Disqus es un servicio de comentarios online.
Es necesario registrarse en Disqus antes de utilizar este plugin." - }, - "disqus-shortname": "Disqus shortname", - "enable-disqus-on-pages": "Disqus en página", - "enable-disqus-on-static-pages": "Disqus en página estaticas", - "enable-disqus-on-sticky-pages": "Disqus en página sticky", - "get-the-shortname-from-the-disqus-general-settings": "Puede obtener el shortname en la página de configuración de Disqus." -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/fa_IR.json b/bl-plugins/disqus/languages/fa_IR.json deleted file mode 100644 index c8cbc555..00000000 --- a/bl-plugins/disqus/languages/fa_IR.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "دیسکاس", - "description": "دیسکاس یک سرویس اینترنتی ارسال دیدگاه برای وبسایت ها می‌باشد.
برای استفاده از این سرویس لازم است که در Disqus ثبت نام کنید." - }, - "disqus-shortname": "نام کوتاه دیسکاس", - "enable-disqus-on-pages": "دیسکاس در صفحات", - "enable-disqus-on-static-pages": "دیسکاس در صفحات استاتیک", - "enable-disqus-on-sticky-pages": "دیسکاس در صفحات چسبنده", - "get-the-shortname-from-the-disqus-general-settings": "دریافت نام کوتاه از تنظیمات عمومی دیسکاس" -} diff --git a/bl-plugins/disqus/languages/fr_FR.json b/bl-plugins/disqus/languages/fr_FR.json deleted file mode 100644 index 7f412942..00000000 --- a/bl-plugins/disqus/languages/fr_FR.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus système de commentaire", - "description": "Disqus est un service Web de discussion et de commentaires d'articles centralisé avec authentification unique. Il est nécessaire de s’inscrire sur Disqus.com avant d’utiliser ce plugin." - }, - "disqus-shortname": "Votre ID Disqus", - "enable-disqus-on-pages": "Disqus sur les pages", - "enable-disqus-on-static-pages": "Disqus sur les pages statiques", - "enable-disqus-on-sticky-pages": "Disqus sur les pages épinglées", - "get-the-shortname-from-the-disqus-general-settings": "Obtenez votre ID à partir des paramètres généraux de Disqus." -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/it.json b/bl-plugins/disqus/languages/it.json deleted file mode 100644 index dee4b46f..00000000 --- a/bl-plugins/disqus/languages/it.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "Disqus è un servizio di hosting per i commenti sui siti web.
E' neccesario essere resitrati su Disqus per utilizzare questo servizio." - }, - "disqus-shortname": "Nome Breve Disqus ", - "enable-disqus-on-pages": "Disqus sulle pagine", - "enable-disqus-on-static-pages": "Disqus sulle pagine statiche", - "enable-disqus-on-sticky-pages": "Disqus sulle pagine sticky", - "get-the-shortname-from-the-disqus-general-settings": "Acquisisci il nome utente da utilizzare dalle impostazioni generali di Disqus" -} diff --git a/bl-plugins/disqus/languages/ja_JP.json b/bl-plugins/disqus/languages/ja_JP.json deleted file mode 100644 index 9837be40..00000000 --- a/bl-plugins/disqus/languages/ja_JP.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "DisqusはWebサイト向けのコメントホスティングサービスです。このサービスを利用するには、Disqus<\/a>に登録する必要があります。" - }, - "disqus-shortname": "Disqusショートネーム", - "enable-disqus-on-pages": "ページにDisqusを使用", - "enable-disqus-on-static-pages": "固定ページにDisqusを使用", - "enable-disqus-on-sticky-pages": "先頭固定ページにDisqusを使用", - "get-the-shortname-from-the-disqus-general-settings": "Disqus一般設定からショートネームを取得します" -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/nl_NL.json b/bl-plugins/disqus/languages/nl_NL.json deleted file mode 100644 index c534c61a..00000000 --- a/bl-plugins/disqus/languages/nl_NL.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus", - "description": "Disqus is hosting service om reacties in websites te implementeren.
Registratie op Disqus.com is nodig voordat deze plugin gebruikt kan gebruiken." - }, - "disqus-shortname": "Disqus shortname", - "enable-disqus-on-pages": "Disqus op pagina's tonen", - "enable-disqus-on-static-pages": "Disqus on statische pagina's tonen", - "enable-disqus-on-sticky-pages": "Disqus on vastgezette pagina's tonen", - "get-the-shortname-from-the-disqus-general-settings": "De shortname is te verkrijgen via de algemene instellingen van Disqus" -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/pl_PL.json b/bl-plugins/disqus/languages/pl_PL.json deleted file mode 100644 index b02aeac0..00000000 --- a/bl-plugins/disqus/languages/pl_PL.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "System komentarzy - Disqus", - "description": "System komentarzy Disqus przechowuje komentarze dla serwisów internetowych. Korzystanie z tej wtyczki wymaga rejestracji w serwisie disqus.com." - }, - "disqus-shortname": "Nazwa użytkownika Disqus", - "enable-disqus-on-pages": "Disqus on pages", - "enable-disqus-on-static-pages": "Disqus on static pages", - "enable-disqus-on-sticky-pages": "Disqus on sticky pages", - "get-the-shortname-from-the-disqus-general-settings": "Get the shortname from the Disqus general settings" -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/ru_RU.json b/bl-plugins/disqus/languages/ru_RU.json deleted file mode 100644 index cce4ebe6..00000000 --- a/bl-plugins/disqus/languages/ru_RU.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Комментарии Disqus", - "description": "Disqus это сервис комментариев для сайтов и блогов. Необходимо зарегистрироваться на Disqus.com перед тем как использовать плагина." - }, - "disqus-shortname": "Краткое имя Disqus", - "enable-disqus-on-pages": "Disqus для страниц", - "enable-disqus-on-static-pages": "Disqus для статических страниц", - "enable-disqus-on-sticky-pages": "Disqus для прикреплённых страниц", - "get-the-shortname-from-the-disqus-general-settings": "Получить краткое имя со страницы общих настроек Disqus" -} diff --git a/bl-plugins/disqus/languages/tr_TR.json b/bl-plugins/disqus/languages/tr_TR.json deleted file mode 100644 index 21ded716..00000000 --- a/bl-plugins/disqus/languages/tr_TR.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Disqus Yorum Sistemi", - "description": "Disqus siteler için yorum barındırması yapan bir firmadır. Eklentiyi kullanmadan önce Disqus.com adresine kayıt olmanız gerekmektedir." - }, - "disqus-shortname": "Disqus shortname", - "enable-disqus-on-pages": "Disqus on pages", - "enable-disqus-on-static-pages": "Disqus on static pages", - "enable-disqus-on-sticky-pages": "Disqus on sticky pages", - "get-the-shortname-from-the-disqus-general-settings": "Get the shortname from the Disqus general settings" -} \ No newline at end of file diff --git a/bl-plugins/disqus/languages/uk_UA.json b/bl-plugins/disqus/languages/uk_UA.json deleted file mode 100644 index f41c5146..00000000 --- a/bl-plugins/disqus/languages/uk_UA.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "plugin-data": - { - "name": "Система коментарів Disqus", - "description": "Disqus надає послуги хостингу коментарів для веб-сайтів. Необхідно зареєструватися на Disqus.com перед використанням цього плагіна." - }, - "disqus-shortname": "Коротке ім'я в Disqus", - "enable-disqus-on-pages": "Disqus on pages", - "enable-disqus-on-static-pages": "Disqus on static pages", - "enable-disqus-on-sticky-pages": "Disqus on sticky pages", - "get-the-shortname-from-the-disqus-general-settings": "Get the shortname from the Disqus general settings" -} \ No newline at end of file diff --git a/bl-plugins/disqus/metadata.json b/bl-plugins/disqus/metadata.json deleted file mode 100644 index c4539610..00000000 --- a/bl-plugins/disqus/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Koblog", - "email": "", - "website": "https://plugins.koblog.com", - "version": "kb_0.0.1", - "releaseDate": "2024-08-23", - "license": "MIT", - "compatible": "kb_0.0.1", - "notes": "" -} diff --git a/bl-plugins/disqus/plugin.php b/bl-plugins/disqus/plugin.php deleted file mode 100644 index 9045eb75..00000000 --- a/bl-plugins/disqus/plugin.php +++ /dev/null @@ -1,108 +0,0 @@ -dbFields = array( - 'shortname' => '', - 'enablePages' => true, - 'enableStatic' => true, - 'enableSticky' => true - ); - } - - public function form() - { - global $L; - - $html = '
'; - $html .= ''; - $html .= ''; - $html .= '' . $L->get('Get the shortname from the Disqus general settings') . ''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - - return $html; - } - - public function pageEnd() - { - global $url; - global $WHERE_AM_I; - - // Do not shows disqus on page not found - if ($url->notFound()) { - return false; - } - - if ($WHERE_AM_I === 'page') { - global $page; - if ($page->published() && $this->getValue('enablePages')) { - return $this->javascript(); - } - if ($page->isStatic() && $this->getValue('enableStatic')) { - return $this->javascript(); - } - if ($page->sticky() && $this->getValue('enableSticky')) { - return $this->javascript(); - } - } - - return false; - } - - private function javascript() - { - global $page; - $pageURL = $page->permalink(); - $pageID = $page->uuid(); - $shortname = $this->getValue('shortname'); - - $code = << -
- -
- -EOF; - return $code; - } -} -- 2.39.5 From e76f5117384ecb1e31dbfbe9a0001eb8d4f71e02 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 11:02:59 +0200 Subject: [PATCH 09/14] =?UTF-8?q?=F0=9F=94=A5=20Remove=20the=20remote-cont?= =?UTF-8?q?ent=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-plugins/remote-content/languages/da.json | 10 - .../remote-content/languages/de_CH.json | 10 - .../remote-content/languages/de_DE.json | 10 - bl-plugins/remote-content/languages/en.json | 11 - bl-plugins/remote-content/languages/es.json | 11 - .../remote-content/languages/fa_IR.json | 11 - .../remote-content/languages/fr_FR.json | 11 - bl-plugins/remote-content/languages/it.json | 11 - .../remote-content/languages/ja_JP.json | 11 - .../remote-content/languages/nl_NL.json | 11 - .../remote-content/languages/ru_RU.json | 11 - bl-plugins/remote-content/metadata.json | 10 - bl-plugins/remote-content/plugin.php | 208 ------------------ 13 files changed, 336 deletions(-) delete mode 100644 bl-plugins/remote-content/languages/da.json delete mode 100644 bl-plugins/remote-content/languages/de_CH.json delete mode 100644 bl-plugins/remote-content/languages/de_DE.json delete mode 100644 bl-plugins/remote-content/languages/en.json delete mode 100644 bl-plugins/remote-content/languages/es.json delete mode 100644 bl-plugins/remote-content/languages/fa_IR.json delete mode 100644 bl-plugins/remote-content/languages/fr_FR.json delete mode 100644 bl-plugins/remote-content/languages/it.json delete mode 100644 bl-plugins/remote-content/languages/ja_JP.json delete mode 100644 bl-plugins/remote-content/languages/nl_NL.json delete mode 100644 bl-plugins/remote-content/languages/ru_RU.json delete mode 100644 bl-plugins/remote-content/metadata.json delete mode 100644 bl-plugins/remote-content/plugin.php diff --git a/bl-plugins/remote-content/languages/da.json b/bl-plugins/remote-content/languages/da.json deleted file mode 100644 index bcc46de7..00000000 --- a/bl-plugins/remote-content/languages/da.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "complete-url-of-the-zip-file": "Den komplette URL sti, til der hvor zip filen befinder sig.", - "plugin-data": { - "description": "Denne udvidelse giver en nem måde at få indholdet fra dit websted uploadet til Github eller lignende service, og være fuld synkroniseret med din Koblog installation.", - "name": "Remote Content" - }, - "source": "Kilde", - "try-webhook": "Prøv webhook'et", - "webhook": "Webhook" -} diff --git a/bl-plugins/remote-content/languages/de_CH.json b/bl-plugins/remote-content/languages/de_CH.json deleted file mode 100644 index 0f59e398..00000000 --- a/bl-plugins/remote-content/languages/de_CH.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugin-data": - { - "name": "Remote Content", - "description": "Das Plugin snychronisiert die Inhalte eines Repository wie GitHub mit einer Koblog-Installation." - }, - "webhook": "Webhook", - "source": "Quelle", - "try-webhook": "Webhook testen", - "complete-url-of-the-zip-file": "Vollständiger URL des ZIP-Archivs."} diff --git a/bl-plugins/remote-content/languages/de_DE.json b/bl-plugins/remote-content/languages/de_DE.json deleted file mode 100644 index 0f59e398..00000000 --- a/bl-plugins/remote-content/languages/de_DE.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugin-data": - { - "name": "Remote Content", - "description": "Das Plugin snychronisiert die Inhalte eines Repository wie GitHub mit einer Koblog-Installation." - }, - "webhook": "Webhook", - "source": "Quelle", - "try-webhook": "Webhook testen", - "complete-url-of-the-zip-file": "Vollständiger URL des ZIP-Archivs."} diff --git a/bl-plugins/remote-content/languages/en.json b/bl-plugins/remote-content/languages/en.json deleted file mode 100644 index 010873a2..00000000 --- a/bl-plugins/remote-content/languages/en.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Remote Content", - "description": "This plugin provides an easy way to have the content of your site on Github or similar and in turn is synchronized with your Koblog." - }, - "webhook": "Webhook", - "source": "Source", - "try-webhook": "Try webhook", - "complete-url-of-the-zip-file": "Complete URL of the zip file." -} \ No newline at end of file diff --git a/bl-plugins/remote-content/languages/es.json b/bl-plugins/remote-content/languages/es.json deleted file mode 100644 index 4510aba1..00000000 --- a/bl-plugins/remote-content/languages/es.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Contenido remoto", - "description": "Este plugin provee una forma facil de tener el contenido de tu sitio en Github o similar y a su vez esta sincronizado con tu Koblog." - }, - "webhook": "Webhook", - "source": "Origen", - "try-webhook": "Probar webhook", - "complete-url-of-the-zip-file": "URL completa del archivo zip." -} \ No newline at end of file diff --git a/bl-plugins/remote-content/languages/fa_IR.json b/bl-plugins/remote-content/languages/fa_IR.json deleted file mode 100644 index 4f81737e..00000000 --- a/bl-plugins/remote-content/languages/fa_IR.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "محتوای راه دور", - "description": "این افزونه یک راه آسان برای داشتن محتوای سایت شما در Github یا مشابه دارد و به نوبه خود، با بلودیت شما هماهنگ شده است ." - }, - "webhook": "Webhook", - "source": "منبع", - "try-webhook": "امتحان webhook", - "complete-url-of-the-zip-file": "آدرس وب کامل فایل زیپ." -} diff --git a/bl-plugins/remote-content/languages/fr_FR.json b/bl-plugins/remote-content/languages/fr_FR.json deleted file mode 100644 index 89f3e1d2..00000000 --- a/bl-plugins/remote-content/languages/fr_FR.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Contenu distant", - "description": "Ce plugin fournit un moyen facile d'avoir le contenu de votre site sur Github ou similaire et à son tour est synchronisé avec votre Koblog." - }, - "webhook": "Webhook", - "source": "Source", - "try-webhook": "Tester le webhook", - "complete-url-of-the-zip-file": "URL complète du fichier zip." -} \ No newline at end of file diff --git a/bl-plugins/remote-content/languages/it.json b/bl-plugins/remote-content/languages/it.json deleted file mode 100644 index 7f31802d..00000000 --- a/bl-plugins/remote-content/languages/it.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Contenuto remoto", - "description": "Questo plugin offre un modo semplice di avere il contenuto del proprio sito su Github e simili e di tenerli sincronizzati con Koblog." - }, - "webhook": "Webhook", - "source": "Sorgente", - "try-webhook": "Prova webhook", - "complete-url-of-the-zip-file": "URL completo del file zipe." -} \ No newline at end of file diff --git a/bl-plugins/remote-content/languages/ja_JP.json b/bl-plugins/remote-content/languages/ja_JP.json deleted file mode 100644 index aa629aee..00000000 --- a/bl-plugins/remote-content/languages/ja_JP.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Remote Content", - "description": "This plugin provides an easy way to have the content of your site on Github or similar and in turn is synchronized with your Koblog." - }, - "webhook": "Webhook", - "source": "ソース", - "try-webhook": "Try webhook", - "complete-url-of-the-zip-file": "Complete URL of the zip file." -} \ No newline at end of file diff --git a/bl-plugins/remote-content/languages/nl_NL.json b/bl-plugins/remote-content/languages/nl_NL.json deleted file mode 100644 index 8c0b43c4..00000000 --- a/bl-plugins/remote-content/languages/nl_NL.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Externe Inhoud", - "description": "Met deze plugin is het eenvoudig om inhoud voor de website op GitHub of soortgelijke bronnen te beheren en vervolgens te synchroniseren met Koblog." - }, - "webhook": "Web-hook", - "source": "Bron", - "try-webhook": "Web-hook testen", - "complete-url-of-the-zip-file": "Complete URL van het .zip-bestand." -} \ No newline at end of file diff --git a/bl-plugins/remote-content/languages/ru_RU.json b/bl-plugins/remote-content/languages/ru_RU.json deleted file mode 100644 index 65b37c1e..00000000 --- a/bl-plugins/remote-content/languages/ru_RU.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugin-data": - { - "name": "Remote Content", - "description": "Этот плагин обеспечивает простой способ синхронизации вашего сайта и Github или аналогичной платформы." - }, - "webhook": "Вебхук", - "source": "Источник", - "try-webhook": "Попробовать этот вебхук", - "complete-url-of-the-zip-file": "Полный URL-адрес zip-файла." -} diff --git a/bl-plugins/remote-content/metadata.json b/bl-plugins/remote-content/metadata.json deleted file mode 100644 index 58b5cad8..00000000 --- a/bl-plugins/remote-content/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Koblog", - "email": "", - "website": "https://plugins.koblog.com/plugin/remote-content", - "version": "kb_0.0.1", - "releaseDate": "2024-08-23", - "license": "MIT", - "compatible": "kb_0.0.1", - "notes": "" -} diff --git a/bl-plugins/remote-content/plugin.php b/bl-plugins/remote-content/plugin.php deleted file mode 100644 index 30b0d102..00000000 --- a/bl-plugins/remote-content/plugin.php +++ /dev/null @@ -1,208 +0,0 @@ -dbFields = array( - 'webhook' => $randomWebhook, - 'source' => '' - ); - } - - public function form() - { - global $language; - - if (extension_loaded('zip') === false) { - $this->formButtons = false; - return '
' . $language->get('the-extension-zip-is-not-installed') . '
'; - } - - $html = '
'; - $html .= ''; - $html .= ''; - $html .= '' . DOMAIN_BASE . $this->getValue('webhook') . ''; - $html .= '
'; - - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '' . $language->get('Complete URL of the zip file') . ''; - $html .= '
'; - - $html .= '
'; - $html .= '
'; - $html .= ''; - $html .= << - function tryWebhook() { - var webhook = document.getElementById("jswebhook").value; - window.open(DOMAIN_BASE+webhook, '_blank'); - } - -EOF; - $html .= '
'; - - return $html; - } - - public function beforeAll() - { - // Check Webhook - $webhook = $this->getValue('webhook'); - if ($this->webhook($webhook)) { - $this->cleanUp(); - - // Download files - $this->downloadFiles(); - - // Delete the current content - $this->deleteContent(); - - // Generate the new content - $this->generateContent(); - - // End request - $this->response(array('status' => '0')); - } - } - - private function downloadFiles() - { - // Download the zip file - Log::set('Plugin Remote Content' . LOG_SEP . 'Downloading the zip file.'); - $source = $this->getValue('source'); - $destinationPath = $this->workspace(); - $destinationFile = $destinationPath . 'content.zip'; - TCP::download($source, $destinationFile); - - // Uncompress the zip file - Log::set('Plugin Remote Content' . LOG_SEP . 'Uncompress the zip file.'); - $zip = new ZipArchive; - if ($zip->open($destinationFile) === true) { - $zip->extractTo($destinationPath); - $zip->close(); - } - - // Delete the zip file - unlink($destinationFile); - return true; - } - - // Delete the page and uploads directories from bl-content - private function deleteContent() - { - // Clean the page database - global $pages; - $pages->db = array(); - - Filesystem::deleteRecursive(PATH_PAGES); - Filesystem::deleteRecursive(PATH_UPLOADS); - mkdir(PATH_PAGES, DIR_PERMISSIONS, true); - mkdir(PATH_UPLOADS, DIR_PERMISSIONS, true); - mkdir(PATH_UPLOADS_PROFILES, DIR_PERMISSIONS, true); - mkdir(PATH_UPLOADS_THUMBNAILS, DIR_PERMISSIONS, true); - - return true; - } - - private function cleanUp() - { - $workspace = $this->workspace(); - Filesystem::deleteRecursive($workspace . DS); - mkdir($workspace, DIR_PERMISSIONS, true); - return true; - } - - private function generateContent() - { - global $pages; - - $root = Filesystem::listDirectories($this->workspace()); - $root = $root[0]; // first directory created by the unzip - - // For each page inside the pages directory - // Parse the page and add to the database - if (Filesystem::directoryExists($root . DS . 'pages')) { - $parentList = Filesystem::listDirectories($root . DS . 'pages' . DS); - foreach ($parentList as $parentDirectory) { - $parentKey = basename($parentDirectory); - if (Filesystem::fileExists($parentDirectory . DS . 'index.md')) { - $row = $this->parsePage($parentDirectory . DS . 'index.md'); - $row['slug'] = $parentKey; - $pages->add($row); - } - - $childList = Filesystem::listDirectories($parentDirectory . DS); - foreach ($childList as $childDirectory) { - $childKey = basename($childDirectory); - if (Filesystem::fileExists($childDirectory . DS . 'index.md')) { - $row = $this->parsePage($childDirectory . DS . 'index.md'); - $row['slug'] = $childKey; - $row['parent'] = $parentKey; - $pages->add($row); - } - } - } - - Theme::plugins('afterPageCreate'); - reindexCategories(); - reindexTags(); - reindexAuthors(); - reindexArchives(); - reindexKinds(); - } - - return true; - } - - private function response($data = array()) - { - $json = json_encode($data); - header('Content-Type: application/json'); - exit($json); - } - - private function parsePage($filename) - { - $lines = file($filename); - $row = array(); - - // Title - $title = ltrim($lines[0], '#'); // Remove the first # - $title = trim($title); - unset($lines[0]); - $row['title'] = $title; - - foreach ($lines as $key => $line) { - if (Text::startsWith($line, '' . PHP_EOL; + $html .= '' . PHP_EOL; + $html .= '' . PHP_EOL; + $html .= '' . PHP_EOL; + $html .= '' . PHP_EOL; + // If the page doesn't have a coverImage try to get an image from the HTML content if (empty($og['image'])) { // Get the image from the content @@ -95,9 +95,7 @@ class pluginOpenGraph extends Plugin } $html .= '' . PHP_EOL; - if (Text::isNotEmpty($this->getValue('fbAppId'))) { - $html .= '' . PHP_EOL; - } + $html .= '' . PHP_EOL; return $html; } } diff --git a/bl-plugins/twitter-cards/languages/da.json b/bl-plugins/twitter-cards/languages/da.json deleted file mode 100644 index 4e6c6851..00000000 --- a/bl-plugins/twitter-cards/languages/da.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "default-image": "Standardbillede", - "plugin-data": { - "description": "Med Twitter kort kan du vedhæfte vigtige billeder, videoer og medieoplevelser til tweets, hvilket hjælper med at få trafik på din hjemmeside.", - "name": "Twitter Cards" - } -} diff --git a/bl-plugins/twitter-cards/languages/de_CH.json b/bl-plugins/twitter-cards/languages/de_CH.json deleted file mode 100644 index 2d38f03a..00000000 --- a/bl-plugins/twitter-cards/languages/de_CH.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "Twitter Cards hängt Medien wie Bilder oder Videos an einen Tweet, wenn ein Link der Website auf Twitter geteilt wird." - } -} diff --git a/bl-plugins/twitter-cards/languages/de_DE.json b/bl-plugins/twitter-cards/languages/de_DE.json deleted file mode 100644 index 2d38f03a..00000000 --- a/bl-plugins/twitter-cards/languages/de_DE.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "Twitter Cards hängt Medien wie Bilder oder Videos an einen Tweet, wenn ein Link der Website auf Twitter geteilt wird." - } -} diff --git a/bl-plugins/twitter-cards/languages/en.json b/bl-plugins/twitter-cards/languages/en.json deleted file mode 100644 index 5f98378d..00000000 --- a/bl-plugins/twitter-cards/languages/en.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website." - }, - "default-image": "Default image" -} \ No newline at end of file diff --git a/bl-plugins/twitter-cards/languages/es.json b/bl-plugins/twitter-cards/languages/es.json deleted file mode 100644 index f9f24da8..00000000 --- a/bl-plugins/twitter-cards/languages/es.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "Con las tarjetas de Twitter puedes adjuntar fotos, videos y experiencias multimedia a tweets." - }, - "default-image": "Imagen predeterminada" -} \ No newline at end of file diff --git a/bl-plugins/twitter-cards/languages/fa_IR.json b/bl-plugins/twitter-cards/languages/fa_IR.json deleted file mode 100644 index e0391f72..00000000 --- a/bl-plugins/twitter-cards/languages/fa_IR.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "بوسیله Twitter Cards ، شما می‌توانید تصاویر، ویدئو و تجربیات رسانه ای را به توئیت پیوست کرده، و با اینکار کمکی می‌شود تا ترافیک بیشتری به سمت وبسایت شما روانه شود." - }, - "default-image": "تصویر پیش‌فرض" -} diff --git a/bl-plugins/twitter-cards/languages/fr_FR.json b/bl-plugins/twitter-cards/languages/fr_FR.json deleted file mode 100644 index 2bfaedd6..00000000 --- a/bl-plugins/twitter-cards/languages/fr_FR.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Cartes Twitter", - "description": "Les Cartes Twitter sont des protocoles qui vous permettent d’attacher des photos, des vidéos et autres médias interactifs à vos tweets, cela vas vous aider à générer du trafic vers votre site." - }, - "default-image": "Image par défaut." -} \ No newline at end of file diff --git a/bl-plugins/twitter-cards/languages/it.json b/bl-plugins/twitter-cards/languages/it.json deleted file mode 100644 index b2408307..00000000 --- a/bl-plugins/twitter-cards/languages/it.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "Con Twitter Cards, puoi aggiungere foto, video e media ai tuoi tweet, aiutando a guidare il traffico sul tuo sito." - }, - "default-image": "Immagine predefinita" -} \ No newline at end of file diff --git a/bl-plugins/twitter-cards/languages/ja_JP.json b/bl-plugins/twitter-cards/languages/ja_JP.json deleted file mode 100644 index 5f98378d..00000000 --- a/bl-plugins/twitter-cards/languages/ja_JP.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website." - }, - "default-image": "Default image" -} \ No newline at end of file diff --git a/bl-plugins/twitter-cards/languages/nl_NL.json b/bl-plugins/twitter-cards/languages/nl_NL.json deleted file mode 100644 index fa7869b7..00000000 --- a/bl-plugins/twitter-cards/languages/nl_NL.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "Met Twitter Cards kunnen foto's, video's and media-ervaringen worden gekoppeld aan tweets om zo bezoekers naar deze website te trekken." - }, - "default-image": "Standaardafbeelding" -} \ No newline at end of file diff --git a/bl-plugins/twitter-cards/languages/ru_RU.json b/bl-plugins/twitter-cards/languages/ru_RU.json deleted file mode 100644 index 61402814..00000000 --- a/bl-plugins/twitter-cards/languages/ru_RU.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "C Twitter Cards вы можете добавить фото, видео и медиа к твиттам, тем самым привлекая дополнительный трафик для вашего сайта." - }, - "default-image": "Изображение по умолчанию" -} diff --git a/bl-plugins/twitter-cards/languages/tr_TR.json b/bl-plugins/twitter-cards/languages/tr_TR.json deleted file mode 100644 index af76e962..00000000 --- a/bl-plugins/twitter-cards/languages/tr_TR.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugin-data": - { - "name": "Twitter Cards", - "description": "Twitter Kartları ile zengin fotoğraf, video ve medya deneyimlerini Tweetlere ekleyebilir ve web sitenize trafik çekmenize yardımcı olabilirsiniz." - }, - "default-image": "Varsayılan resim" -} diff --git a/bl-plugins/twitter-cards/metadata.json b/bl-plugins/twitter-cards/metadata.json deleted file mode 100644 index c4539610..00000000 --- a/bl-plugins/twitter-cards/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Koblog", - "email": "", - "website": "https://plugins.koblog.com", - "version": "kb_0.0.1", - "releaseDate": "2024-08-23", - "license": "MIT", - "compatible": "kb_0.0.1", - "notes": "" -} diff --git a/bl-plugins/twitter-cards/plugin.php b/bl-plugins/twitter-cards/plugin.php deleted file mode 100644 index fde7af92..00000000 --- a/bl-plugins/twitter-cards/plugin.php +++ /dev/null @@ -1,85 +0,0 @@ -dbFields = array( - 'defaultImage' => '' - ); - } - - public function form() - { - global $L; - - $html = '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - - return $html; - } - - public function siteHead() - { - global $url; - global $site; - global $WHERE_AM_I; - global $content; - global $page; - - $data = array( - 'card' => 'summary', - 'site' => '', - 'title' => $site->title(), - 'description' => $site->description(), - 'image' => '' - ); - - switch ($WHERE_AM_I) { - // The user filter by page - case 'page': - $data['title'] = $page->title(); - $data['description'] = $page->description(); - $data['image'] = $page->coverImage($absolute = true); - - $pageContent = $page->content(); - break; - - // The user is in the homepage - default: - $pageContent = ''; - // The image it's from the first page - if (isset($content[0])) { - $data['image'] = $content[0]->coverImage($absolute = true); - $pageContent = $content[0]->content(); - } - break; - } - - $html = PHP_EOL . '' . PHP_EOL; - $html .= '' . PHP_EOL; - $html .= '' . PHP_EOL; - $html .= '' . PHP_EOL; - $html .= '' . PHP_EOL; - - // If the page doesn't have a coverImage try to get an image from the HTML content - if (empty($data['image'])) { - // Get the image from the content - $src = DOM::getFirstImage($pageContent); - if ($src !== false) { - $data['image'] = $src; - } else { - if (Text::isNotEmpty($this->getValue('defaultImage'))) { - $data['image'] = $this->getValue('defaultImage'); - } - } - } - - $html .= '' . PHP_EOL; - return $html; - } -} -- 2.39.5 From da20d6a67d0ffdabdb1721a31f60553666afceb1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 21:27:20 +0200 Subject: [PATCH 11/14] =?UTF-8?q?=F0=9F=90=9B=20rss:=20Improve=20image=20h?= =?UTF-8?q?andling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Taken from https://github.com/bludit/bludit/pull/1559 --- bl-modules/rss/plugin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bl-modules/rss/plugin.php b/bl-modules/rss/plugin.php index 705c314b..abc97cd6 100644 --- a/bl-modules/rss/plugin.php +++ b/bl-modules/rss/plugin.php @@ -44,11 +44,14 @@ class pluginRSS extends Plugin try { // Create the page object from the page key $page = new Page($pageKey); + $imagepath = parse_url($page->coverImage(true), PHP_URL_PATH); + $imagepath = $_SERVER['DOCUMENT_ROOT'] . $imagepath; + $xml .= ''; $xml .= '' . $page->title() . ''; $xml .= '' . $this->encodeURL($page->permalink()) . ''; - $xml .= '' . $page->coverImage(true) . ''; - $xml .= '' . Sanitize::html($page->contentBreak()) . ''; + $xml .= ''; + $xml .= ''.strip_tags( $page->contentBreak() ).''; $xml .= '' . date(DATE_RSS, strtotime($page->getValue('dateRaw'))) . ''; $xml .= '' . $page->uuid() . ''; $xml .= ''; -- 2.39.5 From 3cb045435e7e493119d13242855b75e24ce54f7b Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 21:54:35 +0200 Subject: [PATCH 12/14] =?UTF-8?q?=F0=9F=90=9B=20Autoinstall=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-kernel/boot/rules/60.plugins.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index 87a80198..8301f04b 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -102,6 +102,9 @@ function buildPlugins($path, $autoActivate = false) // If the plugin is installed insert on the hooks if ($Plugin->installed() || $autoActivate) { + if (!$Plugin->installed()) { + $Plugin->install(); + } // Include custom hooks if (!empty($Plugin->customHooks)) { foreach ($Plugin->customHooks as $customHook) { -- 2.39.5 From 069bc5b3a554c91a99e2963ecbd1a84107e08826 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 21:54:48 +0200 Subject: [PATCH 13/14] =?UTF-8?q?=F0=9F=90=9B=20Other=20RSS=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-modules/rss/plugin.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bl-modules/rss/plugin.php b/bl-modules/rss/plugin.php index abc97cd6..fe902a2a 100644 --- a/bl-modules/rss/plugin.php +++ b/bl-modules/rss/plugin.php @@ -31,9 +31,8 @@ class pluginRSS extends Plugin ); $xml = ''; - $xml .= ''; + $xml .= ''; $xml .= ''; - $xml .= ''; $xml .= '' . $site->title() . ''; $xml .= '' . $this->encodeURL($site->url()) . ''; $xml .= '' . $site->description() . ''; -- 2.39.5 From c22506a0e558c2f7f8455ad3096ad1f0ecf91f15 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 3 Jul 2025 21:54:56 +0200 Subject: [PATCH 14/14] =?UTF-8?q?=E2=9C=A8=20Add=20atom=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bl-modules/atom/languages/en.json | 7 ++ bl-modules/atom/languages/fr_FR.json | 7 ++ bl-modules/atom/metadata.json | 10 +++ bl-modules/atom/plugin.php | 125 +++++++++++++++++++++++++++ 4 files changed, 149 insertions(+) create mode 100644 bl-modules/atom/languages/en.json create mode 100644 bl-modules/atom/languages/fr_FR.json create mode 100644 bl-modules/atom/metadata.json create mode 100644 bl-modules/atom/plugin.php diff --git a/bl-modules/atom/languages/en.json b/bl-modules/atom/languages/en.json new file mode 100644 index 00000000..771dffb3 --- /dev/null +++ b/bl-modules/atom/languages/en.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Atom Feed", + "description": "This plugin generates an Atom feed of your site.
The feed has the URL https://example.com/rss.xml" + } +} diff --git a/bl-modules/atom/languages/fr_FR.json b/bl-modules/atom/languages/fr_FR.json new file mode 100644 index 00000000..464d5450 --- /dev/null +++ b/bl-modules/atom/languages/fr_FR.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Flux Atom", + "description": "Ce plugin génère un flux Atom de votre site.
Le flux est accessible a l'URL de ce genre : https://example.com/atom.xml" + } +} diff --git a/bl-modules/atom/metadata.json b/bl-modules/atom/metadata.json new file mode 100644 index 00000000..c4539610 --- /dev/null +++ b/bl-modules/atom/metadata.json @@ -0,0 +1,10 @@ +{ + "author": "Koblog", + "email": "", + "website": "https://plugins.koblog.com", + "version": "kb_0.0.1", + "releaseDate": "2024-08-23", + "license": "MIT", + "compatible": "kb_0.0.1", + "notes": "" +} diff --git a/bl-modules/atom/plugin.php b/bl-modules/atom/plugin.php new file mode 100644 index 00000000..7c91ff69 --- /dev/null +++ b/bl-modules/atom/plugin.php @@ -0,0 +1,125 @@ +itemsPerPage(); + + // Get the list of public pages (sticky and static included) + $list = $pages->getList( + $pageNumber = 1, + $numberOfItems, + $published = true, + $static = true, + $sticky = true, + $draft = false, + $scheduled = false + ); + + $xml = ''; + $xml .= ''; + $xml .= '' . $site->title() . ''; + $xml .= '' . $site->description() . ''; + $xml .= ''; + $xml .= '' . date(DATE_RSS) . ''; + + // Get keys of pages + foreach ($list as $pageKey) { + try { + // Create the page object from the page key + $page = new Page($pageKey); + $imagepath = parse_url($page->coverImage(true), PHP_URL_PATH); + $imagepath = $_SERVER['DOCUMENT_ROOT'] . $imagepath; + + $xml .= ''; + $xml .= '' . $page->title() . ''; + $xml .= ''; + $xml .= ''; + $xml .= ''.strip_tags( $page->contentBreak() ).''; + $xml .= '' . date(DATE_RSS, strtotime($page->getValue('dateRaw'))) . ''; + $xml .= 'urn:uuid:' . $page->uuid() . ''; + $xml .= ''; + $xml .= ''.$page->user('nickname').''; + $xml .= ''; + $xml .= ''; + } catch (Exception $e) { + // Continue + } + } + + $xml .= ''; + + // New DOM document + $doc = new DOMDocument(); + $doc->formatOutput = true; + $doc->loadXML($xml); + return $doc->save($this->workspace() . 'atom.xml'); + } + + public function install($position = 0) + { + parent::install($position); + return $this->createXML(); + } + + public function post() + { + parent::post(); + return $this->createXML(); + } + + public function afterPageCreate() + { + $this->createXML(); + } + + public function afterPageModify() + { + $this->createXML(); + } + + public function afterPageDelete() + { + $this->createXML(); + } + + public function siteHead() + { + return '' . PHP_EOL; + } + + public function beforeAll() + { + $webhook = 'atom.xml'; + if ($this->webhook($webhook)) { + // Send XML header + header('Content-type: text/xml'); + $doc = new DOMDocument(); + + // Load XML + libxml_disable_entity_loader(false); + $doc->load($this->workspace() . 'atom.xml'); + libxml_disable_entity_loader(true); + + // Print the XML + echo $doc->saveXML(); + + // Stop Koblog execution + exit(0); + } + } +} -- 2.39.5