From 0417260bf158c5d7b62888dae2e202b0de115a05 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 10 Aug 2022 00:04:25 +0200 Subject: Initial commit --- includes/banner.php | 222 +++++++++++++ includes/edit.php | 174 ++++++++++ includes/footer.php | 57 ++++ includes/header.php | 719 ++++++++++++++++++++++++++++++++++++++++++ includes/member.php | 84 +++++ includes/refresh.php | 35 ++ includes/score.php | 74 +++++ includes/session.php | 19 ++ includes/subsysbanner.php | 68 ++++ includes/subsysedit.php | 172 ++++++++++ includes/sysbanner.php | 80 +++++ includes/sysedit.php | 172 ++++++++++ includes/system.php | 61 ++++ includes/system/compare.php | 189 +++++++++++ includes/system/history.php | 380 ++++++++++++++++++++++ includes/system/species.php | 53 ++++ includes/system/subsystem.php | 124 ++++++++ includes/system/tree.php | 114 +++++++ 18 files changed, 2797 insertions(+) create mode 100644 includes/banner.php create mode 100644 includes/edit.php create mode 100644 includes/footer.php create mode 100644 includes/header.php create mode 100644 includes/member.php create mode 100644 includes/refresh.php create mode 100644 includes/score.php create mode 100644 includes/session.php create mode 100644 includes/subsysbanner.php create mode 100644 includes/subsysedit.php create mode 100644 includes/sysbanner.php create mode 100644 includes/sysedit.php create mode 100644 includes/system.php create mode 100644 includes/system/compare.php create mode 100644 includes/system/history.php create mode 100644 includes/system/species.php create mode 100644 includes/system/subsystem.php create mode 100644 includes/system/tree.php (limited to 'includes') diff --git a/includes/banner.php b/includes/banner.php new file mode 100644 index 0000000..b5088df --- /dev/null +++ b/includes/banner.php @@ -0,0 +1,222 @@ + + + +
;background:rgba(255, 255, 255, .1);border-radius:10px;display:grid;grid-template-columns: 128px 1fr;"> +
+ +
+
+

+ +

+
+ + Host + + + Fictive + + + Little + + + + , temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-secondary">Age regresses into "> + + Age regressor + + + + 0): ?> + instead of , temporarily behaving and feeling younger than the body is." class="badge rounded-pill bg-warning">Age regressed from "> + + , meaning they are not totally independent from ." class="badge rounded-pill bg-light">Facet of "> + + + + Not talking + + +   + +
+
54, 1fr);" id="member-card"> + + Prefixes: + + + + + + Pronouns: + + + + + Last fronted: + (started " . trim(timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true)["timestamp"])) . ")"); + } else { + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true); + + $thisMember = array_filter($switches, function ($item) { + global $memberData; + return in_array($memberData["id"], $item["members"]); + }); + $thisMember = array_values($thisMember); + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + + if ($frontingEnd === null) { + echo("A long time ago
-"); + } else { + echo('' . timeAgo($frontingEnd["timestamp"]) . ''); + + $seconds = (strtotime($frontingEnd["timestamp"]) - strtotime($frontingStart["timestamp"])); + if ($seconds > 60) { + if ($seconds > 3600) { + echo("
(for " . round($seconds / 3600) . " hours)"); + } else { + echo("
(for " . round($seconds / 60) . " minutes)"); + } + } else { + echo("
(for " . $seconds . " seconds)"); + } + } + } + + ?> +
+ + + Species: + + " style="width:32px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> + + + + System: + +
Subsystem: "> + +
+
+
+ + + Marefriends: 1 ? '
' : '' ?> + + /">.png" style="width:24px;"> ,

'); ?> + + - + + + Sisters: 1 ? '
' : '' ?> + + /">.png" style="width:24px;"> ,

'); ?> + + - + +
+
+
\ No newline at end of file diff --git a/includes/edit.php b/includes/edit.php new file mode 100644 index 0000000..839c130 --- /dev/null +++ b/includes/edit.php @@ -0,0 +1,174 @@ += 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 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true); + +?> + +
+
+ +
+ +

+ Saved · bytes +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/footer.php b/includes/footer.php new file mode 100644 index 0000000..c120941 --- /dev/null +++ b/includes/footer.php @@ -0,0 +1,57 @@ += 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} "; + } +} + +?> + +
+
+ © Equestria.dev Developers
+ PluralKit data updated , next update in 1 ? $t . " minutes" : ($t > 0 ? "a minute" : "a few seconds") ?> +


