summaryrefslogtreecommitdiff
path: root/includes/member/hierarchy.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/member/hierarchy.php')
-rw-r--r--includes/member/hierarchy.php30
1 files changed, 0 insertions, 30 deletions
diff --git a/includes/member/hierarchy.php b/includes/member/hierarchy.php
index 39045b3..301bd1c 100644
--- a/includes/member/hierarchy.php
+++ b/includes/member/hierarchy.php
@@ -10,36 +10,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true);
-function timeAgo($time): string
-{
- if (!is_numeric($time)) {
- $time = strtotime($time);
- }
-
- $periods = ["second", "minute", "hour", "day", "week", "month", "year", "age"];
- $lengths = array("60", "60", "24", "7", "4.35", "12", "100");
-
- $now = time();
-
- $difference = $now - $time;
- if ($difference <= 10 && $difference >= 0) {
- return $tense = "now";
- } elseif ($difference > 0) {
- $tense = "ago";
- } else {
- $tense = "later";
- }
-
- for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths) - 1; $j++) {
- $difference /= $lengths[$j];
- }
-
- $difference = round($difference);
-
- $period = $periods[$j] . ($difference > 1 ? "s" : '');
- return "{$difference} {$period} {$tense}";
-}
-
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true));
$allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true), $systemID);