From 894ea6758f3f99c49807df99ef4bbd95f74273dc Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Mon, 13 Feb 2012 15:39:45 -0800 Subject: Fixes #11. Added notifications back. --- classes/TidypicsAlbum.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'classes') diff --git a/classes/TidypicsAlbum.php b/classes/TidypicsAlbum.php index e04344a6b..d069117bf 100644 --- a/classes/TidypicsAlbum.php +++ b/classes/TidypicsAlbum.php @@ -38,6 +38,10 @@ class TidypicsAlbum extends ElggObject { $this->new_album = true; } + if (!isset($this->last_notified)) { + $this->last_notified = 0; + } + if (!parent::save()) { return false; } @@ -267,6 +271,15 @@ class TidypicsAlbum extends ElggObject { return true; } + /** + * Has enough time elapsed between the last_notified and notify_interval setting? + * + * @return bool + */ + public function shouldNotify() { + return time() - $this->last_notified > elgg_get_plugin_setting('notify_interval', 'tidypics'); + } + /** * Delete all the images in this album */ -- cgit v1.2.3