1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Delete comment images when delete a video.

This commit is contained in:
Daniel Neto 2024-08-19 17:28:11 -03:00
parent 3c20d2a590
commit e3d28d11ab
2 changed files with 7 additions and 1 deletions

View file

@ -3051,6 +3051,12 @@ if (!class_exists('Video')) {
$this->removeFiles($filename); $this->removeFiles($filename);
$commentsImagesDir = self::getStoragePath() . "uploads/comments/{$this->id}/";
if(is_dir($commentsImagesDir)){
rrmdir($commentsImagesDir);
}
self::deleteThumbs($filename); self::deleteThumbs($filename);
} }

View file

@ -60,8 +60,8 @@ if (!User::canComment()) {
?> ?>
}); });
var uploadCommentImageURL = webSiteRootURL + 'view/mini-upload-form/imageUpload.json.php';
$(document).ready(function() { $(document).ready(function() {
var uploadCommentImageURL = webSiteRootURL + 'view/mini-upload-form/imageUpload.json.php';
$('#uploadImageBtn').on('click', function() { $('#uploadImageBtn').on('click', function() {
$('#commentImageInput').click(); $('#commentImageInput').click();