getGUID(); $tags = $file->tags; $title = $file->title; $desc = $file->description; $owner = $vars['entity']->getOwnerEntity(); $friendlytime = friendly_time($vars['entity']->time_created); $mime = $file->mimetype; ///////////////////////////////////////////////////// // get photo tags from database $photo_tags_json = "\"\""; $tag_info = $file->getPhotoTags(); if ($tag_info) { $photo_tags = $tag_info['raw']; $photo_tags_json = $tag_info['json']; $photo_tag_links = $tag_info['links']; } /******************************************************************** * * search view of an image * ********************************************************************/ if (get_context() == "search") { 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()}\">" . '' . $title . ''; echo elgg_view_listing($icon, $info); } /*************************************************************** * * front page view * ****************************************************************/ } else if (get_context() == "front") { ?> <?php echo $title; ?>
thumbnail
guid) { $the_viewer = $viewer->guid; } else { $the_viewer = 0; } // only non-owner views count if ($owner->guid != $view->owner_guid) create_annotation($file_guid, "tp_view", "1", "integer", $the_viewer, ACCESS_PUBLIC); $views_a = get_annotations($file_guid, "object", "image", "tp_view", "", 0, 9999); $views = count($views_a); $my_views = 0; $owner_views = 0; $diff_viewers = array(); // echo "
"; var_dump($owner); echo "
"; foreach($views_a as $view) { if($view->owner_guid == $the_viewer && $the_viewer != 0) $my_views++; if($owner->guid == $view->owner_guid) $owner_views++; //count how many different people have viewed it if($owner->guid != $view->owner_guid) $diff_viewers[$view->owner_guid] = 1; } //remove the owner's views from the total count (prevents artificially inflated view counts) $views = $views - $owner_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); } if ($_SESSION['image_sort']) $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,) ); ?>
guid == $the_viewer) { echo sprintf(elgg_echo("tidypics:viewsbyowner"), $views, count($diff_viewers)); } else { echo sprintf(elgg_echo("tidypics:viewsbyothers"), $views, $my_views); } } ?>
\"{$title}\""; } else { echo "\"{$title}\""; } ?>
'; // tagging code if (get_plugin_setting('tagging', 'tidypics') != "disabled") { echo elgg_view('tidypics/tagging', array( 'photo_tags' => $photo_tags, 'links' => $photo_tag_links, 'photo_tags_json' => $photo_tags_json, 'file_guid' => $file_guid, 'viewer' => $viewer, 'owner' => $owner, ) ); } if (get_plugin_setting('exif', 'tidypics') == "enabled") { ?> $file_guid)); ?>
$tags));?>
$vars['entity'])); ?>
name; ?>
'; // content wrapper } // end of individual image display } ?>