diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/annotation/annotate.php | 2 | ||||
-rw-r--r-- | views/default/annotation/annotatelike.php | 2 | ||||
-rw-r--r-- | views/default/annotation/generic_comment.php | 2 | ||||
-rw-r--r-- | views/default/annotation/latest_comments.php | 2 | ||||
-rw-r--r-- | views/default/annotation/likes.php | 2 | ||||
-rw-r--r-- | views/default/object/default.php | 2 | ||||
-rw-r--r-- | views/default/output/friendlytime.php | 44 | ||||
-rw-r--r-- | views/default/river/item/wrapper.php | 4 |
8 files changed, 9 insertions, 51 deletions
diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php index 5cd2879c2..bfef8e08e 100644 --- a/views/default/annotation/annotate.php +++ b/views/default/annotation/annotate.php @@ -12,7 +12,7 @@ $comment = get_annotation($vars['item']->annotation_id)->value; $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; $string = sprintf(elgg_echo("river:posted:generic"),$url) . " "; - $string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity_subtext'>". friendly_time($object->time_created) ."<a class='river_comment_form_button link'>Comment</a>"; + $string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity_subtext'>". elgg_view_friendly_time($object->time_created) ."<a class='river_comment_form_button link'>Comment</a>"; $string .= elgg_view('likes/forms/link', array('entity' => $object)); $string .= "</span>"; if(get_context() != 'riverdashboard'){ diff --git a/views/default/annotation/annotatelike.php b/views/default/annotation/annotatelike.php index 6a2dcd4ca..43655ba6e 100644 --- a/views/default/annotation/annotatelike.php +++ b/views/default/annotation/annotatelike.php @@ -6,6 +6,6 @@ $url = $object->getURL(); $title = $object->title; $string = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> "; -$string .= elgg_echo("likes:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity_subtext'>" . friendly_time($object->time_created)."</span>"; +$string .= elgg_echo("likes:river:annotate") . " <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity_subtext'>" . elgg_view_friendly_time($object->time_created)."</span>"; echo $string;
\ No newline at end of file diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index 56948aaf4..5b9c62840 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -36,7 +36,7 @@ $owner = get_user($vars['annotation']->owner_guid); <p class="generic_comment_owner"> <a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <span class="entity_subtext"> - <?php echo friendly_time($vars['annotation']->time_created); ?> + <?php echo elgg_view_friendly_time($vars['annotation']->time_created); ?> </span> </p> <!-- output the actual comment --> diff --git a/views/default/annotation/latest_comments.php b/views/default/annotation/latest_comments.php index e1181b63e..79a50fea1 100644 --- a/views/default/annotation/latest_comments.php +++ b/views/default/annotation/latest_comments.php @@ -11,7 +11,7 @@ if($vars['comments']){ $entity = get_entity($comment->entity_guid); //comment owner $comment_owner = get_user($comment->owner_guid); - $friendlytime = friendly_time($comment->time_created); // get timestamp for comment + $friendlytime = elgg_view_friendly_time($comment->time_created); // get timestamp for comment //set the title if($entity->title){ diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php index 2808664df..cb7424f7d 100644 --- a/views/default/annotation/likes.php +++ b/views/default/annotation/likes.php @@ -34,7 +34,7 @@ $owner = get_user($vars['annotation']->owner_guid); ?> <p class="elgg_likes_owner"> <a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo elgg_echo('likes:this') . - " <span class=\"entity_subtext\">" . friendly_time($vars['annotation']->time_created) . "</span>"; ?> + " <span class=\"entity_subtext\">" . elgg_view_friendly_time($vars['annotation']->time_created) . "</span>"; ?> </p> </div> </div>
\ No newline at end of file diff --git a/views/default/object/default.php b/views/default/object/default.php index d49463bf8..cc3dd1e72 100644 --- a/views/default/object/default.php +++ b/views/default/object/default.php @@ -50,7 +50,7 @@ if ($vars['full']) { } $info .= "<div>".sprintf(elgg_echo("entity:default:strapline"), - friendly_time($vars['entity']->time_created), + elgg_view_friendly_time($vars['entity']->time_created), $ownertxt ); diff --git a/views/default/output/friendlytime.php b/views/default/output/friendlytime.php index 282d94c41..710079c2a 100644 --- a/views/default/output/friendlytime.php +++ b/views/default/output/friendlytime.php @@ -6,49 +6,7 @@ * @uses string $vars['time'] Unix-style epoch timestamp */ -$diff = time() - ((int) $vars['time']); - -$minute = 60; -$hour = $minute * 60; -$day = $hour * 24; - -if ($diff < $minute) { - $friendly_time = elgg_echo("friendlytime:justnow"); -} else if ($diff < $hour) { - $diff = round($diff / $minute); - if ($diff == 0) { - $diff = 1; - } - - if ($diff > 1) { - $friendly_time = sprintf(elgg_echo("friendlytime:minutes"), $diff); - } else { - $friendly_time = sprintf(elgg_echo("friendlytime:minutes:singular"), $diff); - } -} else if ($diff < $day) { - $diff = round($diff / $hour); - if ($diff == 0) { - $diff = 1; - } - - if ($diff > 1) { - $friendly_time = sprintf(elgg_echo("friendlytime:hours"), $diff); - } else { - $friendly_time = sprintf(elgg_echo("friendlytime:hours:singular"), $diff); - } -} else { - $diff = round($diff / $day); - if ($diff == 0) { - $diff = 1; - } - - if ($diff > 1) { - $friendly_time = sprintf(elgg_echo("friendlytime:days"), $diff); - } else { - $friendly_time = sprintf(elgg_echo("friendlytime:days:singular"), $diff); - } -} - +$friendly_time = elgg_get_friendly_time($vars['time']); $timestamp = htmlentities(date(elgg_echo('friendlytime:date_format'), $vars['time'])); echo "<acronym title=\"$timestamp\">$friendly_time</acronym>"; diff --git a/views/default/river/item/wrapper.php b/views/default/river/item/wrapper.php index a00273648..6391f23fb 100644 --- a/views/default/river/item/wrapper.php +++ b/views/default/river/item/wrapper.php @@ -28,7 +28,7 @@ if($avatar_icon == "icon"){ ?> <span class="entity_subtext"> (<?php - echo friendly_time($vars['item']->posted); + echo elgg_view_friendly_time($vars['item']->posted); ?>) </span> </p> @@ -53,7 +53,7 @@ if($avatar_icon == "icon"){ ?> <span class="entity_subtext"> (<?php - echo friendly_time($vars['item']->posted); + echo elgg_view_friendly_time($vars['item']->posted); ?>) </span> </p> |