';
}
//显示图片、视频
if (!empty($category['files'])) { //一级目录支持
$pageStartIndex = ($viewData['page']-1) * $viewData['pageSize'];
$index = 0;
foreach ($category['files'] as $file) {
if (empty($file['extension']) || !in_array($file['extension'], $supportedExts)) {
continue;
}
//翻页支持
if ($index < $pageStartIndex) {
$index ++;
continue;
}else if ($index >= $pageStartIndex + $viewData['pageSize']) {
break;
}
$title = !empty($file['title']) ? $file['title'] : $file['filename'];
//图片、视频显示文件修改日期
if (!empty($file['fstat']['mtime']) && !empty($file['fstat']['ctime'])) {
$title = date('Y-m-d', min($file['fstat']['mtime'], $file['fstat']['ctime']));
}
if ($index > 0) {
if (in_array($file['extension'], $imgExts)) {
echo <<
{$title}
eof;
}else if (in_array($file['extension'], $videoExts)) { //输出视频
$videoUrl = urlencode($file['path']);
echo <<