getGUID(); $tags = $file->tags; $title = $file->title; $desc = $file->description; $owner = $vars['entity']->getOwnerEntity(); $friendlytime = friendly_time($vars['entity']->time_created); $mime = $file->mimetype; // photo tags $photo_tag_links = array(); $photo_tags_json = "\"\""; $photo_tags = get_annotations($file_guid,'object','image','phototag'); if ($photo_tags) { $photo_tags_json = "["; foreach ($photo_tags as $p) { $photo_tag = unserialize($p->value); $phototag_text = $photo_tag->value; if ($photo_tag->type === 'user') { $user = get_entity($photo_tag->value); if ($user) $phototag_text = $user->name; else $phototag_text = "unknown user"; } // hack to handle format of Pedro Prez's tags - ugh if (isset($photo_tag->x1)) { $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 . '"},'; $photo_tag_links[] = array($p->id, $phototag_text); // gave up on associative array for now } $photo_tags_json = rtrim($photo_tags_json,','); $photo_tags_json .= ']'; } if (get_context() == "search") { //if this is the search view if (get_input('search_viewtype') == "gallery") { ?>
thumbnail
'.$title.'

'; $info .= "

username}\">{$owner->name} {$friendlytime}"; $numcomments = elgg_count_comments($file); if ($numcomments) $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")"; $info .= "

"; $icon = "getURL()}\">" . elgg_view("tidypics/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . ""; echo elgg_view_listing($icon, $info); } } else { if (!$vars['full']) { //simple gallery view ?>
thumbnail
guid) { $the_viewer = $viewer->guid; } else { $the_viewer = 0; } create_annotation($file_guid, "tp_view", "1", "integer", $the_viewer, 2); $views_a = get_annotations($file_guid, "object", "image", "tp_view", "", 0, 9999); $views = count($views_a); $my_views = 0; foreach($views_a as $view) { if($view->owner_guid == $the_viewer && $the_viewer != 0) $my_views++; } // Build back and next links $back = ''; $next = ''; $album = get_entity($file->container_guid); $current = array_search($file_guid, $_SESSION['image_sort']); if (!$current) { // means we are no longer using the correct album array //rebuild the array $count = get_entities("object","image", $album->guid, '', 999); $_SESSION['image_sort'] = array(); foreach ($count as $image) { array_push($_SESSION['image_sort'], $image->guid); } $current = array_search($file_guid, $_SESSION['image_sort']); } if ($current != 0) $back = '<<' . elgg_echo('image:back') . ''; if (sizeof($_SESSION['image_sort']) > $current + 1) $next = '' . elgg_echo('image:next') . '>>'; ?>
$album,) ); ?>
Views:
'; ?>
  • $file_guid,) ); } ?>
$tags));?>
$vars['entity'])); ?>
name; ?>
'; // content wrapper ?>
getGUID(), false, 'user', '', 0); $content = ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= "
"; echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'form-phototagging', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'body' => $content)); ?>
$photo_tags_json,) ); } // // end of individual image display } ?>