]> git.bochard.net Git - mysite.git/commitdiff
updated /files
authorbochard <mail@tenkyuu.dev>
Sun, 27 Apr 2025 14:04:21 +0000 (22:04 +0800)
committerbochard <mail@tenkyuu.dev>
Sun, 27 Apr 2025 14:04:21 +0000 (22:04 +0800)
14 files changed:
files/90279.jpg [deleted file]
files/Bliss_(Windows_XP).png [deleted file]
files/ascent.jpg [deleted file]
files/autumn.avif [deleted file]
files/azul.jpg [deleted file]
files/bg_music/another_folder/index.php [new file with mode: 0644]
files/bg_music/childhood2.mp3 [new file with mode: 0755]
files/bg_music/index.php [new file with mode: 0644]
files/bg_music/rejectedworld.mp3 [new file with mode: 0755]
files/childhood2.mp3 [deleted file]
files/index.php
files/rejectedworld.mp3 [deleted file]
files/wallpapers/Bliss_(Windows_XP).png [new file with mode: 0755]
files/youtube_xvFZjo5PgG0_640x360_h264.mp4 [new file with mode: 0644]

diff --git a/files/90279.jpg b/files/90279.jpg
deleted file mode 100755 (executable)
index be59ec4..0000000
Binary files a/files/90279.jpg and /dev/null differ
diff --git a/files/Bliss_(Windows_XP).png b/files/Bliss_(Windows_XP).png
deleted file mode 100755 (executable)
index 22ceab5..0000000
Binary files a/files/Bliss_(Windows_XP).png and /dev/null differ
diff --git a/files/ascent.jpg b/files/ascent.jpg
deleted file mode 100755 (executable)
index aed77f5..0000000
Binary files a/files/ascent.jpg and /dev/null differ
diff --git a/files/autumn.avif b/files/autumn.avif
deleted file mode 100755 (executable)
index 9bf696b..0000000
Binary files a/files/autumn.avif and /dev/null differ
diff --git a/files/azul.jpg b/files/azul.jpg
deleted file mode 100755 (executable)
index 0b76525..0000000
Binary files a/files/azul.jpg and /dev/null differ
diff --git a/files/bg_music/another_folder/index.php b/files/bg_music/another_folder/index.php
new file mode 100644 (file)
index 0000000..c102ebc
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+// Set the current directory
+$dir = ".";
+
+// Get the full path for the current directory
+$currentPath = realpath($dir);
+$baseDir = realpath(dirname(__FILE__)); // Get the base directory path
+$relativePath = str_replace($baseDir, '', $currentPath); // Get the relative path
+$relativePath = trim($relativePath, '/'); // Trim leading and trailing slashes
+
+// Construct the full path for the title
+if (empty($relativePath)) {
+    $fullPath = basename($baseDir); // This will be "files" when in the root
+} else {
+    $fullPath = basename($baseDir) . '/' . $relativePath; // This will be "files/bg_music" or similar
+}
+
+// If the relative path is not empty, prepend a slash
+if (!empty($relativePath)) {
+    $fullPath = basename($baseDir) . '/' . $relativePath;
+}
+
+if ($handle = opendir($dir)) {
+    echo "<html>";
+    echo "<head><title>Index of /$fullPath</title></head>";
+    echo "<body>";
+    echo "<h1>Index of /$fullPath</h1><hr><pre>";
+    echo '<a href="../">../</a>' . PHP_EOL;
+
+    $items = [];
+    while (false !== ($entry = readdir($handle))) {
+        // Skip the current and parent directory entries and index.php
+        if ($entry != "." && $entry != ".." && $entry != "index.php") {
+            $items[] = $entry;
+        }
+    }
+    closedir($handle);
+
+    sort($items);
+
+    foreach ($items as $entry) {
+        $filePath = $dir . "/" . $entry;
+        $lastModified = date("d-M-Y H:i", filemtime($filePath));
+        $size = is_dir($filePath) ? "-" : filesize($filePath);
+        $link = htmlspecialchars($entry);
+        
+        // Check if it's a directory and add a trailing slash
+        if (is_dir($filePath)) {
+            $link .= '/'; // Add trailing slash for directories
+        }
+        
+        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
+    }
+
+    echo "</pre><hr>";
+    echo "</body>";
+    echo "</html>";
+} else {
+    echo "Unable to open directory.";
+}
+?>
diff --git a/files/bg_music/childhood2.mp3 b/files/bg_music/childhood2.mp3
new file mode 100755 (executable)
index 0000000..068a74e
Binary files /dev/null and b/files/bg_music/childhood2.mp3 differ
diff --git a/files/bg_music/index.php b/files/bg_music/index.php
new file mode 100644 (file)
index 0000000..c102ebc
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+// Set the current directory
+$dir = ".";
+
+// Get the full path for the current directory
+$currentPath = realpath($dir);
+$baseDir = realpath(dirname(__FILE__)); // Get the base directory path
+$relativePath = str_replace($baseDir, '', $currentPath); // Get the relative path
+$relativePath = trim($relativePath, '/'); // Trim leading and trailing slashes
+
+// Construct the full path for the title
+if (empty($relativePath)) {
+    $fullPath = basename($baseDir); // This will be "files" when in the root
+} else {
+    $fullPath = basename($baseDir) . '/' . $relativePath; // This will be "files/bg_music" or similar
+}
+
+// If the relative path is not empty, prepend a slash
+if (!empty($relativePath)) {
+    $fullPath = basename($baseDir) . '/' . $relativePath;
+}
+
+if ($handle = opendir($dir)) {
+    echo "<html>";
+    echo "<head><title>Index of /$fullPath</title></head>";
+    echo "<body>";
+    echo "<h1>Index of /$fullPath</h1><hr><pre>";
+    echo '<a href="../">../</a>' . PHP_EOL;
+
+    $items = [];
+    while (false !== ($entry = readdir($handle))) {
+        // Skip the current and parent directory entries and index.php
+        if ($entry != "." && $entry != ".." && $entry != "index.php") {
+            $items[] = $entry;
+        }
+    }
+    closedir($handle);
+
+    sort($items);
+
+    foreach ($items as $entry) {
+        $filePath = $dir . "/" . $entry;
+        $lastModified = date("d-M-Y H:i", filemtime($filePath));
+        $size = is_dir($filePath) ? "-" : filesize($filePath);
+        $link = htmlspecialchars($entry);
+        
+        // Check if it's a directory and add a trailing slash
+        if (is_dir($filePath)) {
+            $link .= '/'; // Add trailing slash for directories
+        }
+        
+        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
+    }
+
+    echo "</pre><hr>";
+    echo "</body>";
+    echo "</html>";
+} else {
+    echo "Unable to open directory.";
+}
+?>
diff --git a/files/bg_music/rejectedworld.mp3 b/files/bg_music/rejectedworld.mp3
new file mode 100755 (executable)
index 0000000..4c624ef
Binary files /dev/null and b/files/bg_music/rejectedworld.mp3 differ
diff --git a/files/childhood2.mp3 b/files/childhood2.mp3
deleted file mode 100755 (executable)
index 068a74e..0000000
Binary files a/files/childhood2.mp3 and /dev/null differ
index a80646a551c0431105e1b2caadf835db7ebc16c6..c102ebcac33b505a7298e8d6e52d0711589b15fc 100755 (executable)
@@ -1,70 +1,61 @@
-
-<!DOCTYPE html>
-<html>
-  <head>
-    <style>
-      table td {
-        padding:4px;
-      }
-    </style>
-    <title>Index of /files/</title>
-  </head>
-  <body>
-  <h1>Index of /files/</h1>
-
-  <table>
-    <th>Name</th><th>Size</th><th>Date Modified</th>
-    
-    <tr>
-    <td><a href="../">../</a></td>
-    <td></td>
-    <td></td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\90279.jpg">90279.jpg</a></td>
-    <td>222.8 kB</td>
-    <td>3/24/25, 19:16:28</td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\ascent.jpg">ascent.jpg</a></td>
-    <td>45.0 kB</td>
-    <td>3/24/25, 19:20:25</td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\autumn.avif">autumn.avif</a></td>
-    <td>237.4 kB</td>
-    <td>3/24/25, 19:17:35</td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\azul.jpg">azul.jpg</a></td>
-    <td>83.9 kB</td>
-    <td>3/24/25, 19:20:10</td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\Bliss_(Windows_XP).png">Bliss_(Windows_XP).png</a></td>
-    <td>107.3 kB</td>
-    <td>3/24/25, 19:14:58</td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\childhood2.mp3">childhood2.mp3</a></td>
-    <td>1.6 MB</td>
-    <td>3/24/25, 19:58:44</td>
-    </tr>
-
-    <tr>
-    <td><a href="\files\rejectedworld.mp3">rejectedworld.mp3</a></td>
-    <td>1.4 MB</td>
-    <td>3/24/25, 19:58:44</td>
-    </tr>
-
-  </table>
-  </body>
-
-  <script data-goatcounter="https://bochard.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
-</html>
+<?php
+// Set the current directory
+$dir = ".";
+
+// Get the full path for the current directory
+$currentPath = realpath($dir);
+$baseDir = realpath(dirname(__FILE__)); // Get the base directory path
+$relativePath = str_replace($baseDir, '', $currentPath); // Get the relative path
+$relativePath = trim($relativePath, '/'); // Trim leading and trailing slashes
+
+// Construct the full path for the title
+if (empty($relativePath)) {
+    $fullPath = basename($baseDir); // This will be "files" when in the root
+} else {
+    $fullPath = basename($baseDir) . '/' . $relativePath; // This will be "files/bg_music" or similar
+}
+
+// If the relative path is not empty, prepend a slash
+if (!empty($relativePath)) {
+    $fullPath = basename($baseDir) . '/' . $relativePath;
+}
+
+if ($handle = opendir($dir)) {
+    echo "<html>";
+    echo "<head><title>Index of /$fullPath</title></head>";
+    echo "<body>";
+    echo "<h1>Index of /$fullPath</h1><hr><pre>";
+    echo '<a href="../">../</a>' . PHP_EOL;
+
+    $items = [];
+    while (false !== ($entry = readdir($handle))) {
+        // Skip the current and parent directory entries and index.php
+        if ($entry != "." && $entry != ".." && $entry != "index.php") {
+            $items[] = $entry;
+        }
+    }
+    closedir($handle);
+
+    sort($items);
+
+    foreach ($items as $entry) {
+        $filePath = $dir . "/" . $entry;
+        $lastModified = date("d-M-Y H:i", filemtime($filePath));
+        $size = is_dir($filePath) ? "-" : filesize($filePath);
+        $link = htmlspecialchars($entry);
+        
+        // Check if it's a directory and add a trailing slash
+        if (is_dir($filePath)) {
+            $link .= '/'; // Add trailing slash for directories
+        }
+        
+        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
+    }
+
+    echo "</pre><hr>";
+    echo "</body>";
+    echo "</html>";
+} else {
+    echo "Unable to open directory.";
+}
+?>
diff --git a/files/rejectedworld.mp3 b/files/rejectedworld.mp3
deleted file mode 100755 (executable)
index 4c624ef..0000000
Binary files a/files/rejectedworld.mp3 and /dev/null differ
diff --git a/files/wallpapers/Bliss_(Windows_XP).png b/files/wallpapers/Bliss_(Windows_XP).png
new file mode 100755 (executable)
index 0000000..22ceab5
Binary files /dev/null and b/files/wallpapers/Bliss_(Windows_XP).png differ
diff --git a/files/youtube_xvFZjo5PgG0_640x360_h264.mp4 b/files/youtube_xvFZjo5PgG0_640x360_h264.mp4
new file mode 100644 (file)
index 0000000..aa2b881
Binary files /dev/null and b/files/youtube_xvFZjo5PgG0_640x360_h264.mp4 differ