$item) {
//输出分类名称
echo <<
更多>>
{$item['name']}
eof;
$category = $viewData['scanResults'][$item['id']];
if (!empty($category['files'])) { //一级目录支持,目录下直接存放视频文件
$cate_files = Html::sortFilesByCreateTime($category['files'], 'desc'); //按创建时间排序
foreach($cate_files as $index => $file) {
//跳过非.url文件,且最多显示 8 个
if (!in_array($file['extension'], $videoExts) || empty($file['shortcut']) || $index >= 8) {
continue;
}
$snapshot = !empty($file['cover']) ? $imgPreffix . $file['cover'] : '/img/default.png';
$title = !empty($file['title']) ? Html::mb_substr($file['title'], 0, 33, 'utf-8') : $file['filename'];
$platform = Html::getShareVideosPlatform($file['shortcut']['url']);
$pubDate = date('m/d', $file['fstat']['ctime']);
$imgSrc = $tagIndex == 0 && $index < 4 ? " src=\"{$snapshot}\"" : '';
$imgAlt = $tagIndex == 0 && $index < 4 ? " alt=\"{$title}\"" : '';
$imgCls = $tagIndex == 0 && $index < 4 ? '' : 'lazy';
$itemCls = $index < 4 ? '' : 'hidden-xs';
echo <<
eof;
}
}
echo <<