|
|
|
@ -12,7 +12,7 @@ foreach (array_filter(scandir($_SERVER["DOCUMENT_ROOT"] . "/includes/data/articl
|
|
|
|
|
$keys[] = [
|
|
|
|
|
"type" => "articles",
|
|
|
|
|
"id" => $id,
|
|
|
|
|
"name" => json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/articles/" . $_id)), true)["title"] ?? null
|
|
|
|
|
"name" => json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/articles/" . $_id)), true)["title"] ?? null
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ foreach (array_filter(scandir($_SERVER["DOCUMENT_ROOT"] . "/includes/data/galler
|
|
|
|
|
$keys[] = [
|
|
|
|
|
"type" => "gallery",
|
|
|
|
|
"id" => $id,
|
|
|
|
|
"name" => json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/gallery/" . $_id)), true)["title"] ?? null
|
|
|
|
|
"name" => json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/gallery/" . $_id)), true)["title"] ?? null
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -30,7 +30,7 @@ foreach (array_filter(scandir($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people
|
|
|
|
|
$keys[] = [
|
|
|
|
|
"type" => "people",
|
|
|
|
|
"id" => $id,
|
|
|
|
|
"name" => json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["nick_name"] ?? (isset(json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["first_name"]) && isset(json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["last_name"]) ? json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["first_name"] . " " . json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["last_name"] : null)
|
|
|
|
|
"name" => json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["nick_name"] ?? (isset(json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["first_name"]) && isset(json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["last_name"]) ? json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["first_name"] . " " . json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/people/" . $_id)), true)["last_name"] : null)
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ foreach (array_filter(scandir($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profil
|
|
|
|
|
$keys[] = [
|
|
|
|
|
"type" => "profiles",
|
|
|
|
|
"id" => $id,
|
|
|
|
|
"name" => json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["nick_name"] ?? (isset(json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["first_name"]) && isset(json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["last_name"]) ? json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["first_name"] . " " . json_decode(utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["last_name"] : null)
|
|
|
|
|
"name" => json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["nick_name"] ?? (isset(json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["first_name"]) && isset(json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["last_name"]) ? json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["first_name"] . " " . json_decode(pf_utf8_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/data/profiles/" . $_id)), true)["last_name"] : null)
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -67,36 +67,36 @@ usort($keys, function ($a, $b) {
|
|
|
|
|
$requestsNonPlus = array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests"), function ($i) { return !str_starts_with($i, "."); });
|
|
|
|
|
|
|
|
|
|
$requestsNonPlus = array_values(array_filter($requestsNonPlus, function ($i) {
|
|
|
|
|
$request = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$adata = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true);
|
|
|
|
|
$request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$adata = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true);
|
|
|
|
|
return !$adata["plus"];
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
usort($requestsNonPlus, function ($a, $b) {
|
|
|
|
|
return strtotime(json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$a")), true)["date"]) - strtotime(json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$b")), true)["date"]);
|
|
|
|
|
return strtotime(json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$a")), true)["date"]) - strtotime(json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$b")), true)["date"]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$requestsPlus = array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests"), function ($i) { return !str_starts_with($i, "."); });
|
|
|
|
|
|
|
|
|
|
$requestsPlus = array_values(array_filter($requestsPlus, function ($i) {
|
|
|
|
|
$request = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$adata = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true);
|
|
|
|
|
$request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$adata = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true);
|
|
|
|
|
return $adata["plus"];
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
usort($requestsPlus, function ($a, $b) {
|
|
|
|
|
return strtotime(json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$a")), true)["date"]) - strtotime(json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$b")), true)["date"]);
|
|
|
|
|
return strtotime(json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$a")), true)["date"]) - strtotime(json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$b")), true)["date"]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$requests = [...array_map(function ($i) {
|
|
|
|
|
$id = $i;
|
|
|
|
|
$i = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$i = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$i["_id"] = explode(".", $id)[0];
|
|
|
|
|
$i["_plus"] = true;
|
|
|
|
|
return $i;
|
|
|
|
|
}, $requestsPlus), ...array_map(function ($i) {
|
|
|
|
|
$id = $i;
|
|
|
|
|
$i = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$i = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
|
|
|
|
|
$i["_id"] = explode(".", $id)[0];
|
|
|
|
|
$i["_plus"] = false;
|
|
|
|
|
return $i;
|
|
|
|
@ -108,13 +108,13 @@ usort($keys, function ($a, $b) {
|
|
|
|
|
<div class="list-group">
|
|
|
|
|
<?php foreach ($requests as $request): ?>
|
|
|
|
|
<details class="list-group-item list-group-item-action <?= $request["_plus"] ? "list-group-item-warning" : "" ?>">
|
|
|
|
|
<summary><?= json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/lang/en.json"), true)["request"]["types"][$request["type"]] ?> (<?php if (isset($request["id"]) && trim($request["id"]) !== "" && $request["id"] !== $request["author"]): ?>on <a href="/<?= str_starts_with("gallery", $request["type"]) ? "gallery" : ($request["type"] === "userpage" ? "people" : "article") ?>/<?= $request["id"] ?>" target="_blank"><?= getNameFromId($request["id"]) ?></a>; <?php endif; ?>from <a href="/profile/<?= $request["author"] ?>" target="_blank"><?php $adata = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true); ?> <?= isset($adata["nick_name"]) && trim($adata["nick_name"]) !== "" ? $adata["nick_name"] : $adata["first_name"] . " " . $adata["last_name"] ?></a>; <?= timeAgo($request["date"]) ?>)</summary>
|
|
|
|
|
<summary><?= json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/lang/en.json"), true)["request"]["types"][$request["type"]] ?> (<?php if (isset($request["id"]) && trim($request["id"]) !== "" && $request["id"] !== $request["author"]): ?>on <a href="/<?= str_starts_with("gallery", $request["type"]) ? "gallery" : ($request["type"] === "userpage" ? "people" : "article") ?>/<?= $request["id"] ?>" target="_blank"><?= getNameFromId($request["id"]) ?></a>; <?php endif; ?>from <a href="/profile/<?= $request["author"] ?>" target="_blank"><?php $adata = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true); ?> <?= isset($adata["nick_name"]) && trim($adata["nick_name"]) !== "" ? $adata["nick_name"] : $adata["first_name"] . " " . $adata["last_name"] ?></a>; <?= timeAgo($request["date"]) ?>)</summary>
|
|
|
|
|
|
|
|
|
|
<div class="list-group-item" style="margin-top: 10px;">
|
|
|
|
|
<p>
|
|
|
|
|
<b>ID:</b> <?= $request["_id"] ?><br>
|
|
|
|
|
<b>Publish date:</b> <?= date('r', strtotime($request["date"])) ?><br>
|
|
|
|
|
<b>User:</b> <?php $adata = json_decode(utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true); ?> <?= isset($adata["nick_name"]) && trim($adata["nick_name"]) !== "" ? $adata["nick_name"] : $adata["first_name"] . " " . $adata["last_name"] ?> (<?= $request["author"] ?>)<br>
|
|
|
|
|
<b>User:</b> <?php $adata = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true); ?> <?= isset($adata["nick_name"]) && trim($adata["nick_name"]) !== "" ? $adata["nick_name"] : $adata["first_name"] . " " . $adata["last_name"] ?> (<?= $request["author"] ?>)<br>
|
|
|
|
|
<b>Target:</b> <?= isset($request["id"]) && trim($request["id"]) !== "" && $request["id"] !== $request["author"] ? getNameFromId($request["id"]) . " (" . $request["id"] . ")" : "<span class='text-muted'>Not applicable</span>" ?><br>
|
|
|
|
|
<b>Summary:</b> <?= isset($request["summary"]) && trim($request["summary"]) !== "" ? strip_tags($request["summary"]) : "<span class='text-muted'>Not applicable</span>" ?>
|
|
|
|
|
</p>
|
|
|
|
|