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 { @@ -75,6 +75,7 @@ Class Html {
//生成GA统计代码
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'] : '';
if (empty($msid)) {return '';}

6
themes/tajian/controller/ListController.php

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

22
themes/tajian/controller/SiteController.php

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

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

@ -45,15 +45,15 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use @@ -45,15 +45,15 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use
<div class="app_layout_side">
<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="星星图标" />
<span>首页</span>
</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="添加图标" />
<span>添加</span>
</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="用户图标" />
<span>我的</span>
</a>

Loading…
Cancel
Save