|
|
@ -26,7 +26,6 @@ Class SiteController extends Controller { |
|
|
|
//获取数据 |
|
|
|
//获取数据 |
|
|
|
$menus = array(); //菜单,一级目录 |
|
|
|
$menus = array(); //菜单,一级目录 |
|
|
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
|
|
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
|
|
|
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 |
|
|
|
|
|
|
|
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 |
|
|
|
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 |
|
|
|
|
|
|
|
|
|
|
|
$scanner = new DirScanner(); |
|
|
|
$scanner = new DirScanner(); |
|
|
@ -54,17 +53,7 @@ Class SiteController extends Controller { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//默认显示的目录 |
|
|
|
//默认显示的目录 |
|
|
|
$cateId = $this->get('id', $menus[0]['id']); |
|
|
|
$cateId = $menus[0]['id']; |
|
|
|
$subcate = $scanResults[$cateId]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取当前目录下的readme |
|
|
|
|
|
|
|
$cateReadmeFile = $scanner->getDefaultReadme($cateId); |
|
|
|
|
|
|
|
if (!empty($cateReadmeFile)) { |
|
|
|
|
|
|
|
$Parsedown = new Parsedown(); |
|
|
|
|
|
|
|
$content = file_get_contents($cateReadmeFile['realpath']); |
|
|
|
|
|
|
|
$htmlCateReadme = $Parsedown->text($content); |
|
|
|
|
|
|
|
$htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取tags分类 |
|
|
|
//获取tags分类 |
|
|
|
$tags = $this->getTags($dirTree); |
|
|
|
$tags = $this->getTags($dirTree); |
|
|
@ -77,14 +66,11 @@ Class SiteController extends Controller { |
|
|
|
//昵称支持 |
|
|
|
//昵称支持 |
|
|
|
$nickname = $this->getNickname($readmeFile); |
|
|
|
$nickname = $this->getNickname($readmeFile); |
|
|
|
|
|
|
|
|
|
|
|
$pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name']; |
|
|
|
$pageTitle = $defaultTitle = "{$nickname}的视频收藏夹 | " . FSC::$app['config']['site_name']; |
|
|
|
if (!empty($readmeFile['title'])) { |
|
|
|
|
|
|
|
$pageTitle = "{$readmeFile['title']},来自{$defaultTitle}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$viewName = 'index'; |
|
|
|
$viewName = 'index'; |
|
|
|
$params = compact( |
|
|
|
$params = compact( |
|
|
|
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', 'tags', |
|
|
|
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'tags', |
|
|
|
'nickname' |
|
|
|
'nickname' |
|
|
|
); |
|
|
|
); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
@ -222,7 +208,7 @@ Class SiteController extends Controller { |
|
|
|
//昵称支持 |
|
|
|
//昵称支持 |
|
|
|
$nickname = $this->getNickname($readmeFile); |
|
|
|
$nickname = $this->getNickname($readmeFile); |
|
|
|
|
|
|
|
|
|
|
|
$pageTitle = '添加视频收藏'; |
|
|
|
$pageTitle = '添加视频收藏 | ' . FSC::$app['config']['site_name']; |
|
|
|
$viewName = 'new'; |
|
|
|
$viewName = 'new'; |
|
|
|
$params = compact('dirTree', 'scanResults', 'htmlReadme', 'tags', 'nickname'); |
|
|
|
$params = compact('dirTree', 'scanResults', 'htmlReadme', 'tags', 'nickname'); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|