diff options
Diffstat (limited to 'classes/TidypicsAlbum.php')
-rw-r--r-- | classes/TidypicsAlbum.php | 13 |
1 files changed, 13 insertions, 0 deletions
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; } @@ -268,6 +272,15 @@ class TidypicsAlbum extends ElggObject { } /** + * 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 */ protected function deleteImages() { |