diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/TidypicsImage.php | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/classes/TidypicsImage.php b/classes/TidypicsImage.php index 7eca2f7c3..b97a2b05e 100644 --- a/classes/TidypicsImage.php +++ b/classes/TidypicsImage.php @@ -338,55 +338,20 @@ class TidypicsImage extends ElggFile { /** * Get an array of photo tag information * - * @return array of json representations of the tags and the tag link text + * @return array */ public function getPhotoTags() { $tags = array(); - $annotations = get_annotations($this->getGUID(), 'object', 'image', 'phototag'); + $annotations = elgg_get_annotations(array( + 'guid' => $this->getGUID(), + 'annotation_name' => 'phototag', + )); foreach ($annotations as $annotation) { $tags[] = unserialize($annotation->value); } return $tags; - - /* - $photo_tags_json = "["; - foreach ($photo_tags as $p) { - $photo_tag = unserialize($p->value); - - // create link to page with other photos tagged with same tag - $phototag_text = $photo_tag->value; - $phototag_link = $CONFIG->wwwroot . 'search/?tag=' . $phototag_text . '&subtype=image&object=object'; - if ($photo_tag->type === 'user') { - $user = get_entity($photo_tag->value); - if ($user) { - $phototag_text = $user->name; - } else { - $phototag_text = "unknown user"; - } - - $phototag_link = $CONFIG->wwwroot . "pg/photos/tagged/" . $photo_tag->value; - } - - if (isset($photo_tag->x1)) { - // hack to handle format of Pedro Prez's tags - ugh - $photo_tag->coords = "\"x1\":\"{$photo_tag->x1}\",\"y1\":\"{$photo_tag->y1}\",\"width\":\"{$photo_tag->width}\",\"height\":\"{$photo_tag->height}\""; - $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '","id":"' . $p->id . '"},'; - } else { - $photo_tags_json .= '{' . $photo_tag->coords . ',"text":"' . $phototag_text . '","id":"' . $p->id . '"},'; - } - - // prepare variable arrays for tagging view - $photo_tag_links[$p->id] = array('text' => $phototag_text, 'url' => $phototag_link); - } - - $photo_tags_json = rtrim($photo_tags_json,','); - $photo_tags_json .= ']'; - - $ret_data = array('json' => $photo_tags_json, 'links' => $photo_tag_links); - return $ret_data; - */ } /** |