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