diff --git a/gif/index.php b/gif/index.php deleted file mode 100644 index 7855475..0000000 --- a/gif/index.php +++ /dev/null @@ -1,24 +0,0 @@ - '/assets/gifs/' . basename($f), $gif_files); -$base_url = 'https://sistav.com'; - -$path = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'); - -// /gif/random — serve a random gif -if ($path === 'gif/random') { - if (empty($gifs)) { http_response_code(404); exit; } - $file = $gif_files[array_rand($gif_files)]; - header('Content-Type: image/gif'); - header('Content-Length: ' . filesize($file)); - header('Cache-Control: no-store, no-cache, must-revalidate'); - readfile($file); - exit; -} - -// /gif — return JSON list -header('Content-Type: application/json'); -echo json_encode([ - 'count' => count($gifs), - 'gifs' => array_map(fn($g) => $base_url . $g, $gifs) -]); \ No newline at end of file diff --git a/gif/list/index.php b/gif/list/index.php new file mode 100644 index 0000000..de82865 --- /dev/null +++ b/gif/list/index.php @@ -0,0 +1,10 @@ + '/assets/gifs/' . basename($f), $gif_files); +$base_url = 'https://sistav.com'; + +header('Content-Type: application/json'); +echo json_encode([ + 'count' => count($gifs), + 'gifs' => array_map(fn($g) => $base_url . $g, $gifs) +]); \ No newline at end of file diff --git a/gif/random/index.php b/gif/random/index.php new file mode 100644 index 0000000..9b87d27 --- /dev/null +++ b/gif/random/index.php @@ -0,0 +1,10 @@ +