Startseite und Galerie API hinzugefügt
This commit is contained in:
21
galerie/get_jahre.php
Normal file
21
galerie/get_jahre.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
if(!isset($_GET["event"])) die("GET event fehlt");
|
||||
$event=$_GET["event"];
|
||||
|
||||
if(str_contains($event,"/")||str_contains($event,"\\")) die("Du kannst keine / im Event verwenden.");
|
||||
|
||||
$blacklist=["@eaDir",".",".."];
|
||||
|
||||
$bilderdir="../../bilder/";
|
||||
|
||||
$scan=scandir($bilderdir.$event);
|
||||
|
||||
$result=[];
|
||||
|
||||
foreach ($scan as $key => $value) {
|
||||
if(in_array($value,$blacklist)) continue;
|
||||
if(is_dir($bilderdir.$event."/".$value)) array_push($result,$value);
|
||||
}
|
||||
|
||||
echo json_encode($result,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
|
||||
Reference in New Issue
Block a user