Browse Source

page title improve for theme videoblog

master
filesite 2 years ago
parent
commit
ecd3562660
  1. 1
      conf/app.php
  2. 6
      themes/videoblog/controller/ListController.php
  3. 9
      themes/videoblog/controller/SiteController.php
  4. 6
      themes/videoblog/controller/ViewController.php

1
conf/app.php

@ -5,6 +5,7 @@
$configs = array( $configs = array(
'version' => '0.1.0', 'version' => '0.1.0',
'default_timezone' => 'Asia/Shanghai', //timezone 'default_timezone' => 'Asia/Shanghai', //timezone
'site_name' => 'FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统',
//文档站皮肤 //文档站皮肤
//'content_directory' => 'content/', //directory of contents in /www/ //'content_directory' => 'content/', //directory of contents in /www/

6
themes/videoblog/controller/ListController.php

@ -58,11 +58,11 @@ Class ListController extends Controller {
$htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme); $htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme);
} }
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; $pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name'];
if (!empty($subcate)) { if (!empty($subcate)) {
$pageTitle = "{$subcate['directory']}的照片,来自{$pageTitle}"; $pageTitle = "{$subcate['directory']}相关视频,来自{$defaultTitle}";
if (!empty($subcate['title'])) { if (!empty($subcate['title'])) {
$pageTitle = $subcate['title']; $pageTitle = "{$subcate['title']},来自{$defaultTitle}";
} }
} }
$viewName = '//site/index'; //共享视图 $viewName = '//site/index'; //共享视图

9
themes/videoblog/controller/SiteController.php

@ -59,15 +59,12 @@ Class SiteController extends Controller {
} }
$pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name'];
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统";
if (!empty($readmeFile['title'])) { if (!empty($readmeFile['title'])) {
$pageTitle = $readmeFile['title']; $pageTitle = "{$readmeFile['title']},来自{$defaultTitle}";
} }
if (!empty($subcate)) { if (!empty($subcate)) {
$pageTitle = "{$subcate['directory']},来自{$pageTitle}"; $pageTitle = "{$subcate['directory']},来自{$defaultTitle}";
} }
$viewName = 'index'; $viewName = 'index';
$params = compact('cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme'); $params = compact('cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme');

6
themes/videoblog/controller/ViewController.php

@ -52,11 +52,11 @@ Class ViewController extends ListController {
$htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme); $htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme);
} }
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; $pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name'];
if (!empty($video)) { if (!empty($video)) {
$pageTitle = "{$video['directory']},来自{$pageTitle}"; $pageTitle = "{$video['filename']},来自{$defaultTitle}";
if (!empty($video['title'])) { if (!empty($video['title'])) {
$pageTitle = $video['title']; $pageTitle = "{$video['title']},来自{$defaultTitle}";
} }
} }
$viewName = 'index'; $viewName = 'index';

Loading…
Cancel
Save