diff options
author | Malf Furious <m@lfurio.us> | 2018-09-16 16:00:19 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-09-16 16:00:19 -0400 |
commit | 6b49c22dde73d3770f0f49f075ec86ff28919674 (patch) | |
tree | 8c990a6e6454160479e439d96bbbd19ae252f894 /app/class/obj.class.php | |
parent | 4aa41406ca20733dd0741f6caa54e300c759acc8 (diff) | |
download | scrott-6b49c22dde73d3770f0f49f075ec86ff28919674.tar.gz scrott-6b49c22dde73d3770f0f49f075ec86ff28919674.zip |
Add function obj::hasHeadImg()
We can check for the existence of an object's background image by
calling getBgImg(), since it returns NULL when there is no such image.
But getHeadImg() behaves differently, returning a path to
'static/img/null.jpg' (via df.php) when there is no image, making it
more difficult to tell. This function addresses this concern.
Diffstat (limited to 'app/class/obj.class.php')
-rw-r--r-- | app/class/obj.class.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/class/obj.class.php b/app/class/obj.class.php index 4e44649..003738b 100644 --- a/app/class/obj.class.php +++ b/app/class/obj.class.php @@ -212,6 +212,16 @@ class obj extends table } /* + * Check whether object has a custom head set. This is necessary, since + * getHeadImg() will return a path to a default if the object doesn't + * have its own. + */ + public function hasHeadImg() : bool + { + return is_file("dynmic/heads/" . $this->guid); + } + + /* * Get the URL to the head image resource for this object */ public function getHeadImg() : string |