From 4a8749af98bfa109e404747e0e42ce714cdbdff6 Mon Sep 17 00:00:00 2001 From: dignajar Date: Thu, 2 Jun 2016 21:57:13 -0300 Subject: [PATCH] Extreme friendly urls --- bl-kernel/ajax/uploader.php | 6 +++--- bl-kernel/boot/init.php | 19 +++++++++++++++---- bl-kernel/helpers/text.class.php | 5 +++++ bl-themes/log/assets/css/bludit.css | 4 ---- bl-themes/log/php/sidebar.php | 2 +- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/bl-kernel/ajax/uploader.php b/bl-kernel/ajax/uploader.php index dbb626e0..5ed4ecc5 100644 --- a/bl-kernel/ajax/uploader.php +++ b/bl-kernel/ajax/uploader.php @@ -40,15 +40,15 @@ if($type=='profilePicture') $username = Sanitize::html($_POST['username']); $tmpName = $username.'.png'; $Image = new Image(); - $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, '400', '400', 'crop'); - $Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, false, true); + $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, PROFILE_WIDTH, PROFILE_HEIGHT, 'crop'); + $Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, PROFILE_IMG_QUALITY, false, true); } // --- OTHERS --- else { // Generate the thumbnail $Image = new Image(); $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop'); - $Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, 100, true); + $Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, THUMBNAILS_QUALITY, true); // Move the original to the upload folder. rename(PATH_TMP.'original'.'.'.$fileExtension, PATH_UPLOADS.$tmpName); diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 4fb9037d..1fa25446 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -65,12 +65,20 @@ define('ALERT_STATUS_OK', 0); // Alert status fail define('ALERT_STATUS_FAIL', 1); -// Salt length -define('THUMBNAILS_WIDTH', 400); -define('THUMBNAILS_HEIGHT', 400); +// Amount of thumbnails shown on Bludit Quick images define('THUMBNAILS_AMOUNT', 6); -// Salt length +// Thubmnails size +define('THUMBNAILS_WIDTH', 400); +define('THUMBNAILS_HEIGHT', 400); +define('THUMBNAILS_QUALITY', 100); // 100% + +// Profile image size +define('PROFILE_IMG_WIDTH', 400); +define('PROFILE_IMG_HEIGHT', 400); +define('PROFILE_IMG_QUALITY', 100); // 100% + +// Password salt length define('SALT_LENGTH', 8); // Page brake string @@ -106,6 +114,9 @@ define('TOKEN_EMAIL_TTL', '+15 minutes'); // Charset, default UTF-8. define('CHARSET', 'UTF-8'); +// EXTREME FRIENDLY URL, TRUE for dissmiss internet standard +define('EXTREME_FRIENDLY_URL', true); + // Directory permissions define('DIR_PERMISSIONS', 0755); diff --git a/bl-kernel/helpers/text.class.php b/bl-kernel/helpers/text.class.php index 14153a57..2dcc8f4b 100644 --- a/bl-kernel/helpers/text.class.php +++ b/bl-kernel/helpers/text.class.php @@ -115,6 +115,11 @@ class Text { public static function cleanUrl($string, $separator='-') { + if(EXTREME_FRIENDLY_URL) { + $string = preg_replace("/[\/_|+ -]+/", $separator, $string); + return $string; + } + // Transliterate characters to ASCII $string = str_replace(array_keys(self::$specialChars), self::$specialChars, $string); diff --git a/bl-themes/log/assets/css/bludit.css b/bl-themes/log/assets/css/bludit.css index 6d836205..3c2a0d70 100644 --- a/bl-themes/log/assets/css/bludit.css +++ b/bl-themes/log/assets/css/bludit.css @@ -158,10 +158,6 @@ blockquote p { min-width: 0; } -.plugin { - font-size: 0.9em !important; -} - .plugin > h2 { font-weight: normal !important; text-transform: uppercase; diff --git a/bl-themes/log/php/sidebar.php b/bl-themes/log/php/sidebar.php index 46d53411..9122cf4d 100644 --- a/bl-themes/log/php/sidebar.php +++ b/bl-themes/log/php/sidebar.php @@ -37,5 +37,5 @@ } ?> - + \ No newline at end of file