diff --git a/index.php b/index.php
index e6ab0c1..489e7b1 100644
--- a/index.php
+++ b/index.php
@@ -82,6 +82,7 @@ $shortPath = isset($_SERVER["PATH_INFO"]) ? $_SERVER["PATH_INFO"] : "";
if ($shortPath == '/') $shortPath = '';
$scriptUrlPath = substr($_SERVER["SCRIPT_NAME"], 0, -4); // trim .php
+$folders = array();
$imageFiles = array();
$otherFiles = array();
@@ -95,35 +96,39 @@ foreach (scandir($realDir) as $file) if ($file != '.')
}
elseif (is_dir("$realDir/$file"))
{
- echo "
";
- $preview = getAlbumPreview("$realDir/$file");
- if ($preview !== '') {
- echo "
";
- }
-
- echo "
$file";
- echo "
\n";
+ $folders[] = array( "name" => $file, "link" => "$scriptUrlPath$shortPath/$file", "preview" => getAlbumPreview("$realDir/$file") );
}
else
{
$mime = mime_content_type("$realDir/$file");
if ($mime == "image/jpeg")
- $imageFiles[] = $file;
+ $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file", 100), "link" => dirname($scriptUrlPath)."/view/$shortPath/$file" );
else
- $otherFiles[] = $file;
+ $otherFiles[] = array( "name" => $file, "link" => dirname($scriptUrlPath)."/$realDir/$file" );
}
}
-foreach ($imageFiles as $file) {
- echo "\n";
-}
-
-foreach ($otherFiles as $file) {
- echo "\n";
-}
-
?>
+
+
+
+
+
+
+
+
+
+
+
+