oopsi j'ai pas bien merge

This commit is contained in:
Yasder5 2026-02-23 19:58:22 +01:00
parent d5f740687d
commit 1b6ed09158
6 changed files with 7 additions and 5 deletions

3
.env
View file

@ -6,4 +6,5 @@ DB_DATABASE=projet_folliow
DB_USERNAME=
DB_PASSWORD=
IMG_PATH= uploads/projects/
IMG_PROJECT_PATH = uploads/projects/
IMG_USER_PATH = uploads/profiles/

View file

@ -175,7 +175,7 @@
// Redimensionnement de l'image
if (isset($strImageName)){
$strDest = $_ENV['IMG_PATH'].$strImageName;
$strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName;
$strSource = $_FILES['thumbnail']['tmp_name'];
list($intWidth, $intHeight) = getimagesize($strSource);
@ -213,6 +213,7 @@
// Sauvegarde du fichier
$boolImageOk = imagewebp($objDest, $strDest);
imagedestroy($objDest);
imagedestroy($objSource);
}
@ -229,7 +230,7 @@
if ($boolOk){
// Suppression de l'ancienne image
if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){
$strOldFile = $_ENV['IMG_PATH'].$strOldImg;
$strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -22,7 +22,7 @@
</p>
<div class="mb-4 shadow-sm">
<img src="{$objProject->getThumbnail()}"
<img src="{$smarty.env.IMG_PROJECT_PATH}{$objProject->getThumbnail()}"
class="img-fluid rounded w-100">
</div>
@ -59,7 +59,7 @@
<div class="col-lg-4">
<div class="card text-center shadow-sm p-4">
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}" class="text-decoration-none text-dark">
<img src="{$objProject->getUser_image()}"
<img src="{$smarty.env.IMG_USER_PATH}{$objProject->getUser_image()}"
class="rounded-circle mb-3 mx-auto"
style="width:100px;height:100px;object-fit:cover;">
</a>