GEstion de l'ajout et de l'afichage des photos pour les commentaires !! SQL modifié

This commit is contained in:
leosw committed 2026-04-12 12:51:12 +02:00
1 parent 6e516f05cb
commit b9297c8617
3 files changed
+75 -41

No files matched your search

+12
View File
@@ -233,6 +233,18 @@ switch ($controller->splitted_url[1]) {
$Comment->author = $user->id;
$Comment->content = $poi->content_id;
$Comment->comment = $_POST['comment'];
if (!empty($_FILES['photo']['tmp_name'])) {
$tmp = $_FILES['photo']['tmp_name'];
$filename = uniqid('comment_').'.jpg'; // ou extension dynamique
$destination = $config['medias_folder'].'comment_photos/'.$filename;
move_uploaded_file($tmp, $destination);
// URL publique
$Comment->photo = $filename;
}
$Comment->insert();
}
}