From d124fec101c9b2a2be29587cb4eff5826b78623d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 2 Aug 2009 23:44:40 +0000 Subject: tags go to river now --- actions/addtag.php | 7 ++++++- graphics/icons/river_icon_tag.gif | Bin 0 -> 184 bytes languages/en.php | 7 ++++--- views/default/river/object/image/tag.php | 20 ++++++++++++++++++++ views/default/tidypics/css.php | 4 ++++ 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 graphics/icons/river_icon_tag.gif create mode 100644 views/default/river/object/image/tag.php diff --git a/actions/addtag.php b/actions/addtag.php index fb299dee6..fa2b4b3c6 100644 --- a/actions/addtag.php +++ b/actions/addtag.php @@ -74,8 +74,13 @@ 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)) + if (!check_entity_relationship($user_id, 'phototag', $image_guid)) { add_entity_relationship($user_id, 'phototag', $image_guid); + + // also add this to the river + if (function_exists('add_to_river')) + add_to_river('river/object/image/tag', 'tag', $image_guid, $user_id); // subject is image + } } system_message(elgg_echo("tidypics:phototagging:success")); diff --git a/graphics/icons/river_icon_tag.gif b/graphics/icons/river_icon_tag.gif new file mode 100644 index 000000000..510696147 Binary files /dev/null and b/graphics/icons/river_icon_tag.gif differ diff --git a/languages/en.php b/languages/en.php index 6890ddfd8..de8a22db2 100644 --- a/languages/en.php +++ b/languages/en.php @@ -127,9 +127,10 @@ // river //images - 'image:river:created' => "%s added the image %s to album %s", - 'image:river:item' => "an image", - 'image:river:annotate' => "a comment on the image", + 'image:river:created' => "%s added the photo %s to album %s", + 'image:river:item' => "an photo", + 'image:river:annotate' => "a comment on the photo", + 'image:river:tagged' => "was tagged in the photo", //albums 'album:river:created' => "%s created a new photo album", diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php new file mode 100644 index 000000000..cfe01e444 --- /dev/null +++ b/views/default/river/object/image/tag.php @@ -0,0 +1,20 @@ +subject_guid); + $person_tagged = get_entity($vars['item']->object_guid); + if($image->title) { + $title = $image->title; + } else { + $title = "untitled"; + } + + + + $image_url = "getURL()}\">{$title}"; + $person_url = "getURL()}\">{$person_tagged->name}"; + + $string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url; + + echo $string; + +?> \ No newline at end of file diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php index a68ff22f0..66d42c22a 100644 --- a/views/default/tidypics/css.php +++ b/views/default/tidypics/css.php @@ -175,6 +175,10 @@ padding:0 0 5px; background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; } +.river_user_tag { + background: url(mod/tidypics/graphics/icons/river_icon_tag.gif) no-repeat left -1px; +}} + /* ----------- tagging ---------------- */ #tidypics_tag_instructions { background:#BBDAF7; -- cgit v1.2.3