+
+ + + + + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..af12bcb --- /dev/null +++ b/includes/header.php @@ -0,0 +1,719 @@ + 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly") { + if (str_contains($parts[0], "/")) { + return explode("/", $parts[0])[0]; + } else { + return $parts[0]; + } + } else { + return $name; + } +} + +function getSystemMember(string $system, string $id) { + $systemID = $system; + + $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 getBrightness(string $hexCode) { + if (str_starts_with("#", $hexCode)) { + $hexCode = substr($hexCode, 1); + } + + $red = hexdec(substr($hexCode, 0, 2)); + $green = hexdec(substr($hexCode, 2, 2)); + $blue = hexdec(substr($hexCode, 4, 2)); + $brightness = $red + $green + $blue; + + return $brightness > 382; +} + +function showMembersFromList(array $list, string $id) { + foreach ($list as $member) { if ($member['name'] !== "unknown") { + echo(' +
+ +
' . ($member['display_name'] ?? $member['name']) . '
+
' . $member['proxy_tags'][0]['prefix'] . '
+
'); + }} +} + +function showSubsystem(array $data, string $parentSystem) { + $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$parentSystem-subsystem-$data[source].json"), true); + + echo(' +
'); + echo('
'); + + showMembersFromList(scoreOrder(array_map(function ($i) use ($parentSystem) { + return getSystemMember($parentSystem, $i); + }, $data["members"]), $parentSystem), $parentSystem); + + echo('
+ +
'); +} + +function showSystem(string $id, string $name, string $color, bool $hideTitle) { + if ($hideTitle) { + echo(' +
'); + } else { + echo(' +
'); + } + + if (!$hideTitle) echo(' + +' . $name . ' +'); + + if ($hideTitle) { + echo('
'); + } else { + echo('
'); + } + + showMembersFromList(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id-members.json"), true), $id), $id); + + echo('
+ +
'); +} + +function cloudburst(bool $hideTitle): void { + showSystem("ynmuc", "Cloudburst System", "#5f08a9a6", $hideTitle); +} + +function raindrops(bool $hideTitle): void { + showSystem("gdapd", "Raindrops System", "#a95f08a6", $hideTitle); +} + +?> + + + + + + + + <?= $title ? $title . " · " : "" ?>Cuties and Plurality + + + + + \ No newline at end of file diff --git a/includes/member.php b/includes/member.php new file mode 100644 index 0000000..ad7995f --- /dev/null +++ b/includes/member.php @@ -0,0 +1,84 @@ += 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 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true); + +?> + +
+
+ +
+ + +
+
+ Private administrator information +
    +
  • ID: (, )
  • +
  • Reduced name:
  • +
  • Shared memory access: ()
  • +
  • Protector: ()
  • +
  • Little: ()
  • +
  • Relations count:
  • + +
  • + Score breakdown: +
    + Show details +
      +
    • Host score:
    • +
    • Relationships score:
    • +
    • Fictive score:
    • +
    • Median score:
    • +
    • Species score:
    • +
    • Little score:
    • +
    • Not talking score:
    • +
    • Protector score:
    • +
    • Name score:
    • +
    • Shared memory score:
    • +
    +
    +
  • +
+
+
+ + +
+ + (edit) + + This page is empty." ?> +
+
+ + \ No newline at end of file diff --git a/includes/refresh.php b/includes/refresh.php new file mode 100644 index 0000000..c29136f --- /dev/null +++ b/includes/refresh.php @@ -0,0 +1,35 @@ + time(), + "duration" => $time +])); \ No newline at end of file diff --git a/includes/score.php b/includes/score.php new file mode 100644 index 0000000..c3108f2 --- /dev/null +++ b/includes/score.php @@ -0,0 +1,74 @@ + $scoreHost, + "fictive" => $scoreFictive, + "little" => $scoreLittle, + "median" => $scoreMedian, + "not_talking" => $scoreNotTalking, + "name" => $scoreName, + "protector" => $scoreProtector, + "shared_memory" => $scoreSharedMemory, + "relations" => $scoreRelations, + "species" => $scoreSpecies, + "total" => $score + ]; +} + +function scoreOrder($members, $system) { + $ordered = []; + foreach ($members as $member) { + if ($member["name"] !== "unknown") { + $member["_metadata"] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-$member[id]-metadata.json"), true); + $member["_score"] = calculateScore(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-$member[id]-metadata.json"), true), $member["display_name"] ?? $member["name"]); + $ordered[] = $member; + } + } + + uasort($ordered, function($a, $b) { + return $b["_score"]["total"] - $a["_score"]["total"]; + }); + + return $ordered; +} + +function scoreOrderGlobal() { + $ordered = []; + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + if ($member["name"] !== "unknown") { + $member["_system"] = "gdapd"; + $member["_metadata"] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true); + $member["_score"] = calculateScore(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true), $member["display_name"] ?? $member["name"]); + $ordered[] = $member; + } + } + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + if ($member["name"] !== "unknown") { + $member["_system"] = "ynmuc"; + $member["_metadata"] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true); + $member["_score"] = calculateScore(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true), $member["display_name"] ?? $member["name"]); + $ordered[] = $member; + } + } + + uasort($ordered, function($a, $b) { + return $b["_score"]["total"] - $a["_score"]["total"]; + }); + + return $ordered; +} \ No newline at end of file diff --git a/includes/session.php b/includes/session.php new file mode 100644 index 0000000..27acf6b --- /dev/null +++ b/includes/session.php @@ -0,0 +1,19 @@ + + +
+ +
+
+

