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