diff options
author | cash <cash.costello@gmail.com> | 2012-01-02 15:55:09 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2012-01-02 15:55:09 -0500 |
commit | 9e54d3a4c5274b235a29de9a00e967695024d8e1 (patch) | |
tree | 2af48e3315b48aea2a6e16be1211bcbb38d75eb1 /actions/photos | |
parent | ad4f0fc6c003e0b3365f542795c1c6b3ee06749d (diff) | |
download | elgg-9e54d3a4c5274b235a29de9a00e967695024d8e1.tar.gz elgg-9e54d3a4c5274b235a29de9a00e967695024d8e1.tar.bz2 |
added support for plain word tags
Diffstat (limited to 'actions/photos')
-rw-r--r-- | actions/photos/image/tag.php | 16 |
1 files changed, 13 insertions, 3 deletions
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); |