From 2c873ce8cdd6b402ad770bfbb3357061eb760a80 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 21 Aug 2009 12:09:41 +0000 Subject: added tagging notifications - uses user's default notification setting like comments --- actions/addtag.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'actions') 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() + ) + ); } } -- cgit v1.2.3