Update
@ -0,0 +1,19 @@
|
||||
# TODO
|
||||
|
||||
- [ ] Make all pony heads the same size (square)
|
||||
- [ ] Add a "similar pages" section in the navigation bar
|
||||
|
||||
----
|
||||
|
||||
- [x] <s>Remove "Sensitivity" item</s>
|
||||
- [x] <s>Rename "Sexually active" to "Preemptive sexual consent"</s>
|
||||
- [x] <s>Add romantic/sexual alignments</s>
|
||||
- [x] <s>Aromantic/asexual (default), straight, gay/lesbian (pick automatically depending on gender), bi, pan</s>
|
||||
- [x] <s>Leave some bits for potentially more options</s>
|
||||
- [x] <s>Toggles for sexual polyamory, romantic polyamory, or both</s>
|
||||
- [x] <s>Actually remove deprecated values</s>
|
||||
- [x] <s>Allow caretakers for younger ponies (not just littles)</s>
|
||||
- [x] <s>Redesign the "systems rules" page</s>
|
||||
- [x] <s>Add Markdown support</s>
|
||||
- [x] <s>Redesign the bitset calculator</s>
|
||||
- [x] <s>Redesign the "front planner" page</s>
|
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
|
||||
|
||||
if (!isset($_GET["id"])) die();
|
||||
|
||||
if (isset($_GET["config"])) {
|
||||
$data = [];
|
||||
|
||||
$keys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/permitted.json"), true);
|
||||
$proceed = false;
|
||||
|
||||
if (in_array($_GET["id"], array_keys($keys))) {
|
||||
$proceed = true;
|
||||
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $keys[$_GET["id"]]["system"] . "/fronters.json"), true)["members"];
|
||||
|
||||
if (count($fronters) > 0) {
|
||||
$fronter = $fronters[0];
|
||||
$info = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $fronter["id"] . ".json"), true);
|
||||
$info = parseMetadata($info);
|
||||
|
||||
if (isset($info["birth"]["age"]) && $info["birth"]["age"] < 16 && $info["birth"]["age"] > 0) {
|
||||
$proceed = false;
|
||||
} else if (isset($info["birth"]["year"]) && $info["birth"]["year"] > 1900) {
|
||||
if (!isset($info["birth"]["date"])) $info["birth"]["date"] = "01-01";
|
||||
|
||||
$age = (int)date('Y') - $info["birth"]["year"] + (strtotime(date('Y') . "-" . $info["birth"]["date"]) <= time() ? 0 : -1);
|
||||
|
||||
if ($age < 16) {
|
||||
$proceed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($proceed) {
|
||||
$data = $keys[$_GET["id"]]["config"] ?? [];
|
||||
}
|
||||
} else {
|
||||
$data = [
|
||||
"success" => true,
|
||||
"valid" => false,
|
||||
"underage" => false,
|
||||
"normal" => false
|
||||
];
|
||||
|
||||
$keys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/permitted.json"), true);
|
||||
|
||||
if (in_array($_GET["id"], array_keys($keys))) {
|
||||
$data["valid"] = true;
|
||||
|
||||
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $keys[$_GET["id"]]["system"] . "/fronters.json"), true)["members"];
|
||||
|
||||
if (count($fronters) > 0) {
|
||||
$fronter = $fronters[0];
|
||||
$info = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $fronter["id"] . ".json"), true);
|
||||
$info = parseMetadata($info);
|
||||
|
||||
$data["normal"] = $info["sexually_active"];
|
||||
|
||||
if (isset($info["birth"]["age"]) && $info["birth"]["age"] < 16 && $info["birth"]["age"] > 0) {
|
||||
$data["underage"] = true;
|
||||
} else if (isset($info["birth"]["year"]) && $info["birth"]["year"] > 1900) {
|
||||
if (!isset($info["birth"]["date"])) $info["birth"]["date"] = "01-01";
|
||||
|
||||
$age = (int)date('Y') - $info["birth"]["year"] + (strtotime(date('Y') . "-" . $info["birth"]["date"]) <= time() ? 0 : -1);
|
||||
|
||||
if ($age < 16) {
|
||||
$data["underage"] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
die(json_encode($data));
|
Before Width: | Height: | Size: 493 KiB After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 558 KiB After Width: | Height: | Size: 558 KiB |
Before Width: | Height: | Size: 807 KiB After Width: | Height: | Size: 807 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 291 KiB After Width: | Height: | Size: 291 KiB |
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 177 KiB |
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 368 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 293 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 243 KiB After Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 317 KiB After Width: | Height: | Size: 317 KiB |
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 462 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 362 KiB After Width: | Height: | Size: 362 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1021 KiB After Width: | Height: | Size: 1021 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 332 KiB After Width: | Height: | Size: 332 KiB |
After Width: | Height: | Size: 561 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 483 KiB After Width: | Height: | Size: 483 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 658 KiB After Width: | Height: | Size: 658 KiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 5.1 KiB |
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
$_SERVER['DOCUMENT_ROOT'] = "../..";
|
||||
|
||||
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
|
||||
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$file"), true);
|
||||
echo("$file\n");
|
||||
|
||||
if (!isset($data["bitset"])) {
|
||||
die(" No bitset?? wtf\n");
|
||||
} else {
|
||||
$bits = str_split(substr(str_repeat("0", 48), 0, 48 - strlen(decbin($data["bitset"]))) . decbin($data["bitset"]));
|
||||
echo(" Old:\n");
|
||||
echo(" " . str_replace("+", "\e[92m1\e[39m", str_replace("-", "\e[31m0\e[39m", implode("", str_replace("0", "-", str_replace("1", "+", $bits))))) . "\n");
|
||||
echo(" XXXXXXXXXX X XXXXXX X XX XXXX X\n");
|
||||
|
||||
$bitsOld = implode("", $bits);
|
||||
foreach ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 18, 19, 20, 21, 22, 23, 26, 31, 32, 41, 42, 43, 44, 47] as $bit) {
|
||||
$bits[$bit] = "0";
|
||||
}
|
||||
|
||||
echo(" New:\n");
|
||||
echo(" " . str_replace("+", "\e[92m1\e[39m", str_replace("-", "\e[31m0\e[39m", implode("", str_replace("0", "-", str_replace("1", "+", $bits))))) . "\n");
|
||||
echo(" XXXXXXXXXX X XXXXXX X XX XXXX X\n");
|
||||
echo(" Changed " . levenshtein($bitsOld, implode("", $bits)) . " bit(s)\n");
|
||||
|
||||
echo(" Backup made in " . substr($file, 0, -5) . "-old.json\n");
|
||||
copy($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$file", $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . substr($file, 0, -5) . "-old.json");
|
||||
|
||||
$data["bitset"] = bindec(implode("", $bits));
|
||||
echo(" Saved to " . $file . "\n");
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$file", json_encode($data));
|
||||
}
|
||||
}
|