From f9b65c5a1365ca1fa8c5993812c853872094a335 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Fri, 13 Jul 2018 18:30:42 +0200 Subject: [PATCH] Robots plugin, dynamic titles, fix permissions when upload images --- bl-kernel/admin/controllers/edit-content.php | 5 ++ bl-kernel/admin/controllers/new-content.php | 5 ++ bl-kernel/admin/themes/booty/index.php | 4 +- bl-kernel/admin/themes/booty/login.php | 4 +- bl-kernel/admin/views/edit-content.php | 25 +++++--- bl-kernel/admin/views/new-content.php | 13 ++-- bl-kernel/admin/views/settings.php | 42 +++++++++++++ bl-kernel/ajax/upload-files.php | 1 + bl-kernel/dbpages.class.php | 32 ++++++++++ bl-kernel/dbsite.class.php | 28 ++++++++- bl-kernel/functions.php | 4 ++ bl-kernel/helpers/theme.class.php | 65 ++++++++++++++------ bl-kernel/page.class.php | 12 ++++ bl-plugins/robots/languages/en.json | 7 +++ bl-plugins/robots/metadata.json | 10 +++ bl-plugins/robots/plugin.php | 36 +++++++++++ bl-themes/alternative/index.php | 5 +- bl-themes/alternative/php/head.php | 12 ++-- bl-themes/blogx/index.php | 5 +- bl-themes/blogx/php/head.php | 14 ++--- 20 files changed, 273 insertions(+), 56 deletions(-) create mode 100644 bl-plugins/robots/languages/en.json create mode 100644 bl-plugins/robots/metadata.json create mode 100644 bl-plugins/robots/plugin.php diff --git a/bl-kernel/admin/controllers/edit-content.php b/bl-kernel/admin/controllers/edit-content.php index 07baf355..a0e16354 100644 --- a/bl-kernel/admin/controllers/edit-content.php +++ b/bl-kernel/admin/controllers/edit-content.php @@ -35,6 +35,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { Alert::set( $Language->g('The changes have been saved') ); } } else { + // If the checkbox is not selected the form doesn't send the field + $_POST['noindex'] = isset($_POST['noindex'])?true:false; + $_POST['nofollow'] = isset($_POST['nofollow'])?true:false; + $_POST['noarchive'] = isset($_POST['noarchive'])?true:false; + $key = editPage($_POST); if ($key!==false) { Alert::set( $Language->g('The changes have been saved') ); diff --git a/bl-kernel/admin/controllers/new-content.php b/bl-kernel/admin/controllers/new-content.php index f4531771..104561f8 100644 --- a/bl-kernel/admin/controllers/new-content.php +++ b/bl-kernel/admin/controllers/new-content.php @@ -17,6 +17,11 @@ // ============================================================================ if ($_SERVER['REQUEST_METHOD'] == 'POST') { + // If the checkbox is not selected the form doesn't send the field + $_POST['noindex'] = isset($_POST['noindex'])?true:false; + $_POST['nofollow'] = isset($_POST['nofollow'])?true:false; + $_POST['noarchive'] = isset($_POST['noarchive'])?true:false; + createPage($_POST); Redirect::page('content'); } diff --git a/bl-kernel/admin/themes/booty/index.php b/bl-kernel/admin/themes/booty/index.php index efb429e8..4bcbcfe4 100644 --- a/bl-kernel/admin/themes/booty/index.php +++ b/bl-kernel/admin/themes/booty/index.php @@ -11,7 +11,7 @@ diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index 064dc82e..7c5e9aab 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -78,16 +78,9 @@ -
- - - g('Cancel') ?> - children())===0) { - echo ''; - } - ?> -
+ draft()): ?> +
The content is saved as a draft. To publish it click on the button Publish or if you still working on it click on Save as draft.
+ @@ -226,6 +219,18 @@ ?> +
+
+ + + g('Cancel') ?> + children())===0) { + echo ''; + } + ?> +
+ @@ -205,6 +199,13 @@ ?> +
+
+ + + g('Cancel') ?> +
+