From bdaeeadd6b6e312c1f1cbe570c4f40ba3243ffe5 Mon Sep 17 00:00:00 2001
From: abc2237512422
Date: Sun, 13 Oct 2019 03:00:51 +0800
Subject: [PATCH] 0.52
---
README.md | 6 +++++-
functions.php | 36 ++++++++++++++++++++++++++++++++++++
info.json | 4 ++--
style.css | 2 +-
4 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 834ba4d5..59673135 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,11 @@ Argon - 一个轻盈、简洁、美观的 WordPress 主题
# 更新日志
-## 20191010 v0.5
+## 20191010 v0.52
++ 增加安装统计
++ 增加时区修复
+
+## 20191010 v0.51
+ "说说"增加点赞功能
+ 微调弹出提示的样式
diff --git a/functions.php b/functions.php
index 52ecd940..b60f58a2 100644
--- a/functions.php
+++ b/functions.php
@@ -12,6 +12,31 @@ function theme_slug_setup() {
'argon',
'https://raw.githubusercontent.com/abc2237512422/argon-theme/master/info.json'
);
+//初次使用时发送安装量统计信息
+function post_analytics_info(){
+ if(function_exists('file_get_contents')){
+ $contexts = stream_context_create(
+ array(
+ 'http' => array(
+ 'method'=>"GET",
+ 'header'=>"User-Agent: ArgonTheme\r\n"
+ )
+ )
+ );
+ $result = file_get_contents('http://api.abc233.site/argon_analytics/index.php?domain=' . $_SERVER['HTTP_HOST'], false, $contexts);
+ update_option('argon_has_inited', 'true');
+ return $result;
+ }else{
+ update_option('argon_has_inited', 'true');
+ }
+}
+if (get_option('argon_has_inited') != 'true'){
+ post_analytics_info();
+}
+//时区修正
+if (get_option('argon_enable_timezone_fix') == 'true'){
+ date_default_timezone_set('UTC');
+}
//注册小工具
function argon_widgets_init() {
register_sidebar(
@@ -1123,6 +1148,15 @@ function themeoptions_page(){
+ 是否修正时区错误
+
+ 如遇到时区错误(例如一条刚发的评论显示 8 小时前),这个选项可能可以修复这个问题
+
+
@@ -1148,6 +1182,8 @@ function themeoptions_page(){
update_option('argon_show_readingtime', $_POST['argon_show_readingtime']);
update_option('argon_reading_speed', $_POST['argon_reading_speed']);
update_option('argon_show_sharebtn', $_POST['argon_show_sharebtn']);
+ update_option('argon_enable_timezone_fix', $_POST['argon_enable_timezone_fix']);
+
//LazyLoad 相关
update_option('argon_enable_lazyload', $_POST['argon_enable_lazyload']);
diff --git a/info.json b/info.json
index 71c3d8f5..63789615 100644
--- a/info.json
+++ b/info.json
@@ -1,5 +1,5 @@
{
- "version" : "0.51",
+ "version" : "0.52",
"details_url" : "https://github.com/abc2237512422/argon-theme/releases",
- "download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.51/argon.zip"
+ "download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.52/argon.zip"
}
diff --git a/style.css b/style.css
index 80bc0a03..62f3741b 100644
--- a/style.css
+++ b/style.css
@@ -3,7 +3,7 @@ Theme Name: argon
Author: abc2237512422
Author URI: https://abc233.site/
Description: 轻盈、简洁、美观的 Wordpress 主题 (Beta)
-Version: 0.51
+Version: 0.52
License: MIT License
License URI: https://opensource.org/licenses/MIT
Tags: 两栏, 侧栏在左边, 浮动侧栏, 文章目录, 自适应, 夜间模式, 可自定义