$files) { $total += Html::getDataTotal($files, $supportedExts); //翻页支持 } } $totalNum = ''; if ($total > 0) { $totalNum = <<总数 {$total} eof; } if (!empty($viewData['alertWarning'])) { echo <<{$viewData['alertWarning']}
eof; } echo << {$totalNum} 当前位置: 首页 eof; $breadcrumbs = !empty($viewData['breadcrumbs']) ? $viewData['breadcrumbs'] : []; if (!empty($breadcrumbs)) { foreach ($breadcrumbs as $bread) { if ($bread['id'] != $selectedId) { echo <<{$bread['name']} eof; } else { echo <<{$bread['name']} eof; } } } echo << eof; ?>
'所有', 'image' => '照片', 'video' => '视频', 'audio' => '音乐', ); echo ''; //显示月份导航菜单 if (!empty($viewData['allFiles']) && !empty($viewData['para_year']) && !empty($viewData['cacheData_keys'][$viewData['para_year']])) { echo ''; } //显示图片、视频、音乐 $allFiles = $viewData['allFiles']; if(!empty($allFiles)) { //输出所有文件 $pageStartIndex = ($viewData['page']-1) * $viewData['pageSize']; $index = 0; foreach ($allFiles as $file) { if (empty($file['extname']) || !in_array($file['extname'], $supportedExts)) { continue; } //翻页支持 if ($index < $pageStartIndex) { $index ++; continue; }else if ($index >= $pageStartIndex + $viewData['pageSize']) { break; } //图片、视频显示文件修改日期 if (!empty($file['original_ctime'])) { //优先使用照片的拍摄日期 $title = '摄于' . date('Y-m-d H:i', $file['original_ctime']); }else { $title = Common::getDateFromString($file['filename']); //根据文件名获取拍摄日期 if (empty($title) && !empty($file['fstat']['mtime']) && !empty($file['fstat']['ctime'])) { $title = date('Y-m-d', Common::getFileCreateTime($file)); } } if (in_array($file['extname'], $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']; } //权限检查 $originUrl = $file['path']; $isAllowedToVisit = Common::isUserAllowedToFile($file['realpath']); if (!$isAllowedToVisit) { $smallUrl = '/img/beauty/lock-fill.svg'; $bigUrl = $originUrl = '/img/beauty/lazy.svg'; } echo << {$file['filename']}
{$title}
{$btnSetSnap}
eof; }else if (in_array($file['extname'], $videoExts)) { //输出视频 $videoUrl = urlencode($file['path']); $linkUrl = "/site/player?id={$file['id']}&pid={$file['pid']}&url={$videoUrl}"; if ($viewData['showType'] == 'video') { $linkUrl .= "&page={$viewData['page']}&limit={$viewData['pageSize']}"; //支持按年、月查看视频时,获取更多视频以便自动播放 $linkUrl .= "&year={$viewData['para_year']}&month={$viewData['para_month']}"; } if ($file['extname'] == 'm3u8') { $linkUrl .= "&name=" . urlencode($file['filename']); } //权限检查 $linkTarget = '_blank'; $videoCover = '/img/beauty/video_snap.jpg'; $lockedAttr = ''; $isAllowedToVisit = Common::isUserAllowedToFile($file['realpath']); if (!$isAllowedToVisit) { $linkUrl = 'javascript:;'; $linkTarget = '_self'; $videoCover = '/img/beauty/lock-fill.svg'; $lockedAttr = 'data-lock="true"'; } echo << {$file['filename']}
{$title}
video play button 00:00:00
eof; }else if (in_array($file['extname'], $audioExts)) { //输出音乐 $title = !empty($file['title']) ? $file['title'] : $file['filename']; $videoUrl = urlencode($file['path']); $linkUrl = "/site/audioplayer?id={$file['id']}&pid={$file['pid']}&url={$videoUrl}"; if ($viewData['showType'] == 'audio') { $linkUrl .= "&page={$viewData['page']}&limit={$viewData['pageSize']}"; //支持按年、月查看视频时,获取更多视频以便自动播放 $linkUrl .= "&year={$viewData['para_year']}&month={$viewData['para_month']}"; } $snapshot = '/img/beauty/audio_icon.jpeg'; if (!empty($file['snapshot'])) { $snapshot = $file['snapshot']; }else { //尝试找出同名的图片文件 $matchedImage = Html::searchImageByFilename($file['filename'], $allFiles, $imgExts); if (!empty($matchedImage)) { $snapshot = $matchedImage['path']; } } //权限检查 $linkTarget = '_blank'; $lockedAttr = ''; $isAllowedToVisit = Common::isUserAllowedToFile($file['realpath']); if (!$isAllowedToVisit) { $linkUrl = 'javascript:;'; $linkTarget = '_self'; $snapshot = '/img/beauty/lock-fill.svg'; $lockedAttr = 'data-lock="true"'; } echo << {$file['filename']} {$title} video play button 00:00:00 eof; } $index++; } }else { $tipPrefix = '照片、视频'; if ($viewData['showType'] == 'image') { $tipPrefix = '照片'; }else if ($viewData['showType'] == 'video') { $tipPrefix = '视频'; }else if ($viewData['showType'] == 'audio') { $tipPrefix = '音乐'; } echo <<

咦?没有{$tipPrefix}文件哦

人面不知何处去,桃花依旧笑春风...

eof; } ?>
$viewData['pageSize']) { $pagination = Html::getPaginationHtmlCode($viewData['page'], $viewData['pageSize'], $total); echo $pagination; } ?>