Extreme friendly urls

This commit is contained in:
dignajar 2016-06-02 21:57:13 -03:00
parent b59d045de2
commit 4a8749af98
5 changed files with 24 additions and 12 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -158,10 +158,6 @@ blockquote p {
min-width: 0;
}
.plugin {
font-size: 0.9em !important;
}
.plugin > h2 {
font-weight: normal !important;
text-transform: uppercase;

View File

@ -37,5 +37,5 @@
}
?>
</ul>
<p class="copyright"><?php echo $Site->footer() ?> | Design: <a href="http://html5up.net">HTML5 UP</a></p>
<p class="copyright"><?php echo $Site->footer() ?> | <a href="http://www.bludit.com">BLUDIT</a></p>
</section>