From: bochard Date: Sun, 27 Apr 2025 14:24:28 +0000 (+0800) Subject: fix path title in /files X-Git-Url: https://git.bochard.net/?a=commitdiff_plain;h=124d09bb34621d3276eaf77ee24078230c77f026;p=mysite.git fix path title in /files --- diff --git a/files/bg_music/another_folder/index.php b/files/bg_music/another_folder/index.php index c102ebc..1067e45 100644 --- a/files/bg_music/another_folder/index.php +++ b/files/bg_music/another_folder/index.php @@ -1,35 +1,17 @@ "; - echo "Index of /$fullPath"; + echo "Index of $fullPath"; echo ""; - echo "

Index of /$fullPath


";
+    echo "

Index of $fullPath


";
     echo '../' . 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;
         }
@@ -39,16 +21,15 @@ if ($handle = opendir($dir)) {
     sort($items);
 
     foreach ($items as $entry) {
-        $filePath = $dir . "/" . $entry;
+        $filePath = "./" . $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
+            $link .= '/';
         }
-        
+
         echo "$link" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
     }
 
@@ -58,4 +39,4 @@ if ($handle = opendir($dir)) {
 } else {
     echo "Unable to open directory.";
 }
-?>
+?>
\ No newline at end of file
diff --git a/files/bg_music/index.php b/files/bg_music/index.php
index c102ebc..1067e45 100644
--- a/files/bg_music/index.php
+++ b/files/bg_music/index.php
@@ -1,35 +1,17 @@
 ";
-    echo "Index of /$fullPath";
+    echo "Index of $fullPath";
     echo "";
-    echo "

Index of /$fullPath


";
+    echo "

Index of $fullPath


";
     echo '../' . 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;
         }
@@ -39,16 +21,15 @@ if ($handle = opendir($dir)) {
     sort($items);
 
     foreach ($items as $entry) {
-        $filePath = $dir . "/" . $entry;
+        $filePath = "./" . $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
+            $link .= '/';
         }
-        
+
         echo "$link" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
     }
 
@@ -58,4 +39,4 @@ if ($handle = opendir($dir)) {
 } else {
     echo "Unable to open directory.";
 }
-?>
+?>
\ No newline at end of file
diff --git a/files/index.php b/files/index.php
index c102ebc..1067e45 100755
--- a/files/index.php
+++ b/files/index.php
@@ -1,35 +1,17 @@
 ";
-    echo "Index of /$fullPath";
+    echo "Index of $fullPath";
     echo "";
-    echo "

Index of /$fullPath


";
+    echo "

Index of $fullPath


";
     echo '../' . 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;
         }
@@ -39,16 +21,15 @@ if ($handle = opendir($dir)) {
     sort($items);
 
     foreach ($items as $entry) {
-        $filePath = $dir . "/" . $entry;
+        $filePath = "./" . $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
+            $link .= '/';
         }
-        
+
         echo "$link" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
     }
 
@@ -58,4 +39,4 @@ if ($handle = opendir($dir)) {
 } else {
     echo "Unable to open directory.";
 }
-?>
+?>
\ No newline at end of file
diff --git a/files/wallpapers/index.php b/files/wallpapers/index.php
new file mode 100644
index 0000000..1067e45
--- /dev/null
+++ b/files/wallpapers/index.php
@@ -0,0 +1,42 @@
+";
+    echo "Index of $fullPath";
+    echo "";
+    echo "

Index of $fullPath


";
+    echo '../' . PHP_EOL;
+
+    $items = [];
+    while (false !== ($entry = readdir($handle))) {
+        if ($entry != "." && $entry != ".." && $entry != "index.php") {
+            $items[] = $entry;
+        }
+    }
+    closedir($handle);
+
+    sort($items);
+
+    foreach ($items as $entry) {
+        $filePath = "./" . $entry;
+        $lastModified = date("d-M-Y H:i", filemtime($filePath));
+        $size = is_dir($filePath) ? "-" : filesize($filePath);
+        $link = htmlspecialchars($entry);
+
+        if (is_dir($filePath)) {
+            $link .= '/';
+        }
+
+        echo "$link" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
+    }
+
+    echo "

"; + echo ""; + echo ""; +} else { + echo "Unable to open directory."; +} +?> \ No newline at end of file