Browse Source

title update

master
filesite 7 months ago
parent
commit
de3f0afbc7
  1. 1
      plugins/Html.php
  2. 6
      themes/tajian/controller/ListController.php
  3. 22
      themes/tajian/controller/SiteController.php
  4. 6
      themes/tajian/views/layout/main.php

1
plugins/Html.php

@ -75,6 +75,7 @@ Class Html {
//生成GA统计代码 //生成GA统计代码
public static function getGACode() { public static function getGACode() {
if (!empty(FSC::$app['config']['debug'])) {return '';}
$msid = !empty(FSC::$app['config']['GA_MEASUREMENT_ID']) ? FSC::$app['config']['GA_MEASUREMENT_ID'] : ''; $msid = !empty(FSC::$app['config']['GA_MEASUREMENT_ID']) ? FSC::$app['config']['GA_MEASUREMENT_ID'] : '';
if (empty($msid)) {return '';} if (empty($msid)) {return '';}

6
themes/tajian/controller/ListController.php

@ -10,7 +10,6 @@ Class ListController extends SiteController {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 $htmlCateReadme = ''; //当前目录下的Readme.md 内容
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
@ -20,9 +19,6 @@ Class ListController extends SiteController {
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3); $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3);
$scanResults = $scanner->getScanResults(); $scanResults = $scanner->getScanResults();
//获取目录
$menus = $scanner->getMenus();
$titles = array(); $titles = array();
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {
@ -70,7 +66,7 @@ Class ListController extends SiteController {
} }
$viewName = '//site/index'; //共享视图 $viewName = '//site/index'; //共享视图
$params = compact( $params = compact(
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'cateId', 'dirTree', 'scanResults', 'htmlReadme',
'breadcrumbs', 'htmlCateReadme', 'tags', 'nickname' 'breadcrumbs', 'htmlCateReadme', 'tags', 'nickname'
); );
return $this->render($viewName, $params, $pageTitle); return $this->render($viewName, $params, $pageTitle);

22
themes/tajian/controller/SiteController.php

@ -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);

6
themes/tajian/views/layout/main.php

@ -45,15 +45,15 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use
<div class="app_layout_side"> <div class="app_layout_side">
<div class="menu_ls g_ls_menus"> <div class="menu_ls g_ls_menus">
<a class="this_set" href="<?=$linkPrefix?>/" title=""> <a class="<?php echo FSC::$app['controller'] == 'site' && FSC::$app['action'] == 'index' ? 'this_set' : ''; ?>" href="<?=$linkPrefix?>/" title="我的首页">
<img src="/img/choice.svg" alt="星星图标" /> <img src="/img/choice.svg" alt="星星图标" />
<span>首页</span> <span>首页</span>
</a> </a>
<a href="<?=$linkPrefix?>/site/new" title=""> <a class="<?php echo FSC::$app['controller'] == 'site' && FSC::$app['action'] == 'new' ? 'this_set' : ''; ?>" href="<?=$linkPrefix?>/site/new" title="收藏视频">
<img src="/img/addvideos.svg" alt="添加图标" /> <img src="/img/addvideos.svg" alt="添加图标" />
<span>添加</span> <span>添加</span>
</a> </a>
<a href="###" title=""> <a class="<?php echo FSC::$app['controller'] == 'my' && FSC::$app['action'] == 'index' ? 'this_set' : ''; ?>" href="<?=$linkPrefix?>/my/" title="个人中心">
<img src="/img/PersonalCenter.svg" alt="用户图标" /> <img src="/img/PersonalCenter.svg" alt="用户图标" />
<span>我的</span> <span>我的</span>
</a> </a>

Loading…
Cancel
Save