选作封面'; //如果是首页 if (empty($selectedId) && !empty($viewData['menus'])) { $category = array( 'directories' => $viewData['menus'], 'files' => $viewData['scanResults'], ); $btnSetSnap = ''; } if (empty($viewData['isAdminIp'])) { $btnSetSnap = ''; } if (!empty($category['files'])) { $total = Html::getDataTotal($category['files'], $supportedExts); //翻页支持 } $totalNum = ''; if ($total > 0) { $totalNum = <<总数 {$total} eof; } if (!empty($viewData['alertWarning'])) { echo <<{$viewData['alertWarning']}
eof; } echo << {$totalNum} 当前位置: 首页 eof; if (!empty($breadcrumbs)) { foreach ($breadcrumbs as $bread) { if ($bread['id'] != $selectedId) { echo <<{$bread['name']} eof; } else { echo <<{$bread['name']} eof; } } } echo << eof; ?> $viewData['menus'], 'files' => $viewData['scanResults'], ); } //当前目录的描述介绍 if (!empty($category['description'])) { echo <<{$category['description']}

eof; } //当前目录的readme详细介绍 if (!empty($viewData['htmlCateReadme'])) { echo <<{$viewData['htmlCateReadme']} eof; } $dirHideClass = $dir_ext_status == 'closed' ? 'hide' : ''; ?> eof; } $title = !empty($dir['title']) ? $dir['title'] : $dir['directory']; echo << folder {$title} {$lockIcon} eof; $index++; } } //分割目录和文件 echo ''; if (!empty($category['directories'])) { //两级目录支持 $arrowImg = $dir_ext_status == 'opened' ? 'arrow-up.svg' : 'arrow-down.svg'; $btnTxt = $dir_ext_status == 'opened' ? '收拢目录' : '展开目录'; echo <<
eof; } //显示图片、视频、音乐筛选链接 $arrShowTypes = array( 'all' => '所有', 'image' => '照片', 'video' => '视频', 'audio' => '音乐', ); echo ''; //空目录显示提示信息 if ( ( empty($selectedId) && empty($category['directories']) ) || ( !empty($selectedId) && empty($category['files']) ) ) { echo <<

咦?没有文件哦

空目录吗?复制照片目录或文件到目录后点右上角“清空缓存数据刷新”图标清空缓存。
如果不是空目录,点右上角“清空缓存数据刷新”图标清空缓存,网页有 10 分钟缓存。

eof; } echo '
'; //显示图片、视频 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']; //图片、视频显示文件修改日期 $title = Common::getDateFromString($file['filename']); if (empty($title) && !empty($file['fstat']['mtime']) && !empty($file['fstat']['ctime'])) { $title = date('Y-m-d', min($file['fstat']['mtime'], $file['fstat']['ctime'])); } if (in_array($file['extension'], $imgExts)) { //缩略图 $imgUrl = urlencode($file['path']); $smallUrl = "/site/smallimg/?id={$file['id']}&url={$imgUrl}"; if (empty(FSC::$app['config']['enableSmallImage']) || FSC::$app['config']['enableSmallImage'] === 'false') { $smallUrl = $file['path']; } //大图(支持中尺寸的缩略图) $bigUrl = "/site/smallimg/?id={$file['id']}&url={$imgUrl}&size=middle"; if (empty(FSC::$app['config']['enableSmallImageForWan']) || FSC::$app['config']['enableSmallImageForWan'] === 'false') { $bigUrl = $file['path']; } echo << {$file['filename']}
{$title}
{$btnSetSnap}
eof; }else if (in_array($file['extension'], $videoExts)) { //输出视频 //m3u8支持 if ($file['extension'] == 'm3u8') { $videoUrl = urlencode("{$file['path']}&cid={$viewData['cacheDataId']}"); }else { $videoUrl = urlencode($file['path']); } $linkUrl = "/site/player?id={$file['id']}&pid={$file['pid']}&cid={$viewData['cacheDataId']}&url={$videoUrl}"; if ($viewData['showType'] == 'video') { $linkUrl .= "&page={$viewData['page']}&limit={$viewData['pageSize']}"; } echo << {$file['filename']}
{$title}
video play button 00:00:00
eof; }else if (in_array($file['extension'], $audioExts)) { //输出音乐 $title = !empty($file['title']) ? $file['title'] : $file['filename']; $videoUrl = urlencode($file['path']); $linkUrl = "/site/audioplayer?id={$file['id']}&pid={$file['pid']}&cid={$viewData['cacheDataId']}&url={$videoUrl}"; if ($viewData['showType'] == 'audio') { $linkUrl .= "&page={$viewData['page']}&limit={$viewData['pageSize']}"; } $snapshot = '/img/beauty/audio_icon.jpeg'; if (!empty($file['snapshot'])) { $snapshot = $file['snapshot']; }else { //尝试找出同名的图片文件 $matchedImage = Html::searchImageByFilename($file['filename'], $viewData['allFiles'], $imgExts); if (!empty($matchedImage)) { $snapshot = $matchedImage['path']; } } echo << {$file['filename']} {$title} video play button 00:00:00 eof; } $index++; } } ?>
$viewData['pageSize']) { $pagination = Html::getPaginationHtmlCode($viewData['page'], $viewData['pageSize'], $total); echo $pagination; } ?>