aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-02-13 15:39:45 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-02-13 15:40:52 -0800
commit894ea6758f3f99c49807df99ef4bbd95f74273dc (patch)
tree90f4166d6cd605eb4d7e95d63682732a1c5476a5 /classes
parent67d855d73499f36f15331e1ff18cccd13aa8aa74 (diff)
downloadelgg-894ea6758f3f99c49807df99ef4bbd95f74273dc.tar.gz
elgg-894ea6758f3f99c49807df99ef4bbd95f74273dc.tar.bz2
Fixes #11. Added notifications back.
Diffstat (limited to 'classes')
-rw-r--r--classes/TidypicsAlbum.php13
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() {