diff --git a/lib/DirScanner.php b/lib/DirScanner.php
index bb16294..b4207e2 100644
--- a/lib/DirScanner.php
+++ b/lib/DirScanner.php
@@ -87,7 +87,7 @@ Class DirScanner {
//不允许包含斜杠/,反斜杠\,单引号',双引号",空格字符
//忽略.开头的隐藏文件
private function isValid($name) {
- return str_replace(['/', '\\', "'", '"', ' '], '', $name) == $name && !preg_match('/^\..+/', $name);
+ return str_replace(['/', '\\', "'", '"'], '', $name) == $name && !preg_match('/^\..+/', $name);
}
//解析描述文件内容
diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php
index d1a47e0..e3d84a8 100644
--- a/themes/beauty/controller/ListController.php
+++ b/themes/beauty/controller/ListController.php
@@ -65,6 +65,10 @@ Class ListController extends Controller {
$mp3File = $scanner->getDefaultFile('mp3');
}
+ //翻页支持
+ $page = $this->get('page', 1);
+ $pageSize = $this->get('limit', 24);
+
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统";
if (!empty($subcate)) {
$pageTitle = "{$subcate['directory']}的照片,来自{$pageTitle}";
@@ -75,7 +79,7 @@ Class ListController extends Controller {
$viewName = '//site/index'; //共享视图
$params = compact(
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'breadcrumbs', 'htmlCateReadme',
- 'mp3File'
+ 'mp3File', 'page', 'pageSize'
);
return $this->render($viewName, $params, $pageTitle);
}
diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php
index 2e630ce..7e7e3f4 100644
--- a/themes/beauty/controller/SiteController.php
+++ b/themes/beauty/controller/SiteController.php
@@ -62,6 +62,10 @@ Class SiteController extends Controller {
$mp3File = $scanner->getDefaultFile('mp3');
}
+ //翻页支持
+ $page = $this->get('page', 1);
+ $pageSize = $this->get('limit', 24);
+
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统";
if (!empty($readmeFile['title'])) {
$pageTitle = $readmeFile['title'];
@@ -72,7 +76,7 @@ Class SiteController extends Controller {
$viewName = 'index';
$params = compact(
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme',
- 'mp3File'
+ 'mp3File', 'page', 'pageSize'
);
return $this->render($viewName, $params, $pageTitle);
}
diff --git a/themes/beauty/views/layout/main.php b/themes/beauty/views/layout/main.php
index ff0df17..262ab41 100644
--- a/themes/beauty/views/layout/main.php
+++ b/themes/beauty/views/layout/main.php
@@ -68,9 +68,11 @@ eof;
+
+
diff --git a/themes/beauty/views/site/index.php b/themes/beauty/views/site/index.php
index 4a252ce..275e79c 100644
--- a/themes/beauty/views/site/index.php
+++ b/themes/beauty/views/site/index.php
@@ -36,9 +36,9 @@ eof;
-
+
-
+
*/ ?>
@@ -80,6 +80,7 @@ eof;
-
{$title}
+
+
+ {$title}
+
eof;
$index++;
}
+
+
+ //分割目录和文件
+ echo '';
+ if (!empty($category['files'])) {
+ echo '
';
+ }
+ echo '';
}
if (!empty($category['files'])) { //一级目录支持
+ $total = count($category['files']); //翻页支持
$index = 0;
foreach ($category['files'] as $file) {
if (!in_array($file['extension'], $imgExts)) {
continue;
}
+ if ($index >= $viewData['pageSize']) {break;} //翻页支持
+
$title = !empty($file['title']) ? $file['title'] : $file['filename'];
if ($index > 0) {
echo <<
-
+
+
+
+
+ {$title}
+
+
eof;
} else {
echo <<
-
+
+
+
+
+ {$title}
+
+
eof;
diff --git a/www/css/beauty.css b/www/css/beauty.css
index ef68d2e..9e5c56a 100644
--- a/www/css/beauty.css
+++ b/www/css/beauty.css
@@ -59,11 +59,12 @@ a:link{text-decoration:none}
.im_img:hover{transform:scale(1.03)}
.im_item{padding:5px;height:16vw;overflow:hidden}
.im_item>a{overflow: hidden;display:block;position:relative;width: 100%;height: 100%}
-.im_img_title{background:rgba(7, 7, 7, .3);position:absolute;left:0;right:0;bottom:0;top:0;color:#FFF;border-radius:10px}
+.im_img_title{background:rgba(7, 7, 7, .1);position:absolute;left:0;right:0;bottom:0;top:0;color:#FFF;border-radius:10px}
.im_item:hover .im_img{transform:scale(1.03)}
.im_img_title span{position:absolute;bottom:10px;left:10px;margin-right:10px;font-weight:bold;padding:5px;border:solid 2px #FFF;border-radius:10px}
+.im_img_title img{vertical-align:bottom}
-.web_info{padding:10px 0 42px 0;margin-top:15px;border-top:solid 1px #f5f5f5}
+.web_info{padding:10px 0 42px 0;margin-top:75px;border-top:solid 1px #f5f5f5}
.web_info p{color:#808080;font-size:13px;margin:5px 0}
.web_info a{text-decoration: underline;color:#808080}
.web_info a:hover{color:#000}
diff --git a/www/img/beauty/folder.svg b/www/img/beauty/folder.svg
new file mode 100644
index 0000000..bae37d6
--- /dev/null
+++ b/www/img/beauty/folder.svg
@@ -0,0 +1,4 @@
+
+
diff --git a/www/img/beauty/image.svg b/www/img/beauty/image.svg
new file mode 100644
index 0000000..89ed01e
--- /dev/null
+++ b/www/img/beauty/image.svg
@@ -0,0 +1,25 @@
+
+
diff --git a/www/img/beauty/video.svg b/www/img/beauty/video.svg
new file mode 100644
index 0000000..aa46dce
--- /dev/null
+++ b/www/img/beauty/video.svg
@@ -0,0 +1,2 @@
+
+
diff --git a/www/js/beauty.js b/www/js/beauty.js
index fa7c2af..0444ec1 100644
--- a/www/js/beauty.js
+++ b/www/js/beauty.js
@@ -9,7 +9,7 @@ if ($('#image_site').get(0)) {
// 图片浏览
$('[data-fancybox]').fancybox({
toolbar: true,
- loop: false,
+ loop: true,
smallBtn: false,
buttons: ["zoom", "slideShow", "fullScreen", "download", "thumbs", "close"],
iframe: {