From ae94f42a59c1f308d973dc91214a63a1afb6cae3 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Wed, 19 Apr 2017 21:47:52 -0400 Subject: Add object function rmHeadImg() --- app/class/object.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/class/object.class.php') diff --git a/app/class/object.class.php b/app/class/object.class.php index 0dacd87..55d0874 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -181,6 +181,18 @@ class object extends table return true; } + + /* + * Remove the head image for this object. This deletes the image + * on disk. + */ + public function rmHeadImg() : bool + { + if (!is_file("dynmic/heads/" . $this->guid)) + return true; + + return unlink("dynmic/heads/" . $this->guid); + } } ?> -- cgit v1.2.3