diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /pages/score.inc | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'pages/score.inc')
-rw-r--r-- | pages/score.inc | 208 |
1 files changed, 0 insertions, 208 deletions
diff --git a/pages/score.inc b/pages/score.inc deleted file mode 100644 index 97e666c..0000000 --- a/pages/score.inc +++ /dev/null @@ -1,208 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; - -?> - -<br> -<div class="container"> - <div id="page-content"> - <h2>Score system testing</h2> - - <h4>Raindrops System (<code><?php - - $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = $score["total"]; - } - } - - $total = array_reduce($scores, function($a, $b) { - return $a + $b; - }); - - echo round($total / (count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)) - 1)); - - ?></code>)</h4> - <ul> - <?php - - $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = [ - "name" => $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - - uasort($scores, function($a, $b) { - return $b["score"] - $a["score"]; - }); - - ?> - - <?php foreach ($scores as $score): ?> - <li> - <details> - <summary><a href="<?= $score["page"] ?>"><?= $score["name"] ?></a> (<code><?= $score["score"] ?></code>)</summary> - <pre><?= json_encode($score["details"], JSON_PRETTY_PRINT) ?></pre> - </details> - </li> - <?php endforeach; ?> - </ul> - - - <h4>Cloudburst System (<code><?php - - $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = $score["total"]; - } - } - - $total = array_reduce($scores, function($a, $b) { - return $a + $b; - }); - - echo round($total / (count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)) - 1)); - - ?></code>)</h4> - <ul> - <?php - - $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = [ - "name" => $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - - uasort($scores, function($a, $b) { - return $b["score"] - $a["score"]; - }); - - ?> - - <?php foreach ($scores as $score): ?> - <li> - <details> - <summary><a href="<?= $score["page"] ?>"><?= $score["name"] ?></a> (<code><?= $score["score"] ?></code>)</summary> - <pre><?= json_encode($score["details"], JSON_PRETTY_PRINT) ?></pre> - </details> - </li> - <?php endforeach; ?> - </ul> - - <h4>Global (<code><?php - - $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = $score["total"]; - } - } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = $score["total"]; - } - } - - $total = array_reduce($scores, function($a, $b) { - return $a + $b; - }); - - echo round($total / ((count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)) + count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true))) - 2)); - - ?></code>)</h4> - <ul> - <?php - - $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = [ - "name" => $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); - - $scores[] = [ - "name" => $name, - "page" => "/" . $member["name"], - "score" => $score["total"], - "details" => $score - ]; - } - } - - uasort($scores, function($a, $b) { - return $b["score"] - $a["score"]; - }); - - ?> - - <?php foreach ($scores as $score): ?> - <li> - <details> - <summary><a href="<?= $score["page"] ?>"><?= $score["name"] ?></a> (<code><?= $score["score"] ?></code>)</summary> - <pre><?= json_encode($score["details"], JSON_PRETTY_PRINT) ?></pre> - </details> - </li> - <?php endforeach; ?> - </ul> - </div> -</div> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> |