diff --git a/bl-kernel/admin/controllers/dashboard.php b/bl-kernel/admin/controllers/dashboard.php index 1ed58c85..d3fb3a2c 100644 --- a/bl-kernel/admin/controllers/dashboard.php +++ b/bl-kernel/admin/controllers/dashboard.php @@ -5,8 +5,13 @@ // ============================================================================ function updateBludit() { global $site; - // Check if Bludit need to be update. - if( ($site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) ) { + // New installation + if ($site->currentBuild()==0) { + $site->set(array('currentBuild'=>BLUDIT_BUILD)); + } + + // Check if Bludit need to be update + if ( ($site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) ) { Log::set('UPDATE SYSTEM - Starting.'); // Updates only for version less than Bludit v3.0 rc-3 diff --git a/bl-kernel/admin/themes/booty/html/media.php b/bl-kernel/admin/themes/booty/html/media.php index a85fcce2..6d18ad04 100644 --- a/bl-kernel/admin/themes/booty/html/media.php +++ b/bl-kernel/admin/themes/booty/html/media.php @@ -144,8 +144,9 @@ function deleteMedia(filename) { } function setCoverImage(filename) { + var thumbnail = ""+filename; $("#jscoverImage").val(filename); - $("#jscoverImagePreview").attr("src", HTML_PATH_UPLOADS_THUMBNAILS+filename); + $("#jscoverImagePreview").attr("src", thumbnail); } $(document).ready(function() { diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 48873726..1a8ffc14 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -12,10 +12,11 @@ define('DEBUG_MODE', TRUE); error_reporting(0); // Turn off all error reporting if (DEBUG_MODE) { // Turn on all error reporting - ini_set("display_errors", 1); - ini_set('display_startup_errors',1); + ini_set("display_errors", 0); + ini_set('display_startup_errors',0); ini_set("track_errors", 1); ini_set("html_errors", 1); + ini_set('log_errors', 1); error_reporting(E_ALL | E_STRICT | E_NOTICE); } diff --git a/bl-kernel/pagex.class.php b/bl-kernel/pagex.class.php index 108a1584..ed6b052c 100644 --- a/bl-kernel/pagex.class.php +++ b/bl-kernel/pagex.class.php @@ -279,29 +279,32 @@ class Page { return json_encode($tmp); } - // Returns the file name, FALSE there isn't a cover image setted - // If the user defined an External Cover Image the complete URL is going to be returned - // (boolean) $absolute, TRUE returns the absolute path and file name, FALSE just the file name + // Returns the endpoint of the coverimage, FALSE if the page doesn't have a cover image + // (boolean) $absolute, TRUE returns the complete URL, FALSE returns the filename + // If the user defined an external cover image the function returns it public function coverImage($absolute=true) { - $fileName = $this->getValue('coverImage'); - if (empty($fileName)) { + $filename = $this->getValue('coverImage'); + if (empty($filename)) { return false; } // Check is external cover image - if (filter_var($fileName, FILTER_VALIDATE_URL)) { - return $fileName; + if (filter_var($filename, FILTER_VALIDATE_URL)) { + return $filename; } if ($absolute) { - return DOMAIN_UPLOADS.$fileName; + if (IMAGE_RESTRICT) { + return DOMAIN_UPLOADS_PAGES.$this->uuid().'/'.$filename; + } + return DOMAIN_UPLOADS.$filename; } - return $fileName; + return $filename; } - // Returns the absolute URL of the thumbnail of the cover image, FALSE if the page doen't have cover image + // Returns the endpoint of the thumbnail cover image, FALSE if the page doesn't have a cover image public function thumbCoverImage() { $coverImageFilename = $this->coverImage(false); @@ -314,6 +317,9 @@ class Page { return $coverImageFilename; } + if (IMAGE_RESTRICT) { + return DOMAIN_UPLOADS_PAGES.$this->uuid().'/thumbnails/'.$filename; + } return DOMAIN_UPLOADS_THUMBNAILS.$coverImageFilename; } diff --git a/bl-plugins/tinymce/css/bludit.css b/bl-plugins/tinymce/css/bludit.css index f82bbfba..5514c63e 100644 --- a/bl-plugins/tinymce/css/bludit.css +++ b/bl-plugins/tinymce/css/bludit.css @@ -1,5 +1,5 @@ body { - padding: 10px 5%; + padding: 10px 5% !important; font-size: 16px; } diff --git a/bl-plugins/tinymce/plugin.php b/bl-plugins/tinymce/plugin.php index 7bd2c51a..bffedcce 100644 --- a/bl-plugins/tinymce/plugin.php +++ b/bl-plugins/tinymce/plugin.php @@ -83,6 +83,12 @@ class pluginTinymce extends Plugin { $lang = $L->currentLanguageShortVersion(); } + if (IMAGE_RELATIVE_TO_ABSOLUTE) { + $document_base_url = 'document_base_url: "'.DOMAIN_UPLOADS.'",'; + } else { + $document_base_url = ''; + } + $script = << @@ -120,7 +126,7 @@ tinymce.init({ paste_as_text: true, relative_urls: true, remove_script_host: false, - document_base_url: DOMAIN_UPLOADS, + $document_base_url plugins: ["$plugins"], toolbar1: "$toolbar1", toolbar2: "$toolbar2", diff --git a/install.php b/install.php index f95978dd..1086a86c 100644 --- a/install.php +++ b/install.php @@ -54,6 +54,7 @@ define('PATH_DATABASES', PATH_CONTENT.'databases'.DS); define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS); define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS); define('PATH_UPLOADS_THUMBNAILS',PATH_UPLOADS.'thumbnails'.DS); +define('PATH_UPLOADS_PAGES', PATH_UPLOADS.'pages'.DS); define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS); define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);