|
|
@ -59,6 +59,8 @@ Class SiteController extends Controller { |
|
|
|
$tags = $this->sortTags($menus_sorted, $tags); |
|
|
|
$tags = $this->sortTags($menus_sorted, $tags); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//昵称支持 |
|
|
|
|
|
|
|
$nickname = $this->getNickname($readmeFile); |
|
|
|
|
|
|
|
|
|
|
|
$pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name']; |
|
|
|
$pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name']; |
|
|
|
if (!empty($readmeFile['title'])) { |
|
|
|
if (!empty($readmeFile['title'])) { |
|
|
@ -66,7 +68,10 @@ Class SiteController extends Controller { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$viewName = 'index'; |
|
|
|
$viewName = 'index'; |
|
|
|
$params = compact('cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', 'tags'); |
|
|
|
$params = compact( |
|
|
|
|
|
|
|
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', 'tags', |
|
|
|
|
|
|
|
'nickname' |
|
|
|
|
|
|
|
); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -127,6 +132,18 @@ Class SiteController extends Controller { |
|
|
|
return $sorted_tags; |
|
|
|
return $sorted_tags; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function getNickname($readmeFile) { |
|
|
|
|
|
|
|
$nickname = ''; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($readmeFile['nickname'])) { |
|
|
|
|
|
|
|
$nickname = $readmeFile['nickname']; |
|
|
|
|
|
|
|
}else if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['user_id'])) { |
|
|
|
|
|
|
|
$nickname = FSC::$app['user_id']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $nickname; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//添加新视频 |
|
|
|
//添加新视频 |
|
|
|
public function actionNew() { |
|
|
|
public function actionNew() { |
|
|
|
//获取数据 |
|
|
|
//获取数据 |
|
|
@ -164,10 +181,12 @@ Class SiteController extends Controller { |
|
|
|
$tags = $this->sortTags($menus_sorted, $tags); |
|
|
|
$tags = $this->sortTags($menus_sorted, $tags); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//昵称支持 |
|
|
|
|
|
|
|
$nickname = $this->getNickname($readmeFile); |
|
|
|
|
|
|
|
|
|
|
|
$pageTitle = '添加视频收藏'; |
|
|
|
$pageTitle = '添加视频收藏'; |
|
|
|
$viewName = 'new'; |
|
|
|
$viewName = 'new'; |
|
|
|
$params = compact('dirTree', 'scanResults', 'htmlReadme', 'tags'); |
|
|
|
$params = compact('dirTree', 'scanResults', 'htmlReadme', 'tags', 'nickname'); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|