From 30303a3ad0d0f31d93c25f42bfd10d70e8277b72 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 10 Dec 2022 22:27:08 +0100 Subject: Update --- includes/ai.inc | 311 ------------------------------------------ includes/assets.inc | 1 - includes/banner.inc | 83 ++++++++--- includes/bitset.inc | 6 +- includes/details.inc | 33 ++--- includes/footer.inc | 27 ++-- includes/fullbanner.inc | 55 ++++---- includes/functions.inc | 55 ++++++-- includes/header.inc | 4 +- includes/init.inc | 3 +- includes/language.inc | 14 ++ includes/logo.inc | 110 ++++++++++++++- includes/member.inc | 25 ++-- includes/member/hierarchy.inc | 179 ------------------------ includes/member/tree.inc | 8 -- includes/metadata.inc | 105 ++++++++++++++ includes/navbar.inc | 8 +- includes/navigation.inc | 167 +++++++++++++++-------- includes/pages.json | 227 ++++++++++++++++++++++-------- includes/pane.inc | 33 ++++- includes/profiles.inc | 97 +++++++++++++ includes/rainbow.inc | 13 +- includes/score.inc | 13 +- includes/search.inc | 26 ++-- includes/short.inc | 6 +- includes/subsysbanner.inc | 11 +- includes/sysbanner.inc | 37 ++--- includes/system/compare.inc | 138 +++++++++---------- includes/system/history.inc | 46 ++++++- includes/system/species.inc | 16 +-- includes/system/subsystem.inc | 2 +- includes/system/tree.inc | 14 +- includes/titlebar.inc | 81 +++++------ includes/travelling.inc | 8 +- 34 files changed, 1044 insertions(+), 918 deletions(-) delete mode 100644 includes/ai.inc create mode 100644 includes/language.inc delete mode 100644 includes/member/hierarchy.inc delete mode 100644 includes/member/tree.inc create mode 100644 includes/metadata.inc create mode 100644 includes/profiles.inc (limited to 'includes') diff --git a/includes/ai.inc b/includes/ai.inc deleted file mode 100644 index 8f5f7ba..0000000 --- a/includes/ai.inc +++ /dev/null @@ -1,311 +0,0 @@ - $metadata["robot"] ? - "robot earth pony" : - (!$metadata["plush"] ? "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "alicorn" => $metadata["robot"] ? - "robot alicorn" : - (!$metadata["plush"] ? "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "crystal" => $metadata["robot"] ? - "robot crystal pony" : - (!$metadata["plush"] ? "crystal pony" : - "crystal pony plush"), - "pegasus" => $metadata["robot"] ? - "robot pegasus" : - (!$metadata["plush"] ? "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "batpony" => $metadata["robot"] ? - "robot batpony" : - (!$metadata["plush"] ? "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "unicorn" => $metadata["robot"] ? - "robot unicorn" : - (!$metadata["plush"] ? "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - default => $species . "_" . $metadata["robot"] - }; - } -} - -if (!function_exists("listing")) { - function listing(array $list): string { - $out = ""; - - foreach (array_values($list) as $index => $value) { - $mem = getSystemMember(explode("/", $value)[0], explode("/", $value)[1]); - $value = "" . getMiniName($mem["display_name"] ?? $mem["name"]) . ""; - - if ($index === 0) { - $out = $value; - } else if ($index < count(array_values($list)) - 1) { - $out .= ", " . $value; - } else { - $out .= " and " . $value; - } - } - - return $out; - } -} - -$iam = 0; -$multipleNames = count(explode("/", $memberData["display_name"])) > 1; - -$otherNames = explode("/", $memberData["display_name"]); -array_shift($otherNames); - -if ($memberData["name"] === "scootaloo" && ((int)date('N') - 1) % 2 === 0) { - $metadata["marefriends"] = array_reverse($metadata["marefriends"]); -} - -?> - - -

- - Hello, - - Hi, - - Hey, - - Hey there!

- - - - , - - - -the most common fronter -a protector - -of the , - 0): $source = getMember($metadata["median"]); ?> ">, - = 3) ? "and" : (component(2, 2, 1) ? "I'm" : "I am") ?> - - -= 3 && component(2, 1, 4)): ?>also - -a and a - -a , a and a - -a = 3 && component(2, 2, 4)): ?> too -, -. - -

- -

- - - - Depending on the circumstances, I may not share memories with my headmates - - I may not share memories with my headmates depending on the circumstances - - I sometimes share memories with my headmates - - - - I share memories with my headmates - - I have access to my headmates' memories - - I have access to my headmates' memories - - - - - - - a fictive - - from Equestria - - I come from Equestria - - - - - - - fronting less often - - less often at front - - I like to front less often - - - - - - - nonverbal in real life - - not talking in real life - - I don't talk in real life - - - - - - - 0): ?> - an age regressor - - 0): ?> - capable of age regression - - I can age regress - - - - - - - 0): ?> - younger than the body is - - 0): ?> - younger but not enough to be considered a little - - I feel younger than my headmates - - - - - 0)): ?> - - 0): ?> - affected by spells to make me feel younger - - 0): ?> - affected by age spells - - age regression spells can affect me - - - - - - - 0): ?> - a lot younger than the body is - - 0): ?> - a little - - I feel a lot younger than my headmates - - - -

- -

- - - 0): ?> - - 0): ?> - 1): ?>in relationships within a relationship with - - 0): ?> - 1): ?>My marefriends areMy marefriend is - - 0): ?> - 1): ?>are my marefriendsis my marefriend - - I love - - - - - 0): ?> - - 0): ?> - 1): ?>in relationships within a relationship with - - 0): ?> - 1): ?> sisters are sister is - - 0): ?> - 1): ?>are my sistersis my sister - - - I also love as sister 1): ?>s - - 1): ?>are my familyis my family - - - - - - 0): ?> - - 0): ?> - being taken care of by - - 0): ?> - 1): ?> mares who take care of me are mare who takes care of me is - - 0): ?> - 1): ?>are my caretakersis my caretaker - - - I like having take care of me - - take care of me - - - - -