+
+ + Current Fronter: + + ">.png" style="width:24px;"> + + N/A + + + + + Previous Fronter: ">.png" style="width:24px;"> + + + Members: + + + Parent System: + +
+
+
+
+ +
+
+ You are viewing the page of a subsystem of the . +
+
\ No newline at end of file diff --git a/includes/subsysedit.php b/includes/subsysedit.php new file mode 100644 index 0000000..a19683d --- /dev/null +++ b/includes/subsysedit.php @@ -0,0 +1,172 @@ += 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} "; +} + +?> + +
+
+ +
+ +

+ Saved · bytes +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/sysbanner.php b/includes/sysbanner.php new file mode 100644 index 0000000..d76e601 --- /dev/null +++ b/includes/sysbanner.php @@ -0,0 +1,80 @@ + + +
+ +
+
+

+
+ + Host: + ">.png" style="width:24px;"> + + + + + + Current Fronter: ">.png" style="width:24px;"> + + + + Previous Fronter: ">.png" style="width:24px;"> + + + Members: + + + Last Switch: "> + +
+
+
+
+ + \ No newline at end of file diff --git a/includes/sysedit.php b/includes/sysedit.php new file mode 100644 index 0000000..0e3c9a7 --- /dev/null +++ b/includes/sysedit.php @@ -0,0 +1,172 @@ += 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} "; +} + +?> + +
+
+ +
+ +

+ Saved · bytes +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/system.php b/includes/system.php new file mode 100644 index 0000000..606d63d --- /dev/null +++ b/includes/system.php @@ -0,0 +1,61 @@ += 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} "; +} + +?> + +
+
+ +
+ +
+ + (edit) + + +
+ +
+ + \ No newline at end of file diff --git a/includes/system/compare.php b/includes/system/compare.php new file mode 100644 index 0000000..96eb5d9 --- /dev/null +++ b/includes/system/compare.php @@ -0,0 +1,189 @@ + + +
+
+

Compare members of the

+
+ + Member + Member + Member + Member + Member + Mmbr. + + + Species + Species + Species + Species + Spec. + Spec. + + + Relations + Relations + Relations + Relations + Relt. + Relt. + + + Host + Host + Host + Host + Hst. + Hst. + + + Fictive + Fictive + Fictive + Fictive + Fic. + Fic. + + + Little + Little + Little + Little + Ltl. + Ltl. + + + Not talking + No talk + No talk + NT. + NT. + NT. + + + Protector + Protector + Protect. + Protect. + Prt. + Prt. + + + + " data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="//"> + .png" style="width:24px;"> + ; height: 16px; width: 16px;display: inline-block;vertical-align: middle;border-radius:2px;"> + + + + " style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> + + + + + + 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?> + + +
Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link" href="//">.png" style="width:24px;">

Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link" href="//">.png" style="width:24px;">
+
+
+ + + Yes + + No + + + + + Yes + + No + + + + = 2): ?> + Yes + + Partial + + No + + + + + Yes + + No + + + + + Yes + + No + + + +
+
+ + \ No newline at end of file diff --git a/includes/system/history.php b/includes/system/history.php new file mode 100644 index 0000000..ad4e30e --- /dev/null +++ b/includes/system/history.php @@ -0,0 +1,380 @@ + + +
+
+ (86400 * ($day - 1)); + })); + + uksort($filtered, function ($a, $b) { + return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + }); + + return $filtered; + } + + function getSwitchBefore(string $id) { + global $switches; + + $currentPassed = false; + $before = null; + + foreach ($switches as $switch) { + if ($currentPassed) { + $before = $switch; + break; + } else { + if ($switch["id"] === $id) { + $currentPassed = true; + } + } + } + + return $before; + } + + function isNotToday(int $timestamp, int $offset) { + if (date('Y-m-d', $timestamp) !== date('Y-m-d', time() - (86400 * $offset))) { + return true; + } else { + return false; + } + } + + $switches1 = getSwitchesForDay(0); + $switches2 = getSwitchesForDay(1); + $switches3 = getSwitchesForDay(2); + $switches4 = getSwitchesForDay(3); + $switches5 = getSwitchesForDay(4); + $switches6 = getSwitchesForDay(5); + $switches7 = getSwitchesForDay(6); + $switches8 = getSwitchesForDay(7); + $switches9 = getSwitchesForDay(8); + $switches10 = getSwitchesForDay(9); + + ?> +

