aboutsummaryrefslogtreecommitdiff
path: root/views/default/object
diff options
context:
space:
mode:
authorGreg Froese <greg.froese@gmail.com>2009-06-08 14:38:45 +0000
committerGreg Froese <greg.froese@gmail.com>2009-06-08 14:38:45 +0000
commited5bf08b0a312cfc4bb6b885b0ca293d4b10869b (patch)
treeb0f89fda59e3a4bac71508aab5b8b5609d988dba /views/default/object
parent0b4487d2200a4818fd52d6fbbb1f252e053141c6 (diff)
downloadelgg-ed5bf08b0a312cfc4bb6b885b0ca293d4b10869b.tar.gz
elgg-ed5bf08b0a312cfc4bb6b885b0ca293d4b10869b.tar.bz2
removed owner counts from mostviewed pages and updated view info on image view
Diffstat (limited to 'views/default/object')
-rw-r--r--views/default/object/image.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/views/default/object/image.php b/views/default/object/image.php
index ebac9c775..64109f1a2 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -116,10 +116,17 @@ if ($photo_tags) {
$views = count($views_a);
$my_views = 0;
+ $owner_views = 0;
+ $diff_viewers = array();
+// echo "<pre>"; var_dump($owner); echo "</pre>";
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 = '';
@@ -155,7 +162,13 @@ if ($photo_tags) {
<div id="tidypics_breadcrumbs">
<?php echo elgg_view('tidypics/breadcrumbs', array('album' => $album,) ); ?> <br />
- Views: <?=$views ?> <?= $my_views ? " ($my_views by me)" : ""; ?>
+ <?
+ if($owner->guid == $the_viewer) {
+ echo sprintf(elgg_echo("tidypics:viewsbyowner"), $views, count($diff_viewers));
+ } else {
+ echo sprintf(elgg_echo("tidypics:viewsbyothers"), $views, $my_views);
+ }
+ ?>
</div>
<div id="tidypics_desc">