From 60557abdb2a95cce10c1bc32a1923954be625fa9 Mon Sep 17 00:00:00 2001 From: wehao <30787186+wehaox@users.noreply.github.com> Date: Tue, 22 Feb 2022 19:09:20 +0800 Subject: [PATCH] =?UTF-8?q?1.4.1=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.4.1更新 --- 404.php | 90 +++++++++++++++++++++++++-------------------------- functions.php | 3 ++ index.php | 4 +-- 3 files changed, 50 insertions(+), 47 deletions(-) diff --git a/404.php b/404.php index 6b332a5..e594ac8 100644 --- a/404.php +++ b/404.php @@ -9,54 +9,54 @@ options->title() ?> - @@ -85,4 +85,4 @@ - + \ No newline at end of file diff --git a/functions.php b/functions.php index 426ef73..d130498 100644 --- a/functions.php +++ b/functions.php @@ -1317,6 +1317,9 @@ function get_post_view($archive) //总访问量 function theAllViews(){ $db = Typecho_Db::get(); + if (!array_key_exists('views', $db->fetchRow($db->select()->from('table.contents')))) { + $db->query('ALTER TABLE `'.$db->getPrefix().'contents` ADD `views` INT(10) DEFAULT 0;'); + } $row = $db->fetchAll($db->select('SUM(views)')->from('table.contents')); echo $row[0]["SUM(`views`)"]; } diff --git a/index.php b/index.php index 91ade1d..19fcaa4 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ * 主题更新日志 * @package Typecho-Butterfly * @author b站:wehao- - * @version 1.4.0 + * @version 1.4.1 * @link https://space.bilibili.com/34174433 */ if (!defined('__TYPECHO_ROOT_DIR__')) exit; @@ -116,7 +116,7 @@ function ver() {console.log(` # # # # # # # # # # # # ##### #### # # ###### # # # ###### # - 1.4.0 + 1.4.1 =================================================================== `);} \ No newline at end of file