/**
* 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;
- */
}
/**
<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
<name>Tidypics Photo Gallery</name>
<author>Cash Costello</author>
- <version>1.8.0-preview1</version>
+ <version>1.8.0-preview2</version>
<description>A photo gallery with albums, tagging, and a slideshow.</description>
<category>content</category>
<category>multimedia</category>
<website>https://github.com/cash/Tidypics</website>
- <copyright>Cash Costello 2011</copyright>
+ <copyright>Cash Costello 2011-2012</copyright>
<license>GNU General Public License Version 2</license>
<requires>
<type>elgg_release</type>
case "upload": // upload images to album
set_input('guid', $page[1]);
- set_input('uploader', elgg_extract(2, $page, 'ajax'));
+ set_input('uploader', elgg_extract(2, $page, 'basic'));
require "$base/image/upload.php";
break;