summaryrefslogtreecommitdiff
path: root/includes/system.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-08-26 22:29:23 +0200
committerMinteck <contact@minteck.org>2022-08-26 22:29:23 +0200
commit09bd0164ebc020a54b944b7326dcba496fb5d82c (patch)
tree0c5e765e627ecc94e534ccb6e2bc83917d58dc4c /includes/system.php
parenta2df9a69dcc14cb70118cda2ded499055e7ee358 (diff)
downloadpluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.gz
pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.bz2
pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.zip
idk when was the last commit so I'm making a new one - Violet Dawn
Diffstat (limited to 'includes/system.php')
-rw-r--r--includes/system.php42
1 files changed, 0 insertions, 42 deletions
diff --git a/includes/system.php b/includes/system.php
index 059eed7..46adeb1 100644
--- a/includes/system.php
+++ b/includes/system.php
@@ -1,47 +1,5 @@
<?php global $system; global $systemCommonName; global $systemID; $title = $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
-function getMember(string $id) {
- global $systemID;
-
- $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true);
- $member = null;
-
- foreach ($members as $m) {
- if ($m["id"] === $id) $member = $m;
- }
-
- return $member;
-}
-
-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>