Browse Source

change array define

master
filesite 2 years ago
parent
commit
34a507a783
  1. 15
      conf/app.php
  2. 4
      conf/template_googleimage.php
  3. 4
      conf/template_manual.php
  4. 4
      conf/template_webdirectory.php
  5. 4
      controller/Controller.php
  6. 74
      lib/DirScanner.php
  7. 2
      lib/FSC.php
  8. 8
      themes/googleimage/controller/ListController.php
  9. 6
      themes/googleimage/controller/SiteController.php
  10. 4
      themes/googleimage/views/site/index.php
  11. 2
      themes/manual/controller/SiteController.php
  12. 2
      themes/manual/controller/ViewController.php
  13. 8
      themes/videoblog/controller/ListController.php
  14. 6
      themes/videoblog/controller/SiteController.php
  15. 2
      themes/videoblog/controller/ViewController.php
  16. 6
      themes/videoblog/views/site/index.php
  17. 6
      themes/videoblog/views/view/index.php
  18. 6
      themes/webdirectory/controller/SiteController.php

15
conf/app.php

@ -31,15 +31,22 @@ return array(
//for themes //for themes
/* /*
//图片皮肤配置 //图片皮肤配置
'googleimage' => [ 'googleimage' => array(
'imageHeight' => 350, //图片高度,单位:px 'imageHeight' => 350, //图片高度,单位:px
'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
], ),
*/ */
//视频皮肤配置 //视频皮肤配置
'videoblog' => [ 'videoblog' => array(
'imageHeight' => 180, //图片高度,单位:px 'imageHeight' => 180, //图片高度,单位:px
'contact' => 'FileSite视频网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', 'contact' => 'FileSite视频网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
], ),
//后台管理相关配置
'admin' => array(
'username' => 'filesite',
'password' => '88888888',
),
); );

4
conf/template_googleimage.php

@ -25,8 +25,8 @@ return array(
'debug' => false, 'debug' => false,
//for themes //for themes
'googleimage' => [ 'googleimage' => array(
'imageHeight' => 350, //图片高度,单位:px 'imageHeight' => 350, //图片高度,单位:px
'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
], ),
); );

4
conf/template_manual.php

@ -25,8 +25,8 @@ return array(
'debug' => false, 'debug' => false,
//for themes //for themes
//'googleimage' => [ //'googleimage' => array(
// 'imageHeight' => 350, //图片高度,单位:px // 'imageHeight' => 350, //图片高度,单位:px
// 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', // 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
//], //),
); );

4
conf/template_webdirectory.php

@ -25,8 +25,8 @@ return array(
'debug' => false, 'debug' => false,
//for themes //for themes
//'googleimage' => [ //'googleimage' => array(
// 'imageHeight' => 350, //图片高度,单位:px // 'imageHeight' => 350, //图片高度,单位:px
// 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', // 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>',
//], //),
); );

4
controller/Controller.php