\ No newline at end of file diff --git a/includes/assets.inc b/includes/assets.inc index 3f9971a..05296ce 100644 --- a/includes/assets.inc +++ b/includes/assets.inc @@ -13,7 +13,6 @@ function downloadAssets($system) { echo(" /avatars/$id.webp\n"); file_put_contents("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION), file_get_contents($general['avatar_url'])); exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/avatars/" . $id . ".webp"); - exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/uploads/" . ($id === "gdapd" ? "raindrops" : "cloudburst") . ".png"); unlink("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION)); } diff --git a/includes/banner.inc b/includes/banner.inc index e1b06be..d62ba97 100644 --- a/includes/banner.inc +++ b/includes/banner.inc @@ -1,6 +1,6 @@ ( $french ? - 'Fronteuse la plus présente' + 'Fronteuse la plus présente' : 'Most common fronter' ) @@ -276,13 +289,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { } } - if (($metadata["age_spells"] ?? false) && !$french) { + /*if (($metadata["age_spells"] ?? false) && !$french) { $badges[] = [ "id" => "age_spells", "color" => "#6f42c1", "html" => 'Affected by age spells' ]; - } + }*/ if ($metadata["fictive"] ?? false) { $badges[] = [ @@ -291,18 +304,38 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "html" => ( $french ? - 'Fictive' + 'Fictive' : 'Fictive' ) ]; } + if ($metadata["persecutor"] ?? false) { + $badges[] = [ + "id" => "persecutor", + "color" => "danger", + "html" => ( + $french + ? + 'Persécutrice' + : + 'Persecutor' + ) + ]; + } + if ($metadata["less_frequent"] ?? false) { $badges[] = [ "id" => "nonverbal", "color" => "#fd7e14", - "html" => 'Fronts less often' + "html" => ( + $french + ? + 'Fronte moins souvent' + : + 'Fronts less often' + ) ]; } @@ -310,7 +343,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "nonverbal", "color" => "#20c997", - "html" => 'Non verbal IRL' + "html" => ( + $french + ? + 'Non verbal IRL' + : + 'Non verbal IRL' + ) ]; } @@ -330,6 +369,20 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } + if (($metadata["leader"] ?? false) && $isLoggedIn) { + $badges[] = [ + "id" => "leader", + "color" => "d6a833", + "html" => ( + $french + ? + 'Dirigeante' + : + 'Leader' + ) + ]; + } + if ($metadata["protector"] ?? false) { $badges[] = [ "id" => "protector", @@ -337,7 +390,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "html" => ( $french ? - '
' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '
' + '
' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protectrice")) . '
' : 'Protector' ) @@ -386,18 +439,6 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'Age regresses into '. (getMiniName($regression["display_name"] ?? $regression["name"])) . '' ) ]; - } else { - $badges[] = [ - "id" => "regressor", - "color" => "secondary", - "html" => ( - $french - ? - 'Régresseur d\'âge' - : - 'Age regressor' - ) - ]; } } diff --git a/includes/bitset.inc b/includes/bitset.inc index 1d026e5..0bd5c4d 100644 --- a/includes/bitset.inc +++ b/includes/bitset.inc @@ -11,6 +11,8 @@ function parseBitset ($bitset) { $lessFrequent = substr($bin, 14, 1) !== "0"; $sexuallyActive = substr($bin, 13, 1) !== "0"; $ageRegressor = substr($bin, 12, 1) !== "0"; + $leader = substr($bin, 11, 1) !== "0"; + $persecutor = substr($bin, 10, 1) !== "0"; $magic = bindec(substr($bin, 18, 3)); $sensitivity = bindec(substr($bin, 21, 3)); $protector = substr($bin, 29, 1) !== "0"; @@ -76,6 +78,8 @@ function parseBitset ($bitset) { 'less_frequent' => $lessFrequent, 'age_spells' => $age, 'age_regressor' => $ageRegressor, + 'leader' => $leader, + 'persecutor' => $persecutor, 'sexually_active' => $sexuallyActive, 'species' => array_filter([ $species1, @@ -92,7 +96,7 @@ function parseMetadata ($metadata) { if ($metadata["bitset"]) { $m = parseBitset($metadata["bitset"]); $m["marefriends"] = $metadata["marefriends"] ?? []; - $m["bitset"] = $metadata["bitset"] ?? []; + $m["bitset"] = $metadata["bitset"] ?? 0; $m["sisters"] = $metadata["sisters"] ?? []; $m["regression"] = $metadata["regression"] ?? null; $m["caretakers"] = $metadata["caretakers"] ?? []; diff --git a/includes/details.inc b/includes/details.inc index abd07bc..e4ee519 100644 --- a/includes/details.inc +++ b/includes/details.inc @@ -1,31 +1,20 @@ - -
; margin-left: -20px; margin-right: -20px;"> + +
; margin-left: -20px; margin-right: -20px;">
- Food:
+
"Not needed", - 1 => "Not animals", - 2 => "Not meat", - 3 => "All", + 0 => "" . $lang["details"]["food_states"][0] . "", + 1 => "" . $lang["details"]["food_states"][1] . "", + 2 => "" . $lang["details"]["food_states"][2] . "", + 3 => "" . $lang["details"]["food_states"][3] . "", } ?>
- Shared memory:
+
"None", - 1 => "Partial", - 2 => "Full", - } ?> -
-
- Magic:
- "None", - 1 => "In some cases", - 2 => "Horn", - 3 => "Wings", - 4 => "Horn and wings", - 5 => "Yes", + 0 => "" . $lang["details"]["memory_states"][0] . "", + 1 => "" . $lang["details"]["memory_states"][1] . "", + 2 => "" . $lang["details"]["memory_states"][2] . "", } ?>
diff --git a/includes/footer.inc b/includes/footer.inc index 6cf833c..b95ea78 100644 --- a/includes/footer.inc +++ b/includes/footer.inc @@ -4,17 +4,22 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; ?> -
-
- - © Equestria.dev Developers · version 2...
- Data updated ( 360): ?>not updating; ; took ms, 0 ? (count($refresh["restored"]) > 1 ? "reported " . count($refresh["restored"]) . " failures" : "reported 1 failure") : "no failures reported" ?>) -




+ + @@ -11,7 +11,7 @@
- +
@@ -53,24 +53,27 @@
  • Score breakdown: -
      -
    • Most common fronter score:
    • -
    • Relationships score:
    • -
    • Fictive score:
    • -
    • Median score:
    • -
    • Species score:
    • -
    • Little score:
    • -
    • Not talking score:
    • -
    • Protector score:
    • -
    • Name score:
    • -
    • Shared memory score:
    • -
    -
  • -
  • Full metadata:
      $usage) { if (is_string($usage)) { echo("
    • " . $type . ": " . $usage . "
    • "); + } else if (is_array($usage)) { + if (count($usage) === 0) { + echo("
    • " . $type . ": []
    • "); + } else { + echo("
    • " . $type . ":
        "); + + foreach ($usage as $key => $item) { + if (is_string($item)) { + echo("
      • " . $key . ": " . $item . "
      • "); + } else { + echo("
      • " . $key . ": " . json_encode($item, JSON_UNESCAPED_SLASHES) . "
      • "); + } + } + + echo("
    • "); + } } else { echo("
    • " . $type . ": " . json_encode($usage, JSON_UNESCAPED_SLASHES) . "
    • "); } @@ -78,25 +81,15 @@ ?>
  • - -
    -
    - AI-generated page: - -
    - +
    - is visiting the , therefore currently not in the . + .
    - - -
    -

    Hello there!

    -

    I'm currently a new headmate slowly figuring myself out.

    -

    Give me some time to figure myself out and see this page change as I find new stuff about my identity. Don't be too worried if I accidentally get pushed to front, it's something that can happen sometimes.

    - Thanks! + +
    + is on a trip to Equestria. .
    \ No newline at end of file diff --git a/includes/functions.inc b/includes/functions.inc index c3ec313..cc94f11 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -179,6 +179,10 @@ if (!function_exists("getMiniName")) { $parts = explode(" ", $name); if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) { + if ($parts[0] === "Princess") { + array_shift($parts); + } + if (str_contains($parts[0], "/")) { return explode("/", $parts[0])[0]; } else { @@ -250,7 +254,7 @@ if (!function_exists("showMembersFromList")) { function showMembersFromList(array $list) { foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") { echo(' -
    +
    ' . ($member['display_name'] ?? $member['name']) . '
    ' . (isset($member['travelling']) && $member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? " ") : ($member['proxy_tags'][0]['prefix'] ?? " ")) . '
    @@ -301,18 +305,19 @@ if (!function_exists("showSystem")) { echo('
    '); } - showMembersFromList(scoreOrder([...array_map(function ($i) use ($id) { + showMembersFromList(scoreOrder([...array_map(function ($i) use ($id, $travelling) { $i["travelling"] = false; $i["system"] = $id; + $i["equestria"] = $travelling[$i['id']]['travelling'] && $travelling[$i['id']]['equestria']; return $i; }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/members.json"), true), function ($i) use ($travelling) { - return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); + return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); })), ...array_map(function ($i) use ($id) { $i["travelling"] = true; $i["system"] = ($id === "gdapd" ? "ynmuc" : "gdapd"); return $i; }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($travelling) { - return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; + return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']); }))], $id)); echo('
    @@ -349,23 +354,30 @@ if (!function_exists("getMember")) { } if (!function_exists("timeAgo")) { - function timeAgo($time): string { + function timeAgo($time, $french = false): string { if (!is_numeric($time)) { $time = strtotime($time); } $periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; + $periods_fr = ["sec.", "mn.", "hr.", "j.", "sem.", "m.", "a.", "des années"]; $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); $now = time(); $difference = $now - $time; if ($difference <= 10 && $difference >= 0) { - return $tense = "now"; + if ($french) { + return $tense_fr = "à l'instant"; + } else { + return $tense = "now"; + } } elseif ($difference > 0) { $tense = "ago"; + $tense_fr = "il y a"; } else { $tense = "later"; + $tense_fr = "dans"; } for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { @@ -374,8 +386,13 @@ if (!function_exists("timeAgo")) { $difference = round($difference); - $period = $periods[$j]; - return "{$difference} {$period} {$tense}"; + if ($french) { + $period = $periods_fr[$j]; + return "{$tense_fr} {$difference} {$period}"; + } else { + $period = $periods[$j]; + return "{$difference} {$period} {$tense}"; + } } } @@ -412,21 +429,37 @@ if (!function_exists("timeIn")) { if (!function_exists("duration")) { function duration($seconds) { + global $lang; global $pages; + if ($seconds >= 60) { if (floor($seconds / 60) >= 60) { if (floor($seconds / 3600) >= 24) { $days = floor($seconds / 86400); - return $days . " day" . ($days > 1 ? "s" : ""); + + if ($lang["_french"]) { + return $days . " jour" . ($days > 1 ? "s" : ""); + } else { + return $days . " day" . ($days > 1 ? "s" : ""); + } } else { $hours = floor($seconds / 3600); - return $hours . " hour" . ($hours > 1 ? "s" : ""); + + if ($lang["_french"]) { + return $hours . " heure" . ($hours > 1 ? "s" : ""); + } else { + return $hours . " hour" . ($hours > 1 ? "s" : ""); + } } } else { $minutes = floor($seconds / 60); return $minutes . " minute" . ($minutes > 1 ? "s" : ""); } } else { - return $seconds . " seconds"; + if ($lang["_french"]) { + return $seconds . " secondes"; + } else { + return $seconds . " seconds"; + } } } } diff --git a/includes/header.inc b/includes/header.inc index 2d95799..d338f78 100644 --- a/includes/header.inc +++ b/includes/header.inc @@ -710,7 +710,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; display: grid; - grid-template-columns: repeat(6, 1fr); + grid-template-columns: repeat(5, 1fr); text-align: center; } @@ -780,7 +780,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; -
    +
    - - \ No newline at end of file diff --git a/includes/member/tree.inc b/includes/member/tree.inc deleted file mode 100644 index 2e94951..0000000 --- a/includes/member/tree.inc +++ /dev/null @@ -1,8 +0,0 @@ - + +
    +
    +

    + +
    + +

    + File
    + +

    +

    + Bitset
    + ·
    Edit... + "> +

    +

    + Marefriends (full IDs, comma-separated):
    + "> +

    +

    + Sisters (full IDs, comma-separated):
    + "> +

    +

    + Caretakers (full IDs, comma-separated):
    + "> +

    +

    + Age regressed version (local ID):
    + "> +

    +

    + Birth date (use January 1st for none):
    + -"> +

    +

    + Age (for ponies with fixed age):
    + "> +

    + +
    + +
    + This member does not have a metadata file. This file needs to be initially created by an administrator before it can be edited using this page. +
    + +
    + + + + + + \ No newline at end of file diff --git a/includes/navbar.inc b/includes/navbar.inc index 379f102..3e68493 100644 --- a/includes/navbar.inc +++ b/includes/navbar.inc @@ -1,4 +1,4 @@ - +
    diff --git a/includes/profiles.inc b/includes/profiles.inc new file mode 100644 index 0000000..66274c7 --- /dev/null +++ b/includes/profiles.inc @@ -0,0 +1,97 @@ + 0) || isset($member["_metadata"]["birth"]["year"]) && $member["_metadata"]["birth"]["year"] > 1900) || ((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] === -1) && in_array("alicorn", $member["_metadata"]["species"])), + isset($member["_metadata"]["birth"]["date"]) && trim($member["_metadata"]["birth"]["date"]) !== "" && $member["_metadata"]["birth"]["date"] !== "01-01", + file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) > 200, + file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) > 200, + isset($member["banner"]), + file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png"), + isset($member["color"]) + ]; + + $result = [ + "values" => $values, + "pages" => [], + "characters" => [], + "score" => (float)array_reduce($values, function ($a, $b) { + return $a + $b; + }), + "score2" => (float)array_reduce($values, function ($a, $b) { + return $a + $b; + }), + "actions" => [] + ]; + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) <= 200) { + $result["pages"][] = true; + $result["score"] += strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) / 201; + } else { + $result["pages"][] = false; + } + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) <= 200) { + $result["pages"][] = true; + $result["score"] += strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) / 201; + } else { + $result["pages"][] = false; + } + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html")) { + $result["characters"][] = strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))); + } else { + $result["characters"][] = -1; + } + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html")) { + $result["characters"][] = strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))); + } else { + $result["characters"][] = -1; + } + + if (!((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] > 0) || isset($member["_metadata"]["birth"]["year"]) && $member["_metadata"]["birth"]["year"] > 1900) && !(isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] === -1) && in_array("alicorn", $member["_metadata"]["species"])) { + $result["score"] += 0.5; + } + + $result["progress"] = $result["score"] / 7; + $result["sortable"] = (int)($result["progress"] * 100000000000000); + + if (!$result["values"][5]) { + $result["actions"][] = "a Pony Town character"; + } + + if (!$result["values"][6]) { + $result["actions"][] = "a color"; + } + + if (!$result["values"][2]) { + if ($result["characters"][0] === -1) { + $result["actions"][] = "a public page"; + } else { + $result["actions"][] = (200 - $result["characters"][0]) . " characters to the public page"; + } + } + + if (!$result["values"][3]) { + if ($result["characters"][1] === -1) { + $result["actions"][] = "a private page"; + } else { + $result["actions"][] = (200 - $result["characters"][1]) . " characters to the private page"; + } + } + + if (!$result["values"][4]) { + $result["actions"][] = "a banner"; + } + + if (!$result["values"][0]) { + $result["actions"][] = "an age"; + } + + if (!$result["values"][1]) { + $result["actions"][] = "a birthdate"; + } + + return $result; +} \ No newline at end of file diff --git a/includes/rainbow.inc b/includes/rainbow.inc index 470f288..fba960e 100644 --- a/includes/rainbow.inc +++ b/includes/rainbow.inc @@ -4,8 +4,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; -function rainbow(): array { +function rainbow($hideCloudburst = false): array { $members = scoreOrderGlobal(); + + if ($hideCloudburst) { + $members = array_filter($members, function ($i) { + return $i["_system"] === "gdapd"; + }); + } + $data = []; foreach ($members as $member) { @@ -33,8 +40,8 @@ function rainbow(): array { return $data; } -function getMembersByColor(): array { - $members = rainbow(); +function getMembersByColor($hideCloudburst = false): array { + $members = rainbow($hideCloudburst); uasort($members, function ($a, $b) { return $a['hsl'][0] - $b['hsl'][0]; }); diff --git a/includes/score.inc b/includes/score.inc index 21baf67..703b9cc 100644 --- a/includes/score.inc +++ b/includes/score.inc @@ -1,7 +1,6 @@ $scoreHost, + "leader" => $scoreLeader, "fictive" => $scoreFictive, "little" => $scoreLittle, "median" => $scoreMedian, @@ -32,6 +32,7 @@ function calculateScore($metadata, $name) { "shared_memory" => $scoreSharedMemory, "relations" => $scoreRelations, "species" => $scoreSpecies, + "persecutor" => $scorePersecutor, "additional" => $scoreAdd, "total" => $score ]; diff --git a/includes/search.inc b/includes/search.inc index f240363..c125556 100644 --- a/includes/search.inc +++ b/includes/search.inc @@ -1,13 +1,15 @@ + + @@ -102,20 +103,20 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa
    \ No newline at end of file diff --git a/includes/system/compare.inc b/includes/system/compare.inc index d7fbdc6..4f9711d 100644 --- a/includes/system/compare.inc +++ b/includes/system/compare.inc @@ -1,4 +1,4 @@ -
    -

    Compare members of the

    +

    - Member - Member - Member - Member - Member - Mmbr. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> - Species - Species - Species - Species - Spec. - Spec. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> - Relations - Relations - Relations - Relations - Relt. - Relt. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> - Memory - Memory - Memory - Memory - Mem. - Mem. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> - Fictive - Fictive - Fictive - Fictive - Fic. - Fic. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> - Little - Little - Little - Little - Ltl. - Ltl. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> - Protector - Protector - Protect. - Protect. - Prt. - Prt. + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> + " data-bs-toggle="tooltip"> " data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/"> " style="width:24px;"> @@ -97,27 +91,27 @@ function getMember(string $id) {
    Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">

    " data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">

    Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">

    " data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">

    Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">
    + }); sort($mfMember); $mfMember = $mfMember[0]; ?>
    " data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">
    0): ?> - Partial + " src="/assets/icons/partial.svg" alt="" style="width:24px;"> - Yes + " src="/assets/icons/complete.svg" alt="" style="width:24px;"> - No + " src="/assets/icons/none.svg" alt="" style="width:24px;"> - Yes + " src="/assets/icons/complete.svg" alt="" style="width:24px;"> - No + " src="/assets/icons/none.svg" alt="" style="width:24px;"> - = 2): ?> - Yes - - Partial + + " src="/assets/icons/complete.svg" alt="" style="width:24px;"> + + " src="/assets/icons/partial.svg" alt="" style="width:24px;"> - No + " src="/assets/icons/none.svg" alt="" style="width:24px;"> - Yes, but currently travelling + " src="/assets/icons/partial.svg" alt="" style="width:24px;"> - Yes + " src="/assets/icons/complete.svg" alt="" style="width:24px;"> - No + " src="/assets/icons/none.svg" alt="" style="width:24px;"> diff --git a/includes/system/history.inc b/includes/system/history.inc index 31a7c73..b66b8c4 100644 --- a/includes/system/history.inc +++ b/includes/system/history.inc @@ -1,4 +1,4 @@ - -

    Front history in the

    +