aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-20 00:53:06 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-20 00:53:06 +0000
commitd8af70961afb5cfab76ffffa3672ed6f1040baf4 (patch)
treef863de5bd4f725ddf0f06f4cdf38a4a606adaeb2
parent79455e6a6f76844742b4cafdca151e7b0bba00fd (diff)
downloadelgg-d8af70961afb5cfab76ffffa3672ed6f1040baf4.tar.gz
elgg-d8af70961afb5cfab76ffffa3672ed6f1040baf4.tar.bz2
Refs #1531: Added full time and dates to friendly time stamptes via acronym tags.
git-svn-id: http://code.elgg.org/elgg/trunk@3957 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/elgglib.php15
-rw-r--r--languages/en.php1
2 files changed, 10 insertions, 6 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 43dba4a43..09940082c 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1234,29 +1234,32 @@ function friendly_time($time) {
$diff = 1;
}
if ($diff > 1) {
- return sprintf(elgg_echo("friendlytime:minutes"),$diff);
+ $friendly_time = sprintf(elgg_echo("friendlytime:minutes"), $diff);
}
- return sprintf(elgg_echo("friendlytime:minutes:singular"),$diff);
+ $friendly_time = sprintf(elgg_echo("friendlytime:minutes:singular"), $diff);
} else if ($diff < 86400) {
$diff = round($diff / 3600);
if ($diff == 0) {
$diff = 1;
}
if ($diff > 1) {
- return sprintf(elgg_echo("friendlytime:hours"),$diff);
+ $friendly_time = sprintf(elgg_echo("friendlytime:hours"), $diff);
}
- return sprintf(elgg_echo("friendlytime:hours:singular"),$diff);
+ $friendly_time = sprintf(elgg_echo("friendlytime:hours:singular"), $diff);
} else {
$diff = round($diff / 86400);
if ($diff == 0) {
$diff = 1;
}
if ($diff > 1) {
- return sprintf(elgg_echo("friendlytime:days"),$diff);
+ $friendly_time = sprintf(elgg_echo("friendlytime:days"), $diff);
}
- return sprintf(elgg_echo("friendlytime:days:singular"),$diff);
+ $friendly_time = sprintf(elgg_echo("friendlytime:days:singular"), $diff);
}
+
+ $timestamp = htmlentities(date(elgg_echo('friendlytime:date_format', $time)));
+ return "<acronym title=\"$timestamp\">$friendly_time</acronym>";
}
/**
diff --git a/languages/en.php b/languages/en.php
index b495c2396..61929d527 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -677,6 +677,7 @@ Once you have logged in, we highly recommend that you change your password.
'friendlytime:hours:singular' => "an hour ago",
'friendlytime:days' => "%s days ago",
'friendlytime:days:singular' => "yesterday",
+ 'friendlytime:date_format' => 'j F Y @ g:ia',
'date:month:01' => 'January %s',
'date:month:02' => 'February %s',