oopsi j'ai pas bien merge
This commit is contained in:
parent
d5f740687d
commit
1b6ed09158
6 changed files with 7 additions and 5 deletions
3
.env
3
.env
|
|
@ -6,4 +6,5 @@ DB_DATABASE=projet_folliow
|
||||||
DB_USERNAME=
|
DB_USERNAME=
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
|
|
||||||
IMG_PATH= uploads/projects/
|
IMG_PROJECT_PATH = uploads/projects/
|
||||||
|
IMG_USER_PATH = uploads/profiles/
|
||||||
|
|
@ -175,7 +175,7 @@
|
||||||
|
|
||||||
// Redimensionnement de l'image
|
// Redimensionnement de l'image
|
||||||
if (isset($strImageName)){
|
if (isset($strImageName)){
|
||||||
$strDest = $_ENV['IMG_PATH'].$strImageName;
|
$strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName;
|
||||||
$strSource = $_FILES['thumbnail']['tmp_name'];
|
$strSource = $_FILES['thumbnail']['tmp_name'];
|
||||||
list($intWidth, $intHeight) = getimagesize($strSource);
|
list($intWidth, $intHeight) = getimagesize($strSource);
|
||||||
|
|
||||||
|
|
@ -213,6 +213,7 @@
|
||||||
|
|
||||||
// Sauvegarde du fichier
|
// Sauvegarde du fichier
|
||||||
$boolImageOk = imagewebp($objDest, $strDest);
|
$boolImageOk = imagewebp($objDest, $strDest);
|
||||||
|
|
||||||
imagedestroy($objDest);
|
imagedestroy($objDest);
|
||||||
imagedestroy($objSource);
|
imagedestroy($objSource);
|
||||||
}
|
}
|
||||||
|
|
@ -229,7 +230,7 @@
|
||||||
if ($boolOk){
|
if ($boolOk){
|
||||||
// Suppression de l'ancienne image
|
// Suppression de l'ancienne image
|
||||||
if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){
|
if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){
|
||||||
$strOldFile = $_ENV['IMG_PATH'].$strOldImg;
|
$strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg;
|
||||||
if (file_exists($strOldFile)) unlink($strOldFile);
|
if (file_exists($strOldFile)) unlink($strOldFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
BIN
uploads/projects/699ca2c207e75.webp
Normal file
BIN
uploads/projects/699ca2c207e75.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
uploads/projects/699ca2cf9f010.webp
Normal file
BIN
uploads/projects/699ca2cf9f010.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
uploads/projects/699ca324b5dbc.webp
Normal file
BIN
uploads/projects/699ca324b5dbc.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
|
|
@ -22,7 +22,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="mb-4 shadow-sm">
|
<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">
|
class="img-fluid rounded w-100">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<div class="card text-center shadow-sm p-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">
|
<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"
|
class="rounded-circle mb-3 mx-auto"
|
||||||
style="width:100px;height:100px;object-fit:cover;">
|
style="width:100px;height:100px;object-fit:cover;">
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue