diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-05-13 11:54:48 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-05-13 11:54:48 +0000 |
commit | b32a22535f4b41187475618769d0a4d07aba6684 (patch) | |
tree | b76c289a39ee324eb8b5edd6fe675b613362d100 | |
parent | fe45d33afc444e0f77d912a65de83ba9f0c92f33 (diff) | |
download | elgg-b32a22535f4b41187475618769d0a4d07aba6684.tar.gz elgg-b32a22535f4b41187475618769d0a4d07aba6684.tar.bz2 |
added relationship between user and photo when tagged - this will enable searching for all photos that include user x
-rw-r--r-- | actions/addtag.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actions/addtag.php b/actions/addtag.php index 562d53882..dc4274728 100644 --- a/actions/addtag.php +++ b/actions/addtag.php @@ -1,6 +1,6 @@ <?php
/**
- * Tidypics Add Tag
+ * Tidypics Add Photo Tag
*
*/
@@ -67,6 +67,12 @@ //Save annotation
if ($image->annotate('phototag', serialize($tag), $access_id, $owner_id)) {
+ // if tag is a user id, add relationship for searching (find all images with user x)
+ if ($relationships_type === 'user') {
+ if (!check_entity_relationship($user_id, 'phototag', $image_guid))
+ add_entity_relationship($user_id, 'phototag', $image_guid);
+ }
+
system_message(elgg_echo("tidypics:phototagging:success"));
}
|