Front history in the

+

Today

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches1); + + $fronters[] = [ + "member" => $switches2[0] ? $switches2[0]["members"][0] : ($switches3[0] ? $switches3[0]["members"][0] : ($switches4[0] ? $switches4[0]["members"][0] : ($switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]))))))), + "date" => strtotime($switches2[0] ? $switches2[0]["timestamp"] : ($switches3[0] ? $switches3[0]["timestamp"] : ($switches4[0] ? $switches4[0]["timestamp"] : ($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))))) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

Yesterday

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches2); + + $fronters[] = [ + "member" => $switches3[0] ? $switches3[0]["members"][0] : ($switches4[0] ? $switches4[0]["members"][0] : ($switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0])))))), + "date" => strtotime($switches3[0] ? $switches3[0]["timestamp"] : ($switches4[0] ? $switches4[0]["timestamp"] : ($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))))) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches3); + + $fronters[] = [ + "member" => $switches4[0] ? $switches4[0]["members"][0] : ($switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]))))), + "date" => strtotime($switches4[0] ? $switches4[0]["timestamp"] : ($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches4); + + $fronters[] = [ + "member" => $switches5[0] ? $switches5[0]["members"][0] : ($switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0])))), + "date" => strtotime($switches5[0] ? $switches5[0]["timestamp"] : ($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches5); + + $fronters[] = [ + "member" => $switches6[0] ? $switches6[0]["members"][0] : ($switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]))), + "date" => strtotime($switches6[0] ? $switches6[0]["timestamp"] : ($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches6); + + $fronters[] = [ + "member" => $switches7[0] ? $switches7[0]["members"][0] : ($switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0])), + "date" => strtotime($switches7[0] ? $switches7[0]["timestamp"] : ($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches7); + + $fronters[] = [ + "member" => $switches8[0] ? $switches8[0]["members"][0] : ($switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0]), + "date" => strtotime($switches8[0] ? $switches8[0]["timestamp"] : ($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches8); + + $fronters[] = [ + "member" => $switches9[0] ? $switches9[0]["members"][0] : $switches10[0]["members"][0], + "date" => strtotime($switches9[0] ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches9); + + $fronters[] = [ + "member" => $switches10[0] ? $switches10[0]["members"][0] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][0], + "date" => strtotime($switches10[0] ? $switches10[0]["timestamp"] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["timestamp"]) + ]; + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +

+ $i["members"][0], + "date" => strtotime($i["timestamp"]) + ]; + }, $switches10); + + $fronters = array_unique($fronters, SORT_REGULAR); + + foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + ?> + + +
+ + \ No newline at end of file diff --git a/includes/system/species.php b/includes/system/species.php new file mode 100644 index 0000000..a2251d0 --- /dev/null +++ b/includes/system/species.php @@ -0,0 +1,53 @@ + +
+
+ () +
+ +
+ 0): ?> + + /">.png" style="width:24px;"> ,  
'); $index++; endforeach; ?> + - +
+
+ + +
+
+

members by species

+ + + + + + + +
+ + \ No newline at end of file diff --git a/includes/system/subsystem.php b/includes/system/subsystem.php new file mode 100644 index 0000000..5d28cba --- /dev/null +++ b/includes/system/subsystem.php @@ -0,0 +1,124 @@ += 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} "; +} + +if (getSubsystemByID($subsystemID) === null) header("Location: /?error=Invalid subsystem ID") and die(); +$subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.json"), true); + +$title = $subsystemData["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; + +?> + +
+
+ +
+ +
+ + (edit) + + +
+ +
+ + \ No newline at end of file diff --git a/includes/system/tree.php b/includes/system/tree.php new file mode 100644 index 0000000..04cbf83 --- /dev/null +++ b/includes/system/tree.php @@ -0,0 +1,114 @@ + + +
+ + + \ No newline at end of file -- cgit