From af26a60db00294af093bf8e385d3e628de1c47d2 Mon Sep 17 00:00:00 2001 From: Greg Froese Date: Sat, 16 May 2009 00:16:40 +0000 Subject: counting now using annotations --- views/default/object/image.php | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/default/object/image.php b/views/default/object/image.php index 09a121256..13a94fc7d 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -88,7 +88,26 @@ if ($photo_tags) { // //////////////////////////////////////////////////////// - + // Get view information + + $viewer = get_loggedin_user(); + + //who is viewing? + if($viewer->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"); + $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 = ''; @@ -123,17 +142,19 @@ if ($photo_tags) {
- $album,) ); ?> + $album,) ); ?>
+ Views:
- +
'; ?> +
@@ -159,7 +180,11 @@ if ($photo_tags) {
$tags));?>
+
+ $vars['entity'])); ?> +
name; ?>
-- cgit v1.2.3