summaryrefslogtreecommitdiff
path: root/includes/sysedit.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/sysedit.php')
-rw-r--r--includes/sysedit.php29
1 files changed, 0 insertions, 29 deletions
diff --git a/includes/sysedit.php b/includes/sysedit.php
index 91ebbe1..0eca518 100644
--- a/includes/sysedit.php
+++ b/includes/sysedit.php
@@ -1,34 +1,5 @@
<?php global $system; global $systemCommonName; global $systemID; $title = "Editing " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
-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}";
-}
-
?>
<br>