diff options
author | Malf Furious <m@lfurio.us> | 2017-04-19 22:49:05 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-04-19 22:49:05 -0400 |
commit | 8256cbd7976d463ddfd31660995540a9c8adc315 (patch) | |
tree | 1b2417b2fe7ba32f2c4741a66eea03caf70d7be5 /app | |
parent | 07a1a1b7f207101ad27084ad37082f96afad8ac6 (diff) | |
download | scrott-8256cbd7976d463ddfd31660995540a9c8adc315.tar.gz scrott-8256cbd7976d463ddfd31660995540a9c8adc315.zip |
Add object function getBgImg()
Diffstat (limited to '')
-rw-r--r-- | app/class/object.class.php | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ -204,6 +204,18 @@ class object extends table } /* + * 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, * still unhandled. |