From 9e54d3a4c5274b235a29de9a00e967695024d8e1 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 2 Jan 2012 15:55:09 -0500 Subject: added support for plain word tags --- actions/photos/image/tag.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'actions/photos') diff --git a/actions/photos/image/tag.php b/actions/photos/image/tag.php index 0c7ce06ae..20f476944 100644 --- a/actions/photos/image/tag.php +++ b/actions/photos/image/tag.php @@ -26,7 +26,17 @@ if (empty($username)) { forward(REFERER); } -/* +$user = get_user_by_username($username); +if (!$user) { + // plain tag + $relationships_type = 'word'; + $value = $username; +} else { + $relationships_type = 'user'; + $value = $user->guid; +} + +/* // not adding as plain tag yet $new_word_tag = false; if ($user_id != 0) { $relationships_type = 'user'; @@ -60,8 +70,8 @@ if ($new_word_tag) { $tag = new stdClass(); $tag->coords = $coordinates_str; -$tag->type = 'user'; -$tag->value = get_user_by_username($username)->getGUID(); +$tag->type = $relationships_type; +$tag->value = $value; $access_id = $image->getAccessID(); $annotation_id = $image->annotate('phototag', serialize($tag), $access_id); -- cgit v1.2.3