diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-02-20 00:53:06 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-02-20 00:53:06 +0000 |
commit | d8af70961afb5cfab76ffffa3672ed6f1040baf4 (patch) | |
tree | f863de5bd4f725ddf0f06f4cdf38a4a606adaeb2 /engine/lib/elgglib.php | |
parent | 79455e6a6f76844742b4cafdca151e7b0bba00fd (diff) | |
download | elgg-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
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r-- | engine/lib/elgglib.php | 15 |
1 files changed, 9 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>"; } /** |