aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-08-21 12:09:41 +0000
committerCash Costello <cash.costello@gmail.com>2009-08-21 12:09:41 +0000
commit2c873ce8cdd6b402ad770bfbb3357061eb760a80 (patch)
tree027dbc7f126ae349cd63e091a394a5d5f01be6d6
parent0e4c0fc5462386354cdd2c8920be2946f702b98c (diff)
downloadelgg-2c873ce8cdd6b402ad770bfbb3357061eb760a80.tar.gz
elgg-2c873ce8cdd6b402ad770bfbb3357061eb760a80.tar.bz2
added tagging notifications - uses user's default notification setting like comments
-rw-r--r--actions/addtag.php14
-rw-r--r--languages/en.php5
2 files changed, 18 insertions, 1 deletions
diff --git a/actions/addtag.php b/actions/addtag.php
index 3f623fc86..2c258db84 100644
--- a/actions/addtag.php
+++ b/actions/addtag.php
@@ -69,6 +69,7 @@
$access_id = $image->getAccessID();
$owner_id = get_loggedin_userid();
+ $tagger = get_loggedin_user();
//Save annotation
if ($image->annotate('phototag', serialize($tag), $access_id, $owner_id)) {
@@ -79,7 +80,18 @@
// also add this to the river - subject is image, object is the tagged user
if (function_exists('add_to_river'))
- add_to_river('river/object/image/tag', 'tag', $image_guid, $user_id, $access_id);
+ add_to_river('river/object/image/tag', 'tag', $image_guid, $user_id, $access_id);
+
+ // notify user of tagging as long as not self
+ if ($owner_id != $user_id)
+ notify_user($user_id, $owner_id, elgg_echo('tidypics:tag:subject'),
+ sprintf(
+ elgg_echo('tidypics:tag:body'),
+ $image->title,
+ $tagger->name,
+ $image->getURL()
+ )
+ );
}
}
diff --git a/languages/en.php b/languages/en.php
index c6d9bd61b..98cf9db53 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -112,6 +112,11 @@
'tidypics:phototagging:success' => 'Photo tag was successfully added',
'tidypics:phototagging:error' => 'Unexpected error occurred during tagging',
'tidypics:deletetag:success' => 'Selected tags were successfully deleted',
+
+ 'tidypics:tag:subject' => "You have been tagged in a photo",
+ 'tidypics:tag:body' => "You have been tagged in the photo %s by %s.
+
+The photo can be viewed here: %s",
//rss