summaryrefslogtreecommitdiffstats
path: root/app/class/object.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-04-19 22:45:18 -0400
committerMalf Furious <m@lfurio.us>2017-04-19 22:45:18 -0400
commit3c4d7755d0a88c148884e0cbb90b327a96d87973 (patch)
tree7af020842b0bc091f03a2c998be0cba17752c0b1 /app/class/object.class.php
parent77d16dcad807e80e439d636301ccf588195f53fc (diff)
downloadscrott-3c4d7755d0a88c148884e0cbb90b327a96d87973.tar.gz
scrott-3c4d7755d0a88c148884e0cbb90b327a96d87973.zip
Add object function setBgImg()
Diffstat (limited to '')
-rw-r--r--app/class/object.class.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php
index 8d889e7..f8f5460 100644
--- a/app/class/object.class.php
+++ b/app/class/object.class.php
@@ -25,6 +25,7 @@ class object extends table
* Constants used for uploading images
*/
public const HEAD_MAXSIZE = 1048576; // 1Mb
+ public const BG_MAXSIZE = 1048576; // 1Mb
public const IMAGE_MIME = array(
"image/jpeg",
"image/jpg",
@@ -201,6 +202,17 @@ class object extends table
return unlink("dynmic/heads/" . $this->guid);
}
+
+ /*
+ * Set the background image for this object, overwriting any
+ * existing image. $image should be an uploaded file to PHP,
+ * still unhandled.
+ */
+ public function setBgImg(array $image) : bool
+ {
+ $path = "dynmic/bgs/" . $this->guid;
+ return saveFile($image, $path, self::BG_MAXSIZE, self::IMAGE_MIME);
+ }
}
?>