From d75331d8b8816f0806ca324b550483cbadaf656f Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Tue, 14 Jul 2020 14:15:59 +0800 Subject: =?UTF-8?q?:zap:=20Add:=20=E5=8A=A0=E5=85=A5=20HTML=20=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++++ includes/footer.php | 14 ++++++++----- includes/head.php | 3 ++- index.php | 2 +- libs/Utils.php | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++--- themeConfig.php | 12 ++++++++++- 6 files changed, 89 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c6141d0..a1b976b 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,16 @@ $ git clone https://github.com/BigCoke233/miracles.git - 新增:可以使用 TimThumb 裁剪文章缩略图了(需要在高级设置 themeConfig.php 里打开) - 优化:归档页面 meta 元信息 +**v20200713A** + +- 优化:改进番剧页面(Done by Kengwang) +- 修复:解决随机颜文字可能报错的问题 +- 修复:评论列表缺失 #comments id + +**v20200714A** + +- 修复:删除不必要的判断 + ## 📝 计划 diff --git a/includes/footer.php b/includes/footer.php index 312249e..82d39dc 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -12,7 +12,7 @@ $faces = explode("&&",$faces); $faces = "".$faces[mt_rand(0,count($faces)-1)].""; } - if($faces && $this->options->build_time)echo $faces; + if($faces && $this->options->build_time) echo $faces; ?>

@@ -26,7 +26,7 @@ if($this->options->customCDN): $custom=$this->options->customCDN; else: $custom=Helper::options()->themeUrl("","Miracles"); endif; Utils::addRequires($js_files,"js",$this->options->CDN,$custom); ?> - + + afterPjax = function() {owoLoad();options->pjax_complete(); ?>}; options->CDN,$custom); ?> - + footer(); ?> + .*?|.*?<\/nocompress>|||)/msi', $html_source, -1, PREG_SPLIT_DELIM_CAPTURE); + $compress = ''; + foreach ($chunks as $c) { + if (strtolower(substr($c, 0, 19)) == '') { + $c = substr($c, 19, strlen($c) - 19 - 20); + $compress .= $c; + continue; + } else if (strtolower(substr($c, 0, 12)) == '') { + $c = substr($c, 12, strlen($c) - 12 - 13); + $compress .= $c; + continue; + } else if (strtolower(substr($c, 0, 4)) == ' $char) { + if ($char == '"' && $chars[$key - 1] != '\\' && !$is_apos) { + $is_quot = !$is_quot; + } else if ($char == '\'' && $chars[$key - 1] != '\\' && !$is_quot) { + $is_apos = !$is_apos; + } else if ($char == '/' && $chars[$key + 1] == '/' && !$is_quot && !$is_apos) { + $tmp = substr($tmp, 0, $key); + break; + } + } + } + $c .= $tmp; + } + } + $c = preg_replace('/[\\n\\r\\t]+/', ' ', $c); + $c = preg_replace('/\\s{2,}/', ' ', $c); + $c = preg_replace('/>\\s <', $c); + $c = preg_replace('/\\/\\*.*?\\*\\//i', '', $c); + $c = preg_replace('//', '', $c); + $compress .= $c; + } + return $compress; + } } \ No newline at end of file diff --git a/themeConfig.php b/themeConfig.php index 89357b0..ba13cfe 100644 --- a/themeConfig.php +++ b/themeConfig.php @@ -7,12 +7,16 @@ * 通常 'on' 表示开启;'off' 则表示关闭 */ +/* 字体 */ + //主题字体 CDN $GLOBALS['miraclesFontCDN'] = array( 'if' => 'on', //是否开启字体 CDN(使用思源宋体/黑体) 'cdn' => 'google_font' //默认 Google Font,可选项:google_font / font_lolinet,或者直接输入字体文件 url ); +/* 文章缩略图 */ + //是否剪裁文章缩略图 //使用 TimThumb 剪裁文章缩略图能达到最好效果,但会消耗服务器资源 $GLOBALS['miraclesIfTimThumb'] = 'off'; @@ -33,4 +37,10 @@ $GLOBALS['miraclesTimThumbAllowList'] = array ( 'imageshack.us', 'tinypic.com', 'jsdelivr.net' -); \ No newline at end of file +); + +/* 页面压缩 */ + +//是否压缩 HTML 源代码 +//压缩能优化页面传输速度,但可能会给服务器增加一定负担(不过也还好 +$GLOBALS['miraclesIfCompressHTML'] = 'on'; \ No newline at end of file -- cgit v1.2.3