@ -214,7 +214,7 @@ Class Controller {
if (!empty($names)) { if (!empty($names)) {
$menus_sorted = array_keys($names); $menus_sorted = array_keys($names);
$arr = []; $arr = array();
foreach($menus_sorted as $name) { foreach($menus_sorted as $name) {
$index = array_search($name, $menu_dirs); $index = array_search($name, $menu_dirs);
array_push($arr, $menus[$index]); array_push($arr, $menus[$index]);
@ -229,7 +229,7 @@ Class Controller {
if (!empty($names)) { if (!empty($names)) {
$sorted_dirs = array_keys($names); $sorted_dirs = array_keys($names);
$arr = []; $arr = array();
foreach($sorted_dirs as $name) { foreach($sorted_dirs as $name) {
foreach($dirTree as $index => $item) { foreach($dirTree as $index => $item) {
if (!empty($item['directory']) && $item['directory'] == $name) { if (!empty($item['directory']) && $item['directory'] == $name) {

74
lib/DirScanner.php

@ -10,12 +10,12 @@ Class DirScanner {
private $userIp = '127.0.0.1'; //用户IP地址 private $userIp = '127.0.0.1'; //用户IP地址
private $nginxSecureTimeout = 1800; //Nginx防盗链有效期,单位:秒 private $nginxSecureTimeout = 1800; //Nginx防盗链有效期,单位:秒
private $nginxSecureLinkMd5Pattern = '{secure_link_expires}{uri}{remote_addr} {secret}'; //Nginx防盗链MD5加密方式 private $nginxSecureLinkMd5Pattern = '{secure_link_expires}{uri}{remote_addr} {secret}'; //Nginx防盗链MD5加密方式
private $allowReadContentFileExtensions = [ //允许读取文件内容的文件类型 private $allowReadContentFileExtensions = array( //允许读取文件内容的文件类型
'txt', 'txt',
'md', 'md',
'url', 'url',
]; );
private $fields = [ //私有属性字段名和说明 private $fields = array( //私有属性字段名和说明
'directory' => '目录名', 'directory' => '目录名',
'filename' => '文件名', 'filename' => '文件名',
'realpath' => '完整路径', 'realpath' => '完整路径',
@ -28,16 +28,16 @@ Class DirScanner {
'description' => '描述', 'description' => '描述',
'keywords' => '关键词', 'keywords' => '关键词',
'snapshot' => '快照图片', 'snapshot' => '快照图片',
]; );
private $rootDir; //当前扫描的根目录 private $rootDir; //当前扫描的根目录
private $webRoot = '/content/'; //网站静态文件相对路径的根目录 private $webRoot = '/content/'; //网站静态文件相对路径的根目录
private $scanningDirLevel = 0; //当前扫描的目录深度 private $scanningDirLevel = 0; //当前扫描的目录深度
private $scanStartTime = 0; //扫描开始时间,单位:秒 private $scanStartTime = 0; //扫描开始时间,单位:秒
private $scanResults = []; //目录扫描结果 private $scanResults = array(); //目录扫描结果
private $tree = []; //目录扫描树形结构 private $tree = array(); //目录扫描树形结构
protected $supportFileExtensions = [ //支持的文件类型 protected $supportFileExtensions = array( //支持的文件类型
'txt', //纯文本 'txt', //纯文本
'md', //纯文本 'md', //纯文本
'url', //快捷方式 'url', //快捷方式
@ -49,8 +49,8 @@ Class DirScanner {
'mp4', //视频 'mp4', //视频
'ts', //视频 'ts', //视频
'm3u8', //视频 'm3u8', //视频
]; );
protected $maxReadFilesize = [ //默认每种文件读取内容最大大小 protected $maxReadFilesize = array( //默认每种文件读取内容最大大小
'txt' => 100*1024, //纯文本 'txt' => 100*1024, //纯文本
'md' => 5*1024*1024, //纯文本 'md' => 5*1024*1024, //纯文本
'url' => 20*1024, //快捷方式 'url' => 20*1024, //快捷方式
@ -62,8 +62,8 @@ Class DirScanner {
'mp4' => 100*1024*1024, //视频 'mp4' => 100*1024*1024, //视频
'ts' => 10*1024*1024, //视频 'ts' => 10*1024*1024, //视频
'm3u8' => 10*1024*1024, //视频 'm3u8' => 10*1024*1024, //视频
]; );
protected $securedFileExtensions = [ //开启Nginx防盗链的文件类型 protected $securedFileExtensions = array( //开启Nginx防盗链的文件类型
'jpg', //图片 'jpg', //图片
'jpeg', //图片 'jpeg', //图片
'png', //图片 'png', //图片
@ -72,7 +72,7 @@ Class DirScanner {
'mp4', //视频 'mp4', //视频
'ts', //视频 'ts', //视频
'm3u8', //视频 'm3u8', //视频
]; );
public $scanTimeCost = 0; //上一次目录扫描耗时,单位:毫秒 public $scanTimeCost = 0; //上一次目录扫描耗时,单位:毫秒
@ -93,7 +93,7 @@ Class DirScanner {
if (empty($content)) {return [];} if (empty($content)) {return [];}
$content = trim($content); $content = trim($content);
$data = []; $data = array();
if (in_array($field, ['title', 'snapshot'])) { if (in_array($field, ['title', 'snapshot'])) {
if ($field == 'snapshot') { if ($field == 'snapshot') {
$img_realpath = realpath("{$pathinfo['dirname']}/{$content}"); $img_realpath = realpath("{$pathinfo['dirname']}/{$content}");
@ -143,12 +143,12 @@ Class DirScanner {
private function isNginxSecureLinkMd5PatternValid($pattern) { private function isNginxSecureLinkMd5PatternValid($pattern) {
$valid = true; $valid = true;
$fieldsNeeded = [ $fieldsNeeded = array(
'{secure_link_expires}', '{secure_link_expires}',
'{uri}', '{uri}',
'{remote_addr}', '{remote_addr}',
'{secret}', '{secret}',
]; );
foreach($fieldsNeeded as $needle) { foreach($fieldsNeeded as $needle) {
if (strstr($pattern, $needle) === false) { if (strstr($pattern, $needle) === false) {
$valid = false; $valid = false;
@ -162,15 +162,15 @@ Class DirScanner {
//根据路径生成目录数组 //根据路径生成目录数组
private function getDirData($realpath, $files) { private function getDirData($realpath, $files) {
$id = $this->getId($realpath); $id = $this->getId($realpath);
$data = [ $data = array(
'id' => $id, 'id' => $id,
'directory' => basename($realpath), 'directory' => basename($realpath),
'realpath' => $realpath, 'realpath' => $realpath,
'path' => $this->getDirPath($id), 'path' => $this->getDirPath($id),
]; );
$sub_dirs = []; $sub_dirs = array();
$sub_files = []; $sub_files = array();
//try to merge description data //try to merge description data
if (!empty($files[$id])) { if (!empty($files[$id])) {
@ -205,19 +205,19 @@ Class DirScanner {
fclose($fp); fclose($fp);
$pathinfo = pathinfo($realpath); $pathinfo = pathinfo($realpath);
$extension = strtolower($pathinfo['extension']); $extension = strtolower($pathinfo['extension']);
$data = [ $data = array(
'id' => $id, 'id' => $id,
'filename' => $pathinfo['filename'], 'filename' => $pathinfo['filename'],
'extension' => $extension, 'extension' => $extension,
'fstat' => [ 'fstat' => array(
'size' => $fstat['size'], 'size' => $fstat['size'],
'atime' => $fstat['atime'], 'atime' => $fstat['atime'],
'mtime' => $fstat['mtime'], 'mtime' => $fstat['mtime'],
'ctime' => $fstat['ctime'], 'ctime' => $fstat['ctime'],
], ),
'realpath' => $realpath, 'realpath' => $realpath,
'path' => $this->getFilePath( $id, $this->getRelativeDirname($pathinfo['dirname']), $pathinfo['filename'], $extension, $fstat['mtime'] ), 'path' => $this->getFilePath( $id, $this->getRelativeDirname($pathinfo['dirname']), $pathinfo['filename'], $extension, $fstat['mtime'] ),
]; );
if ($extension == 'url') { if ($extension == 'url') {
$data['shortcut'] = $this->parseShortCuts($realpath, $pathinfo['filename']); $data['shortcut'] = $this->parseShortCuts($realpath, $pathinfo['filename']);
@ -251,7 +251,7 @@ Class DirScanner {
//合并描述文件内容到md文件或者目录数据 //合并描述文件内容到md文件或者目录数据
//增加视频文件:mp4, m3u8描述文件支持 //增加视频文件:mp4, m3u8描述文件支持
private function mergeDescriptionData($realpath) { private function mergeDescriptionData($realpath) {
$data = []; $data = array();
$ext = $this->parseDescriptionFiles($realpath); $ext = $this->parseDescriptionFiles($realpath);
//try to find the md file //try to find the md file
@ -337,7 +337,7 @@ Class DirScanner {
} }
$webRoot = preg_replace('/\/$/', '', $this->webRoot); $webRoot = preg_replace('/\/$/', '', $this->webRoot);
$extensionPathMap = [ //默认每种文件读取内容最大大小 $extensionPathMap = array( //默认每种文件读取内容最大大小
'txt' => '', 'txt' => '',
'md' => '/view/', 'md' => '/view/',
'url' => '/link/', 'url' => '/link/',
@ -349,7 +349,7 @@ Class DirScanner {
'ico' => "{$webRoot}{$directory}{$filename}.{$extension}", 'ico' => "{$webRoot}{$directory}{$filename}.{$extension}",
'mp4' => "{$webRoot}{$directory}{$filename}.{$extension}", 'mp4' => "{$webRoot}{$directory}{$filename}.{$extension}",
'ts' => "{$webRoot}{$directory}{$filename}.{$extension}", 'ts' => "{$webRoot}{$directory}{$filename}.{$extension}",
]; );
$path = isset($extensionPathMap[$extension]) ? $extensionPathMap[$extension] : ''; $path = isset($extensionPathMap[$extension]) ? $extensionPathMap[$extension] : '';
@ -515,10 +515,10 @@ Class DirScanner {
foreach($files as $file) { foreach($files as $file) {
if (in_array($file, $ignore_files) || !$this->isValid($file)) {continue;} if (in_array($file, $ignore_files) || !$this->isValid($file)) {continue;}
$branch = []; $branch = array();
$realpath = realpath("{$dir}{$file}"); $realpath = realpath("{$dir}{$file}");
if (is_dir($realpath)) { if (is_dir($realpath)) {
$files = []; $files = array();
if ($nextLevels >= 0) { if ($nextLevels >= 0) {
$files = $this->scan($realpath, $levels); $files = $this->scan($realpath, $levels);
if (!empty($files)) { if (!empty($files)) {
@ -575,19 +575,19 @@ Class DirScanner {
} }
//获取菜单,扫描结果中的目录结构 //获取菜单,扫描结果中的目录结构
public function getMenus($tree = []) { public function getMenus($tree = array()) {
$results = empty($tree) ? $this->tree : $tree; $results = empty($tree) ? $this->tree : $tree;
$menus = []; $menus = array();
if (empty($results)) {return $menus;} if (empty($results)) {return $menus;}
foreach ($results as $id => $item) { foreach ($results as $id => $item) {
$dir = []; $dir = array();
if (!empty($item['directory'])) { if (!empty($item['directory'])) {
$dir = [ $dir = array(
'id' => $item['id'], 'id' => $item['id'],
'directory' => $item['directory'], 'directory' => $item['directory'],
'path' => $item['path'], 'path' => $item['path'],
]; );
if (!empty($item['snapshot'])) { if (!empty($item['snapshot'])) {
$dir['snapshot'] = $item['snapshot']; $dir['snapshot'] = $item['snapshot'];
} }
@ -633,17 +633,17 @@ Class DirScanner {
# split text into lines # split text into lines
$lines = explode("\n", $content); $lines = explode("\n", $content);
$titles = []; $titles = array();
if (!empty($lines)) { if (!empty($lines)) {
foreach($lines as $line) { foreach($lines as $line) {
preg_match_all('/^#(.+)/u', $line, $matches); preg_match_all('/^#(.+)/u', $line, $matches);
if (!empty($matches[1])) { if (!empty($matches[1])) {
foreach($matches[1] as $title) { foreach($matches[1] as $title) {
$num = substr_count($title, '#'); $num = substr_count($title, '#');
$titles[] = [ $titles[] = array(
'name' => trim(str_replace('#', '', $title)), 'name' => trim(str_replace('#', '', $title)),
'heading' => 'h' . ($num+1), 'heading' => 'h' . ($num+1),
]; );
} }
} }
} }
@ -656,7 +656,7 @@ Class DirScanner {
public function fixMDUrls($realpath, $html) { public function fixMDUrls($realpath, $html) {
$pathinfo = pathinfo($realpath); $pathinfo = pathinfo($realpath);
$matches = []; $matches = array();
//匹配图片地址 //匹配图片地址
$reg_imgs = '/src="([^"]+)"/i'; $reg_imgs = '/src="([^"]+)"/i';

2
lib/FSC.php

@ -7,7 +7,7 @@ Class FSC {
protected static $start_time = 0; protected static $start_time = 0;
//call function in controller //call function in controller
public static function run($config = []) { public static function run($config = array()) {
self::$start_time = !empty($config['start_time']) ? $config['start_time'] : microtime(true); self::$start_time = !empty($config['start_time']) ? $config['start_time'] : microtime(true);
try { try {

8
themes/googleimage/controller/ListController.php

@ -9,10 +9,10 @@ Class ListController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = []; //菜单,一级目录 $menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 $htmlCateReadme = ''; //当前目录下的Readme.md 内容
$menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
$scanner = new DirScanner(); $scanner = new DirScanner();
$scanner->setWebRoot(FSC::$app['config']['content_directory']); $scanner->setWebRoot(FSC::$app['config']['content_directory']);
@ -22,7 +22,7 @@ Class ListController extends Controller {
//获取目录 //获取目录
$menus = $scanner->getMenus(); $menus = $scanner->getMenus();
$titles = []; $titles = array();
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {
if (!empty($readmeFile['sort'])) { if (!empty($readmeFile['sort'])) {
@ -72,7 +72,7 @@ Class ListController extends Controller {
//根据目录结构以及当前目录获取面包屑 //根据目录结构以及当前目录获取面包屑
protected function getBreadcrumbs($menus, $subcate) { protected function getBreadcrumbs($menus, $subcate) {
$breads = []; $breads = array();
array_push($breads, [ array_push($breads, [
'id' => $subcate['id'], 'id' => $subcate['id'],

6
themes/googleimage/controller/SiteController.php

@ -9,10 +9,10 @@ Class SiteController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = []; //菜单,一级目录 $menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 $htmlCateReadme = ''; //当前目录下的Readme.md 内容
$menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
$scanner = new DirScanner(); $scanner = new DirScanner();
$scanner->setWebRoot(FSC::$app['config']['content_directory']); $scanner->setWebRoot(FSC::$app['config']['content_directory']);
@ -22,7 +22,7 @@ Class SiteController extends Controller {
//获取目录 //获取目录
$menus = $scanner->getMenus(); $menus = $scanner->getMenus();
$titles = []; $titles = array();
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {
if (!empty($readmeFile['sort'])) { if (!empty($readmeFile['sort'])) {

4
themes/googleimage/views/site/index.php

@ -42,7 +42,7 @@ eof;
<div class="content"> <div class="content">
<?php <?php
$imgExts = ['jpg', 'jpeg', 'png', 'gif']; $imgExts = array('jpg', 'jpeg', 'png', 'gif');
$category = $viewData['scanResults'][$selectedId]; $category = $viewData['scanResults'][$selectedId];
//当前目录的描述介绍 //当前目录的描述介绍
@ -109,4 +109,4 @@ eof;
} }
} }
?> ?>
</div> </div>

2
themes/manual/controller/SiteController.php

@ -9,7 +9,7 @@ Class SiteController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$titles = []; $titles = array();
$content = ''; $content = '';
$html = ''; $html = '';

2
themes/manual/controller/ViewController.php

@ -15,7 +15,7 @@ Class ViewController extends Controller {
} }
//获取数据 //获取数据
$titles = []; $titles = array();
$content = ''; $content = '';
$html = ''; $html = '';

8
themes/videoblog/controller/ListController.php

@ -9,10 +9,10 @@ Class ListController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = []; //菜单,一级目录 $menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 $htmlCateReadme = ''; //当前目录下的Readme.md 内容
$menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
$scanner = new DirScanner(); $scanner = new DirScanner();
$scanner->setWebRoot(FSC::$app['config']['content_directory']); $scanner->setWebRoot(FSC::$app['config']['content_directory']);
@ -22,7 +22,7 @@ Class ListController extends Controller {
//获取目录 //获取目录
$menus = $scanner->getMenus(); $menus = $scanner->getMenus();
$titles = []; $titles = array();
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {
if (!empty($readmeFile['sort'])) { if (!empty($readmeFile['sort'])) {
@ -72,7 +72,7 @@ Class ListController extends Controller {
//根据目录结构以及当前目录获取面包屑 //根据目录结构以及当前目录获取面包屑
protected function getBreadcrumbs($menus, $subcate) { protected function getBreadcrumbs($menus, $subcate) {
$breads = []; $breads = array();
if (!empty($subcate['directory'])) { if (!empty($subcate['directory'])) {
array_push($breads, [ array_push($breads, [

6
themes/videoblog/controller/SiteController.php

@ -9,10 +9,10 @@ Class SiteController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = []; //菜单,一级目录 $menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 $htmlCateReadme = ''; //当前目录下的Readme.md 内容
$menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
$scanner = new DirScanner(); $scanner = new DirScanner();
$scanner->setWebRoot(FSC::$app['config']['content_directory']); $scanner->setWebRoot(FSC::$app['config']['content_directory']);
@ -22,7 +22,7 @@ Class SiteController extends Controller {
//获取目录 //获取目录
$menus = $scanner->getMenus(); $menus = $scanner->getMenus();
$titles = []; $titles = array();
$htmlReadme = ''; $htmlReadme = '';
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {

2
themes/videoblog/controller/ViewController.php

@ -26,7 +26,7 @@ Class ViewController extends ListController {
//获取目录 //获取目录
$menus = $scanner->getMenus(); $menus = $scanner->getMenus();
$titles = []; $titles = array();
$htmlReadme = ''; $htmlReadme = '';
$readmeFile = $scanner->getDefaultReadme(); $readmeFile = $scanner->getDefaultReadme();
if (!empty($readmeFile)) { if (!empty($readmeFile)) {

6
themes/videoblog/views/site/index.php

@ -42,8 +42,8 @@ eof;
<div class="content"> <div class="content">
<?php <?php
$imgExts = ['jpg', 'jpeg', 'png', 'gif']; $imgExts = array('jpg', 'jpeg', 'png', 'gif');
$videoExts = ['mp4', 'm3u8']; $videoExts = array('mp4', 'm3u8');
$category = $viewData['scanResults'][$selectedId]; $category = $viewData['scanResults'][$selectedId];
//当前目录的描述介绍 //当前目录的描述介绍
@ -152,4 +152,4 @@ eof;
} }
} }
?> ?>
</div> </div>

6
themes/videoblog/views/view/index.php

@ -1,8 +1,8 @@
<?php <?php
$videoUrl = ''; $videoUrl = '';
$poster = ''; $poster = '';
$imgExts = ['jpg', 'jpeg', 'png', 'gif']; $imgExts = array('jpg', 'jpeg', 'png', 'gif');
$videoExts = ['mp4', 'm3u8']; $videoExts = array('mp4', 'm3u8');
if (!empty($viewData['video'])) { if (!empty($viewData['video'])) {
$video = $viewData['video']; $video = $viewData['video'];
@ -34,4 +34,4 @@ if (!empty($viewData['video'])) {
id="myvideo"> id="myvideo">
<source src="<?php echo $videoUrl; ?>" type="video/mp4"> <source src="<?php echo $videoUrl; ?>" type="video/mp4">
</video> </video>
</div> </div>

6
themes/webdirectory/controller/SiteController.php

@ -9,12 +9,12 @@ Class SiteController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = []; //菜单,一级目录 $menus = array(); //菜单,一级目录
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlContact = ''; //Readme_contact.txt 说明文件内容,右侧悬浮菜单里的“联系我” $htmlContact = ''; //Readme_contact.txt 说明文件内容,右侧悬浮菜单里的“联系我”
$menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
$titles = []; $titles = array();
$content = ''; $content = '';
$scanner = new DirScanner(); $scanner = new DirScanner();

Loading…
Cancel
Save