|
|
|
@ -60,15 +60,22 @@ eof;
@@ -60,15 +60,22 @@ eof;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($category['directories'])) { //两级目录支持 |
|
|
|
|
$index = 0; |
|
|
|
|
foreach($category['directories'] as $dir) { |
|
|
|
|
echo <<<eof |
|
|
|
|
<a href="{$dir['path']}" class="img-item"> |
|
|
|
|
eof; |
|
|
|
|
|
|
|
|
|
if (!empty($dir['snapshot'])) { |
|
|
|
|
if ($index > 0) { |
|
|
|
|
echo <<<eof |
|
|
|
|
<img data-src="{$dir['snapshot']}" class="lazyload" alt="{$dir['directory']}"> |
|
|
|
|
eof; |
|
|
|
|
}else { |
|
|
|
|
echo <<<eof |
|
|
|
|
<img src="{$dir['snapshot']}" alt="{$dir['directory']}"> |
|
|
|
|
eof; |
|
|
|
|
} |
|
|
|
|
}else if (!empty($dir['files'])) { |
|
|
|
|
$first_img = array_shift($dir['files']); |
|
|
|
|
if (!in_array($first_img['extension'], $imgExts)) { |
|
|
|
@ -81,11 +88,17 @@ eof;
@@ -81,11 +88,17 @@ eof;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (in_array($first_img['extension'], $imgExts)) { |
|
|
|
|
if ($index > 0) { |
|
|
|
|
echo <<<eof |
|
|
|
|
<img data-src="{$first_img['path']}" class="lazyload" alt="{$first_img['filename']}"> |
|
|
|
|
eof; |
|
|
|
|
}else { |
|
|
|
|
echo <<<eof |
|
|
|
|
<img src="{$first_img['path']}" alt="{$first_img['filename']}"> |
|
|
|
|
eof; |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
echo <<<eof |
|
|
|
|
<img src="/img/default.png" alt="default image"> |
|
|
|
|
eof; |
|
|
|
|
} |
|
|
|
@ -96,20 +109,34 @@ eof;
@@ -96,20 +109,34 @@ eof;
|
|
|
|
|
<strong>{$title}</strong> |
|
|
|
|
</a> |
|
|
|
|
eof; |
|
|
|
|
$index ++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($category['files'])) { //一级目录支持 |
|
|
|
|
$index = 0; |
|
|
|
|
foreach($category['files'] as $file) { |
|
|
|
|
if (!in_array($file['extension'], $imgExts)) {continue;} |
|
|
|
|
|
|
|
|
|
$title = !empty($file['title']) ? $file['title'] : $file['filename']; |
|
|
|
|
|
|
|
|
|
if ($index > 0) { |
|
|
|
|
echo <<<eof |
|
|
|
|
<a href="{$file['path']}" class="img-item img-preview" target="_blank"> |
|
|
|
|
<img data-src="{$file['path']}" class="lazyload" alt="{$file['filename']}"> |
|
|
|
|
<strong>{$title}</strong> |
|
|
|
|
</a> |
|
|
|
|
eof; |
|
|
|
|
}else { |
|
|
|
|
echo <<<eof |
|
|
|
|
<a href="{$file['path']}" class="img-item img-preview" target="_blank"> |
|
|
|
|
<img src="{$file['path']}" alt="{$file['filename']}"> |
|
|
|
|
<strong>{$title}</strong> |
|
|
|
|
</a> |
|
|
|
|
eof; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$index ++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
?> |
|
|
|
|