From 9dececd6b9694cf071b93c40121d5d66e0f325c6 Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 6 Apr 2023 15:05:45 +0200 Subject: fonction Article::delete() --- model/Article.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'model/Article.php') diff --git a/model/Article.php b/model/Article.php index f4fe65a..33848bb 100644 --- a/model/Article.php +++ b/model/Article.php @@ -252,6 +252,14 @@ class Article // delete public function delete() { - unlink('data/' . $this->page . '/' . $this->format . '/' . $this->fileCode . '.' . $this->format); + $path = 'data/' . $this->page . '/' . $this->format . '/' . $this->fileCode . '.' . $this->format; + unlink($path); + + // fichiers html dans html-maxi-images + $path_maxi = 'data/' . $this->page . '/' . $this->format . '-maxi-images/' . $this->fileCode . '.' . $this->format; + if(file_exists($path_maxi)) + { + unlink($path_maxi); + } } } -- cgit v1.2.3