aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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