From ac5410de94127d7fe139de0e9bf4fd1c20bdae2b Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 1 Apr 2016 00:46:17 -0400 Subject: Add function getHeadImage() to User class This function will return the path to the head image (user image) for the user object. This path should be something like: /file.php?d=img/heads&f= --- app/class/user.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/class/user.class.php') diff --git a/app/class/user.class.php b/app/class/user.class.php index 1130396..ab9ecf5 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -187,6 +187,14 @@ class User extends Object return "glyphicon glyphicon-user"; } + + /* + * Get this user's head image + */ + function getHeadImage() + { + return $this->ar() . "/file.php?d=img/heads&f=" . $this->guid; + } } ?> -- cgit v1.2.3 From 6d6e62add5976b3afec23d1745302d676ccd88ac Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 30 Apr 2016 22:19:36 -0400 Subject: Add function User::rmHeadImage() Function to delete the user image file for the given user object. --- app/class/user.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/class/user.class.php') diff --git a/app/class/user.class.php b/app/class/user.class.php index ab9ecf5..1d17dfe 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -195,6 +195,17 @@ class User extends Object { return $this->ar() . "/file.php?d=img/heads&f=" . $this->guid; } + + /* + * Remove this user's head image + */ + function rmHeadImage() + { + if (!is_file("assets/img/heads/" . $this->guid)) + return true; + + return unlink("assets/img/heads/" . $this->guid); + } } ?> -- cgit v1.2.3