diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
commit | 8fabf77b2a7720a357c63817c07035a9908818a0 (patch) | |
tree | d689fcac1403e2473010fe80bc337599a78c21a4 /Neutron-trunk/cms-special/gallery/index.php | |
parent | 7b4af63a90a726b98a59b83e53f040a7a566a11d (diff) | |
download | electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.gz electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.bz2 electrode-8fabf77b2a7720a357c63817c07035a9908818a0.zip |
Update
Diffstat (limited to 'Neutron-trunk/cms-special/gallery/index.php')
-rw-r--r-- | Neutron-trunk/cms-special/gallery/index.php | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/Neutron-trunk/cms-special/gallery/index.php b/Neutron-trunk/cms-special/gallery/index.php deleted file mode 100644 index 3fe2fad..0000000 --- a/Neutron-trunk/cms-special/gallery/index.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/api/renderer/render.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php"; -$buffer = ""; // Initialiser un nouveau tampon vide - -function buffer(string $value) { - global $buffer; - $buffer = $buffer . $value; -} - -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures") && count(scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures")) > 2) { - $categories = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories"); - array_push($categories, "unclassed"); - foreach ($categories as $category) { - if ($category != "." && $category != "..") { - $shown = false; - if ($category == "unclassed") { - buffer("<h2>" . $lang["gallery"]["unclassed"] . "</h2>"); - } else { - buffer("<h2>" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories/" . $category) . "</h2>"); - } - buffer("<div style=\"text-align: center;\">"); - $photos = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures"); - foreach ($photos as $photo) { - if ($photo == "." || $photo == "..") {} else { - $praw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $photo); - $pcat = explode("|", $praw)[1]; - $ppath = explode("|", $praw)[0]; - if ($pcat == $category) { - $shown = true; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . $ppath)) { - buffer("<div class=\"photo\">"); - buffer("<a href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/gallery/preview/?url={$GLOBALS["SYSTEM_ROOT"]}" . $ppath . "&return={$GLOBALS["SYSTEM_ROOT"]}/cms-special/gallery\"><img class=\"photo_image\" src=\"{$GLOBALS["SYSTEM_ROOT"]}" . $ppath . "\" /></a>"); - if (isset(explode("|", $praw)[2])) { - buffer("<br><div class=\"photo_label\">" . explode("|", $praw)[2] . "</div>"); - } - buffer("</div>"); - } else { - buffer("<div class=\"photo\">"); - buffer('<p><table class="message_error message_black"><tbody><tr><td><img src="' . $GLOBALS["SYSTEM_ROOT"] .'/resources/image/message_error.svg" class="message_img"></td><td style="width:100%;">' . $lang["gallery"]["error"] . '</td></tr></tbody></table></p>'); - buffer("</div>"); - } - } - } - } - if (!$shown) { - buffer("<p><div style=\"text-align: center;\"><i>" . $lang["gallery"]["nothing"] . "</i></div></p>"); - } - buffer("</center></div></center>"); - } - } -} else { - buffer("<div style=\"text-align: center;\"><i>" . $lang["gallery"]["disabled"][0] . "<b>" . $lang["gallery"]["disabled"][1] . "</b>" . $lang["gallery"]["disabled"][2] . "</i></div>"); -} -buffer("<script>window.onload = () => {setTimeout(() => {Array.from(document.getElementsByClassName('photo_image')).forEach((el) => {el.classList.add('loaded')});}, 1000)}</script>"); - -renderSpecial($buffer, $lang["gallery"]["title"]); - -?>
\ No newline at end of file |