From 8256cbd7976d463ddfd31660995540a9c8adc315 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Wed, 19 Apr 2017 22:49:05 -0400 Subject: Add object function getBgImg() --- app/class/object.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app') diff --git a/app/class/object.class.php b/app/class/object.class.php index 3bf64ec..7c80b5b 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -203,6 +203,18 @@ class object extends table return unlink("dynmic/heads/" . $this->guid); } + /* + * Get the URL to the background image resource for this + * object. If no image is set, NULL is returned. + */ + public function getBgImg() : ?string + { + if (!is_file("dynmic/bgs/" . $this->guid)) + return NULL; + + return ar() . "/df.php?d=bgs&f=" . $this->guid; + } + /* * Set the background image for this object, overwriting any * existing image. $image should be an uploaded file to PHP, -- cgit v1.2.3